Documentation

Overview

The uniter package implements the API interface used by the uniter worker. This file contains code common to all API versions.

The uniter package implements the API interface used by the uniter worker. This file contains the API facade version 0.

The uniter package implements the API interface used by the uniter worker. This file contains the API facade version 1.

Index

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

func (s *StatusAPI) ServiceStatus(args params.Entities) (params.ServiceStatusResults, error)

ServiceStatus returns the status of the Services and its workloads if the given unit is the leader.

func (*StatusAPI) SetAgentStatus

func (s *StatusAPI) SetAgentStatus(args params.SetStatus) (params.ErrorResults, error)

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

func (s *StatusAPI) SetServiceStatus(args params.SetStatus) (params.ErrorResults, error)

SetServiceStatus sets the status for all the Services in args if the given Unit is the leader.

func (*StatusAPI) SetStatus

func (s *StatusAPI) SetStatus(args params.SetStatus) (params.ErrorResults, error)

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

func (s *StatusAPI) SetUnitStatus(args params.SetStatus) (params.ErrorResults, error)

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

func (s *StatusAPI) UnitStatus(args params.Entities) (params.StatusResults, error)

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

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 UniterAPIV0

type UniterAPIV0 struct {
	// contains filtered or unexported fields
}

UniterAPIV0 implements the API facade version 0, used by the uniter worker.

func NewUniterAPIV0

func NewUniterAPIV0(st *state.State, resources *common.Resources, authorizer common.Authorizer) (*UniterAPIV0, error)

NewUniterAPIV0 creates a new instance of the Uniter API, version 0.

func (*UniterAPIV0) Actions

