@canonical/jujulib
Version:
Juju API client
1,576 lines (1,570 loc) • 49.6 kB
JavaScript
/**
Juju Uniter version 19.
This facade is available on:
Controller-machine-agent
Machine-agent
Unit-agent
Models
NOTE: This file was generated using the Juju schema
from Juju 3.3 at the git SHA 65fa4c1ee5.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
UniterAPI implements the latest version (v18) of the Uniter API.
*/
class UniterV19 {
constructor(transport, info) {
this.NAME = "Uniter";
this.VERSION = 19;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
APIAddresses returns the list of addresses used to connect to the API.
*/
aPIAddresses(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "APIAddresses",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
APIHostPorts returns the API server addresses.
*/
aPIHostPorts(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "APIHostPorts",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ActionStatus returns the status of Actions by Tags passed in.
*/
actionStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "ActionStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Actions returns the Actions by Tags passed and ensures that the Unit asking
for them is the same Unit that has the Actions.
*/
actions(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "Actions",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
AddMetricBatches adds the metrics for the specified unit.
*/
addMetricBatches(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "AddMetricBatches",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ApplicationStatus returns the status of the Applications and its workloads
if the given unit is the leader.
*/
applicationStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "ApplicationStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
AssignedMachine returns the machine tag for each given unit tag, or
an error satisfying params.IsCodeNotAssigned when a unit has no
assigned machine.
*/
assignedMachine(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "AssignedMachine",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
AvailabilityZone returns the availability zone for each given unit, if applicable.
*/
availabilityZone(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "AvailabilityZone",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
BeginActions marks the actions represented by the passed in Tags as running.
*/
beginActions(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "BeginActions",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method.
*/
canApplyLXDProfile(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "CanApplyLXDProfile",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
CharmArchiveSha256 returns the SHA256 digest of the charm archive
(bundle) data for each charm url in the given parameters.
*/
charmArchiveSha256(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "CharmArchiveSha256",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
CharmModifiedVersion returns the most CharmModifiedVersion for all given
units or applications.
*/
charmModifiedVersion(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "CharmModifiedVersion",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
CharmURL returns the charm URL for all given units or applications.
*/
charmURL(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "CharmURL",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ClearResolved removes any resolved setting from each given unit.
*/
clearResolved(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "ClearResolved",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
CloudAPIVersion returns the cloud API version, if available.
*/
cloudAPIVersion(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "CloudAPIVersion",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
cloudSpec(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "CloudSpec",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
commitHookChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "CommitHookChanges",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ConfigSettings returns the complete set of application charm config
settings available to each given unit.
*/
configSettings(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "ConfigSettings",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
CreateSecretURIs creates new secret URIs.
*/
createSecretURIs(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "CreateSecretURIs",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
CreateSecrets creates new secrets.
*/
createSecrets(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "CreateSecrets",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
CurrentModel returns the name and UUID for the current juju model.
*/
currentModel(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "CurrentModel",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Destroy advances all given Alive units' lifecycles as far as
possible. See state/Unit.Destroy().
*/
destroy(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "Destroy",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
DestroyAllSubordinates destroys all subordinates of each given unit.
*/
destroyAllSubordinates(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "DestroyAllSubordinates",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
DestroyUnitStorageAttachments marks each storage attachment of the
specified units as Dying.
*/
destroyUnitStorageAttachments(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "DestroyUnitStorageAttachments",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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).
*/
ensureDead(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "EnsureDead",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
EnterScope ensures each unit has entered its scope in the relation,
for all of the given relation/unit pairs. See also
state.RelationUnit.EnterScope().
*/
enterScope(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "EnterScope",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
FinishActions saves the result of a completed Action
*/
finishActions(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "FinishActions",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets.
This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook.
*/
getConsumerSecretsRevisionInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "GetConsumerSecretsRevisionInfo",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
*/
getMeterStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "GetMeterStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetPodSpec gets the pod specs for a set of applications.
*/
getPodSpec(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "GetPodSpec",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetPrincipal returns the result of calling PrincipalName() and
converting it to a tag, on each given unit.
*/
getPrincipal(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "GetPrincipal",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetRawK8sSpec gets the raw k8s specs for a set of applications.
*/
getRawK8sSpec(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "GetRawK8sSpec",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetSecretBackendConfigs gets the config needed to create a client to secret backends.
*/
getSecretBackendConfigs(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "GetSecretBackendConfigs",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetSecretContentInfo returns the secret values for the specified secrets.
*/
getSecretContentInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "GetSecretContentInfo",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetSecretMetadata returns metadata for the caller's secrets.
*/
getSecretMetadata(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "GetSecretMetadata",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetSecretRevisionContentInfo returns the secret values for the specified secret revisions.
*/
getSecretRevisionContentInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "GetSecretRevisionContentInfo",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GoalStates returns information of charm units and relations.
*/
goalStates(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "GoalStates",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
HasSubordinates returns the whether each given unit has any subordinates.
*/
hasSubordinates(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "HasSubordinates",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
LXDProfileName is a shim to call the LXDProfileAPIv2 version of this method.
*/
lXDProfileName(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "LXDProfileName",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
LXDProfileRequired is a shim to call the LXDProfileAPIv2 version of this method.
*/
lXDProfileRequired(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "LXDProfileRequired",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
LeaveScope signals each unit has left its scope in the relation,
for all of the given relation/unit pairs. See also
state.RelationUnit.LeaveScope().
*/
leaveScope(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "LeaveScope",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Life returns the life status of every supplied entity, where available.
*/
life(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "Life",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
LogActionsMessages records the log messages against the specified actions.
*/
logActionsMessages(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "LogActionsMessages",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Merge merges in the provided leadership settings. Only leaders for
the given service may perform this operation.
*/
merge(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "Merge",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ModelConfig returns the current model's configuration.
*/
modelConfig(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "ModelConfig",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
NetworkInfo returns network interfaces/addresses for specified bindings.
*/
networkInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "NetworkInfo",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
OpenedMachinePortRangesByEndpoint returns the port ranges opened by each
unit on the provided machines grouped by application endpoint.
*/
openedMachinePortRangesByEndpoint(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "OpenedMachinePortRangesByEndpoint",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
OpenedPortRangesByEndpoint returns the port ranges opened by the unit.
*/
openedPortRangesByEndpoint(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "OpenedPortRangesByEndpoint",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
PrivateAddress returns the private address for each given unit, if set.
*/
privateAddress(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "PrivateAddress",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
providerType(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "ProviderType",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
PublicAddress returns the public address for each given unit, if set.
*/
publicAddress(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "PublicAddress",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Read reads leadership settings for the provided service ID. Any
unit of the service may perform this operation.
*/
read(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "Read",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ReadLocalApplicationSettings returns the local application settings for a
particular relation when invoked by the leader unit.
*/
readLocalApplicationSettings(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "ReadLocalApplicationSettings",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ReadRemoteSettings returns the remote settings of each given set of
relation/local unit/remote unit.
*/
readRemoteSettings(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "ReadRemoteSettings",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
readSettings(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "ReadSettings",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Refresh retrieves the latest values for attributes on this unit.
*/
refresh(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "Refresh",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Relation returns information about all given relation/unit pairs,
including their id, key and the local endpoint.
*/
relation(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "Relation",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RelationById returns information about all given relations,
specified by their ids, including their key and the local
endpoint.
*/
relationById(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "RelationById",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RelationsStatus returns for each unit the corresponding relation and status information.
*/
relationsStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "RelationsStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RemoveSecrets removes the specified secrets.
*/
removeSecrets(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "RemoveSecrets",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RemoveStorageAttachments removes the specified storage
attachments from state.
*/
removeStorageAttachments(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "RemoveStorageAttachments",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RequestReboot sets the reboot flag on the provided machines
*/
requestReboot(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "RequestReboot",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Resolved returns the current resolved setting for each given unit.
*/
resolved(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "Resolved",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SLALevel returns the model's SLA level.
*/
sLALevel(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SLALevel",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SecretsGrant grants access to a secret for the specified subjects.
*/
secretsGrant(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SecretsGrant",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SecretsRevoke revokes access to a secret for the specified subjects.
*/
secretsRevoke(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SecretsRevoke",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SecretsRotated records when secrets were last rotated.
*/
secretsRotated(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SecretsRotated",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetAgentStatus will set status for agents of Units passed in args, if one
of the args is not an Unit it will fail.
*/
setAgentStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SetAgentStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetApplicationStatus sets the status for all the Applications in args if the given Unit is
the leader.
*/
setApplicationStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SetApplicationStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
setCharmURL(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SetCharmURL",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetRelationStatus updates the status of the specified relations.
*/
setRelationStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SetRelationStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetState sets the state persisted by the charm running in this unit
and the state internal to the uniter for this unit.
*/
setState(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SetState",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
setStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SetStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
setUnitStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SetUnitStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit.
If no upgrade is in progress an error is returned instead.
*/
setUpgradeSeriesUnitStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SetUpgradeSeriesUnitStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetWorkloadVersion sets the workload version for each given unit. An error will
be returned if a unit is dead.
*/
setWorkloadVersion(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "SetWorkloadVersion",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
State returns the state persisted by the charm running in this unit
and the state internal to the uniter for this unit.
*/
state(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "State",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
StorageAttachmentLife returns the lifecycle state of the storage attachments
with the specified tags.
*/
storageAttachmentLife(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "StorageAttachmentLife",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
StorageAttachments returns the storage attachments with the specified tags.
*/
storageAttachments(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "StorageAttachments",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
UnitStatus returns the workload status information for the unit.
*/
unitStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "UnitStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
UnitStorageAttachments returns the IDs of storage attachments for a collection of units.
*/
unitStorageAttachments(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "UnitStorageAttachments",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
UpdateNetworkInfo refreshes the network settings for a unit's bound
endpoints.
*/
updateNetworkInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "UpdateNetworkInfo",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
UpdateSecrets updates the specified secrets.
*/
updateSecrets(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "UpdateSecrets",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
UpgradeSeriesUnitStatus returns the current preparation status of an
upgrading unit.
If no series upgrade is in progress an error is returned instead.
*/
upgradeSeriesUnitStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "UpgradeSeriesUnitStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Watch starts an NotifyWatcher for each given entity.
*/
watch(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "Watch",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchAPIHostPorts watches the API server addresses.
*/
watchAPIHostPorts(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchAPIHostPorts",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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().
*/
watchActionNotifications(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchActionNotifications",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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).
*/
watchConfigSettingsHash(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchConfigSettingsHash",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers.
*/
watchConsumedSecretsChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchConsumedSecretsChanges",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
watchForModelConfigChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchForModelConfigChanges",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method.
*/
watchInstanceData(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchInstanceData",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchLeadershipSettings will block the caller until leadership settings
for the given service ID change.
*/
watchLeadershipSettings(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchLeadershipSettings",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
*/
watchMeterStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchMeterStatus",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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".
*/
watchObsolete(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchObsolete",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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().
*/
watchRelationUnits(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchRelationUnits",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config.
*/
watchSecretRevisionsExpiryChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchSecretRevisionsExpiryChanges",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config.
*/
watchSecretsRotationChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchSecretsRotationChanges",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchStorageAttachments creates watchers for a collection of storage
attachments, each of which can be used to watch changes to storage
attachment info.
*/
watchStorageAttachments(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchStorageAttachments",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
watchTrustConfigSettingsHash(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchTrustConfigSettingsHash",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
watchUnitAddressesHash(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchUnitAddressesHash",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
watchUnitRelations(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchUnitRelations",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
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.
*/
watchUnitStorageAttachments(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchUnitStorageAttachments",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks.
*/
watchUpgradeSeriesNotifications(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WatchUpgradeSeriesNotifications",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WorkloadVersion returns the workload version for all given units or applications.
*/
workloadVersion(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Uniter",
request: "WorkloadVersion",
version: 19,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
UniterV19.NAME = "Uniter";
UniterV19.VERSION = 19;
export default UniterV19;
//# sourceMappingURL=UniterV19.js.map