juju: github.com/juju/juju/apiserver/facades/agent/uniter Index | Files | Directories

package uniter

import "github.com/juju/juju/apiserver/facades/agent/uniter"

Package uniter implements the API interface used by the uniter worker.

Index

Package Files

access.go lxdprofile.go networkinfo.go newlxdprofile.go state.go status.go storage.go subordinaterelationwatcher.go uniter.go

type CachedApplication Uses

type CachedApplication interface {
    Status() status.StatusInfo
}

CachedApplication represents the methods that the StatusAPI needs on an application from the model cache.

type CachedModel Uses

type CachedModel interface {
    Application(string) (CachedApplication, error)
}

CachedModel represents the methods that the StatusAPI needs on a model from the model cache.

type LXDProfileAPI Uses

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

func NewExternalLXDProfileAPI Uses

func NewExternalLXDProfileAPI(
    st *state.State,
    resources facade.Resources,
    authorizer facade.Authorizer,
    accessUnit common.GetAuthFunc,
    logger loggo.Logger,
) *LXDProfileAPI

NewExternalLXDProfileAPI can be used for API registration.

func NewLXDProfileAPI Uses

func NewLXDProfileAPI(
    backend LXDProfileBackend,
    resources facade.Resources,
    authorizer facade.Authorizer,
    accessUnit common.GetAuthFunc,
    logger loggo.Logger,
) *LXDProfileAPI

NewLXDProfileAPI returns a new LXDProfileAPI. Currently both GetAuthFuncs can used to determine current permissions.

func (*LXDProfileAPI) RemoveUpgradeCharmProfileData Uses

func (u *LXDProfileAPI) RemoveUpgradeCharmProfileData(args params.Entities) (params.ErrorResults, error)

RemoveUpgradeCharmProfileData is intended to clean up the LXDProfile status to ensure that we start from a clean slate.

func (*LXDProfileAPI) WatchLXDProfileUpgradeNotifications Uses

func (u *LXDProfileAPI) WatchLXDProfileUpgradeNotifications(args params.LXDProfileUpgrade) (params.StringsWatchResults, error)

WatchLXDProfileUpgradeNotifications returns a StringsWatcher for observing changes to the lxd profile changes.

NOTE: can be removed in juju version 3.

func (*LXDProfileAPI) WatchUnitLXDProfileUpgradeNotifications Uses

func (u *LXDProfileAPI) WatchUnitLXDProfileUpgradeNotifications(args params.Entities) (params.StringsWatchResults, error)

WatchUnitLXDProfileUpgradeNotifications returns a StringsWatcher for observing changes to the lxd profile changes for one unit.

type LXDProfileAPIv2 Uses

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

func NewExternalLXDProfileAPIv2 Uses

func NewExternalLXDProfileAPIv2(
    st *state.State,
    resources facade.Resources,
    authorizer facade.Authorizer,
    accessUnit common.GetAuthFunc,
    logger loggo.Logger,
) *LXDProfileAPIv2

ExternalLXDProfileAPIv2 can be used for API registration.

func NewLXDProfileAPIv2 Uses

func NewLXDProfileAPIv2(
    backend LXDProfileBackendV2,
    resources facade.Resources,
    authorizer facade.Authorizer,
    accessUnit common.GetAuthFunc,
    logger loggo.Logger,
) *LXDProfileAPIv2

LXDProfileAPIv2 returns a new LXDProfileAPIv2. Currently both GetAuthFuncs can used to determine current permissions.

func (*LXDProfileAPIv2) CanApplyLXDProfile Uses

func (u *LXDProfileAPIv2) CanApplyLXDProfile(args params.Entities) (params.BoolResults, error)

CanApplyLXDProfile returns true if

- this is an IAAS model,
- the unit is not on a manual machine,
- the provider type is "lxd" or it's an lxd container.

func (*LXDProfileAPIv2) LXDProfileName Uses

func (u *LXDProfileAPIv2) LXDProfileName(args params.Entities) (params.StringResults, error)

LXDProfileName returns the name of the lxd profile applied to the unit's machine for the current charm version.

func (*LXDProfileAPIv2) LXDProfileRequired Uses

func (u *LXDProfileAPIv2) LXDProfileRequired(args params.CharmURLs) (params.BoolResults, error)

