juju

package
v0.0.0-...-6337964 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2014 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIEndpointForEnv

func APIEndpointForEnv(envName string, refresh bool) (configstore.APIEndpoint, error)

APIEndpointForEnv returns the endpoint information for a given environment It tries to just return the information from the cached settings unless there is nothing cached or refresh is True

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

func DeployService(st *state.State, args DeployServiceParams) (*state.Service, error)

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

func NewAPIClientFromName(envName string) (*api.Client, error)

NewAPIClientFromName returns an api.Client connected to the API Server for the named environment. If envName is "", the default environment will be used.

func NewAPIFromName

func NewAPIFromName(envName string) (*api.State, error)

NewAPIFromName returns an api.State 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.

func NewUserManagerClient

func NewUserManagerClient(envName string) (*usermanager.Client, error)

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) Close

func (c *Conn) Close() error

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
	ServiceOwner   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
	// Networks holds a list of networks to required to start on boot.
	Networks []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