Documentation
¶
Index ¶
- Variables
- func InstanceConfig(st *state.State, machineId, nonce, dataDir string) (*instancecfg.InstanceConfig, error)
- func NewUnitMatcher(patterns []string) (unitMatcher, error)
- func ParallelExecute(dataDir string, args []*RemoteExec) params.RunResults
- func UnitChainPredicateFn(predicate Predicate, getUnit func(string) *state.Unit) func(*state.Unit) (bool, error)
- type API
- type Client
- func (c *Client) APIHostPorts() (result params.APIHostPortsResult, err error)
- func (c *Client) AbortCurrentUpgrade() error
- func (c *Client) AddCharm(args params.CharmURL) error
- func (c *Client) AddCharmWithAuthorization(args params.AddCharmWithAuthorization) error
- func (c *Client) AddMachines(args params.AddMachines) (params.AddMachinesResults, error)
- func (c *Client) AddMachinesV2(args params.AddMachines) (params.AddMachinesResults, error)
- func (c *Client) AgentVersion() (params.AgentVersionResult, error)
- func (c *Client) CharmInfo(args params.CharmInfo) (api.CharmInfo, error)
- func (c *Client) DestroyMachines(args params.DestroyMachines) error
- func (c *Client) DestroyModel() (err error)
- func (c *Client) FindTools(args params.FindToolsParams) (params.FindToolsResult, error)
- func (c *Client) FullStatus(args params.StatusParams) (params.FullStatus, error)
- func (c *Client) GetBundleChanges(args params.GetBundleChangesParams) (params.GetBundleChangesResults, error)
- func (c *Client) GetModelConstraints() (params.GetConstraintsResults, error)
- func (c *Client) InjectMachines(args params.AddMachines) (params.AddMachinesResults, error)
- func (c *Client) ModelGet() (params.ModelConfigResults, error)
- func (c *Client) ModelInfo() (params.ModelInfo, error)
- func (c *Client) ModelSet(args params.ModelSet) error
- func (c *Client) ModelUnset(args params.ModelUnset) error
- func (c *Client) ModelUserInfo() (params.ModelUserInfoResults, error)
- func (c *Client) PrivateAddress(p params.PrivateAddress) (results params.PrivateAddressResults, err error)
- func (c *Client) ProvisioningScript(args params.ProvisioningScriptParams) (params.ProvisioningScriptResult, error)
- func (c *Client) PublicAddress(p params.PublicAddress) (results params.PublicAddressResults, err error)
- func (c *Client) ResolveCharms(args params.ResolveCharms) (params.ResolveCharmResults, error)
- func (c *Client) Resolved(p params.Resolved) error
- func (c *Client) RetryProvisioning(p params.Entities) (params.ErrorResults, error)
- func (c *Client) Run(run params.RunParams) (results params.RunResults, err error)
- func (c *Client) RunOnAllMachines(run params.RunParams) (params.RunResults, error)
- func (c *Client) SetModelAgentVersion(args params.SetModelAgentVersion) error
- func (c *Client) SetModelConstraints(args params.SetConstraints) error
- func (c *Client) ShareModel(args params.ModifyModelUsers) (result params.ErrorResults, err error)
- func (c *Client) Status() (params.LegacyStatus, error)
- func (c *Client) StatusHistory(args params.StatusHistoryArgs) (params.StatusHistoryResults, error)
- func (c *Client) WatchAll() (params.AllWatcherId, error)
- type MachineOrder
- type Predicate
- type RemoteExec
- type Unit
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func InstanceConfig ¶
func InstanceConfig(st *state.State, machineId, nonce, dataDir string) (*instancecfg.InstanceConfig, error)
InstanceConfig returns information from the environment config that is needed for machine cloud-init (for non-controllers only). It is exposed for testing purposes. TODO(rog) fix environs/manual tests so they do not need to call this, or move this elsewhere.
func NewUnitMatcher ¶
NewUnitMatcher returns a unitMatcher that matches units with one of the specified patterns, or all units if no patterns are specified.
An error will be returned if any of the specified patterns is invalid. Patterns are valid if they contain only alpha-numeric characters, hyphens, or asterisks (and one optional '/' to separate service/unit).
func ParallelExecute ¶
func ParallelExecute(dataDir string, args []*RemoteExec) params.RunResults
ParallelExecute executes all of the requests defined in the params, using the system identity stored in the dataDir.
func UnitChainPredicateFn ¶
func UnitChainPredicateFn( predicate Predicate, getUnit func(string) *state.Unit, ) func(*state.Unit) (bool, error)
UnitChainPredicateFn builds a function which runs the given predicate over a unit and all of its subordinates. If one unit in the chain matches, the entire chain matches.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client serves client-specific API methods.
func NewClient ¶
func NewClient(st *state.State, resources *common.Resources, authorizer common.Authorizer) (*Client, error)
NewClient creates a new instance of the Client Facade.
func (*Client) APIHostPorts ¶
func (c *Client) APIHostPorts() (result params.APIHostPortsResult, err error)
APIHostPorts returns the API host/port addresses stored in state.
func (*Client) AbortCurrentUpgrade ¶
AbortCurrentUpgrade aborts and archives the current upgrade synchronisation record, if any.
func (*Client) AddCharmWithAuthorization ¶
func (c *Client) AddCharmWithAuthorization(args params.AddCharmWithAuthorization) error
AddCharmWithAuthorization adds the given charm URL (which must include revision) to the model, if it does not exist yet. Local charms are not supported, only charm store URLs. See also AddLocalCharm().
The authorization macaroon, args.CharmStoreMacaroon, may be omitted, in which case this call is equivalent to AddCharm.
func (*Client) AddMachines ¶
func (c *Client) AddMachines(args params.AddMachines) (params.AddMachinesResults, error)
AddMachines adds new machines with the supplied parameters.
func (*Client) AddMachinesV2 ¶
func (c *Client) AddMachinesV2(args params.AddMachines) (params.AddMachinesResults, error)
AddMachinesV2 adds new machines with the supplied parameters.
func (*Client) AgentVersion ¶
func (c *Client) AgentVersion() (params.AgentVersionResult, error)
AgentVersion returns the current version that the API server is running.
func (*Client) CharmInfo ¶
CharmInfo returns information about the requested charm.
func (*Client) DestroyMachines ¶
func (c *Client) DestroyMachines(args params.DestroyMachines) error
DestroyMachines removes a given set of machines.
func (*Client) DestroyModel ¶
DestroyModel will try to destroy the current model. If there is a block on destruction, this method will return an error.
func (*Client) FindTools ¶
func (c *Client) FindTools(args params.FindToolsParams) (params.FindToolsResult, error)
FindTools returns a List containing all tools matching the given parameters.
func (*Client) FullStatus ¶
func (c *Client) FullStatus(args params.StatusParams) (params.FullStatus, error)
FullStatus gives the information needed for juju status over the api
func (*Client) GetBundleChanges ¶
func (c *Client) GetBundleChanges(args params.GetBundleChangesParams) (params.GetBundleChangesResults, error)
GetBundleChanges returns the list of changes required to deploy the given bundle data. The changes are sorted by requirements, so that they can be applied in order.
func (*Client) GetModelConstraints ¶
func (c *Client) GetModelConstraints() (params.GetConstraintsResults, error)
GetModelConstraints returns the constraints for the model.
func (*Client) InjectMachines ¶
func (c *Client) InjectMachines(args params.AddMachines) (params.AddMachinesResults, error)
InjectMachines injects a machine into state with provisioned status.
func (*Client) ModelGet ¶
func (c *Client) ModelGet() (params.ModelConfigResults, error)
ModelGet implements the server-side part of the get-model-config CLI command.
func (*Client) ModelInfo ¶
ModelInfo returns information about the current model (default series and type).
func (*Client) ModelSet ¶
ModelSet implements the server-side part of the set-model-config CLI command.
func (*Client) ModelUnset ¶
func (c *Client) ModelUnset(args params.ModelUnset) error
ModelUnset implements the server-side part of the set-model-config CLI command.
func (*Client) ModelUserInfo ¶
func (c *Client) ModelUserInfo() (params.ModelUserInfoResults, error)
ModelUserInfo returns information on all users in the model.
func (*Client) PrivateAddress ¶
func (c *Client) PrivateAddress(p params.PrivateAddress) (results params.PrivateAddressResults, err error)
PrivateAddress implements the server side of Client.PrivateAddress.
func (*Client) ProvisioningScript ¶
func (c *Client) ProvisioningScript(args params.ProvisioningScriptParams) (params.ProvisioningScriptResult, error)
ProvisioningScript returns a shell script that, when run, provisions a machine agent on the machine executing the script.
func (*Client) PublicAddress ¶
func (c *Client) PublicAddress(p params.PublicAddress) (results params.PublicAddressResults, err error)
PublicAddress implements the server side of Client.PublicAddress.
func (*Client) ResolveCharms ¶
func (c *Client) ResolveCharms(args params.ResolveCharms) (params.ResolveCharmResults, error)
ResolveCharm resolves the best available charm URLs with series, for charm locations without a series specified.
func (*Client) Resolved ¶
Resolved implements the server side of Client.Resolved.
func (*Client) RetryProvisioning ¶
RetryProvisioning marks a provisioning error as transient on the machines.
func (*Client) Run ¶
Run the commands specified on the machines identified through the list of machines, units and services.
func (*Client) RunOnAllMachines ¶
RunOnAllMachines attempts to run the specified command on all the machines.
func (*Client) SetModelAgentVersion ¶
func (c *Client) SetModelAgentVersion(args params.SetModelAgentVersion) error
SetModelAgentVersion sets the model agent version.
func (*Client) SetModelConstraints ¶
func (c *Client) SetModelConstraints(args params.SetConstraints) error
SetModelConstraints sets the constraints for the model.
func (*Client) ShareModel ¶
func (c *Client) ShareModel(args params.ModifyModelUsers) (result params.ErrorResults, err error)
ShareModel manages allowing and denying the given user(s) access to the model.
func (*Client) Status ¶
func (c *Client) Status() (params.LegacyStatus, error)
Status is a stub version of FullStatus that was introduced in 1.16
func (*Client) StatusHistory ¶
func (c *Client) StatusHistory(args params.StatusHistoryArgs) (params.StatusHistoryResults, error)
StatusHistory returns a slice of past statuses for several entities.
func (*Client) WatchAll ¶
func (c *Client) WatchAll() (params.AllWatcherId, error)
type MachineOrder ¶
MachineOrder is used to provide the api to sort the results by the machine id.
func (MachineOrder) Len ¶
func (a MachineOrder) Len() int
func (MachineOrder) Less ¶
func (a MachineOrder) Less(i, j int) bool
func (MachineOrder) Swap ¶
func (a MachineOrder) Swap(i, j int)
type Predicate ¶
Predicate is a function that when given a unit, machine, or service, will determine whether the unit meets some criteria.
type RemoteExec ¶
type RemoteExec struct {
ssh.ExecParams
MachineId string
UnitId string
}
RemoteExec extends the standard ssh.ExecParams by providing the machine and perhaps the unit ids. These are then returned in the params.RunResult return values.
type Unit ¶
type Unit interface {
status.StatusHistoryGetter
Life() state.Life
Destroy() (err error)
IsPrincipal() bool
PublicAddress() (network.Address, error)
PrivateAddress() (network.Address, error)
Resolve(retryHooks bool) error
AgentHistory() status.StatusHistoryGetter
}
Unit represents a state.Unit.
Source Files
¶
- bundles.go
- client.go
- filtering.go
- instanceconfig.go
- run.go
- state.go
- status.go