LXDProfileRequired returns true if charm has an lxd profile in it.

func (*LXDProfileAPIv2) WatchInstanceData Uses

func (u *LXDProfileAPIv2) WatchInstanceData(args params.Entities) (params.NotifyWatchResults, error)

WatchInstanceData returns a NotifyWatcher for observing changes to the lxd profile for one unit.

type LXDProfileBackend Uses

type LXDProfileBackend interface {
    Machine(string) (LXDProfileMachine, error)
    Unit(string) (LXDProfileUnit, error)
}

type LXDProfileBackendV2 Uses

type LXDProfileBackendV2 interface {
    Charm(*charm.URL) (LXDProfileCharmV2, error)
    Machine(string) (LXDProfileMachineV2, error)
    Unit(string) (LXDProfileUnitV2, error)
    Model() (LXDProfileModelV2, error)
}

type LXDProfileCharmV2 Uses

type LXDProfileCharmV2 interface {
    LXDProfile() lxdprofile.Profile
}

LXDProfileCharmV2 describes charm-receiver state methods for executing a lxd profile upgrade.

type LXDProfileMachine Uses

type LXDProfileMachine interface {
    WatchLXDProfileUpgradeNotifications(string) (state.StringsWatcher, error)
}

LXDProfileMachine describes machine-receiver state methods for executing a lxd profile upgrade.

type LXDProfileMachineV2 Uses

type LXDProfileMachineV2 interface {
    CharmProfiles() ([]string, error)
    ContainerType() instance.ContainerType
    IsManual() (bool, error)
    WatchInstanceData() state.NotifyWatcher
}

LXDProfileMachineV2 describes machine-receiver state methods for executing a lxd profile upgrade.

type LXDProfileModelV2 Uses

type LXDProfileModelV2 interface {
    ModelConfig() (*config.Config, error)
    Type() state.ModelType
}

type LXDProfileState Uses

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

LXDProfileState implements the LXDProfileBackend indirection over state.State.

func (LXDProfileState) Machine Uses

func (s LXDProfileState) Machine(id string) (LXDProfileMachine, error)

func (LXDProfileState) Unit Uses

func (s LXDProfileState) Unit(id string) (LXDProfileUnit, error)

type LXDProfileStateV2 Uses

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

LXDProfileStateV2 implements the LXDProfileBackendV2 indirection over state.State.

func (LXDProfileStateV2) Charm Uses

func (s LXDProfileStateV2) Charm(curl *charm.URL) (LXDProfileCharmV2, error)

func (LXDProfileStateV2) Machine Uses

func (s LXDProfileStateV2) Machine(id string) (LXDProfileMachineV2, error)

func (LXDProfileStateV2) Model Uses

func (s LXDProfileStateV2) Model() (LXDProfileModelV2, error)

func (LXDProfileStateV2) Unit Uses

func (s LXDProfileStateV2) Unit(id string) (LXDProfileUnitV2, error)

type LXDProfileUnit Uses

type LXDProfileUnit interface {
    AssignedMachineId() (string, error)
    Name() string
    Tag() names.Tag
    WatchLXDProfileUpgradeNotifications() (state.StringsWatcher, error)
}

LXDProfileUnit describes unit-receiver state methods for executing a lxd profile upgrade.

type LXDProfileUnitV2 Uses

type LXDProfileUnitV2 interface {
    ApplicationName() string
    AssignedMachineId() (string, error)
    CharmURL() (*charm.URL, bool)
    Name() string
    Tag() names.Tag
}

LXDProfileUnitV2 describes unit-receiver state methods for executing a lxd profile upgrade.

type NetworkInfo Uses

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

NetworkInfo is responsible for processing requests for network data for unit endpoint bindings and/or relations.

func NewNetworkInfo Uses

func NewNetworkInfo(st *state.State, tag names.UnitTag, retryFactory func() retry.CallArgs) (*NetworkInfo, error)

NewNetworkInfo initialises and returns a new NetworkInfo based on the input state and unit tag.

func (*NetworkInfo) NetworksForRelation Uses

func (n *NetworkInfo) NetworksForRelation(
    binding string, rel *state.Relation, pollPublic bool,
) (boundSpace string, ingress corenetwork.SpaceAddresses, egress []string, _ error)

