uniter

package
v0.0.0-...-7139314 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 41 Imported by: 2

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type CachedApplication

type CachedApplication interface {
	Status() status.StatusInfo
}

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

type CachedModel

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

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

type LXDProfileAPI

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

func NewExternalLXDProfileAPI

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

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

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

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

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

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

func NewExternalLXDProfileAPIv2

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

NewExternalLXDProfileAPIv2 can be used for API registration.

func NewLXDProfileAPIv2

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

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

func (*LXDProfileAPIv2) CanApplyLXDProfile

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

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

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

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

func (*LXDProfileAPIv2) WatchInstanceData

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

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

type LXDProfileBackendV2

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

type LXDProfileCharmV2

type LXDProfileCharmV2 interface {
	LXDProfile() lxdprofile.Profile
}

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

type LXDProfileMachine

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

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

type LXDProfileMachineV2

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

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

type LXDProfileState

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

LXDProfileState implements the LXDProfileBackend indirection over state.State.

func (LXDProfileState) Machine

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

func (LXDProfileState) Unit

type LXDProfileStateV2

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

LXDProfileStateV2 implements the LXDProfileBackendV2 indirection over state.State.

func (LXDProfileStateV2) Charm

func (LXDProfileStateV2) Machine

func (LXDProfileStateV2) Model

func (LXDProfileStateV2) Unit

type LXDProfileUnit

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

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

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

type Machine

type Machine interface {
	// Id returns the machine's model-unique identifier.
	Id() string

	// MachineTag returns the machine's tag, specifically typed.
	MachineTag() names.MachineTag

	// PrivateAddress returns the machine's preferred private address.
	PrivateAddress() (network.SpaceAddress, error)

	// AllDeviceAddresses returns the IP addresses for the machine's
	// link-layer devices.
	AllDeviceAddresses(subs network.SubnetInfos) ([]NetInfoAddress, error)
}

Machine describes methods required for interrogating the addresses of a machine in state.

type NetInfoAddress

type NetInfoAddress interface {
	network.Address

	// SpaceAddr returns the SpaceAddress representation for
	// the address, which was determined from its subnet.
	SpaceAddr() network.SpaceAddress

	// DeviceName is the name of the link-layer device
	// with which this address is associated.
	DeviceName() string

	// HWAddr returns the hardware address (MAC or Infiniband GUID)
	// for the device with which this address is associated.
	HWAddr() (string, error)

	// ParentDeviceName returns the name of the network device that
	// is the parent of this one.
	// An empty string is returned if no parent can be determined.
	ParentDeviceName() string
}

type NetworkInfo

type NetworkInfo interface {
	ProcessAPIRequest(params.NetworkInfoParams) (params.NetworkInfoResults, error)
	NetworksForRelation(
		binding string, rel *state.Relation, pollPublic bool,
	) (boundSpace string, ingress network.SpaceAddresses, egress []string, err error)
}

func NewNetworkInfo

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 NewNetworkInfoForStrategy

func NewNetworkInfoForStrategy(
	st *state.State, tag names.UnitTag, retryFactory func() retry.CallArgs, lookupHost func(string) ([]string, error),
) (NetworkInfo, error)

NewNetworkInfoForStrategy initialises and returns a new NetworkInfo based on the input state and unit tag, allowing further specification of behaviour via the input retry factory and host resolver.

type NetworkInfoBase

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

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

type NetworkInfoCAAS

type NetworkInfoCAAS struct {
	*NetworkInfoBase
	// contains filtered or unexported fields
}

NetworkInfoCAAS is used to provide network info for CAAS units.

func (*NetworkInfoCAAS) NetworksForRelation