func (u *UniterAPIV0) Actions(args params.Entities) (params.ActionsQueryResults, 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 (*UniterAPIV0) AvailabilityZone

func (u *UniterAPIV0) AvailabilityZone(args params.Entities) (params.StringResults, error)

AvailabilityZone returns the availability zone for each given unit, if applicable.

func (*UniterAPIV0) BeginActions

func (u *UniterAPIV0) BeginActions(args params.Entities) (params.ErrorResults, error)

BeginActions marks the actions represented by the passed in Tags as running.

func (*UniterAPIV0) CharmArchiveSha256

func (u *UniterAPIV0) 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 (*UniterAPIV0) CharmArchiveURLs

func (u *UniterAPIV0) 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 (*UniterAPIV0) CharmURL

func (u *UniterAPIV0) CharmURL(args params.Entities) (params.StringBoolResults, error)

CharmURL returns the charm URL for all given units or services.

func (*UniterAPIV0) ClearResolved

func (u *UniterAPIV0) ClearResolved(args params.Entities) (params.ErrorResults, error)

ClearResolved removes any resolved setting from each given unit.

func (*UniterAPIV0) ClosePort

func (u *UniterAPIV0) ClosePort(args params.EntitiesPorts) (params.ErrorResults, error)

ClosePort sets the policy of the port with protocol and number to be closed, for all given units.

TODO(dimitern): This is deprecated and is kept for backwards-compatibility. Use ClosePorts instead.

func (*UniterAPIV0) ClosePorts

func (u *UniterAPIV0) 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 (*UniterAPIV0) ConfigSettings

func (u *UniterAPIV0) ConfigSettings(args params.Entities) (params.ConfigSettingsResults, error)

ConfigSettings returns the complete set of service charm config settings available to each given unit.

func (*UniterAPIV0) CurrentEnvironUUID

func (u *UniterAPIV0) CurrentEnvironUUID() (params.StringResult, error)

CurrentEnvironUUID returns the UUID for the current juju environment.

func (*UniterAPIV0) CurrentEnvironment

func (u *UniterAPIV0) CurrentEnvironment() (params.EnvironmentResult, error)

CurrentEnvironment returns the name and UUID for the current juju environment.

func (*UniterAPIV0) Destroy

func (u *UniterAPIV0) Destroy(args params.Entities) (params.ErrorResults, error)

Destroy advances all given Alive units' lifecycles as far as possible. See state/Unit.Destroy().

func (*UniterAPIV0) DestroyAllSubordinates

func (u *UniterAPIV0) DestroyAllSubordinates(args params.Entities) (params.ErrorResults, error)

DestroyAllSubordinates destroys all subordinates of each given unit.

func (*UniterAPIV0) EnterScope

func (u *UniterAPIV0) 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 (*UniterAPIV0) FinishActions

func (u *UniterAPIV0) FinishActions(args params.ActionExecutionResults) (params.ErrorResults, error)

FinishActions saves the result of a completed Action

func (*UniterAPIV0) GetOwnerTag

func (u *UniterAPIV0) GetOwnerTag(args params.Entities) (params.StringResult, error)

GetOwnerTag returns the user tag of the owner of the first given service tag in args.

NOTE: This is obsolete and is replaced by ServiceOwner in APIV1, which should be used instead. This method is not propely handling multiple tags and does not check for permissions. See also http://pad.lv/1270795.

func (*UniterAPIV0) GetPrincipal

func (u *UniterAPIV0) 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 (*UniterAPIV0) HasSubordinates

func (u *UniterAPIV0) HasSubordinates(args params.Entities) (params.BoolResults, error)

HasSubordinates returns the whether each given unit has any subordinates.

func (*UniterAPIV0) JoinedRelations

func (u *UniterAPIV0) 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 (*UniterAPIV0) LeaveScope

func (u *UniterAPIV0) 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 (*UniterAPIV0) OpenPort

func (u *UniterAPIV0) OpenPort(args params.EntitiesPorts) (params.ErrorResults, error)

OpenPort sets the policy of the port with protocol an number to be opened, for all given units.

TODO(dimitern): This is deprecated and is kept for backwards-compatibility. Use OpenPorts instead.

func (*UniterAPIV0) OpenPorts

func (u *UniterAPIV0) 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 (*UniterAPIV0) PrivateAddress

func (u *UniterAPIV0) PrivateAddress(args params.Entities) (params.StringResults, error)

PrivateAddress returns the private address for each given unit, if set.

func (*UniterAPIV0) ProviderType

func (u *UniterAPIV0) ProviderType() (params.StringResult, error)

ProviderType returns the provider type used by the current juju environment.

TODO(dimitern): Refactor the uniter to call this instead of calling EnvironConfig() just to get the provider type. Once we have machine addresses, this might be completely unnecessary though.

func (*UniterAPIV0) PublicAddress

func (u *UniterAPIV0) PublicAddress(args params.Entities) (params.StringResults, error)

PublicAddress returns the public address for each given unit, if set.

func (*UniterAPIV0) ReadRemoteSettings

func (u *UniterAPIV0) ReadRemoteSettings(args params.RelationUnitPairs) (params.SettingsResults, error)

ReadRemoteSettings returns the remote settings of each given set of relation/local unit/remote unit.

func (*UniterAPIV0) ReadSettings

func (u *UniterAPIV0) ReadSettings(args params.RelationUnits) (params.SettingsResults, error)

ReadSettings returns the local settings of each given set of relation/unit.

func (*UniterAPIV0) Relation

func (u *UniterAPIV0) 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 (*UniterAPIV0) RelationById

func (u *UniterAPIV0) 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 (*UniterAPIV0) Resolved

func (u *UniterAPIV0) Resolved(args params.Entities) (params.ResolvedModeResults, error)

Resolved returns the current resolved setting for each given unit.

func (*UniterAPIV0) SetCharmURL

func (u *UniterAPIV0) 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 (*UniterAPIV0) UpdateSettings

func (u *UniterAPIV0) 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 (*UniterAPIV0) WatchActionNotifications

func (u *UniterAPIV0) 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 (*UniterAPIV0) WatchConfigSettings

func (u *UniterAPIV0) 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 (*UniterAPIV0) WatchRelationUnits

func (u *UniterAPIV0) 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 (*UniterAPIV0) WatchServiceRelations

func (u *UniterAPIV0) 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 (*UniterAPIV0) WatchUnitAddresses

func (u *UniterAPIV0) WatchUnitAddresses(args params.Entities) (params.NotifyWatchResults, error)

WatchAddresses returns a NotifyWatcher for observing changes to each unit's addresses.

type UniterAPIV1

type UniterAPIV1 struct {
	// contains filtered or unexported fields
}

UniterAPI implements the API version 1, used by the uniter worker.

func NewUniterAPIV1

func NewUniterAPIV1(st *state.State, resources *common.Resources, authorizer common.Authorizer) (*UniterAPIV1, error)

NewUniterAPIV1 creates a new instance of the Uniter API, version 1.

func (*UniterAPIV1) Actions

func (u *UniterAPIV1) Actions(args params.Entities) (params.ActionsQueryResults, 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 (*UniterAPIV1) AllMachinePorts

func (u *UniterAPIV1) AllMachinePorts(args params.Entities) (params.MachinePortsResults, error)

AllMachinePorts returns all opened port ranges for each given machine (on all networks).

func (*UniterAPIV1) AssignedMachine

func (u *UniterAPIV1) 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 (*UniterAPIV1) AvailabilityZone

func (u *UniterAPIV1) AvailabilityZone(args params.Entities) (params.StringResults, error)

AvailabilityZone returns the availability zone for each given unit, if applicable.

func (*UniterAPIV1) BeginActions

func (u *UniterAPIV1) BeginActions(args params.Entities) (params.ErrorResults, error)

BeginActions marks the actions represented by the passed in Tags as running.

func (*UniterAPIV1) CharmArchiveSha256

func (u *UniterAPIV1) 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 (*UniterAPIV1) CharmArchiveURLs

func (u *UniterAPIV1) 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 (*UniterAPIV1) CharmURL

func (u *UniterAPIV1) CharmURL(args params.Entities) (params.StringBoolResults, error)

CharmURL returns the charm URL for all given units or services.

func (*UniterAPIV1) ClearResolved

func (u *UniterAPIV1) ClearResolved(args params.Entities) (params.ErrorResults, error)

ClearResolved removes any resolved setting from each given unit.

func (*UniterAPIV1) ClosePort

func (u *UniterAPIV1) ClosePort(args params.EntitiesPorts) (params.ErrorResults, error)

ClosePort sets the policy of the port with protocol and number to be closed, for all given units.

TODO(dimitern): This is deprecated and is kept for backwards-compatibility. Use ClosePorts instead.

func (*UniterAPIV1) ClosePorts

func (u *UniterAPIV1) 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 (*UniterAPIV1) ConfigSettings

func (u *UniterAPIV1) ConfigSettings(args params.Entities) (params.ConfigSettingsResults, error)

ConfigSettings returns the complete set of service charm config settings available to each given unit.

func (*UniterAPIV1) CurrentEnvironUUID

func (u *UniterAPIV1) CurrentEnvironUUID() (params.StringResult, error)

CurrentEnvironUUID returns the UUID for the current juju environment.

func (*UniterAPIV1) CurrentEnvironment

func (u *UniterAPIV1) CurrentEnvironment() (params.EnvironmentResult, error)

CurrentEnvironment returns the name and UUID for the current juju environment.

func (*UniterAPIV1) Destroy

func (u *UniterAPIV1) Destroy(args params.Entities) (params.ErrorResults, error)

Destroy advances all given Alive units' lifecycles as far as possible. See state/Unit.Destroy().

func (*UniterAPIV1) DestroyAllSubordinates

func (u *UniterAPIV1) DestroyAllSubordinates(args params.Entities) (params.ErrorResults, error)

DestroyAllSubordinates destroys all subordinates of each given unit.

func (*UniterAPIV1) EnterScope

func (u *UniterAPIV1) 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 (*UniterAPIV1) FinishActions

func (u *UniterAPIV1) FinishActions(args params.ActionExecutionResults) (params.ErrorResults, error)

FinishActions saves the result of a completed Action

func (*UniterAPIV1) GetPrincipal

func (u *UniterAPIV1) 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 (*UniterAPIV1) HasSubordinates

func (u *UniterAPIV1) HasSubordinates(args params.Entities) (params.BoolResults, error)

HasSubordinates returns the whether each given unit has any subordinates.

func (*UniterAPIV1) JoinedRelations

func (u *UniterAPIV1) 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 (*UniterAPIV1) LeaveScope

func (u *UniterAPIV1) 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 (*UniterAPIV1) OpenPort

func (u *UniterAPIV1) OpenPort(args params.EntitiesPorts) (params.ErrorResults, error)

OpenPort sets the policy of the port with protocol an number to be opened, for all given units.

TODO(dimitern): This is deprecated and is kept for backwards-compatibility. Use OpenPorts instead.

func (*UniterAPIV1) OpenPorts

func (u *UniterAPIV1) 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 (*UniterAPIV1) PrivateAddress

func (u *UniterAPIV1) PrivateAddress(args params.Entities) (params.StringResults, error)

PrivateAddress returns the private address for each given unit, if set.

func (*UniterAPIV1) ProviderType

func (u *UniterAPIV1) ProviderType() (params.StringResult, error)

ProviderType returns the provider type used by the current juju environment.

TODO(dimitern): Refactor the uniter to call this instead of calling EnvironConfig() just to get the provider type. Once we have machine addresses, this might be completely unnecessary though.

func (*UniterAPIV1) PublicAddress

func (u *UniterAPIV1) PublicAddress(args params.Entities) (params.StringResults, error)

PublicAddress returns the public address for each given unit, if set.

func (*UniterAPIV1) ReadRemoteSettings

func (u *UniterAPIV1) ReadRemoteSettings(args params.RelationUnitPairs) (params.SettingsResults, error)

ReadRemoteSettings returns the remote settings of each given set of relation/local unit/remote unit.

func (*UniterAPIV1) ReadSettings

func (u *UniterAPIV1) ReadSettings(args params.RelationUnits) (params.SettingsResults, error)

ReadSettings returns the local settings of each given set of relation/unit.

func (*UniterAPIV1) Relation

func (u *UniterAPIV1) 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 (*UniterAPIV1) RelationById

func (u *UniterAPIV1) 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 (*UniterAPIV1) Resolved

func (u *UniterAPIV1) Resolved(args params.Entities) (params.ResolvedModeResults, error)

Resolved returns the current resolved setting for each given unit.

func (*UniterAPIV1) ServiceOwner

func (u *UniterAPIV1) ServiceOwner(args params.Entities) (params.StringResults, error)

ServiceOwner returns the owner user for each given service tag.

func (*UniterAPIV1) SetCharmURL

func (u *UniterAPIV1) 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 (*UniterAPIV1) UpdateSettings

func (u *UniterAPIV1) 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 (*UniterAPIV1) WatchActionNotifications

func (u *UniterAPIV1) 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 (*UniterAPIV1) WatchConfigSettings

func (u *UniterAPIV1) 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 (*UniterAPIV1) WatchRelationUnits

func (u *UniterAPIV1) 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 (*UniterAPIV1) WatchServiceRelations

func (u *UniterAPIV1) 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 (*UniterAPIV1) WatchUnitAddresses

func (u *UniterAPIV1) WatchUnitAddresses(args params.Entities) (params.NotifyWatchResults, error)

WatchAddresses returns a NotifyWatcher for observing changes to each unit's addresses.

type UniterAPIV2

type UniterAPIV2 struct {
	UniterAPIV1
	StorageAPI
}

UniterAPI implements the API version 2, used by the uniter worker.

func NewUniterAPIV2

func NewUniterAPIV2(st *state.State, resources *common.Resources, authorizer common.Authorizer) (*UniterAPIV2, error)

NewUniterAPIV2 creates a new instance of the Uniter API, version 2.

func (*UniterAPIV2) Actions

func (u *UniterAPIV2) Actions(args params.Entities) (params.ActionsQueryResults, 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 (*UniterAPIV2) AddMetricBatches

func (u *UniterAPIV2) AddMetricBatches(args params.MetricBatchParams) (params.ErrorResults, error)

AddMetricBatches adds the metrics for the specified unit.

func (*UniterAPIV2) AvailabilityZone

func (u *UniterAPIV2) AvailabilityZone(args params.Entities) (params.StringResults, error)

AvailabilityZone returns the availability zone for each given unit, if applicable.

func (*UniterAPIV2) BeginActions

func (u *UniterAPIV2) BeginActions(args params.Entities) (params.ErrorResults, error)

BeginActions marks the actions represented by the passed in Tags as running.

func (*UniterAPIV2) CharmArchiveSha256

func (u *UniterAPIV2) 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 (*UniterAPIV2) CharmArchiveURLs

func (u *UniterAPIV2) 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 (*UniterAPIV2) CharmURL

func (u *UniterAPIV2) CharmURL(args params.Entities) (params.StringBoolResults, error)

CharmURL returns the charm URL for all given units or services.

func (*UniterAPIV2) ClearResolved

func (u *UniterAPIV2) ClearResolved(args params.Entities) (params.ErrorResults, error)

ClearResolved removes any resolved setting from each given unit.

func (*UniterAPIV2) ClosePort

func (u *UniterAPIV2) ClosePort(args params.EntitiesPorts) (params.ErrorResults, error)

ClosePort sets the policy of the port with protocol and number to be closed, for all given units.

TODO(dimitern): This is deprecated and is kept for backwards-compatibility. Use ClosePorts instead.

func (*UniterAPIV2) ClosePorts

func (u *UniterAPIV2) 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 (*UniterAPIV2) ConfigSettings

func (u *UniterAPIV2) ConfigSettings(args params.Entities) (params.ConfigSettingsResults, error)

ConfigSettings returns the complete set of service charm config settings available to each given unit.

func (*UniterAPIV2) CurrentEnvironUUID

func (u *UniterAPIV2) CurrentEnvironUUID() (params.StringResult, error)

CurrentEnvironUUID returns the UUID for the current juju environment.

func (*UniterAPIV2) CurrentEnvironment

func (u *UniterAPIV2) CurrentEnvironment() (params.EnvironmentResult, error)

CurrentEnvironment returns the name and UUID for the current juju environment.

func (*UniterAPIV2) Destroy

func (u *UniterAPIV2) Destroy(args params.Entities) (params.ErrorResults, error)

Destroy advances all given Alive units' lifecycles as far as possible. See state/Unit.Destroy().

func (*UniterAPIV2) DestroyAllSubordinates

func (u *UniterAPIV2) DestroyAllSubordinates(args params.Entities) (params.ErrorResults, error)

DestroyAllSubordinates destroys all subordinates of each given unit.

func (*UniterAPIV2) EnterScope

func (u *UniterAPIV2) 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 (*UniterAPIV2) FinishActions

func (u *UniterAPIV2) FinishActions(args params.ActionExecutionResults) (params.ErrorResults, error)

FinishActions saves the result of a completed Action

func (*UniterAPIV2) GetPrincipal

func (u *UniterAPIV2) 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 (*UniterAPIV2) HasSubordinates

func (u *UniterAPIV2) HasSubordinates(args params.Entities) (params.BoolResults, error)

HasSubordinates returns the whether each given unit has any subordinates.

func (*UniterAPIV2) JoinedRelations

func (u *UniterAPIV2) 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 (*UniterAPIV2) LeaveScope

func (u *UniterAPIV2) 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 (*UniterAPIV2) OpenPort

func (u *UniterAPIV2) OpenPort(args params.EntitiesPorts) (params.ErrorResults, error)

OpenPort sets the policy of the port with protocol an number to be opened, for all given units.

TODO(dimitern): This is deprecated and is kept for backwards-compatibility. Use OpenPorts instead.

func (*UniterAPIV2) OpenPorts

func (u *UniterAPIV2) 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 (*UniterAPIV2) PrivateAddress

func (u *UniterAPIV2) PrivateAddress(args params.Entities) (params.StringResults, error)

PrivateAddress returns the private address for each given unit, if set.

func (*UniterAPIV2) ProviderType

func (u *UniterAPIV2) ProviderType() (params.StringResult, error)

ProviderType returns the provider type used by the current juju environment.

TODO(dimitern): Refactor the uniter to call this instead of calling EnvironConfig() just to get the provider type. Once we have machine addresses, this might be completely unnecessary though.

func (*UniterAPIV2) PublicAddress

func (u *UniterAPIV2) PublicAddress(args params.Entities) (params.StringResults, error)

PublicAddress returns the public address for each given unit, if set.

func (*UniterAPIV2) ReadRemoteSettings

func (u *UniterAPIV2) ReadRemoteSettings(args params.RelationUnitPairs) (params.SettingsResults, error)

ReadRemoteSettings returns the remote settings of each given set of relation/local unit/remote unit.

func (*UniterAPIV2) ReadSettings

func (u *UniterAPIV2) ReadSettings(args params.RelationUnits) (params.SettingsResults, error)

ReadSettings returns the local settings of each given set of relation/unit.

func (*UniterAPIV2) Relation

func (u *UniterAPIV2) 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 (*UniterAPIV2) RelationById

func (u *UniterAPIV2) 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 (*UniterAPIV2) Resolved

func (u *UniterAPIV2) Resolved(args params.Entities) (params.ResolvedModeResults, error)

Resolved returns the current resolved setting for each given unit.

func (*UniterAPIV2) SetCharmURL

func (u *UniterAPIV2) 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 (*UniterAPIV2) UpdateSettings

func (u *UniterAPIV2) 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 (*UniterAPIV2) WatchActionNotifications

func (u *UniterAPIV2) 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 (*UniterAPIV2) WatchConfigSettings

func (u *UniterAPIV2) 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 (*UniterAPIV2) WatchRelationUnits

func (u *UniterAPIV2) 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 (*UniterAPIV2) WatchServiceRelations

func (u *UniterAPIV2) 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 (*UniterAPIV2) WatchUnitAddresses

func (u *UniterAPIV2) WatchUnitAddresses(args params.Entities) (params.NotifyWatchResults, error)

WatchAddresses returns a NotifyWatcher for observing changes to each unit's addresses.