NetworksForRelation returns the ingress and egress addresses for a relation and unit. The ingress addresses depend on if the relation is cross-model and whether the relation endpoint is bound to a space.

func (*NetworkInfo) ProcessAPIRequest Uses

func (n *NetworkInfo) ProcessAPIRequest(args params.NetworkInfoParams) (params.NetworkInfoResults, error)

ProcessAPIRequest handles a request to the uniter API NetworkInfo method. TODO (manadart 2019-10-09): This method verges on impossible to reason about and should be rewritten.

type StatusAPI Uses

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 Uses

func NewStatusAPI(st *state.State, model CachedModel, getCanModify common.GetAuthFunc, leadershipChecker leadership.Checker) *StatusAPI

NewStatusAPI creates a new server-side Status setter API facade.

func (*StatusAPI) ApplicationStatus Uses

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 Uses

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 Uses

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

SetApplicationStatus sets the status for all the Applications in args if the given Unit is the leader.

func (*StatusAPI) SetStatus Uses

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 Uses

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 Uses

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

UnitStatus returns the workload status information for the unit.

type StorageAPI Uses

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

StorageAPI provides access to the Storage API facade.

func (*StorageAPI) AddUnitStorage Uses

func (s *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 Uses

func (s *StorageAPI) DestroyUnitStorageAttachments(args params.Entities) (params.ErrorResults, error)

DestroyUnitStorageAttachments marks each storage attachment of the specified units as Dying.

func (*StorageAPI) RemoveStorageAttachments Uses

func (s *StorageAPI) RemoveStorageAttachments(args params.StorageAttachmentIds) (params.ErrorResults, error)

RemoveStorageAttachments removes the specified storage attachments from state.

func (*StorageAPI) StorageAttachmentLife Uses

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 Uses

func (s *StorageAPI) StorageAttachments(args params.StorageAttachmentIds) (params.StorageAttachmentResults, error)

StorageAttachments returns the storage attachments with the specified tags.

func (*StorageAPI) UnitStorageAttachments Uses

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 Uses

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 Uses

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 Unit Uses

type Unit interface {
    AssignedMachineId() (string, error)
    ShouldBeAssigned() bool
    StorageConstraints() (map[string]state.StorageConstraints, error)
}

type UniterAPI Uses

type UniterAPI struct {
    *common.LifeGetter
    *StatusAPI
    *common.DeadEnsurer
    *common.AgentEntityWatcher
    *common.APIAddresser
    *common.ModelWatcher
    *common.RebootRequester
    *common.UpgradeSeriesAPI
    *common.UnitStateAPI
    *leadershipapiserver.LeadershipSettingsAccessor
    meterstatus.MeterStatus

    *StorageAPI
    // contains filtered or unexported fields
}

UniterAPI implements the latest version (v17) of the Uniter API, which augments the payload of the CommitHookChanges API call and introduces the OpenedMachinePortRanges call as a replacement for AllMachinePorts.

func NewUniterAPI Uses

func NewUniterAPI(context facade.Context) (*UniterAPI, error)

NewUniterAPI creates a new instance of the core Uniter API.

func (*UniterAPI) ActionStatus Uses

func (u *UniterAPI) ActionStatus(args params.Entities) (params.StringResults, error)

ActionStatus returns the status of Actions by Tags passed in.

func (*UniterAPI) Actions Uses

func (u *UniterAPI) 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 (*UniterAPI) AddMetricBatches Uses

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

AddMetricBatches adds the metrics for the specified unit.

func (*UniterAPI) AllMachinePorts Uses

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

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

DEPRECATED: clients should switch to the OpenedMachinePortRanges API call when using the V17+ API.

TODO(achilleasa): remove from V17 once all client references to this API have been changed to use the new API.

func (*UniterAPI) AssignedMachine Uses

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

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

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

func (*UniterAPI) BeginActions Uses

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

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

func (*UniterAPI) CanApplyLXDProfile Uses

func (u *UniterAPI) CanApplyLXDProfile(args params.Entities) (params.BoolResults, error)

CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method.

func (*UniterAPI) CharmArchiveSha256 Uses

func (u *UniterAPI) 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 (*UniterAPI) CharmModifiedVersion Uses

func (u *UniterAPI) CharmModifiedVersion(args params.Entities) (params.IntResults, error)

CharmModifiedVersion returns the most CharmModifiedVersion for all given units or applications.

func (*UniterAPI) CharmURL Uses

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

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

func (*UniterAPI) ClearResolved Uses

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

ClearResolved removes any resolved setting from each given unit.

func (*UniterAPI) ClosePorts Uses

func (u *UniterAPI) 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 (*UniterAPI) CloudAPIVersion Uses

func (u *UniterAPI) CloudAPIVersion() (params.StringResult, error)

CloudAPIVersion returns the cloud API version, if available.

func (*UniterAPI) CloudSpec Uses

func (u *UniterAPI) CloudSpec() (params.CloudSpecResult, error)

CloudSpec returns the cloud spec used by the model in which the authenticated unit or application resides. A check is made beforehand to ensure that the request is made by an entity that has been granted the appropriate trust.

func (*UniterAPI) CommitHookChanges Uses

func (u *UniterAPI) CommitHookChanges(args params.CommitHookChangesArgs) (params.ErrorResults, error)

CommitHookChanges batches together all required API calls for applying a set of changes after a hook successfully completes and executes them in a single transaction.

func (*UniterAPI) ConfigSettings Uses

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

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

func (*UniterAPI) CurrentModel Uses

func (u *UniterAPI) CurrentModel() (params.ModelResult, error)

CurrentModel returns the name and UUID for the current juju model.

func (*UniterAPI) Destroy Uses

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

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

func (*UniterAPI) DestroyAllSubordinates Uses

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

DestroyAllSubordinates destroys all subordinates of each given unit.

func (*UniterAPI) EnterScope Uses

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

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

FinishActions saves the result of a completed Action

func (*UniterAPI) GetPodSpec Uses

func (u *UniterAPI) GetPodSpec(args params.Entities) (params.StringResults, error)

GetPodSpec gets the pod specs for a set of applications.

func (*UniterAPI) GetPrincipal Uses

func (u *UniterAPI) 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 (*UniterAPI) GetRawK8sSpec Uses

func (u *UniterAPI) GetRawK8sSpec(args params.Entities) (params.StringResults, error)

GetRawK8sSpec gets the raw k8s specs for a set of applications.

func (*UniterAPI) GoalStates Uses

func (u *UniterAPI) GoalStates(args params.Entities) (params.GoalStateResults, error)

GoalStates returns information of charm units and relations.

func (*UniterAPI) HasSubordinates Uses

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

HasSubordinates returns the whether each given unit has any subordinates.

func (*UniterAPI) LXDProfileName Uses

func (u *UniterAPI) LXDProfileName(args params.Entities) (params.StringResults, error)

LXDProfileName is a shim to call the LXDProfileAPIv2 version of this method.

func (*UniterAPI) LXDProfileRequired Uses

func (u *UniterAPI) LXDProfileRequired(args params.CharmURLs) (params.BoolResults, error)

LXDProfileRequired is a shim to call the LXDProfileAPIv2 version of this method.

func (*UniterAPI) LeaveScope Uses

func (u *UniterAPI) 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 (*UniterAPI) LogActionsMessages Uses

func (u *UniterAPI) LogActionsMessages(args params.ActionMessageParams) (params.ErrorResults, error)

LogActionsMessages records the log messages against the specified actions.

func (*UniterAPI) NetworkInfo Uses

func (u *UniterAPI) NetworkInfo(args params.NetworkInfoParams) (params.NetworkInfoResults, error)

NetworkInfo returns network interfaces/addresses for specified bindings.

func (*UniterAPI) OpenPorts Uses

func (u *UniterAPI) OpenPorts(args params.EntitiesPortRanges) (params.ErrorResults, error)

func (*UniterAPI) OpenedMachinePortRangesByEndpoint Uses

func (u *UniterAPI) OpenedMachinePortRangesByEndpoint(args params.Entities) (params.OpenMachinePortRangesByEndpointResults, error)

OpenedMachinePortRangesByEndpoint returns the port ranges opened by each unit on the provided machines grouped by application endpoint.

func (*UniterAPI) PrivateAddress Uses

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

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

func (*UniterAPI) ProviderType Uses

func (u *UniterAPI) 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 (*UniterAPI) PublicAddress Uses

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

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

func (*UniterAPI) ReadLocalApplicationSettings Uses

func (u *UniterAPI) ReadLocalApplicationSettings(arg params.RelationUnit) (params.SettingsResult, error)

ReadLocalApplicationSettings returns the local application settings for a particular relation when invoked by the leader unit.

func (*UniterAPI) ReadRemoteSettings Uses

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

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

func (*UniterAPI) ReadSettings Uses

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

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

NOTE(achilleasa): Using this call to read application data is deprecated and will not work for k8s charms (see LP1876097). Instead, clients should use ReadLocalApplicationSettings.

func (*UniterAPI) Refresh Uses

func (u *UniterAPI) Refresh(args params.Entities) (params.UnitRefreshResults, error)

Refresh retrieves the latest values for attributes on this unit.

func (*UniterAPI) Relation Uses

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

func (u *UniterAPI) 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 (*UniterAPI) RelationsStatus Uses

func (u *UniterAPI) RelationsStatus(args params.Entities) (params.RelationUnitStatusResults, error)

RelationsStatus returns for each unit the corresponding relation and status information.

func (*UniterAPI) Resolved Uses

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

Resolved returns the current resolved setting for each given unit.

func (*UniterAPI) SLALevel Uses

func (u *UniterAPI) SLALevel() (params.StringResult, error)

SLALevel returns the model's SLA level.

func (*UniterAPI) SetCharmURL Uses

func (u *UniterAPI) 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 known.

func (*UniterAPI) SetRelationStatus Uses

func (u *UniterAPI) SetRelationStatus(args params.RelationStatusArgs) (params.ErrorResults, error)

SetRelationStatus updates the status of the specified relations.

func (*UniterAPI) SetWorkloadVersion Uses

func (u *UniterAPI) 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 (*UniterAPI) UpdateNetworkInfo Uses

func (u *UniterAPI) UpdateNetworkInfo(args params.Entities) (params.ErrorResults, error)

UpdateNetworkInfo refreshes the network settings for a unit's bound endpoints.

func (*UniterAPI) UpdateSettings Uses

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

func (u *UniterAPI) 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 (*UniterAPI) WatchConfigSettingsHash Uses

func (u *UniterAPI) WatchConfigSettingsHash(args params.Entities) (params.StringsWatchResults, error)

WatchConfigSettingsHash returns a StringsWatcher that yields a hash of the config values every time the config changes. The uniter can save this hash and use it to decide whether the config-changed hook needs to be run (or whether this was just an agent restart with no substantive config change).

func (*UniterAPI) WatchInstanceData Uses

func (u *UniterAPI) WatchInstanceData(args params.Entities) (params.NotifyWatchResults, error)

WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method.

func (*UniterAPI) WatchRelationUnits Uses

func (u *UniterAPI) 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 (*UniterAPI) WatchTrustConfigSettingsHash Uses

func (u *UniterAPI) WatchTrustConfigSettingsHash(args params.Entities) (params.StringsWatchResults, error)

WatchTrustConfigSettingsHash returns a StringsWatcher that yields a hash of the application config values whenever they change. The uniter can use the hash to determine whether the actual values have changed since it last saw the config.

func (*UniterAPI) WatchUnitAddressesHash Uses

func (u *UniterAPI) WatchUnitAddressesHash(args params.Entities) (params.StringsWatchResults, error)

WatchUnitAddressesHash returns a StringsWatcher that yields the hashes of the addresses for the unit whenever the addresses change. The uniter can use the hash to determine whether the actual address values have changed since it last saw the config.

func (*UniterAPI) WatchUnitRelations Uses

func (u *UniterAPI) WatchUnitRelations(args params.Entities) (params.StringsWatchResults, error)

WatchUnitRelations returns a StringsWatcher, for each given unit, that notifies of changes to the lifecycles of relations relevant to that unit. For principal units, this will be all of the relations for the application. For subordinate units, only relations with the principal unit's application will be monitored.

func (*UniterAPI) WorkloadVersion Uses

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

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

type UniterAPIV10 Uses

type UniterAPIV10 struct {
    // LXDProfileAPI is removed from a UniterAPI embedded struct to UniterAPIV10
    // embedded struct removing it completely from future API versions.
    *LXDProfileAPI
    UniterAPIV11
}

UniterAPIV10 adds WatchUnitLXDProfileUpgradeNotifications and

func NewUniterAPIV10 Uses

func NewUniterAPIV10(context facade.Context) (*UniterAPIV10, error)

NewUniterAPIV10 creates an instance of the V10 uniter API.

func (*UniterAPIV10) CloudAPIVersion Uses

func (u *UniterAPIV10) CloudAPIVersion(_, _ struct{})

CloudAPIVersion isn't on the v10 API.

type UniterAPIV11 Uses

type UniterAPIV11 struct {
    *LXDProfileAPI
    UniterAPIV12
}

UniterAPIV11 implements version (v11) of the Uniter API, which adds CloudAPIVersion.

func NewUniterAPIV11 Uses

func NewUniterAPIV11(context facade.Context) (*UniterAPIV11, error)

NewUniterAPIV11 creates an instance of the V11 uniter API.

type UniterAPIV12 Uses

type UniterAPIV12 struct {
    UniterAPIV13
}

UniterAPIV12 implements version (v12) of the Uniter API, Removes the embedded LXDProfileAPI, which in turn removes the following; RemoveUpgradeCharmProfileData, WatchUnitLXDProfileUpgradeNotifications and WatchLXDProfileUpgradeNotifications

func NewUniterAPIV12 Uses

func NewUniterAPIV12(context facade.Context) (*UniterAPIV12, error)

NewUniterAPIV12 creates an instance of the V12 uniter API.

type UniterAPIV13 Uses

type UniterAPIV13 struct {
    UniterAPIV14
}

UniterAPIV13 implements version (v13) of the Uniter API, which adds UpdateNetworkInfo.

func NewUniterAPIV13 Uses

func NewUniterAPIV13(context facade.Context) (*UniterAPIV13, error)

NewUniterAPIV13 creates an instance of the V13 uniter API.

func (*UniterAPIV13) GetPodSpec Uses

func (u *UniterAPIV13) GetPodSpec(_, _ struct{})

GetPodSpec isn't on the v13 API.

type UniterAPIV14 Uses

type UniterAPIV14 struct {
    UniterAPIV15
}

UniterAPIV14 implements version (v14) of the Uniter API, which adds GetPodSpec, SetState and State.

func NewUniterAPIV14 Uses

func NewUniterAPIV14(context facade.Context) (*UniterAPIV14, error)

NewUniterAPIV14 creates an instance of the V14 uniter API.

func (*UniterAPIV14) CommitHookChanges Uses

func (u *UniterAPIV14) CommitHookChanges(_ struct{})

CommitHookChanges isn't on the v14 API.

func (*UniterAPIV14) GetRawK8sSpec Uses

func (u *UniterAPIV14) GetRawK8sSpec(_, _ struct{})

GetRawK8sSpec isn't on the v14 API.

func (*UniterAPIV14) ReadLocalApplicationSettings Uses

func (u *UniterAPIV14) ReadLocalApplicationSettings(_ struct{})

ReadLocalApplicationSettings is not available in V14 of the API.

func (*UniterAPIV14) SetPodSpec Uses

func (u *UniterAPIV14) SetPodSpec(args params.SetPodSpecParams) (params.ErrorResults, error)

SetPodSpec sets the pod specs for a set of applications. This call is kept here for backwards compatibility with V14 clients. Clients that support V15+ of the facade will use the CommitHookChanges API call instead.

func (*UniterAPIV14) SetState Uses

func (u *UniterAPIV14) SetState(_ struct{})

SetState isn't on the v14 API.

func (*UniterAPIV14) State Uses

func (u *UniterAPIV14) State(_ struct{})

State isn't on the v14 API.

func (*UniterAPIV14) WatchActionNotifications Uses

func (u *UniterAPIV14) WatchActionNotifications(args params.Entities) (params.StringsWatchResults, error)

WatchActionNotifications preserves previous functionality of the ActionNotifications watcher to only trigger once on creation of a pending Action.

type UniterAPIV15 Uses

type UniterAPIV15 struct {
    UniterAPI
}

UniterAPIV15 implements version (v15) of the Uniter API, which adds the State, CommitHookChanges, ReadLocalApplicationSettings calls and changes WatchActionNotifications to notify on action changes.

func NewUniterAPIV15 Uses

func NewUniterAPIV15(context facade.Context) (*UniterAPIV15, error)

NewUniterAPIV15 creates an instance of the V15 uniter API.

func (*UniterAPIV15) CanApplyLXDProfile Uses

func (u *UniterAPIV15) CanApplyLXDProfile(_ struct{})

CanApplyLXDProfile isn't on the v15 API.

func (*UniterAPIV15) LXDProfileName Uses

func (u *UniterAPIV15) LXDProfileName(_ struct{})

LXDProfileName isn't on the v15 API.

func (*UniterAPIV15) LXDProfileRequired Uses

func (u *UniterAPIV15) LXDProfileRequired(_ struct{})

LXDProfileRequired isn't on the v15 API.

func (*UniterAPIV15) WatchInstanceData Uses

func (u *UniterAPIV15) WatchInstanceData(_ struct{})

WatchInstanceData isn't on the v15 API.

type UniterAPIV16 Uses

type UniterAPIV16 struct {
    UniterAPI
}

UniterAPIV16 implements version (v16) of the Uniter API, which adds LXDPorfileAPIV2.

func NewUniterAPIV16 Uses

func NewUniterAPIV16(context facade.Context) (*UniterAPIV16, error)

NewUniterAPIV16 creates an instance of the V16 uniter API.

func (*UniterAPIV16) OpenedMachinePortRangesByEndpoint Uses

func (u *UniterAPIV16) OpenedMachinePortRangesByEndpoint(_ struct{})

OpenedMachinePortRangesByEndpoint is not available in V16 of the API.

type UniterAPIV4 Uses

type UniterAPIV4 struct {
    UniterAPIV5
}

UniterAPIV4 has old WatchApplicationRelations and NetworkConfig methods, and doesn't have the new SLALevel, NetworkInfo or WatchUnitRelations methods.

func NewUniterAPIV4 Uses

func NewUniterAPIV4(context facade.Context) (*UniterAPIV4, error)

NewUniterAPIV4 creates an instance of the V4 uniter API.

func (*UniterAPIV4) NetworkConfig Uses

func (u *UniterAPIV4) NetworkConfig(args params.UnitsNetworkConfig) (params.UnitNetworkConfigResults, error)

NetworkConfig returns information about all given relation/unit pairs, including their id, key and the local endpoint. It's not included in APIv5 TODO(wpk): NetworkConfig API is obsoleted by Uniter.NetworkInfo

func (*UniterAPIV4) NetworkInfo Uses

func (u *UniterAPIV4) NetworkInfo(_, _ struct{})

NetworkInfo isn't on the V4 API.

func (*UniterAPIV4) SLALevel Uses

func (u *UniterAPIV4) SLALevel(_, _ struct{})

SLALevel isn't on the V4 API.

func (*UniterAPIV4) WatchApplicationRelations Uses

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

WatchApplicationRelations returns a StringsWatcher, for each given application, that notifies of changes to the lifecycles of relations involving that application. This method is obsolete - it's been replaced by WatchUnitRelations in V5 of the uniter API.

func (*UniterAPIV4) WatchUnitRelations Uses

func (u *UniterAPIV4) WatchUnitRelations(_, _ struct{})

WatchUnitRelations isn't on the V4 API.

type UniterAPIV5 Uses

type UniterAPIV5 struct {
    UniterAPIV6
}

UniterAPIV5 returns a RelationResultsV5 instead of RelationResults from Relation and RelationById - elements don't have an OtherApplication field.

func NewUniterAPIV5 Uses

func NewUniterAPIV5(context facade.Context) (*UniterAPIV5, error)

NewUniterAPIV5 creates an instance of the V5 uniter API.

func (*UniterAPIV5) Relation Uses

func (u *UniterAPIV5) Relation(args params.RelationUnits) (params.RelationResultsV5, error)

Relation returns information about all given relation/unit pairs, including their id, key and the local endpoint (without other application name).

func (*UniterAPIV5) RelationById Uses

func (u *UniterAPIV5) RelationById(args params.RelationIds) (params.RelationResultsV5, error)

RelationById returns information about all given relations, specified by their ids, including their key and the local endpoint (without other application name).

type UniterAPIV6 Uses

type UniterAPIV6 struct {
    UniterAPIV7
}

UniterAPIV6 adds NetworkInfo as a preferred method to calling NetworkConfig.

func NewUniterAPIV6 Uses

func NewUniterAPIV6(context facade.Context) (*UniterAPIV6, error)

NewUniterAPIV6 creates an instance of the V6 uniter API.

func (*UniterAPIV6) JoinedRelations Uses

func (u *UniterAPIV6) JoinedRelations(args params.Entities) (params.StringsResults, error)

JoinedRelations returns the tags of all relations for which each supplied unit has entered scope. TODO(wallyworld) - this API is replaced by RelationsStatus

func (*UniterAPIV6) NetworkInfo Uses

func (u *UniterAPIV6) NetworkInfo(args params.NetworkInfoParams) (params.NetworkInfoResultsV6, error)

NetworkInfo implements UniterAPIV6 version of NetworkInfo by constructing an API V6 compatible result.

type UniterAPIV7 Uses

type UniterAPIV7 struct {
    UniterAPIV8
}

UniterAPIV7 adds CMR support to NetworkInfo.

func NewUniterAPIV7 Uses

func NewUniterAPIV7(context facade.Context) (*UniterAPIV7, error)

NewUniterAPIV7 creates an instance of the V7 uniter API.

func (*UniterAPIV7) SetPodSpec Uses

func (u *UniterAPIV7) SetPodSpec(_, _ struct{})

SetPodSpec isn't on the v7 API.

type UniterAPIV8 Uses

type UniterAPIV8 struct {
    UniterAPIV9
}

UniterAPIV8 adds SetContainerSpec, GoalStates, CloudSpec, WatchTrustConfigSettings, WatchActionNotifications, UpgradeSeriesStatus, SetUpgradeSeriesStatus.

func NewUniterAPIV8 Uses

func NewUniterAPIV8(context facade.Context) (*UniterAPIV8, error)

NewUniterAPIV8 creates an instance of the V8 uniter API.

func (*UniterAPIV8) WatchConfigSettings Uses

func (u *UniterAPIV8) WatchConfigSettings(args params.Entities) (params.NotifyWatchResults, error)

WatchConfigSettings returns a NotifyWatcher for observing changes to each unit's application configuration settings. See also state/watcher.go:Unit.WatchConfigSettings().

func (*UniterAPIV8) WatchConfigSettingsHash Uses

func (u *UniterAPIV8) WatchConfigSettingsHash(_, _ struct{})

WatchConfigSettingsHash isn't on the v8 API.

func (*UniterAPIV8) WatchSettings Uses

func (u *UniterAPIV8) WatchSettings(args params.Entities, configWatcherFn func(u *state.Unit) (state.NotifyWatcher, error)) (params.NotifyWatchResults, error)

func (*UniterAPIV8) WatchTrustConfigSettings Uses

func (u *UniterAPIV8) WatchTrustConfigSettings(args params.Entities) (params.NotifyWatchResults, error)

func (*UniterAPIV8) WatchTrustConfigSettingsHash Uses

func (u *UniterAPIV8) WatchTrustConfigSettingsHash(_, _ struct{})

WatchTrustConfigSettingsHash isn't on the v8 API.

func (*UniterAPIV8) WatchUnitAddresses Uses

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

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

func (*UniterAPIV8) WatchUnitAddressesHash Uses

func (u *UniterAPIV8) WatchUnitAddressesHash(_, _ struct{})

WatchUnitAddressesHash isn't on the v8 API.

type UniterAPIV9 Uses

type UniterAPIV9 struct {
    // LXDProfileAPI is removed from a UniterAPI embedded struct to UniterAPIV9
    // embedded struct removing it completely from future API versions.
    *LXDProfileAPI
    UniterAPIV10
}

UniterAPIV9 adds WatchConfigSettingsHash, WatchTrustConfigSettingsHash, WatchUnitAddressesHash and LXDProfileAPI, which includes WatchLXDProfileUpgradeNotifications and RemoveUpgradeCharmProfileData

func NewUniterAPIV9 Uses

func NewUniterAPIV9(context facade.Context) (*UniterAPIV9, error)

NewUniterAPIV9 creates an instance of the V9 uniter API.

Directories

PathSynopsis
mocksPackage mocks is a generated GoMock package.

Package uniter imports 38 packages (graph) and is imported by 5 packages. Updated 2020-09-30. Refresh now. Tools for package owners.