func (n *NetworkInfoCAAS) NetworksForRelation(
	endpoint string, rel *state.Relation, pollAddr bool,
) (string, network.SpaceAddresses, []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 (*NetworkInfoCAAS) ProcessAPIRequest

ProcessAPIRequest handles a request to the uniter API NetworkInfo method.

type NetworkInfoIAAS

type NetworkInfoIAAS struct {
	*NetworkInfoBase
	// contains filtered or unexported fields
}

NetworkInfoIAAS is used to provide network info for IAAS units.

func (*NetworkInfoIAAS) NetworksForRelation

func (n *NetworkInfoIAAS) NetworksForRelation(
	endpoint string, rel *state.Relation, _ bool,
) (string, network.SpaceAddresses, []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 (*NetworkInfoIAAS) ProcessAPIRequest

ProcessAPIRequest handles a request to the uniter API NetworkInfo method.

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, model CachedModel, getCanModify common.GetAuthFunc, leadershipChecker leadership.Checker) *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 Applications 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) 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 Unit

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

type UniterAPI

UniterAPI implements the latest version (v18) of the Uniter API.

func (*UniterAPI) ActionStatus

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

ActionStatus returns the status of Actions by Tags passed in.

func (*UniterAPI) Actions

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

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

AddMetricBatches adds the metrics for the specified unit.

func (*UniterAPI) AssignedMachine

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

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

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

func (*UniterAPI) BeginActions

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

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

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

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

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

func (*UniterAPI) CharmURL

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

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

func (*UniterAPI) ClearResolved

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

ClearResolved removes any resolved setting from each given unit.

func (*UniterAPI) CloudAPIVersion

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

CloudAPIVersion returns the cloud API version, if available.

func (*UniterAPI) CloudSpec

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

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

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

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

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

func (*UniterAPI) Destroy

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

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

DestroyAllSubordinates destroys all subordinates of each given unit.

func (*UniterAPI) EnterScope

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

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

FinishActions saves the result of a completed Action

func (*UniterAPI) GetPodSpec

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

GetPodSpec gets the pod specs for a set of applications.

func (*UniterAPI) GetPrincipal

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

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

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

func (*UniterAPI) GoalStates

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

GoalStates returns information of charm units and relations.

func (*UniterAPI) HasSubordinates

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

HasSubordinates returns the whether each given unit has any subordinates.

func (*UniterAPI) LXDProfileName

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

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

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

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

LogActionsMessages records the log messages against the specified actions.

func (*UniterAPI) NetworkInfo

NetworkInfo returns network interfaces/addresses for specified bindings.

func (*UniterAPI) OpenedMachinePortRangesByEndpoint

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

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

func (*UniterAPI) OpenedPortRangesByEndpoint

func (u *UniterAPI) OpenedPortRangesByEndpoint() (params.OpenPortRangesByEndpointResults, error)

OpenedPortRangesByEndpoint returns the port ranges opened by the unit.

func (*UniterAPI) PrivateAddress

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

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

func (*UniterAPI) ProviderType

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

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

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

func (*UniterAPI) ReadLocalApplicationSettings

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

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

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

Refresh retrieves the latest values for attributes on this unit.

func (*UniterAPI) Relation

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

func (*UniterAPI) RelationById

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

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

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

func (*UniterAPI) Resolved

Resolved returns the current resolved setting for each given unit.

func (*UniterAPI) SLALevel

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

SLALevel returns the model's SLA level.

func (*UniterAPI) SetCharmURL

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

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

SetRelationStatus updates the status of the specified relations.

func (*UniterAPI) SetWorkloadVersion

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

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

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

func (*UniterAPI) WatchActionNotifications

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

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

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

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

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

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

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

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

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

type UniterAPIv18

type UniterAPIv18 struct {
	UniterAPI
}

UniterAPIv18 Implements version 18 of the uniter API, which includes methods ModelUUID and OpenedApplicationPortRangesByEndpoint that were removed from later versions.

func (*UniterAPIv18) ModelUUID

func (u *UniterAPIv18) ModelUUID() params.StringResult

ModelUUID returns the model UUID that this unit resides in. It is implemented here directly as a result of removing it from embedded APIAddresser *without* bumping the facade version.

func (*UniterAPIv18) OpenedApplicationPortRangesByEndpoint

func (u *UniterAPIv18) OpenedApplicationPortRangesByEndpoint(entity params.Entity) (params.ApplicationOpenedPortsResults, error)

OpenedApplicationPortRangesByEndpoint returns the port ranges opened by each application.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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