Documentation ¶
Index ¶
- Constants
- func ClientError(err error) error
- func ErrCode(err error) string
- type AddRelation
- type AddRelationResults
- type AddServiceUnits
- type AddServiceUnitsResults
- type AgentTools
- type AgentToolsResult
- type AgentToolsResults
- type AllWatcherId
- type AllWatcherNextResults
- type AnnotationInfo
- type CharmInfo
- type Creds
- type Delta
- type DestroyRelation
- type DestroyServiceUnits
- type Endpoint
- type Entities
- type Entity
- type EntityId
- type EntityInfo
- type Error
- type ErrorResults
- type GetAnnotations
- type GetAnnotationsResults
- type GetServiceConstraints
- type GetServiceConstraintsResults
- type Life
- type LifeResult
- type LifeResults
- type MachineAgentGetMachinesResult
- type MachineAgentGetMachinesResults
- type MachineInfo
- type MachineJob
- type MachineSetStatus
- type MachinesSetStatus
- type NotifyWatchResult
- type NotifyWatchResults
- type PasswordChange
- type PasswordChanges
- type RelationInfo
- type Resolved
- type ResolvedResults
- type ServiceDeploy
- type ServiceDestroy
- type ServiceExpose
- type ServiceGet
- type ServiceGetResults
- type ServiceInfo
- type ServiceSet
- type ServiceSetCharm
- type ServiceSetYAML
- type ServiceUnexpose
- type SetAgentTools
- type SetAgentToolsResult
- type SetAgentToolsResults
- type SetAnnotations
- type SetServiceConstraints
- type Status
- type StringsWatchResult
- type UnitInfo
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" )
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.
Types ¶
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 AgentTools ¶
type AgentTools struct { Tag string Major int Minor int Patch int Build int Arch string Series string URL string }
AgentTools describes the tools for a given Agent. This is mostly a flattened state.Tools description, plus an agent Tag field.
type AgentToolsResult ¶
type AgentToolsResult struct { AgentTools AgentTools Error *Error }
AgentToolsResult holds the tools and possibly error for a given Agent request
type AgentToolsResults ¶
type AgentToolsResults struct {
Tools []AgentToolsResult
}
AgentToolsResults is a list of tools for various requested agents.
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 CharmInfo ¶
type CharmInfo struct {
CharmURL string
}
CharmInfo stores parameters for a CharmInfo 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 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 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 ErrorResults ¶
type ErrorResults struct { // Errors contains errors occured while performing each operation (if any). Errors []*Error }
ErrorResults holds the results of calling a bulk operation which mutates multiple entites, like Machiner.SetStatus. The order and number of elements matches the entities specified in the request.
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 GetServiceConstraints ¶
type GetServiceConstraints struct {
ServiceName string
}
GetServiceConstraints stores parameters for making the GetServiceConstraints call.
type GetServiceConstraintsResults ¶
type GetServiceConstraintsResults struct {
Constraints constraints.Value
}
GetServiceConstraintsResults holds results of the GetServiceConstraints 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 MachineAgentGetMachinesResult ¶
type MachineAgentGetMachinesResult struct { Life Life Jobs []MachineJob Error *Error }
MachineAgentGetMachinesResult holds the results of a machineagent.API.GetMachines call for a single machine.
type MachineAgentGetMachinesResults ¶
type MachineAgentGetMachinesResults struct {
Machines []MachineAgentGetMachinesResult
}
MachineAgentGetMachinesResults holds the results of a machineagent.API.GetMachines call.
type MachineInfo ¶
type MachineInfo struct { Id string `bson:"_id"` InstanceId string Status Status StatusInfo string }
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" JobManageState MachineJob = "JobManageState" )
type MachineSetStatus ¶
MachineSetStatus holds a machine tag, status and extra info.
type MachinesSetStatus ¶
type MachinesSetStatus struct {
Machines []MachineSetStatus
}
MachinesSetStatus holds the parameters for making a Machiner.SetStatus call.
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 PasswordChange ¶
PasswordChange specifies a password change for the entity with the given tag.
type PasswordChanges ¶
type PasswordChanges struct {
Changes []PasswordChange
}
PasswordChanges holds the parameters for making a SetPasswords call.
type RelationInfo ¶
func (*RelationInfo) EntityId ¶
func (i *RelationInfo) EntityId() EntityId
type ResolvedResults ¶
ResolvedResults holds results of the Resolved 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 ForceMachineId 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 call.
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 Life Life 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 SetAgentTools ¶
type SetAgentTools struct {
AgentTools []AgentTools
}
Set what tools are being run for multiple agents
type SetAgentToolsResult ¶
The result of setting the tools for one agent
type SetAgentToolsResults ¶
type SetAgentToolsResults struct {
Results []SetAgentToolsResult
}
The result of setting the tools for many agents
type SetAnnotations ¶
SetAnnotations stores parameters for making the SetAnnotations call.
type SetServiceConstraints ¶
type SetServiceConstraints struct { ServiceName string Constraints constraints.Value }
SetServiceConstraints stores parameters for making the SetServiceConstraints call.
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 StringsWatchResult ¶
StringsWatchResult holds a StringsWatcher id, changes and an error (if any).