Documentation ¶
Index ¶
- type StatusAPI
- func (s *StatusAPI) ServiceStatus(args params.Entities) (params.ServiceStatusResults, error)
- func (s *StatusAPI) SetAgentStatus(args params.SetStatus) (params.ErrorResults, error)
- func (s *StatusAPI) SetServiceStatus(args params.SetStatus) (params.ErrorResults, error)
- func (s *StatusAPI) SetStatus(args params.SetStatus) (params.ErrorResults, error)
- func (s *StatusAPI) SetUnitStatus(args params.SetStatus) (params.ErrorResults, error)
- func (s *StatusAPI) UnitStatus(args params.Entities) (params.StatusResults, error)
- type StorageAPI
- func (a *StorageAPI) AddUnitStorage(args params.StoragesAddParams) (params.ErrorResults, error)
- func (s *StorageAPI) DestroyUnitStorageAttachments(args params.Entities) (params.ErrorResults, error)
- func (s *StorageAPI) RemoveStorageAttachments(args params.StorageAttachmentIds) (params.ErrorResults, error)
- func (s *StorageAPI) StorageAttachmentLife(args params.StorageAttachmentIds) (params.LifeResults, error)
- func (s *StorageAPI) StorageAttachments(args params.StorageAttachmentIds) (params.StorageAttachmentResults, error)
- func (s *StorageAPI) UnitStorageAttachments(args params.Entities) (params.StorageAttachmentIdsResults, error)
- func (s *StorageAPI) WatchStorageAttachments(args params.StorageAttachmentIds) (params.NotifyWatchResults, error)
- func (s *StorageAPI) WatchUnitStorageAttachments(args params.Entities) (params.StringsWatchResults, error)
- type UniterAPIV3
- func (u *UniterAPIV3) Actions(args params.Entities) (params.ActionResults, error)
- func (u *UniterAPIV3) AddMetricBatches(args params.MetricBatchParams) (params.ErrorResults, error)
- func (u *UniterAPIV3) AllMachinePorts(args params.Entities) (params.MachinePortsResults, error)
- func (u *UniterAPIV3) AssignedMachine(args params.Entities) (params.StringResults, error)
- func (u *UniterAPIV3) AvailabilityZone(args params.Entities) (params.StringResults, error)
- func (u *UniterAPIV3) BeginActions(args params.Entities) (params.ErrorResults, error)
- func (u *UniterAPIV3) CharmArchiveSha256(args params.CharmURLs) (params.StringResults, error)
- func (u *UniterAPIV3) CharmArchiveURLs(args params.CharmURLs) (params.StringsResults, error)
- func (u *UniterAPIV3) CharmModifiedVersion(args params.Entities) (params.IntResults, error)
- func (u *UniterAPIV3) CharmURL(args params.Entities) (params.StringBoolResults, error)
- func (u *UniterAPIV3) ClearResolved(args params.Entities) (params.ErrorResults, error)
- func (u *UniterAPIV3) ClosePorts(args params.EntitiesPortRanges) (params.ErrorResults, error)
- func (u *UniterAPIV3) ConfigSettings(args params.Entities) (params.ConfigSettingsResults, error)
- func (u *UniterAPIV3) CurrentModel() (params.ModelResult, error)
- func (u *UniterAPIV3) Destroy(args params.Entities) (params.ErrorResults, error)
- func (u *UniterAPIV3) DestroyAllSubordinates(args params.Entities) (params.ErrorResults, error)
- func (u *UniterAPIV3) EnterScope(args params.RelationUnits) (params.ErrorResults, error)
- func (u *UniterAPIV3) FinishActions(args params.ActionExecutionResults) (params.ErrorResults, error)
- func (u *UniterAPIV3) GetPrincipal(args params.Entities) (params.StringBoolResults, error)
- func (u *UniterAPIV3) HasSubordinates(args params.Entities) (params.BoolResults, error)
- func (u *UniterAPIV3) JoinedRelations(args params.Entities) (params.StringsResults, error)
- func (u *UniterAPIV3) LeaveScope(args params.RelationUnits) (params.ErrorResults, error)
- func (u *UniterAPIV3) NetworkConfig(args params.UnitsNetworkConfig) (params.UnitNetworkConfigResults, error)
- func (u *UniterAPIV3) OpenPorts(args params.EntitiesPortRanges) (params.ErrorResults, error)
- func (u *UniterAPIV3) PrivateAddress(args params.Entities) (params.StringResults, error)
- func (u *UniterAPIV3) ProviderType() (params.StringResult, error)
- func (u *UniterAPIV3) PublicAddress(args params.Entities) (params.StringResults, error)
- func (u *UniterAPIV3) ReadRemoteSettings(args params.RelationUnitPairs) (params.SettingsResults, error)
- func (u *UniterAPIV3) ReadSettings(args params.RelationUnits) (params.SettingsResults, error)
- func (u *UniterAPIV3) Relation(args params.RelationUnits) (params.RelationResults, error)
- func (u *UniterAPIV3) RelationById(args params.RelationIds) (params.RelationResults, error)
- func (u *UniterAPIV3) Resolved(args params.Entities) (params.ResolvedModeResults, error)
- func (u *UniterAPIV3) ServiceOwner(args params.Entities) (params.StringResults, error)
- func (u *UniterAPIV3) SetCharmURL(args params.EntitiesCharmURL) (params.ErrorResults, error)
- func (u *UniterAPIV3) UpdateSettings(args params.RelationUnitsSettings) (params.ErrorResults, error)
- func (u *UniterAPIV3) WatchActionNotifications(args params.Entities) (params.StringsWatchResults, error)
- func (u *UniterAPIV3) WatchConfigSettings(args params.Entities) (params.NotifyWatchResults, error)
- func (u *UniterAPIV3) WatchRelationUnits(args params.RelationUnits) (params.RelationUnitsWatchResults, error)
- func (u *UniterAPIV3) WatchServiceRelations(args params.Entities) (params.StringsWatchResults, error)
- func (u *UniterAPIV3) WatchUnitAddresses(args params.Entities) (params.NotifyWatchResults, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatusAPI ¶
type StatusAPI struct {
// contains filtered or unexported fields
}
StatusAPI is the uniter part that deals with setting/getting status from different entities, this particular separation from base is because we have a shim to support unit/agent split.
func NewStatusAPI ¶
func NewStatusAPI(st *state.State, getCanModify common.GetAuthFunc) *StatusAPI
NewStatusAPI creates a new server-side Status setter API facade.
func (*StatusAPI) ServiceStatus ¶
ServiceStatus returns the status of the Services and its workloads if the given unit is the leader.
func (*StatusAPI) SetAgentStatus ¶
SetAgentStatus will set status for agents of Units passed in args, if one of the args is not an Unit it will fail.
func (*StatusAPI) SetServiceStatus ¶
SetServiceStatus sets the status for all the Services in args if the given Unit is the leader.
func (*StatusAPI) SetStatus ¶
SetStatus will set status for a entities passed in args. If the entity is a Unit it will instead set status to its agent, to emulate backwards compatibility.
func (*StatusAPI) SetUnitStatus ¶
SetUnitStatus sets status for all elements passed in args, the difference with SetStatus is that if an entity is a Unit it will set its status instead of its agent.
func (*StatusAPI) UnitStatus ¶
UnitStatus returns the workload status information for the unit.
type StorageAPI ¶
type StorageAPI struct {
// contains filtered or unexported fields
}
StorageAPI provides access to the Storage API facade.
func (*StorageAPI) AddUnitStorage ¶
func (a *StorageAPI) AddUnitStorage( args params.StoragesAddParams, ) (params.ErrorResults, error)
AddUnitStorage validates and creates additional storage instances for units. Failures on an individual storage instance do not block remaining instances from being processed.
func (*StorageAPI) DestroyUnitStorageAttachments ¶
func (s *StorageAPI) DestroyUnitStorageAttachments(args params.Entities) (params.ErrorResults, error)
DestroyUnitStorageAttachments marks each storage attachment of the specified units as Dying.
func (*StorageAPI) RemoveStorageAttachments ¶
func (s *StorageAPI) RemoveStorageAttachments(args params.StorageAttachmentIds) (params.ErrorResults, error)
RemoveStorageAttachments removes the specified storage attachments from state.
func (*StorageAPI) StorageAttachmentLife ¶
func (s *StorageAPI) StorageAttachmentLife(args params.StorageAttachmentIds) (params.LifeResults, error)
StorageAttachmentLife returns the lifecycle state of the storage attachments with the specified tags.
func (*StorageAPI) StorageAttachments ¶
func (s *StorageAPI) StorageAttachments(args params.StorageAttachmentIds) (params.StorageAttachmentResults, error)
StorageAttachments returns the storage attachments with the specified tags.
func (*StorageAPI) UnitStorageAttachments ¶
func (s *StorageAPI) UnitStorageAttachments(args params.Entities) (params.StorageAttachmentIdsResults, error)
UnitStorageAttachments returns the IDs of storage attachments for a collection of units.
func (*StorageAPI) WatchStorageAttachments ¶
func (s *StorageAPI) WatchStorageAttachments(args params.StorageAttachmentIds) (params.NotifyWatchResults, error)
WatchStorageAttachments creates watchers for a collection of storage attachments, each of which can be used to watch changes to storage attachment info.
func (*StorageAPI) WatchUnitStorageAttachments ¶
func (s *StorageAPI) WatchUnitStorageAttachments(args params.Entities) (params.StringsWatchResults, error)
WatchUnitStorageAttachments creates watchers for a collection of units, each of which can be used to watch for lifecycle changes to the corresponding unit's storage attachments.
type UniterAPIV3 ¶
type UniterAPIV3 struct { *common.LifeGetter *StatusAPI *common.DeadEnsurer *common.AgentEntityWatcher *common.APIAddresser *common.ModelWatcher *common.RebootRequester *leadershipapiserver.LeadershipSettingsAccessor meterstatus.MeterStatus StorageAPI // contains filtered or unexported fields }
UniterAPIV3 implements the API version 3, used by the uniter worker.
func NewUniterAPIV3 ¶
func NewUniterAPIV3(st *state.State, resources *common.Resources, authorizer common.Authorizer) (*UniterAPIV3, error)
NewUniterAPIV3 creates a new instance of the Uniter API, version 3.
func (*UniterAPIV3) Actions ¶
func (u *UniterAPIV3) Actions(args params.Entities) (params.ActionResults, error)
Actions returns the Actions by Tags passed and ensures that the Unit asking for them is the same Unit that has the Actions.
func (*UniterAPIV3) AddMetricBatches ¶
func (u *UniterAPIV3) AddMetricBatches(args params.MetricBatchParams) (params.ErrorResults, error)
AddMetricBatches adds the metrics for the specified unit.
func (*UniterAPIV3) AllMachinePorts ¶
func (u *UniterAPIV3) AllMachinePorts(args params.Entities) (params.MachinePortsResults, error)
AllMachinePorts returns all opened port ranges for each given machine (on all networks).
func (*UniterAPIV3) AssignedMachine ¶
func (u *UniterAPIV3) AssignedMachine(args params.Entities) (params.StringResults, error)
AssignedMachine returns the machine tag for each given unit tag, or an error satisfying params.IsCodeNotAssigned when a unit has no assigned machine.
func (*UniterAPIV3) AvailabilityZone ¶
func (u *UniterAPIV3) AvailabilityZone(args params.Entities) (params.StringResults, error)
AvailabilityZone returns the availability zone for each given unit, if applicable.
func (*UniterAPIV3) BeginActions ¶
func (u *UniterAPIV3) BeginActions(args params.Entities) (params.ErrorResults, error)
BeginActions marks the actions represented by the passed in Tags as running.
func (*UniterAPIV3) CharmArchiveSha256 ¶
func (u *UniterAPIV3) CharmArchiveSha256(args params.CharmURLs) (params.StringResults, error)
CharmArchiveSha256 returns the SHA256 digest of the charm archive (bundle) data for each charm url in the given parameters.
func (*UniterAPIV3) CharmArchiveURLs ¶
func (u *UniterAPIV3) CharmArchiveURLs(args params.CharmURLs) (params.StringsResults, error)
CharmArchiveURLs returns the URLS for the charm archive (bundle) data for each charm url in the given parameters.
func (*UniterAPIV3) CharmModifiedVersion ¶
func (u *UniterAPIV3) CharmModifiedVersion(args params.Entities) (params.IntResults, error)
CharmModifiedVersion returns the most CharmModifiedVersion for all given units or services.
func (*UniterAPIV3) CharmURL ¶
func (u *UniterAPIV3) CharmURL(args params.Entities) (params.StringBoolResults, error)
CharmURL returns the charm URL for all given units or services.
func (*UniterAPIV3) ClearResolved ¶
func (u *UniterAPIV3) ClearResolved(args params.Entities) (params.ErrorResults, error)
ClearResolved removes any resolved setting from each given unit.
func (*UniterAPIV3) ClosePorts ¶
func (u *UniterAPIV3) ClosePorts(args params.EntitiesPortRanges) (params.ErrorResults, error)
ClosePorts sets the policy of the port range with protocol to be closed, for all given units.
func (*UniterAPIV3) ConfigSettings ¶
func (u *UniterAPIV3) ConfigSettings(args params.Entities) (params.ConfigSettingsResults, error)
ConfigSettings returns the complete set of service charm config settings available to each given unit.
func (*UniterAPIV3) CurrentModel ¶
func (u *UniterAPIV3) CurrentModel() (params.ModelResult, error)
CurrentModel returns the name and UUID for the current juju model.
func (*UniterAPIV3) Destroy ¶
func (u *UniterAPIV3) Destroy(args params.Entities) (params.ErrorResults, error)
Destroy advances all given Alive units' lifecycles as far as possible. See state/Unit.Destroy().
func (*UniterAPIV3) DestroyAllSubordinates ¶
func (u *UniterAPIV3) DestroyAllSubordinates(args params.Entities) (params.ErrorResults, error)
DestroyAllSubordinates destroys all subordinates of each given unit.
func (*UniterAPIV3) EnterScope ¶
func (u *UniterAPIV3) EnterScope(args params.RelationUnits) (params.ErrorResults, error)
EnterScope ensures each unit has entered its scope in the relation, for all of the given relation/unit pairs. See also state.RelationUnit.EnterScope().
func (*UniterAPIV3) FinishActions ¶
func (u *UniterAPIV3) FinishActions(args params.ActionExecutionResults) (params.ErrorResults, error)
FinishActions saves the result of a completed Action
func (*UniterAPIV3) GetPrincipal ¶
func (u *UniterAPIV3) GetPrincipal(args params.Entities) (params.StringBoolResults, error)
GetPrincipal returns the result of calling PrincipalName() and converting it to a tag, on each given unit.
func (*UniterAPIV3) HasSubordinates ¶
func (u *UniterAPIV3) HasSubordinates(args params.Entities) (params.BoolResults, error)
HasSubordinates returns the whether each given unit has any subordinates.
func (*UniterAPIV3) JoinedRelations ¶
func (u *UniterAPIV3) JoinedRelations(args params.Entities) (params.StringsResults, error)
JoinedRelations returns the tags of all relations for which each supplied unit has entered scope. It should be called RelationsInScope, but it's not convenient to make that change until we have versioned APIs.
func (*UniterAPIV3) LeaveScope ¶
func (u *UniterAPIV3) LeaveScope(args params.RelationUnits) (params.ErrorResults, error)
LeaveScope signals each unit has left its scope in the relation, for all of the given relation/unit pairs. See also state.RelationUnit.LeaveScope().
func (*UniterAPIV3) NetworkConfig ¶
func (u *UniterAPIV3) NetworkConfig(args params.UnitsNetworkConfig) (params.UnitNetworkConfigResults, error)
NetworkConfig returns information about all given relation/unit pairs, including their id, key and the local endpoint.
func (*UniterAPIV3) OpenPorts ¶
func (u *UniterAPIV3) OpenPorts(args params.EntitiesPortRanges) (params.ErrorResults, error)
OpenPorts sets the policy of the port range with protocol to be opened, for all given units.
func (*UniterAPIV3) PrivateAddress ¶
func (u *UniterAPIV3) PrivateAddress(args params.Entities) (params.StringResults, error)
PrivateAddress returns the private address for each given unit, if set.
func (*UniterAPIV3) ProviderType ¶
func (u *UniterAPIV3) ProviderType() (params.StringResult, error)
ProviderType returns the provider type used by the current juju model.
TODO(dimitern): Refactor the uniter to call this instead of calling ModelConfig() just to get the provider type. Once we have machine addresses, this might be completely unnecessary though.
func (*UniterAPIV3) PublicAddress ¶
func (u *UniterAPIV3) PublicAddress(args params.Entities) (params.StringResults, error)
PublicAddress returns the public address for each given unit, if set.
func (*UniterAPIV3) ReadRemoteSettings ¶
func (u *UniterAPIV3) ReadRemoteSettings(args params.RelationUnitPairs) (params.SettingsResults, error)
ReadRemoteSettings returns the remote settings of each given set of relation/local unit/remote unit.
func (*UniterAPIV3) ReadSettings ¶
func (u *UniterAPIV3) ReadSettings(args params.RelationUnits) (params.SettingsResults, error)
ReadSettings returns the local settings of each given set of relation/unit.
func (*UniterAPIV3) Relation ¶
func (u *UniterAPIV3) Relation(args params.RelationUnits) (params.RelationResults, error)
Relation returns information about all given relation/unit pairs, including their id, key and the local endpoint.
func (*UniterAPIV3) RelationById ¶
func (u *UniterAPIV3) RelationById(args params.RelationIds) (params.RelationResults, error)
RelationById returns information about all given relations, specified by their ids, including their key and the local endpoint.
func (*UniterAPIV3) Resolved ¶
func (u *UniterAPIV3) Resolved(args params.Entities) (params.ResolvedModeResults, error)
Resolved returns the current resolved setting for each given unit.
func (*UniterAPIV3) ServiceOwner ¶
func (u *UniterAPIV3) ServiceOwner(args params.Entities) (params.StringResults, error)
ServiceOwner returns the owner user for each given service tag.
func (*UniterAPIV3) SetCharmURL ¶
func (u *UniterAPIV3) SetCharmURL(args params.EntitiesCharmURL) (params.ErrorResults, error)
SetCharmURL sets the charm URL for each given unit. An error will be returned if a unit is dead, or the charm URL is not know.
func (*UniterAPIV3) UpdateSettings ¶
func (u *UniterAPIV3) UpdateSettings(args params.RelationUnitsSettings) (params.ErrorResults, error)
UpdateSettings persists all changes made to the local settings of all given pairs of relation and unit. Keys with empty values are considered a signal to delete these values.
func (*UniterAPIV3) WatchActionNotifications ¶
func (u *UniterAPIV3) WatchActionNotifications(args params.Entities) (params.StringsWatchResults, error)
WatchActionNotifications returns a StringsWatcher for observing incoming action calls to a unit. See also state/watcher.go Unit.WatchActionNotifications(). This method is called from api/uniter/uniter.go WatchActionNotifications().
func (*UniterAPIV3) WatchConfigSettings ¶
func (u *UniterAPIV3) WatchConfigSettings(args params.Entities) (params.NotifyWatchResults, error)
WatchConfigSettings returns a NotifyWatcher for observing changes to each unit's service configuration settings. See also state/watcher.go:Unit.WatchConfigSettings().
func (*UniterAPIV3) WatchRelationUnits ¶
func (u *UniterAPIV3) WatchRelationUnits(args params.RelationUnits) (params.RelationUnitsWatchResults, error)
WatchRelationUnits returns a RelationUnitsWatcher for observing changes to every unit in the supplied relation that is visible to the supplied unit. See also state/watcher.go:RelationUnit.Watch().
func (*UniterAPIV3) WatchServiceRelations ¶
func (u *UniterAPIV3) WatchServiceRelations(args params.Entities) (params.StringsWatchResults, error)
WatchServiceRelations returns a StringsWatcher, for each given service, that notifies of changes to the lifecycles of relations involving that service.
func (*UniterAPIV3) WatchUnitAddresses ¶
func (u *UniterAPIV3) WatchUnitAddresses(args params.Entities) (params.NotifyWatchResults, error)
WatchUnitAddresses returns a NotifyWatcher for observing changes to each unit's addresses.