uniter

package
v0.0.0-...-4bd6544 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2016 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

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) ApplicationStatus

func (s *StatusAPI) ApplicationStatus(args params.Entities) (params.ApplicationStatusResults, error)

ApplicationStatus returns the status of the Applications 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) SetApplicationStatus

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

SetApplicationStatus 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 UniterAPIV3

UniterAPIV3 implements the API version 3, used by the uniter worker.

func NewUniterAPIV4

func NewUniterAPIV4(st *state.State, resources facade.Resources, authorizer facade.Authorizer) (*UniterAPIV3, error)

NewUniterAPIV4 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) 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

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

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

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

NetworkConfig returns information about all given relation/unit pairs, including their id, key and the local endpoint.

func (*UniterAPIV3) OpenPorts

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

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

Resolved returns the current resolved setting for each given unit.

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) SetWorkloadVersion

func (u *UniterAPIV3) SetWorkloadVersion(args params.EntityWorkloadVersions) (params.ErrorResults, error)

SetWorkloadVersion sets the workload version for each given unit. An error will be returned if a unit is dead.

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) WatchApplicationRelations

func (u *UniterAPIV3) WatchApplicationRelations(args params.Entities) (params.StringsWatchResults, error)

WatchApplicationRelations returns a StringsWatcher, for each given service, that notifies of changes to the lifecycles of relations involving that service.

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) WatchUnitAddresses

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

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

func (*UniterAPIV3) WorkloadVersion

func (u *UniterAPIV3) WorkloadVersion(args params.Entities) (params.StringResults, error)

WorkloadVersion returns the workload version for all given units or services.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL