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 state.go status.go storage.go subordinaterelationwatcher.go uniter.go

Variables

var PreferredAddressRetryArgs = func() retry.CallArgs {
    return retry.CallArgs{
        Clock:       clock.WallClock,
        Delay:       3 * time.Second,
        MaxDuration: 30 * time.Second,
    }
}

PreferredAddressRetryArgs returns the retry strategy for getting a unit's preferred address. Override for testing to use a different clock. TODO (manadart 2019-10-09): Pass this as an argument to the NetworkInfo constructor instead of exporting this public type for patching in tests.

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

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

type LXDProfileMachine Uses

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

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

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 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 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) (*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, 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
    *leadershipapiserver.LeadershipSettingsAccessor
    meterstatus.MeterStatus

    *StorageAPI
    // contains filtered or unexported fields
}

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

func NewUniterAPI Uses

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

NewUniterAPI creates a new instance of the core Uniter API.

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

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

OpenPorts sets the policy of the port range with protocol to be opened, for all given units.

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

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) SetPodSpec Uses

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

SetPodSpec sets the pod specs for a set of applications.

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) WatchRelationApplicationSettings Uses

func (u *UniterAPI) WatchRelationApplicationSettings(args params.RelationApplications) (params.NotifyWatchResults, error)

WatchRelationApplicationSettings watches for changes to a relation's application settings. Only accessible for agents that are members of the relation and counterparts of the requested application.

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 {
    *LXDProfileAPI
    UniterAPI
}

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

Network Info 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 33 packages (graph) and is imported by 4 packages. Updated 2019-10-17. Refresh now. Tools for package owners.