juju

package
v0.0.0-...-9d6b0cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2013 License: AGPL-3.0, AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitJujuHome

func InitJujuHome() error

InitJujuHome initializes the charm and environs/config packages to use default paths based on the $JUJU_HOME or $HOME environment variables. This function should be called before calling NewConn or Conn.Deploy.

Types

type APIConn

type APIConn struct {
	Environ environs.Environ
	State   *api.State
}

APIConn holds a connection to a juju environment and its associated state through its API interface.

func NewAPIConn

func NewAPIConn(environ environs.Environ, dialOpts api.DialOpts) (*APIConn, error)

NewAPIConn returns a new Conn that uses the given environment. The environment must have already been bootstrapped.

func (*APIConn) Close

func (c *APIConn) Close() error

Close terminates the connection to the environment and releases any associated resources.

type Conn

type Conn struct {
	Environ environs.Environ
	State   *state.State
}

Conn holds a connection to a juju environment and its associated state.

func NewConn

func NewConn(environ environs.Environ) (*Conn, error)

NewConn returns a new Conn that uses the given environment. The environment must have already been bootstrapped.

func NewConnFromName

func NewConnFromName(environName string) (*Conn, error)

NewConnFromName returns a Conn pointing at the environName environment, or the default environment if not specified.

func NewConnFromState

func NewConnFromState(st *state.State) (*Conn, error)

NewConnFromState returns a Conn that uses an Environ made by reading the environment configuration. The resulting Conn uses the given State - closing it will close that State.

func (*Conn) AddUnits

func (conn *Conn) AddUnits(svc *state.Service, n int, machineIdSpec string) ([]*state.Unit, error)

AddUnits starts n units of the given service and allocates machines to them as necessary.

func (*Conn) Close

func (c *Conn) Close() error

Close terminates the connection to the environment and releases any associated resources.

func (*Conn) DeployService

func (conn *Conn) DeployService(args DeployServiceParams) (*state.Service, error)

DeployService takes a charm and various parameters and deploys it.

func (*Conn) PutCharm

func (conn *Conn) PutCharm(curl *charm.URL, repo charm.Repository, bumpRevision bool) (*state.Charm, error)

PutCharm uploads the given charm to provider storage, and adds a state.Charm to the state. The charm is not uploaded if a charm with the same URL already exists in the state. If bumpRevision is true, the charm must be a local directory, and the revision number will be incremented before pushing.

type DeployServiceParams

type DeployServiceParams struct {
	ServiceName    string
	Charm          *state.Charm
	ConfigSettings charm.Settings
	Constraints    constraints.Value
	NumUnits       int
	// ToMachineSpec is either:
	// - an existing machine/container id eg "1" or "1/lxc/2"
	// - a new container on an existing machine eg "lxc:1"
	// Use string to avoid ambiguity around machine 0.
	ToMachineSpec string
}

DeployServiceParams contains the arguments required to deploy the referenced charm.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL