Documentation
¶
Index ¶
- func AddUnits(st *state.State, svc *state.Service, n int, machineIdSpec string) ([]*state.Unit, error)
- func DeployService(st *state.State, args DeployServiceParams) (*state.Service, error)
- func InitJujuHome() error
- func NewAPIClientFromName(envName string) (*api.Client, error)
- func NewKeyManagerClient(envName string) (*keymanager.Client, error)
- type APIConn
- type Conn
- type DeployServiceParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUnits ¶
func AddUnits(st *state.State, 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 DeployService ¶
DeployService takes a charm and various parameters and deploys it.
func InitJujuHome ¶
func InitJujuHome() error
InitJujuHome initializes the charm, environs/config and utils/ssh 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.
func NewAPIClientFromName ¶
NewAPIClientFromName returns an api.Client connected to the API Server for the named environment. If envName is "", the default environment will be used.
func NewKeyManagerClient ¶
func NewKeyManagerClient(envName string) (*keymanager.Client, error)
NewKeyManagerClient returns an api.keymanager.Client connected to the API Server for the named environment. If envName is "", the default environment will be used.
Types ¶
type APIConn ¶
APIConn holds a connection to a juju environment and its associated state through its API interface.
func NewAPIConn ¶
NewAPIConn returns a new Conn that uses the given environment. The environment must have already been bootstrapped.
type Conn ¶
Conn holds a connection to a juju environment and its associated state.
func NewConn ¶
NewConn returns a new Conn that uses the given environment. The environment must have already been bootstrapped.
func NewConnFromName ¶
NewConnFromName returns a Conn pointing at the environName environment, or the default environment if not specified.
func NewConnFromState ¶
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) Close ¶
Close terminates the connection to the environment and releases any associated resources.
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.