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

Hierarchy

  • default

Implements

Constructors

Properties

Methods

aPIAddresses aPIHostPorts actionStatus actions addMetricBatches applicationStatus assignedMachine availabilityZone beginActions canApplyLXDProfile charmArchiveSha256 charmModifiedVersion charmURL clearResolved cloudAPIVersion cloudSpec commitHookChanges configSettings createSecretURIs createSecrets currentModel destroy destroyAllSubordinates destroyUnitStorageAttachments ensureDead enterScope finishActions getConsumerSecretsRevisionInfo getMeterStatus getPodSpec getPrincipal getRawK8sSpec getSecretBackendConfigs getSecretContentInfo getSecretMetadata getSecretRevisionContentInfo goalStates hasSubordinates lXDProfileName lXDProfileRequired leaveScope life logActionsMessages merge modelConfig networkInfo openedMachinePortRangesByEndpoint openedPortRangesByEndpoint privateAddress providerType publicAddress read readLocalApplicationSettings readRemoteSettings readSettings refresh relation relationById relationsStatus removeSecrets removeStorageAttachments requestReboot resolved sLALevel secretsGrant secretsRevoke secretsRotated setAgentStatus setApplicationStatus setCharmURL setRelationStatus setState setStatus setUnitStatus setUpgradeSeriesUnitStatus setWorkloadVersion state storageAttachmentLife storageAttachments unitStatus unitStorageAttachments updateNetworkInfo updateSecrets upgradeSeriesUnitStatus watch watchAPIHostPorts watchActionNotifications watchConfigSettingsHash watchConsumedSecretsChanges watchForModelConfigChanges watchInstanceData watchLeadershipSettings watchMeterStatus watchObsolete watchRelationUnits watchSecretRevisionsExpiryChanges watchSecretsRotationChanges watchStorageAttachments watchTrustConfigSettingsHash watchUnitAddressesHash watchUnitRelations watchUnitStorageAttachments watchUpgradeSeriesNotifications workloadVersion

Constructors

Properties

NAME: string = "Uniter"
VERSION: number = 19
_transport: Transport
NAME: string = "Uniter"
VERSION: number = 19

