Documentation ¶
Index ¶
- Variables
- type AllWatcher
- type CharmInfo
- type Client
- func (c *Client) AddRelation(endpoints ...string) (*params.AddRelationResults, error)
- func (c *Client) AddServiceUnits(service string, numUnits int) ([]string, error)
- func (c *Client) CharmInfo(charmURL string) (*CharmInfo, error)
- func (c *Client) DestroyRelation(endpoints ...string) error
- func (c *Client) DestroyServiceUnits(unitNames []string) error
- func (c *Client) EnvironmentInfo() (*EnvironmentInfo, error)
- func (c *Client) GetAnnotations(tag string) (map[string]string, error)
- func (c *Client) GetServiceConstraints(service string) (constraints.Value, error)
- func (c *Client) Resolved(unit string, retry bool) error
- func (c *Client) ServiceDeploy(charmUrl string, serviceName string, numUnits int, configYAML string, ...) error
- func (c *Client) ServiceDestroy(service string) error
- func (c *Client) ServiceExpose(service string) error
- func (c *Client) ServiceGet(service string) (*params.ServiceGetResults, error)
- func (c *Client) ServiceSet(service string, options map[string]string) error
- func (c *Client) ServiceSetCharm(serviceName string, charmUrl string, force bool) error
- func (c *Client) ServiceSetYAML(service string, yaml string) error
- func (c *Client) ServiceUnexpose(service string) error
- func (c *Client) SetAnnotations(tag string, pairs map[string]string) error
- func (c *Client) SetServiceConstraints(service string, constraints constraints.Value) error
- func (c *Client) Status() (*Status, error)
- func (c *Client) WatchAll() (*AllWatcher, error)
- type DialOpts
- type EnvironmentInfo
- type Info
- type MachineInfo
- type NotifyWatcher
- type State
- func (s *State) Broken() <-chan struct{}
- func (s *State) Call(objType, id, request string, args, response interface{}) error
- func (st *State) Client() *Client
- func (s *State) Close() error
- func (st *State) Login(tag, password string) error
- func (st *State) MachineAgent() *machineagent.State
- func (st *State) Machiner() *machiner.State
- func (s *State) RPCClient() *rpc.Conn
- func (st *State) Upgrader() (*upgrader.Upgrader, error)
- type Status
- type StringsWatcher
- type WatchAll
Constants ¶
This section is empty.
Variables ¶
var PingPeriod = 1 * time.Minute
PingPeriod defines how often the internal connection health check will run. It's a variable so it can be changed in tests.
Functions ¶
This section is empty.
Types ¶
type AllWatcher ¶
type AllWatcher struct {
// contains filtered or unexported fields
}
AllWatcher holds information allowing us to get Deltas describing changes to the entire environment.
func (*AllWatcher) Stop ¶
func (watcher *AllWatcher) Stop() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the client-accessible part of the state.
func (*Client) AddRelation ¶
func (c *Client) AddRelation(endpoints ...string) (*params.AddRelationResults, error)
AddRelation adds a relation between the specified endpoints and returns the relation info.
func (*Client) AddServiceUnits ¶
AddServiceUnits adds a given number of units to a service.
func (*Client) DestroyRelation ¶
DestroyRelation removes the relation between the specified endpoints.
func (*Client) DestroyServiceUnits ¶
DestroyServiceUnits decreases the number of units dedicated to a service.
func (*Client) EnvironmentInfo ¶
func (c *Client) EnvironmentInfo() (*EnvironmentInfo, error)
EnvironmentInfo returns details about the Juju environment.
func (*Client) GetAnnotations ¶
GetAnnotations returns annotations that have been set on the given entity.
func (*Client) GetServiceConstraints ¶
func (c *Client) GetServiceConstraints(service string) (constraints.Value, error)
GetServiceConstraints returns the constraints for the given service.
func (*Client) ServiceDeploy ¶
func (c *Client) ServiceDeploy(charmUrl string, serviceName string, numUnits int, configYAML string, cons constraints.Value) error
ServiceDeploy obtains the charm, either locally or from the charm store, and deploys it.
func (*Client) ServiceDestroy ¶
ServiceDestroy destroys a given service.
func (*Client) ServiceExpose ¶
ServiceExpose changes the juju-managed firewall to expose any ports that were also explicitly marked by units as open.
func (*Client) ServiceGet ¶
func (c *Client) ServiceGet(service string) (*params.ServiceGetResults, error)
ServiceGet returns the configuration for the named service.
func (*Client) ServiceSet ¶
ServiceSet sets configuration options on a service.
func (*Client) ServiceSetCharm ¶
ServiceSetCharm sets the charm for a given service.
func (*Client) ServiceSetYAML ¶
ServiceSetYAML sets configuration options on a service given options in YAML format.
func (*Client) ServiceUnexpose ¶
ServiceUnexpose changes the juju-managed firewall to unexpose any ports that were also explicitly marked by units as open.
func (*Client) SetAnnotations ¶
SetAnnotations sets the annotation pairs on the given entity. Currently annotations are supported on machines, services, units and the environment itself.
func (*Client) SetServiceConstraints ¶
func (c *Client) SetServiceConstraints(service string, constraints constraints.Value) error
SetServiceConstraints specifies the constraints for the given service.
func (*Client) WatchAll ¶
func (c *Client) WatchAll() (*AllWatcher, error)
WatchAll returns an AllWatcher, from which you can request the Next collection of Deltas.
type DialOpts ¶
type DialOpts struct { // Timeout is the amount of time to wait contacting // a state server. Timeout time.Duration // RetryDelay is the amount of time to wait between // unsucssful connection attempts. RetryDelay time.Duration }
DialOpts holds configuration parameters that control the Dialing behavior when connecting to a state server.
func DefaultDialOpts ¶
func DefaultDialOpts() DialOpts
DefaultDialOpts returns a DialOpts representing the default parameters for contacting a state server.
type EnvironmentInfo ¶
EnvironmentInfo holds information about the Juju environment.
type Info ¶
type Info struct { // Addrs holds the addresses of the state servers. Addrs []string // CACert holds the CA certificate that will be used // to validate the state server's certificate, in PEM format. CACert []byte // Tag holds the name of the entity that is connecting. // If this and the password are empty, no login attempt will be made // (this is to allow tests to access the API to check that operations // fail when not logged in). Tag string // Password holds the password for the administrator or connecting entity. Password string }
Info encapsulates information about a server holding juju state and can be used to make a connection to it.
type MachineInfo ¶
type MachineInfo struct {
InstanceId string // blank if not set.
}
MachineInfo holds information about a machine.
type NotifyWatcher ¶
NotifyWatcher will send events when something changes. It does not send content for those changes.
type State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) Broken ¶
func (s *State) Broken() <-chan struct{}
Broken returns a channel that's closed when the connection is broken.
func (*State) Call ¶
Call invokes a low-level RPC method of the given objType, id, and request, passing the given parameters and filling in the response results. This should not be used directly by clients. TODO (dimitern) Add tests for all client-facing objects to verify we return the correct error when invoking Call("Object", "non-empty-id",...)
func (*State) Client ¶
Client returns an object that can be used to access client-specific functionality.
func (*State) Login ¶
Login authenticates as the entity with the given name and password. Subsequent requests on the state will act as that entity. This method is usually called automatically by Open.
func (*State) MachineAgent ¶
func (st *State) MachineAgent() *machineagent.State
MachineAgent returns a version of the state that provides functionality required by the machine agent code.
func (*State) Machiner ¶
Machiner returns a version of the state that provides functionality required by the machiner worker.
type Status ¶
type Status struct {
Machines map[string]MachineInfo
}
Status holds information about the status of a juju environment.
type StringsWatcher ¶
StringsWatcher will send events when something changes. The content for the changes is a list of strings.