Documentation ¶
Index ¶
- Constants
- func ClientError(err error) error
- func ErrCode(err error) string
- func IsCodeAlreadyExists(err error) bool
- func IsCodeCannotEnterScope(err error) bool
- func IsCodeCannotEnterScopeYet(err error) bool
- func IsCodeExcessiveContention(err error) bool
- func IsCodeHasAssignedUnits(err error) bool
- func IsCodeNoAddressSet(err error) bool
- func IsCodeNotAssigned(err error) bool
- func IsCodeNotFound(err error) bool
- func IsCodeNotFoundOrCodeUnauthorized(err error) bool
- func IsCodeNotImplemented(err error) bool
- func IsCodeNotProvisioned(err error) bool
- func IsCodeStopped(err error) bool
- func IsCodeTryAgain(err error) bool
- func IsCodeUnauthorized(err error) bool
- func IsCodeUnitHasSubordinates(err error) bool
- type APIHostPortsResult
- type AddMachineParams
- type AddMachines
- type AddMachinesResult
- type AddMachinesResults
- type AddRelation
- type AddRelationResults
- type AddServiceUnits
- type AddServiceUnitsResults
- type AgentGetEntitiesResult
- type AgentGetEntitiesResults
- type AgentVersionResult
- type AllWatcherId
- type AllWatcherNextResults
- type AnnotationInfo
- type BoolResult
- type BoolResults
- type BytesResult
- type CharmArchiveURLResult
- type CharmArchiveURLResults
- type CharmInfo
- type CharmURL
- type CharmURLs
- type CharmsResponse
- type ConfigSettings
- type ConfigSettingsResult
- type ConfigSettingsResults
- type ConstraintsResult
- type ConstraintsResults
- type ContainerConfig
- type ContainerManagerConfig
- type ContainerManagerConfigParams
- type Creds
- type Delta
- type DeployerConnectionValues
- type DestroyMachines
- type DestroyRelation
- type DestroyServiceUnits
- type DistributionGroupResult
- type DistributionGroupResults
- type Endpoint
- type EnsureAvailability
- type Entities
- type EntitiesCharmURL
- type EntitiesPorts
- type EntitiesVersion
- type Entity
- type EntityCharmURL
- type EntityId
- type EntityInfo
- type EntityPassword
- type EntityPasswords
- type EntityPort
- type EntityStatus
- type EntityVersion
- type EnvironConfig
- type EnvironConfigResult
- type EnvironmentGetResults
- type EnvironmentResult
- type EnvironmentSet
- type EnvironmentUnset
- type Error
- type ErrorResult
- type ErrorResults
- type FindToolsParams
- type FindToolsResults
- type GetAnnotations
- type GetAnnotationsResults
- type GetConstraintsResults
- type GetServiceConstraints
- type InstanceInfo
- type InstancesInfo
- type IsMasterResult
- type Life
- type LifeResult
- type LifeResults
- type ListSSHKeys
- type LoginResult
- type MachineAddresses
- type MachineContainers
- type MachineContainersParams
- type MachineInfo
- type MachineJob
- type MachineNetworkInfoResult
- type MachineNetworkInfoResults
- type MachineSetProvisioned
- type ModifyUser
- type ModifyUserSSHKeys
- type ModifyUsers
- type Network
- type NetworkInterface
- type NotifyWatchResult
- type NotifyWatchResults
- type PortsResult
- type PortsResults
- type PrivateAddress
- type PrivateAddressResults
- type ProvisioningInfo
- type ProvisioningInfoResult
- type ProvisioningInfoResults
- type ProvisioningScriptParams
- type ProvisioningScriptResult
- type PublicAddress
- type PublicAddressResults
- type RelationIds
- type RelationInfo
- type RelationResult
- type RelationResults
- type RelationSettings
- type RelationSettingsResult
- type RelationSettingsResults
- type RelationUnit
- type RelationUnitPair
- type RelationUnitPairs
- type RelationUnitSettings
- type RelationUnits
- type RelationUnitsChange
- type RelationUnitsSettings
- type RelationUnitsWatchResult
- type RelationUnitsWatchResults
- type RequestedNetworkResult
- type RequestedNetworksResults
- type ResolveCharmResult
- type ResolveCharmResults
- type ResolveCharms
- type Resolved
- type ResolvedMode
- type ResolvedModeResult
- type ResolvedModeResults
- type ResolvedResults
- type RsyslogConfigResult
- type RsyslogConfigResults
- type RunParams
- type RunResult
- type RunResults
- type ServiceCharmRelations
- type ServiceCharmRelationsResults
- type ServiceDeploy
- type ServiceDestroy
- type ServiceExpose
- type ServiceGet
- type ServiceGetResults
- type ServiceInfo
- type ServiceSet
- type ServiceSetCharm
- type ServiceSetYAML
- type ServiceUnexpose
- type ServiceUnset
- type ServiceUpdate
- type SetAnnotations
- type SetConstraints
- type SetEnvironAgentVersion
- type SetMachinesAddresses
- type SetProvisioned
- type SetRsyslogCertParams
- type SetStatus
- type StateServingInfo
- type Status
- type StatusData
- type StatusParams
- type StatusResult
- type StatusResults
- type StringBoolResult
- type StringBoolResults
- type StringResult
- type StringResults
- type StringsResult
- type StringsResults
- type StringsWatchResult
- type StringsWatchResults
- type ToolsResult
- type ToolsResults
- type UnitInfo
- type UnitSettings
- type Version
- type VersionResult
- type VersionResults
- type WatchContainer
- type WatchContainers
Constants ¶
const ( CodeNotFound = "not found" CodeCannotEnterScope = "cannot enter scope" CodeCannotEnterScopeYet = "cannot enter scope yet" CodeExcessiveContention = "excessive contention" CodeUnitHasSubordinates = "unit has subordinates" CodeNotAssigned = "not assigned" CodeStopped = "stopped" CodeHasAssignedUnits = "machine has assigned units" CodeNotProvisioned = "not provisioned" CodeNoAddressSet = "no address set" CodeTryAgain = "try again" CodeNotImplemented = rpc.CodeNotImplemented CodeAlreadyExists = "already exists" )
The Code constants hold error codes for some kinds of error.
Variables ¶
This section is empty.
Functions ¶
func ClientError ¶
ClientError maps errors returned from an RPC call into local errors with appropriate values.
func ErrCode ¶
ErrCode returns the error code associated with the given error, or the empty string if there is none.
func IsCodeAlreadyExists ¶
func IsCodeCannotEnterScope ¶
func IsCodeHasAssignedUnits ¶
func IsCodeNoAddressSet ¶
func IsCodeNotAssigned ¶
func IsCodeNotFound ¶
func IsCodeNotFoundOrCodeUnauthorized ¶
IsCodeNotFoundOrCodeUnauthorized is used in API clients which, pre-API, used errors.IsNotFound; this is because an API client is not necessarily privileged to know about the existence or otherwise of a particular entity, and the server may hence convert NotFound to Unauthorized at its discretion.
func IsCodeNotImplemented ¶
func IsCodeNotProvisioned ¶
func IsCodeStopped ¶
func IsCodeTryAgain ¶
func IsCodeUnauthorized ¶
Types ¶
type APIHostPortsResult ¶
APIHostPortsResult holds the result of an APIHostPorts call. Each element in the top level slice holds the addresses for one API server.
type AddMachineParams ¶
type AddMachineParams struct { // The following fields hold attributes that will be given to the // new machine when it is created. Series string Constraints constraints.Value Jobs []MachineJob // If Placement is non-nil, it contains a placement directive // that will be used to decide how to instantiate the machine. Placement *instance.Placement // If ParentId is non-empty, it specifies the id of the // parent machine within which the new machine will // be created. In that case, ContainerType must also be // set. ParentId string // ContainerType optionally gives the container type of the // new machine. If it is non-empty, the new machine // will be implemented by a container. If it is specified // but ParentId is empty, a new top level machine will // be created to hold the container with given series, // constraints and jobs. ContainerType instance.ContainerType // If InstanceId is non-empty, it will be associated with // the new machine along with the given nonce, // hardware characteristics and addresses. // All the following fields will be ignored if ContainerType // is set. InstanceId instance.Id Nonce string HardwareCharacteristics instance.HardwareCharacteristics Addrs []instance.Address }
AddMachineParams encapsulates the parameters used to create a new machine.
type AddMachines ¶
type AddMachines struct {
MachineParams []AddMachineParams
}
AddMachines holds the parameters for making the AddMachinesWithPlacement call.
type AddMachinesResult ¶
AddMachinesResults holds the name of a machine added by the state.api.client.AddMachine call for a single machine.
type AddMachinesResults ¶
type AddMachinesResults struct {
Machines []AddMachinesResult
}
AddMachinesResults holds the results of an AddMachines call.
type AddRelation ¶
type AddRelation struct {
Endpoints []string
}
AddRelation holds the parameters for making the AddRelation call. The endpoints specified are unordered.
type AddRelationResults ¶
AddRelationResults holds the results of a AddRelation call. The Endpoints field maps service names to the involved endpoints.
type AddServiceUnits ¶
AddServiceUnits holds parameters for the AddUnits call.
type AddServiceUnitsResults ¶
type AddServiceUnitsResults struct {
Units []string
}
AddServiceUnitsResults holds the names of the units added by the AddServiceUnits call.
type AgentGetEntitiesResult ¶
type AgentGetEntitiesResult struct { Life Life Jobs []MachineJob ContainerType instance.ContainerType Error *Error }
AgentGetEntitiesResult holds the results of a machineagent.API.GetEntities call for a single entity.
type AgentGetEntitiesResults ¶
type AgentGetEntitiesResults struct {
Entities []AgentGetEntitiesResult
}
AgentGetEntitiesResults holds the results of a agent.API.GetEntities call.
type AgentVersionResult ¶
AgentVersionResult is used to return the current version number of the agent running the API server.
type AllWatcherId ¶
type AllWatcherId struct {
AllWatcherId string
}
AllWatcherId holds the id of an AllWatcher.
type AllWatcherNextResults ¶
type AllWatcherNextResults struct {
Deltas []Delta
}
AllWatcherNextResults holds deltas returned from calling AllWatcher.Next().
type AnnotationInfo ¶
func (*AnnotationInfo) EntityId ¶
func (i *AnnotationInfo) EntityId() EntityId
type BoolResult ¶
BoolResult holds the result of an API call that returns a a boolean or an error.
type BoolResults ¶
type BoolResults struct {
Results []BoolResult
}
BoolResults holds multiple results with BoolResult each.
type BytesResult ¶
type BytesResult struct {
Result []byte
}
BytesResult holds the result of an API call that returns a slice of bytes.
type CharmArchiveURLResult ¶
type CharmArchiveURLResult struct { Error *Error Result string DisableSSLHostnameVerification bool }
CharmArchiveURLResult holds a charm archive (bundle) URL, a DisableSSLHostnameVerification flag or an error.
type CharmArchiveURLResults ¶
type CharmArchiveURLResults struct {
Results []CharmArchiveURLResult
}
CharmArchiveURLResults holds the bulk operation result of an API call that returns a charm archive (bundle) URL, a DisableSSLHostnameVerification flag or an error.
type CharmInfo ¶
type CharmInfo struct {
CharmURL string
}
CharmInfo stores parameters for a CharmInfo call.
type CharmURLs ¶
type CharmURLs struct {
URLs []CharmURL
}
CharmURLs identifies multiple charm URLs.
type CharmsResponse ¶
type CharmsResponse struct { Error string `json:",omitempty"` CharmURL string `json:",omitempty"` Files []string `json:",omitempty"` }
CharmsResponse is the server response to charm upload or GET requests.
type ConfigSettings ¶
type ConfigSettings map[string]interface{}
ConfigSettings holds unit, service or cham configuration settings with string keys and arbitrary values.
type ConfigSettingsResult ¶
type ConfigSettingsResult struct { Error *Error Settings ConfigSettings }
ConfigSettingsResult holds a configuration map or an error.
type ConfigSettingsResults ¶
type ConfigSettingsResults struct {
Results []ConfigSettingsResult
}
ConfigSettingsResults holds multiple configuration maps or errors.
type ConstraintsResult ¶
type ConstraintsResult struct { Error *Error Constraints constraints.Value }
ConstraintsResult holds machine constraints or an error.
type ConstraintsResults ¶
type ConstraintsResults struct {
Results []ConstraintsResult
}
ConstraintsResults holds multiple constraints results.
type ContainerConfig ¶
type ContainerConfig struct { ProviderType string AuthorizedKeys string SSLHostnameVerification bool Proxy proxy.Settings AptProxy proxy.Settings }
ContainerConfig contains information from the environment config that is needed for container cloud-init.
type ContainerManagerConfig ¶
ContainerManagerConfig contains information from the environment config that is needed for configuring the container manager.
type ContainerManagerConfigParams ¶
type ContainerManagerConfigParams struct {
Type instance.ContainerType
}
ContainerManagerConfigParams contains the parameters for the ContainerManagerConfig provisioner API call.
type Delta ¶
type Delta struct { // If Removed is true, the entity has been removed; // otherwise it has been created or changed. Removed bool // Entity holds data about the entity that has changed. Entity EntityInfo }
Delta holds details of a change to the environment.
func (*Delta) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Delta) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type DeployerConnectionValues ¶
DeployerConnectionValues containers the result of deployer.ConnectionInfo API call.
type DestroyMachines ¶
DestroyMachines holds parameters for the DestroyMachines call.
type DestroyRelation ¶
type DestroyRelation struct {
Endpoints []string
}
DestroyRelation holds the parameters for making the DestroyRelation call. The endpoints specified are unordered.
type DestroyServiceUnits ¶
type DestroyServiceUnits struct {
UnitNames []string
}
DestroyServiceUnits holds parameters for the DestroyUnits call.
type DistributionGroupResult ¶
DistributionGroupResult contains the result of the DistributionGroup provisioner API call.
type DistributionGroupResults ¶
type DistributionGroupResults struct {
Results []DistributionGroupResult
}
DistributionGroupResults is the bulk form of DistributionGroupResult.
type EnsureAvailability ¶
type EnsureAvailability struct { NumStateServers int Constraints constraints.Value // Series is the series to associate with new state server machines. // If this is empty, then the environment's default series is used. Series string }
EnsureAvailability contains arguments for the EnsureAvailability client API call.
type EntitiesCharmURL ¶
type EntitiesCharmURL struct {
Entities []EntityCharmURL
}
EntitiesCharmURL holds the parameters for making a SetCharmURL API call.
type EntitiesPorts ¶
type EntitiesPorts struct {
Entities []EntityPort
}
EntitiesPorts holds the parameters for making an OpenPort or ClosePort on some entities.
type EntitiesVersion ¶
type EntitiesVersion struct {
AgentTools []EntityVersion
}
EntitiesVersion specifies what tools are being run for multiple entities.
type EntityCharmURL ¶
EntityCharmURL holds an entity's tag and a charm URL.
type EntityInfo ¶
type EntityInfo interface { // EntityId returns an identifier that will uniquely // identify the entity within its kind EntityId() EntityId }
EntityInfo is implemented by all entity Info types.
type EntityPassword ¶
EntityPassword specifies a password change for the entity with the given tag.
type EntityPasswords ¶
type EntityPasswords struct {
Changes []EntityPassword
}
EntityPasswords holds the parameters for making a SetPasswords call.
type EntityPort ¶
EntityPort holds an entity's tag, a protocol and a port.
type EntityStatus ¶
type EntityStatus struct { Tag string Status Status Info string Data StatusData }
EntityStatus holds an entity tag, status and extra info.
type EntityVersion ¶
EntityVersion specifies the tools version to be set for an entity with the given tag. version.Binary directly.
type EnvironConfig ¶
type EnvironConfig map[string]interface{}
EnvironConfig holds an environment configuration.
type EnvironConfigResult ¶
type EnvironConfigResult struct {
Config EnvironConfig
}
EnvironConfigResult holds environment configuration or an error.
type EnvironmentGetResults ¶
type EnvironmentGetResults struct {
Config map[string]interface{}
}
EnvironmentGetResults contains the result of EnvironmentGet client API call.
type EnvironmentResult ¶
EnvironmentResult holds the result of an API call returning a name and UUID for an environment.
type EnvironmentSet ¶
type EnvironmentSet struct {
Config map[string]interface{}
}
EnvironmentSet contains the arguments for EnvironmentSet client API call.
type EnvironmentUnset ¶
type EnvironmentUnset struct {
Keys []string
}
EnvironmentUnset contains the arguments for EnvironmentUnset client API call.
type ErrorResult ¶
type ErrorResult struct {
Error *Error
}
ErrorResult holds the error status of a single operation.
type ErrorResults ¶
type ErrorResults struct { // Results contains the error results from each operation. Results []ErrorResult }
ErrorResults holds the results of calling a bulk operation which returns no data, only an error result. The order and number of elements matches the operations specified in the request.
func (ErrorResults) OneError ¶
func (result ErrorResults) OneError() error
OneError returns the error from the result of a bulk operation on a single value.
type FindToolsParams ¶
FindToolsParams defines parameters for the FindTools method.
type FindToolsResults ¶
FindToolsResults holds a list of tools from FindTools and any error.
type GetAnnotations ¶
type GetAnnotations struct {
Tag string
}
GetAnnotations stores parameters for making the GetAnnotations call.
type GetAnnotationsResults ¶
GetAnnotationsResults holds annotations associated with an entity.
type GetConstraintsResults ¶
type GetConstraintsResults struct {
Constraints constraints.Value
}
GetConstraintsResults holds results of the GetConstraints call.
type GetServiceConstraints ¶
type GetServiceConstraints struct {
ServiceName string
}
GetServiceConstraints stores parameters for making the GetServiceConstraints call.
type InstanceInfo ¶
type InstanceInfo struct { Tag string InstanceId instance.Id Nonce string Characteristics *instance.HardwareCharacteristics Networks []Network Interfaces []NetworkInterface }
InstanceInfo holds a machine tag, provider-specific instance id, a nonce, a list of networks and interfaces to set up.
type InstancesInfo ¶
type InstancesInfo struct {
Machines []InstanceInfo
}
InstancesInfo holds the parameters for making a SetInstanceInfo call for multiple machines.
type IsMasterResult ¶
type IsMasterResult struct { // Master reports whether the connected agent // lives on the same instance as the mongo replica // set master. Master bool }
IsMasterResult holds the result of an IsMaster API call.
type Life ¶
type Life string
Life describes the lifecycle state of an entity ("alive", "dying" or "dead").
type LifeResult ¶
LifeResult holds the life status of a single entity, or an error indicating why it is not available.
type LifeResults ¶
type LifeResults struct {
Results []LifeResult
}
LifeResults holds the life or error status of multiple entities.
type ListSSHKeys ¶
ListSSHKeys stores parameters used for a KeyManager.ListKeys call.
type LoginResult ¶
LoginResult holds the result of a Login call.
type MachineAddresses ¶
MachineAddresses holds an machine tag and addresses.
type MachineContainers ¶
type MachineContainers struct { MachineTag string ContainerTypes []instance.ContainerType }
MachineContainers holds the arguments for making an SetSupportedContainers call on a given machine.
type MachineContainersParams ¶
type MachineContainersParams struct {
Params []MachineContainers
}
MachineContainersParams holds the arguments for making a SetSupportedContainers API call.
type MachineInfo ¶
type MachineInfo struct { Id string `bson:"_id"` InstanceId string Status Status StatusInfo string StatusData StatusData Life Life Series string SupportedContainers []instance.ContainerType SupportedContainersKnown bool HardwareCharacteristics *instance.HardwareCharacteristics `json:",omitempty"` Jobs []MachineJob Addresses []instance.Address }
MachineInfo holds the information about a Machine that is watched by StateWatcher.
func (*MachineInfo) EntityId ¶
func (i *MachineInfo) EntityId() EntityId
type MachineJob ¶
type MachineJob string
MachineJob values define responsibilities that machines may be expected to fulfil.
const ( JobHostUnits MachineJob = "JobHostUnits" JobManageEnviron MachineJob = "JobManageEnviron" // Deprecated in 1.18 JobManageStateDeprecated MachineJob = "JobManageState" )
func (MachineJob) NeedsState ¶
func (job MachineJob) NeedsState() bool
NeedsState returns true if the job requires a state connection.
type MachineNetworkInfoResult ¶
MachineNetworkInfoResult holds network info for a single machine.
type MachineNetworkInfoResults ¶
type MachineNetworkInfoResults struct {
Results []MachineNetworkInfoResult
}
MachineNetworkInfoResults holds network info for multiple machines.
type MachineSetProvisioned ¶
type MachineSetProvisioned struct { Tag string InstanceId instance.Id Nonce string Characteristics *instance.HardwareCharacteristics }
MachineSetProvisioned holds a machine tag, provider-specific instance id, a nonce, or an error.
NOTE: This is deprecated since 1.19.0 and not used by the provisioner, it's just retained for backwards-compatibility and should be removed.
type ModifyUser ¶
type ModifyUser struct { // Tag is here purely for backwards compatability. Older clients will // attempt to use the EntityPassword structure, so we need a Tag here // (which will be treated as Username) Tag string Username string DisplayName string Password string }
ModifyUser stores the parameters used for a UserManager.Add|Remove call
type ModifyUserSSHKeys ¶
ModifySSHKeys stores parameters used for a KeyManager.Add|Delete|Import call for a user.
type ModifyUsers ¶
type ModifyUsers struct {
Changes []ModifyUser
}
ModifyUsers holds the parameters for making a UserManager Add or Modify calls.
type Network ¶
type Network struct { // Tag is the network's tag. Tag string // ProviderId is the provider-specific network id. ProviderId network.Id // CIDR of the network, in "123.45.67.89/12" format. CIDR string // VLANTag needs to be between 1 and 4094 for VLANs and 0 for // normal networks. It's defined by IEEE 802.1Q standard. VLANTag int }
Network describes a single network available on an instance.
type NetworkInterface ¶
type NetworkInterface struct { // MACAddress is the network interface's hardware MAC address // (e.g. "aa:bb:cc:dd:ee:ff"). MACAddress string // InterfaceName is the OS-specific network device name (e.g. // "eth1", even for for a VLAN eth1.42 virtual interface). InterfaceName string // NetworkTag is this interface's network tag. NetworkTag string // IsVirtual is true when the interface is a virtual device, as // opposed to a physical device. IsVirtual bool }
NetworkInterface describes a single network interface available on an instance.
type NotifyWatchResult ¶
NotifyWatchResult holds a NotifyWatcher id and an error (if any).
type NotifyWatchResults ¶
type NotifyWatchResults struct {
Results []NotifyWatchResult
}
NotifyWatchResults holds the results for any API call which ends up returning a list of NotifyWatchers
type PortsResult ¶
PortsResult holds the result of an API call that returns a slice of instance.Port or an error.
type PortsResults ¶
type PortsResults struct {
Results []PortsResult
}
PortsResults holds the bulk operation result of an API call that returns a slice of instance.Port.
type PrivateAddress ¶
type PrivateAddress struct {
Target string
}
PrivateAddress holds parameters for the PrivateAddress call.
type PrivateAddressResults ¶
type PrivateAddressResults struct {
PrivateAddress string
}
PrivateAddressResults holds results of the PrivateAddress call.
type ProvisioningInfo ¶
type ProvisioningInfo struct { Constraints constraints.Value Series string Placement string Networks []string }
ProvisioningInfo holds machine provisioning info.
type ProvisioningInfoResult ¶
type ProvisioningInfoResult struct { Error *Error Result *ProvisioningInfo }
ProvisioningInfoResult holds machine provisioning info or an error.
type ProvisioningInfoResults ¶
type ProvisioningInfoResults struct {
Results []ProvisioningInfoResult
}
ProvisioningInfoResults holds multiple machine provisioning info results.
type ProvisioningScriptParams ¶
type ProvisioningScriptParams struct { MachineId string Nonce string // DataDir may be "", in which case the default will be used. DataDir string // DisablePackageCommands may be set to disable all package-related // commands. It is then the responsibility of the provisioner to // ensure that all the packages required by Juju are available. DisablePackageCommands bool }
ProvisioningScriptParams contains the parameters for the ProvisioningScript client API call.
type ProvisioningScriptResult ¶
type ProvisioningScriptResult struct {
Script string
}
ProvisioningScriptResult contains the result of the ProvisioningScript client API call.
type PublicAddress ¶
type PublicAddress struct {
Target string
}
PublicAddress holds parameters for the PublicAddress call.
type PublicAddressResults ¶
type PublicAddressResults struct {
PublicAddress string
}
PublicAddressResults holds results of the PublicAddress call.
type RelationIds ¶
type RelationIds struct {
RelationIds []int
}
RelationIds holds multiple relation ids.
type RelationInfo ¶
func (*RelationInfo) EntityId ¶
func (i *RelationInfo) EntityId() EntityId
type RelationResult ¶
RelationResult returns information about a single relation, or an error.
type RelationResults ¶
type RelationResults struct {
Results []RelationResult
}
RelationResults holds the result of an API call that returns information about multiple relations.
type RelationSettings ¶
RelationSettings holds relation settings names and values.
type RelationSettingsResult ¶
type RelationSettingsResult struct { Error *Error Settings RelationSettings }
RelationSettingsResult holds a relation settings map or an error.
type RelationSettingsResults ¶
type RelationSettingsResults struct {
Results []RelationSettingsResult
}
RelationSettingsResults holds the result of an API calls that returns settings for multiple relations.
type RelationUnit ¶
RelationUnit holds a relation and a unit tag.
type RelationUnitPair ¶
RelationUnitPair holds a relation tag, a local and remote unit tags.
type RelationUnitPairs ¶
type RelationUnitPairs struct {
RelationUnitPairs []RelationUnitPair
}
RelationUnitPairs holds the parameters for API calls expecting multiple sets of a relation tag, a local and remote unit tags.
type RelationUnitSettings ¶
type RelationUnitSettings struct { Relation string Unit string Settings RelationSettings }
RelationUnitSettings holds a relation tag, a unit tag and local unit settings.
type RelationUnits ¶
type RelationUnits struct {
RelationUnits []RelationUnit
}
RelationUnits holds the parameters for API calls expecting a pair of relation and unit tags.
type RelationUnitsChange ¶
type RelationUnitsChange struct { Changed map[string]UnitSettings Departed []string }
RelationUnitsChange holds notifications of units entering and leaving the scope of a RelationUnit, and changes to the settings of those units known to have entered.
When remote units first enter scope and then when their settings change, the changes will be noted in the Changed field, which holds the unit settings for every such unit, indexed by the unit id.
When remote units leave scope, their ids will be noted in the Departed field, and no further events will be sent for those units.
type RelationUnitsSettings ¶
type RelationUnitsSettings struct {
RelationUnits []RelationUnitSettings
}
RelationUnitsSettings holds the arguments for making a EnterScope or WriteSettings API calls.
type RelationUnitsWatchResult ¶
type RelationUnitsWatchResult struct { RelationUnitsWatcherId string Changes RelationUnitsChange Error *Error }
RelationUnitsWatchResult holds a RelationUnitsWatcher id, changes and an error (if any).
type RelationUnitsWatchResults ¶
type RelationUnitsWatchResults struct {
Results []RelationUnitsWatchResult
}
RelationUnitsWatchResults holds the results for any API call which ends up returning a list of RelationUnitsWatchers.
type RequestedNetworkResult ¶
RequestedNetworkResult holds requested networks or an error.
type RequestedNetworksResults ¶
type RequestedNetworksResults struct {
Results []RequestedNetworkResult
}
RequestedNetworksResults holds multiple requested networks results.
type ResolveCharmResult ¶
type ResolveCharmResult struct { URL *charm.URL `json:",omitempty"` Error string `json:",omitempty"` }
ResolveCharmResult holds the result of resolving a charm reference to a URL, or any error that occurred.
type ResolveCharmResults ¶
type ResolveCharmResults struct {
URLs []ResolveCharmResult
}
ResolveCharmResults holds results of the ResolveCharms call.
type ResolveCharms ¶
ResolveCharms stores charm references for a ResolveCharms call.
type ResolvedMode ¶
type ResolvedMode string
ResolvedMode describes the way state transition errors are resolved.
const ( ResolvedNone ResolvedMode = "" ResolvedRetryHooks ResolvedMode = "retry-hooks" ResolvedNoHooks ResolvedMode = "no-hooks" )
type ResolvedModeResult ¶
type ResolvedModeResult struct { Error *Error Mode ResolvedMode }
ResolvedModeResult holds a resolved mode or an error.
type ResolvedModeResults ¶
type ResolvedModeResults struct {
Results []ResolvedModeResult
}
ResolvedModeResults holds the bulk operation result of an API call that returns a resolved mode or an error.
type ResolvedResults ¶
ResolvedResults holds results of the Resolved call.
type RsyslogConfigResult ¶
type RsyslogConfigResult struct { Error *Error CACert string // Port is only used by state servers as the port to listen on. // Clients should use HostPorts for the rsyslog addresses to forward // logs to. Port int HostPorts []instance.HostPort }
RsyslogConfigResult holds the result of a GetRsyslogConfig call.
type RsyslogConfigResults ¶
type RsyslogConfigResults struct {
Results []RsyslogConfigResult
}
RsyslogConfigResults is the bulk form of RyslogConfigResult
type RunParams ¶
type RunParams struct { Commands string Timeout time.Duration Machines []string Services []string Units []string }
RunParams is used to provide the parameters to the Run method. Commands and Timeout are expected to have values, and one or more values should be in the Machines, Services, or Units slices.
type RunResult ¶
type RunResult struct { exec.ExecResponse MachineId string UnitId string Error string }
RunResult contains the result from an individual run call on a machine. UnitId is populated if the command was run inside the unit context.
type RunResults ¶
type RunResults struct {
Results []RunResult
}
RunResults is used to return the slice of results. API server side calls need to return single structure values.
type ServiceCharmRelations ¶
type ServiceCharmRelations struct {
ServiceName string
}
ServiceCharmRelations holds parameters for making the ServiceCharmRelations call.
type ServiceCharmRelationsResults ¶
type ServiceCharmRelationsResults struct {
CharmRelations []string
}
ServiceCharmRelationsResults holds the results of the ServiceCharmRelations call.
type ServiceDeploy ¶
type ServiceDeploy struct { ServiceName string CharmUrl string NumUnits int Config map[string]string ConfigYAML string // Takes precedence over config if both are present. Constraints constraints.Value ToMachineSpec string Networks []string }
ServiceDeploy holds the parameters for making the ServiceDeploy call.
type ServiceDestroy ¶
type ServiceDestroy struct {
ServiceName string
}
ServiceDestroy holds the parameters for making the ServiceDestroy call.
type ServiceExpose ¶
type ServiceExpose struct {
ServiceName string
}
ServiceExpose holds the parameters for making the ServiceExpose call.
type ServiceGet ¶
type ServiceGet struct {
ServiceName string
}
ServiceGet holds parameters for making the ServiceGet or ServiceGetCharmURL calls.
type ServiceGetResults ¶
type ServiceGetResults struct { Service string Charm string Config map[string]interface{} Constraints constraints.Value }
ServiceGetResults holds results of the ServiceGet call.
type ServiceInfo ¶
type ServiceInfo struct { Name string `bson:"_id"` Exposed bool CharmURL string OwnerTag string Life Life MinUnits int Constraints constraints.Value Config map[string]interface{} }
func (*ServiceInfo) EntityId ¶
func (i *ServiceInfo) EntityId() EntityId
type ServiceSet ¶
ServiceSet holds the parameters for a ServiceSet command. Options contains the configuration data.
type ServiceSetCharm ¶
ServiceSetCharm sets the charm for a given service.
type ServiceSetYAML ¶
ServiceSetYAML holds the parameters for a ServiceSetYAML command. Config contains the configuration data in YAML format.
type ServiceUnexpose ¶
type ServiceUnexpose struct {
ServiceName string
}
ServiceUnexpose holds parameters for the ServiceUnexpose call.
type ServiceUnset ¶
ServiceUnset holds the parameters for a ServiceUnset command. Options contains the option attribute names to unset.
type ServiceUpdate ¶
type ServiceUpdate struct { ServiceName string CharmUrl string ForceCharmUrl bool MinUnits *int SettingsStrings map[string]string SettingsYAML string // Takes precedence over SettingsStrings if both are present. Constraints *constraints.Value }
ServiceUpdate holds the parameters for making the ServiceUpdate call.
type SetAnnotations ¶
SetAnnotations stores parameters for making the SetAnnotations call.
type SetConstraints ¶
type SetConstraints struct { ServiceName string //optional, if empty, environment constraints are set. Constraints constraints.Value }
SetConstraints stores parameters for making the SetConstraints call.
type SetEnvironAgentVersion ¶
SetEnvironAgentVersion contains the arguments for SetEnvironAgentVersion client API call.
type SetMachinesAddresses ¶
type SetMachinesAddresses struct {
MachineAddresses []MachineAddresses
}
SetMachinesAddresses holds the parameters for making a SetMachineAddresses call.
type SetProvisioned ¶
type SetProvisioned struct {
Machines []MachineSetProvisioned
}
SetProvisioned holds the parameters for making a SetProvisioned call for a machine.
NOTE: This is deprecated since 1.19.0 and not used by the provisioner, it's just retained for backwards-compatibility and should be removed.
type SetRsyslogCertParams ¶
type SetRsyslogCertParams struct {
CACert []byte
}
SetRsyslogCertParams holds parameters for the SetRsyslogCert call.
type SetStatus ¶
type SetStatus struct {
Entities []EntityStatus
}
SetStatus holds the parameters for making a SetStatus/UpdateStatus call.
type StateServingInfo ¶
type StateServingInfo struct { APIPort int StatePort int Cert string PrivateKey string // this will be passed as the KeyFile argument to MongoDB SystemIdentity string }
StateServingInfo holds information needed by a state server.
type Status ¶
type Status string
Status represents the status of an entity. It could be a unit, machine or its agent.
const ( // The entity is not yet participating in the environment. StatusPending Status = "pending" // The unit has performed initial setup and is adapting itself to // the environment. Not applicable to machines. StatusInstalled Status = "installed" // The entity is actively participating in the environment. StatusStarted Status = "started" // The entity's agent will perform no further action, other than // to set the unit to Dead at a suitable moment. StatusStopped Status = "stopped" // The entity requires human intervention in order to operate // correctly. StatusError Status = "error" // The entity ought to be signalling activity, but it cannot be // detected. StatusDown Status = "down" )
type StatusData ¶
type StatusData map[string]interface{}
StatusData contains additional information for a status.
type StatusParams ¶
type StatusParams struct {
Patterns []string
}
StatusParams holds parameters for the Status call.
type StatusResult ¶
type StatusResult struct { Error *Error Id string Life Life Status Status Info string Data StatusData }
StatusResult holds an entity status, extra information, or an error.
type StatusResults ¶
type StatusResults struct {
Results []StatusResult
}
StatusResults holds multiple status results.
type StringBoolResult ¶
StringBoolResult holds the result of an API call that returns a string and a boolean.
type StringBoolResults ¶
type StringBoolResults struct {
Results []StringBoolResult
}
StringBoolResults holds multiple results with a string and a bool each.
type StringResult ¶
StringResult holds a string or an error.
type StringResults ¶
type StringResults struct {
Results []StringResult
}
StringResults holds the bulk operation result of an API call that returns a string or an error.
type StringsResult ¶
StringsResult holds the result of an API call that returns a slice of strings or an error.
type StringsResults ¶
type StringsResults struct {
Results []StringsResult
}
StringsResults holds the bulk operation result of an API call that returns a slice of strings or an error.
type StringsWatchResult ¶
StringsWatchResult holds a StringsWatcher id, changes and an error (if any).
type StringsWatchResults ¶
type StringsWatchResults struct {
Results []StringsWatchResult
}
StringsWatchResults holds the results for any API call which ends up returning a list of StringsWatchers.
type ToolsResult ¶
ToolsResult holds the tools and possibly error for a given Tools() API call.
type ToolsResults ¶
type ToolsResults struct {
Results []ToolsResult
}
ToolsResults is a list of tools for various requested agents.
type UnitInfo ¶
type UnitSettings ¶
type UnitSettings struct {
Version int64
}
UnitSettings holds information about a service unit's settings within a relation.
type VersionResult ¶
VersionResult holds the version and possibly error for a given DesiredVersion() API call.
type VersionResults ¶
type VersionResults struct {
Results []VersionResult
}
VersionResults is a list of versions for the requested entities.
type WatchContainer ¶
WatchContainer identifies a single container type within a machine.
type WatchContainers ¶
type WatchContainers struct {
Params []WatchContainer
}
WatchContainers holds the arguments for making a WatchContainers API call.