Methods

  • APIAddresses returns the list of addresses used to connect to the API.

    Parameters

    • params: any

    Returns Promise<StringsResult>

  • APIHostPorts returns the API server addresses.

    Parameters

    • params: any

    Returns Promise<APIHostPortsResult>

  • ActionStatus returns the status of Actions by Tags passed in.

    Parameters

    Returns Promise<StringResults>

  • Actions returns the Actions by Tags passed and ensures that the Unit asking for them is the same Unit that has the Actions.

    Parameters

    Returns Promise<ActionResults>

  • AssignedMachine returns the machine tag for each given unit tag, or an error satisfying params.IsCodeNotAssigned when a unit has no assigned machine.

    Parameters

    Returns Promise<StringResults>

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

    Parameters

    Returns Promise<StringResults>

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

    Parameters

    Returns Promise<ErrorResults>

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

    Parameters

    Returns Promise<BoolResults>

  • CharmArchiveSha256 returns the SHA256 digest of the charm archive (bundle) data for each charm url in the given parameters.

    Parameters

    Returns Promise<StringResults>

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

    Parameters

    Returns Promise<IntResults>

  • ClearResolved removes any resolved setting from each given unit.

    Parameters

    Returns Promise<ErrorResults>

  • CloudAPIVersion returns the cloud API version, if available.

    Parameters

    • params: any

    Returns Promise<StringResult>

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

    Parameters

    • params: any

    Returns Promise<CloudSpecResult>

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

    Parameters

    Returns Promise<ErrorResults>

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

    Parameters

    • params: any

    Returns Promise<ModelResult>

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

    Parameters

    Returns Promise<ErrorResults>

  • DestroyAllSubordinates destroys all subordinates of each given unit.

    Parameters

    Returns Promise<ErrorResults>

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

    Parameters

    Returns Promise<ErrorResults>

  • EnsureDead calls EnsureDead on each given entity from state. It will fail if the entity is not present. If it's Alive, nothing will happen (see state/EnsureDead() for units or machines).

    Parameters

    Returns Promise<ErrorResults>

  • EnterScope ensures each unit has entered its scope in the relation, for all of the given relation/unit pairs. See also state.RelationUnit.EnterScope().

    Parameters

    Returns Promise<ErrorResults>

  • GetPodSpec gets the pod specs for a set of applications.

    Parameters

    Returns Promise<StringResults>

  • GetPrincipal returns the result of calling PrincipalName() and converting it to a tag, on each given unit.

    Parameters

    Returns Promise<StringBoolResults>

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

    Parameters

    Returns Promise<StringResults>

  • GetSecretMetadata returns metadata for the caller's secrets.

    Parameters

    • params: any

    Returns Promise<ListSecretResults>

  • HasSubordinates returns the whether each given unit has any subordinates.

    Parameters

    Returns Promise<BoolResults>

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

    Parameters

    Returns Promise<StringResults>

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

    Parameters

    Returns Promise<BoolResults>

  • LeaveScope signals each unit has left its scope in the relation, for all of the given relation/unit pairs. See also state.RelationUnit.LeaveScope().

    Parameters

    Returns Promise<ErrorResults>

  • Life returns the life status of every supplied entity, where available.

    Parameters

    Returns Promise<LifeResults>

  • ModelConfig returns the current model's configuration.

    Parameters

    • params: any

    Returns Promise<ModelConfigResult>

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

    Parameters

    Returns Promise<StringResults>

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

    Parameters

    • params: any

    Returns Promise<StringResult>

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

    Parameters

    Returns Promise<StringResults>

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

    Parameters

    Returns Promise<SettingsResult>

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

    Parameters

    Returns Promise<SettingsResults>

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

    Parameters

    Returns Promise<RelationResults>

  • RelationById returns information about all given relations, specified by their ids, including their key and the local endpoint.

    Parameters

    Returns Promise<RelationResults>

  • RequestReboot sets the reboot flag on the provided machines

    Parameters

    Returns Promise<ErrorResults>

  • SLALevel returns the model's SLA level.

    Parameters

    • params: any

    Returns Promise<StringResult>

  • SetAgentStatus will set status for agents of Units passed in args, if one of the args is not an Unit it will fail.

    Parameters

    Returns Promise<ErrorResults>

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

    Parameters

    Returns Promise<ErrorResults>

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

    Parameters

    Returns Promise<ErrorResults>

  • SetState sets the state persisted by the charm running in this unit and the state internal to the uniter for this unit.

    Parameters

    Returns Promise<ErrorResults>

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

    Parameters

    Returns Promise<ErrorResults>

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

    Parameters

    Returns Promise<ErrorResults>

  • State returns the state persisted by the charm running in this unit and the state internal to the uniter for this unit.

    Parameters

    Returns Promise<UnitStateResults>

  • UnitStatus returns the workload status information for the unit.

    Parameters

    Returns Promise<StatusResults>

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

    Parameters

    Returns Promise<ErrorResults>

  • UpgradeSeriesUnitStatus returns the current preparation status of an upgrading unit. If no series upgrade is in progress an error is returned instead.

    Parameters

    Returns Promise<UpgradeSeriesStatusResults>

  • WatchAPIHostPorts watches the API server addresses.

    Parameters

    • params: any

    Returns Promise<NotifyWatchResult>

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

    Parameters

    Returns Promise<StringsWatchResults>

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

    Parameters

    Returns Promise<StringsWatchResults>

  • WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers.

    Parameters

    Returns Promise<StringsWatchResults>

  • WatchForModelConfigChanges returns a NotifyWatcher that observes changes to the model configuration. Note that although the NotifyWatchResult contains an Error field, it's not used because we are only returning a single watcher, so we use the regular error return.

    Parameters

    • params: any

    Returns Promise<NotifyWatchResult>

  • WatchLeadershipSettings will block the caller until leadership settings for the given service ID change.

    Parameters

    Returns Promise<NotifyWatchResults>

  • WatchObsolete returns a watcher for notifying when:

    • a secret owned by the entity is deleted
    • a secret revision owed by the entity no longer has any consumers

    Obsolete revisions results are "uri/revno" and deleted secret results are "uri".

    Parameters

    Returns Promise<StringsWatchResult>

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

    Parameters

    Returns Promise<RelationUnitsWatchResults>

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

    Parameters

    Returns Promise<StringsWatchResults>

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

    Parameters

    Returns Promise<StringsWatchResults>

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

    Parameters

    Returns Promise<StringsWatchResults>

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

    Parameters

    Returns Promise<StringsWatchResults>

  • WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks.

    Parameters

    Returns Promise<NotifyWatchResults>

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

    Parameters

    Returns Promise<StringResults>

Generated using TypeDoc