diff --git a/.gitignore b/.gitignore
index 2cd7e8cde..d07f1d9c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ api/!(test)**/*.js
dist/
.nyc_output/
docs
+.nfs.*
diff --git a/README.md b/README.md
index 9b13d1ba8..8585a8260 100644
--- a/README.md
+++ b/README.md
@@ -112,7 +112,7 @@ Detailed Facade documentation is available as part of the [full API documentatio
| Annotations |
- [AnnotationsV2.ts](/api/facades/annotations/AnnotationsV2.ts)
|
| ApplicationOffers | - [ApplicationOffersV2.ts](/api/facades/application-offers/ApplicationOffersV2.ts)
- [ApplicationOffersV3.ts](/api/facades/application-offers/ApplicationOffersV3.ts)
- [ApplicationOffersV4.ts](/api/facades/application-offers/ApplicationOffersV4.ts)
|
| ApplicationScaler | - [ApplicationScalerV1.ts](/api/facades/application-scaler/ApplicationScalerV1.ts)
|
-| Application | - [ApplicationV12.ts](/api/facades/application/ApplicationV12.ts)
- [ApplicationV13.ts](/api/facades/application/ApplicationV13.ts)
- [ApplicationV14.ts](/api/facades/application/ApplicationV14.ts)
- [ApplicationV15.ts](/api/facades/application/ApplicationV15.ts)
- [ApplicationV18.ts](/api/facades/application/ApplicationV18.ts)
|
+| Application | - [ApplicationV12.ts](/api/facades/application/ApplicationV12.ts)
- [ApplicationV13.ts](/api/facades/application/ApplicationV13.ts)
- [ApplicationV14.ts](/api/facades/application/ApplicationV14.ts)
- [ApplicationV15.ts](/api/facades/application/ApplicationV15.ts)
- [ApplicationV18.ts](/api/facades/application/ApplicationV18.ts)
- [ApplicationV19.ts](/api/facades/application/ApplicationV19.ts)
|
| Backups | - [BackupsV2.ts](/api/facades/backups/BackupsV2.ts)
- [BackupsV3.ts](/api/facades/backups/BackupsV3.ts)
|
| Block | - [BlockV2.ts](/api/facades/block/BlockV2.ts)
|
| Bundle | - [BundleV1.ts](/api/facades/bundle/BundleV1.ts)
- [BundleV4.ts](/api/facades/bundle/BundleV4.ts)
- [BundleV5.ts](/api/facades/bundle/BundleV5.ts)
- [BundleV6.ts](/api/facades/bundle/BundleV6.ts)
|
@@ -132,9 +132,9 @@ Detailed Facade documentation is available as part of the [full API documentatio
| CharmDownloader | - [CharmDownloaderV1.ts](/api/facades/charm-downloader/CharmDownloaderV1.ts)
|
| CharmHub | - [CharmHubV1.ts](/api/facades/charm-hub/CharmHubV1.ts)
|
| CharmRevisionUpdater | - [CharmRevisionUpdaterV2.ts](/api/facades/charm-revision-updater/CharmRevisionUpdaterV2.ts)
|
-| Charms | - [CharmsV2.ts](/api/facades/charms/CharmsV2.ts)
- [CharmsV4.ts](/api/facades/charms/CharmsV4.ts)
- [CharmsV5.ts](/api/facades/charms/CharmsV5.ts)
- [CharmsV6.ts](/api/facades/charms/CharmsV6.ts)
|
+| Charms | - [CharmsV2.ts](/api/facades/charms/CharmsV2.ts)
- [CharmsV4.ts](/api/facades/charms/CharmsV4.ts)
- [CharmsV5.ts](/api/facades/charms/CharmsV5.ts)
- [CharmsV6.ts](/api/facades/charms/CharmsV6.ts)
- [CharmsV7.ts](/api/facades/charms/CharmsV7.ts)
|
| Cleaner | - [CleanerV2.ts](/api/facades/cleaner/CleanerV2.ts)
|
-| Client | - [ClientV2.ts](/api/facades/client/ClientV2.ts)
- [ClientV3.ts](/api/facades/client/ClientV3.ts)
- [ClientV5.ts](/api/facades/client/ClientV5.ts)
- [ClientV6.ts](/api/facades/client/ClientV6.ts)
|
+| Client | - [ClientV2.ts](/api/facades/client/ClientV2.ts)
- [ClientV3.ts](/api/facades/client/ClientV3.ts)
- [ClientV5.ts](/api/facades/client/ClientV5.ts)
- [ClientV6.ts](/api/facades/client/ClientV6.ts)
- [ClientV7.ts](/api/facades/client/ClientV7.ts)
|
| Cloud | - [CloudV1.ts](/api/facades/cloud/CloudV1.ts)
- [CloudV2.ts](/api/facades/cloud/CloudV2.ts)
- [CloudV3.ts](/api/facades/cloud/CloudV3.ts)
- [CloudV4.ts](/api/facades/cloud/CloudV4.ts)
- [CloudV5.ts](/api/facades/cloud/CloudV5.ts)
- [CloudV7.ts](/api/facades/cloud/CloudV7.ts)
|
| Controller | - [ControllerV11.ts](/api/facades/controller/ControllerV11.ts)
- [ControllerV3.ts](/api/facades/controller/ControllerV3.ts)
- [ControllerV4.ts](/api/facades/controller/ControllerV4.ts)
- [ControllerV5.ts](/api/facades/controller/ControllerV5.ts)
- [ControllerV6.ts](/api/facades/controller/ControllerV6.ts)
- [ControllerV7.ts](/api/facades/controller/ControllerV7.ts)
- [ControllerV8.ts](/api/facades/controller/ControllerV8.ts)
- [ControllerV9.ts](/api/facades/controller/ControllerV9.ts)
|
| CredentialManager | - [CredentialManagerV1.ts](/api/facades/credential-manager/CredentialManagerV1.ts)
|
@@ -176,7 +176,7 @@ Detailed Facade documentation is available as part of the [full API documentatio
| MigrationMaster | - [MigrationMasterV2.ts](/api/facades/migration-master/MigrationMasterV2.ts)
- [MigrationMasterV3.ts](/api/facades/migration-master/MigrationMasterV3.ts)
|
| MigrationMinion | - [MigrationMinionV1.ts](/api/facades/migration-minion/MigrationMinionV1.ts)
|
| MigrationStatusWatcher | - [MigrationStatusWatcherV1.ts](/api/facades/migration-status-watcher/MigrationStatusWatcherV1.ts)
|
-| MigrationTarget | - [MigrationTargetV1.ts](/api/facades/migration-target/MigrationTargetV1.ts)
- [MigrationTargetV2.ts](/api/facades/migration-target/MigrationTargetV2.ts)
|
+| MigrationTarget | - [MigrationTargetV1.ts](/api/facades/migration-target/MigrationTargetV1.ts)
- [MigrationTargetV2.ts](/api/facades/migration-target/MigrationTargetV2.ts)
- [MigrationTargetV3.ts](/api/facades/migration-target/MigrationTargetV3.ts)
|
| ModelConfig | - [ModelConfigV2.ts](/api/facades/model-config/ModelConfigV2.ts)
- [ModelConfigV3.ts](/api/facades/model-config/ModelConfigV3.ts)
|
| ModelGeneration | - [ModelGenerationV4.ts](/api/facades/model-generation/ModelGenerationV4.ts)
|
| ModelManager | - [ModelManagerV2.ts](/api/facades/model-manager/ModelManagerV2.ts)
- [ModelManagerV3.ts](/api/facades/model-manager/ModelManagerV3.ts)
- [ModelManagerV4.ts](/api/facades/model-manager/ModelManagerV4.ts)
- [ModelManagerV5.ts](/api/facades/model-manager/ModelManagerV5.ts)
- [ModelManagerV8.ts](/api/facades/model-manager/ModelManagerV8.ts)
- [ModelManagerV9.ts](/api/facades/model-manager/ModelManagerV9.ts)
|
@@ -207,7 +207,7 @@ Detailed Facade documentation is available as part of the [full API documentatio
| SecretsRevisionWatcher | - [SecretsRevisionWatcherV1.ts](/api/facades/secrets-revision-watcher/SecretsRevisionWatcherV1.ts)
|
| SecretsRotationWatcher | - [SecretsRotationWatcherV1.ts](/api/facades/secrets-rotation-watcher/SecretsRotationWatcherV1.ts)
|
| SecretsTriggerWatcher | - [SecretsTriggerWatcherV1.ts](/api/facades/secrets-trigger-watcher/SecretsTriggerWatcherV1.ts)
|
-| Secrets | - [SecretsV1.ts](/api/facades/secrets/SecretsV1.ts)
|
+| Secrets | - [SecretsV1.ts](/api/facades/secrets/SecretsV1.ts)
- [SecretsV2.ts](/api/facades/secrets/SecretsV2.ts)
|
| Singular | - [SingularV2.ts](/api/facades/singular/SingularV2.ts)
|
| Spaces | - [SpacesV6.ts](/api/facades/spaces/SpacesV6.ts)
|
| SSHClient | - [SSHClientV2.ts](/api/facades/sshclient/SSHClientV2.ts)
- [SSHClientV3.ts](/api/facades/sshclient/SSHClientV3.ts)
- [SSHClientV4.ts](/api/facades/sshclient/SSHClientV4.ts)
|
@@ -218,11 +218,13 @@ Detailed Facade documentation is available as part of the [full API documentatio
| Subnets | - [SubnetsV4.ts](/api/facades/subnets/SubnetsV4.ts)
- [SubnetsV5.ts](/api/facades/subnets/SubnetsV5.ts)
|
| Undertaker | - [UndertakerV1.ts](/api/facades/undertaker/UndertakerV1.ts)
|
| UnitAssigner | - [UnitAssignerV1.ts](/api/facades/unit-assigner/UnitAssignerV1.ts)
|
-| Uniter | - [UniterV16.ts](/api/facades/uniter/UniterV16.ts)
- [UniterV18.ts](/api/facades/uniter/UniterV18.ts)
|
+| Uniter | - [UniterV16.ts](/api/facades/uniter/UniterV16.ts)
- [UniterV18.ts](/api/facades/uniter/UniterV18.ts)
- [UniterV19.ts](/api/facades/uniter/UniterV19.ts)
|
| UpgradeSeries | - [UpgradeSeriesV3.ts](/api/facades/upgrade-series/UpgradeSeriesV3.ts)
|
| UpgradeSteps | - [UpgradeStepsV2.ts](/api/facades/upgrade-steps/UpgradeStepsV2.ts)
|
| Upgrader | - [UpgraderV1.ts](/api/facades/upgrader/UpgraderV1.ts)
|
| UserManager | - [UserManagerV1.ts](/api/facades/user-manager/UserManagerV1.ts)
- [UserManagerV2.ts](/api/facades/user-manager/UserManagerV2.ts)
- [UserManagerV3.ts](/api/facades/user-manager/UserManagerV3.ts)
|
+| UserSecretsDrain | - [UserSecretsDrainV1.ts](/api/facades/user-secrets-drain/UserSecretsDrainV1.ts)
|
+| UserSecretsManager | - [UserSecretsManagerV1.ts](/api/facades/user-secrets-manager/UserSecretsManagerV1.ts)
|
| VolumeAttachmentPlansWatcher | - [VolumeAttachmentPlansWatcherV1.ts](/api/facades/volume-attachment-plans-watcher/VolumeAttachmentPlansWatcherV1.ts)
|
| VolumeAttachmentsWatcher | - [VolumeAttachmentsWatcherV2.ts](/api/facades/volume-attachments-watcher/VolumeAttachmentsWatcherV2.ts)
|
diff --git a/api/client.ts b/api/client.ts
index 1d0d93805..9bf16a286 100644
--- a/api/client.ts
+++ b/api/client.ts
@@ -30,7 +30,7 @@ import {
} from "./types.js";
import { createAsyncHandler } from "./utils.js";
-export const CLIENT_VERSION = "3.2.1";
+export const CLIENT_VERSION = "3.3.2";
export interface ConnectOptions {
bakery?: Bakery | null;
@@ -271,7 +271,7 @@ class Client {
"user-data": "",
};
const url = this._transport._ws.url;
- const origin = new URL(url).origin;
+ const origin = url;
if (credentials.username && credentials.password) {
args.credentials = credentials.password;
@@ -540,7 +540,7 @@ class Connection {
const clientRequestedFacades = facades.reduce(
(facadeVersions: { [k: string]: FacadeClassList }, current) => {
if ("versions" in current) {
- // generic facade, where we won't the best version
+ // generic facade, where we want the best version
if (!facadeVersions[current.name]) facadeVersions[current.name] = [];
facadeVersions[current.name].push(...current.versions);
} else {
diff --git a/api/facades/application/ApplicationV19.ts b/api/facades/application/ApplicationV19.ts
new file mode 100644
index 000000000..d6ed1f42a
--- /dev/null
+++ b/api/facades/application/ApplicationV19.ts
@@ -0,0 +1,1125 @@
+/**
+ Juju Application 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.2 at the git SHA 65fa4c1ee5.
+ Do not manually edit this file.
+*/
+
+import type { JujuRequest } from "../../../generator/interfaces.js";
+import { ConnectionInfo, Transport } from "../../client.js";
+import { Facade } from "../../types.js";
+import { autoBind } from "../../utils.js";
+
+export interface AddApplicationUnits {
+ application: string;
+ "attach-storage"?: string[];
+ "num-units": number;
+ placement: Placement[];
+ policy?: string;
+}
+
+export interface AddApplicationUnitsResults {
+ units: string[];
+}
+
+export interface AddRelation {
+ endpoints: string[];
+ "via-cidrs"?: string[];
+}
+
+export interface AddRelationResults {
+ endpoints: Record;
+}
+
+export interface ApplicationCharmRelations {
+ application: string;
+}
+
+export interface ApplicationCharmRelationsResults {
+ "charm-relations": string[];
+}
+
+export interface ApplicationConfigUnsetArgs {
+ Args: ApplicationUnset[];
+}
+
+export interface ApplicationConstraint {
+ constraints: Value;
+ error?: Error;
+}
+
+export interface ApplicationDeploy {
+ Force: boolean;
+ application: string;
+ "attach-storage"?: string[];
+ channel: string;
+ "charm-origin"?: CharmOrigin;
+ "charm-url": string;
+ config?: Record;
+ "config-yaml": string;
+ constraints: Value;
+ devices?: Record;
+ "endpoint-bindings"?: Record;
+ "num-units": number;
+ placement?: Placement[];
+ policy?: string;
+ resources?: Record;
+ storage?: Record;
+}
+
+export interface ApplicationExpose {
+ application: string;
+ "exposed-endpoints"?: Record;
+}
+
+export interface ApplicationGet {
+ application: string;
+ branch: string;
+}
+
+export interface ApplicationGetArgs {
+ args: ApplicationGet[];
+}
+
+export interface ApplicationGetConfigResults {
+ Results: ConfigResult[];
+}
+
+export interface ApplicationGetConstraintsResults {
+ results: ApplicationConstraint[];
+}
+
+export interface ApplicationGetResults {
+ application: string;
+ "application-config"?: AdditionalProperties;
+ base: Base;
+ channel: string;
+ charm: string;
+ config: AdditionalProperties;
+ constraints: Value;
+ "endpoint-bindings"?: Record;
+}
+
+export interface ApplicationInfoResult {
+ error: Error;
+ result: ApplicationResult;
+}
+
+export interface ApplicationInfoResults {
+ results: ApplicationInfoResult[];
+}
+
+export interface ApplicationMergeBindings {
+ "application-tag": string;
+ bindings: Record;
+ force: boolean;
+}
+
+export interface ApplicationMergeBindingsArgs {
+ args: ApplicationMergeBindings[];
+}
+
+export interface ApplicationMetricCredential {
+ application: string;
+ "metrics-credentials": number[];
+}
+
+export interface ApplicationMetricCredentials {
+ creds: ApplicationMetricCredential[];
+}
+
+export interface ApplicationOfferDetails {
+ "application-description": string;
+ bindings?: Record;
+ endpoints?: RemoteEndpoint[];
+ "offer-name": string;
+ "offer-url": string;
+ "offer-uuid": string;
+ "source-model-tag": string;
+ spaces?: RemoteSpace[];
+ users?: OfferUserDetails[];
+}
+
+export interface ApplicationResult {
+ base?: Base;
+ channel?: string;
+ charm?: string;
+ constraints?: Value;
+ "endpoint-bindings"?: Record;
+ exposed: boolean;
+ "exposed-endpoints"?: Record;
+ life: string;
+ principal: boolean;
+ remote: boolean;
+ tag: string;
+}
+
+export interface ApplicationSetCharm {
+ application: string;
+ channel: string;
+ "charm-origin"?: CharmOrigin;
+ "charm-url": string;
+ "config-settings"?: Record;
+ "config-settings-yaml"?: string;
+ "endpoint-bindings"?: Record;
+ force: boolean;
+ "force-base": boolean;
+ "force-units": boolean;
+ generation: string;
+ "resource-ids"?: Record;
+ "storage-constraints"?: Record;
+}
+
+export interface ApplicationUnexpose {
+ application: string;
+ "exposed-endpoints": string[];
+}
+
+export interface ApplicationUnset {
+ application: string;
+ branch: string;
+ options: string[];
+}
+
+export interface ApplicationsDeploy {
+ applications: ApplicationDeploy[];
+}
+
+export interface Base {
+ channel: string;
+ name: string;
+}
+
+export interface CharmOrigin {
+ architecture?: string;
+ base?: Base;
+ branch?: string;
+ hash?: string;
+ id: string;
+ "instance-key"?: string;
+ revision?: number;
+ risk?: string;
+ source: string;
+ track?: string;
+ type: string;
+}
+
+export interface CharmRelation {
+ interface: string;
+ limit: number;
+ name: string;
+ optional: boolean;
+ role: string;
+ scope: string;
+}
+
+export interface CharmURLOriginResult {
+ "charm-origin": CharmOrigin;
+ error?: Error;
+ url: string;
+}
+
+export interface ConfigResult {
+ config: AdditionalProperties;
+ error?: Error;
+}
+
+export interface ConfigSet {
+ application: string;
+ config: Record;
+ "config-yaml": string;
+ generation: string;
+}
+
+export interface ConfigSetArgs {
+ Args: ConfigSet[];
+}
+
+export interface Constraints {
+ Count: number;
+ Pool: string;
+ Size: number;
+}
+
+export interface ConsumeApplicationArg {
+ ApplicationOfferDetails: ApplicationOfferDetails;
+ "application-alias"?: string;
+ "application-description": string;
+ bindings?: Record;
+ endpoints?: RemoteEndpoint[];
+ "external-controller"?: ExternalControllerInfo;
+ macaroon?: Macaroon;
+ "offer-name": string;
+ "offer-url": string;
+ "offer-uuid": string;
+ "source-model-tag": string;
+ spaces?: RemoteSpace[];
+ users?: OfferUserDetails[];
+}
+
+export interface ConsumeApplicationArgs {
+ args: ConsumeApplicationArg[];
+}
+
+export interface DeployFromRepositoryArg {
+ ApplicationName: string;
+ AttachStorage: string[];
+ CharmName: string;
+ ConfigYAML: string;
+ Cons: Value;
+ Devices: Record;
+ DryRun: boolean;
+ Placement: Placement[];
+ Storage: Record;
+ Trust: boolean;
+ base?: Base;
+ channel?: string;
+ "endpoint-bindings"?: Record;
+ force?: boolean;
+ "num-units"?: number;
+ resources?: Record;
+ revision?: number;
+}
+
+export interface DeployFromRepositoryArgs {
+ Args: DeployFromRepositoryArg[];
+}
+
+export interface DeployFromRepositoryInfo {
+ architecture: string;
+ base?: Base;
+ channel: string;
+ "effective-channel"?: string;
+ name: string;
+ revision: number;
+}
+
+export interface DeployFromRepositoryResult {
+ Errors: Error[];
+ Info: DeployFromRepositoryInfo;
+ PendingResourceUploads: PendingResourceUpload[];
+}
+
+export interface DeployFromRepositoryResults {
+ Results: DeployFromRepositoryResult[];
+}
+
+export interface DestroyApplicationInfo {
+ "destroyed-storage": Entity[];
+ "destroyed-units": Entity[];
+ "detached-storage": Entity[];
+}
+
+export interface DestroyApplicationParams {
+ "application-tag": string;
+ "destroy-storage"?: boolean;
+ "dry-run"?: boolean;
+ force: boolean;
+ "max-wait"?: number;
+}
+
+export interface DestroyApplicationResult {
+ error: Error;
+ info: DestroyApplicationInfo;
+}
+
+export interface DestroyApplicationResults {
+ results: DestroyApplicationResult[];
+}
+
+export interface DestroyApplicationsParams {
+ applications: DestroyApplicationParams[];
+}
+
+export interface DestroyConsumedApplicationParams {
+ "application-tag": string;
+ force?: boolean;
+ "max-wait"?: number;
+}
+
+export interface DestroyConsumedApplicationsParams {
+ applications: DestroyConsumedApplicationParams[];
+}
+
+export interface DestroyRelation {
+ endpoints?: string[];
+ force?: boolean;
+ "max-wait"?: number;
+ "relation-id": number;
+}
+
+export interface DestroyUnitInfo {
+ "destroyed-storage": Entity[];
+ "detached-storage": Entity[];
+}
+
+export interface DestroyUnitParams {
+ "destroy-storage"?: boolean;
+ "dry-run"?: boolean;
+ force?: boolean;
+ "max-wait"?: number;
+ "unit-tag": string;
+}
+
+export interface DestroyUnitResult {
+ error: Error;
+ info: DestroyUnitInfo;
+}
+
+export interface DestroyUnitResults {
+ results: DestroyUnitResult[];
+}
+
+export interface DestroyUnitsParams {
+ units: DestroyUnitParams[];
+}
+
+export interface EndpointRelationData {
+ ApplicationData: AdditionalProperties;
+ "cross-model": boolean;
+ endpoint: string;
+ "related-endpoint": string;
+ "relation-id": number;
+ "unit-relation-data": Record;
+}
+
+export interface Entities {
+ entities: Entity[];
+}
+
+export interface Entity {
+ tag: string;
+}
+
+export interface Error {
+ code: string;
+ info?: AdditionalProperties;
+ message: string;
+}
+
+export interface ErrorResult {
+ error: Error;
+}
+
+export interface ErrorResults {
+ results: ErrorResult[];
+}
+
+export interface ExposedEndpoint {
+ "expose-to-cidrs": string[];
+ "expose-to-spaces": string[];
+}
+
+export interface ExternalControllerInfo {
+ addrs: string[];
+ "ca-cert": string;
+ "controller-alias": string;
+ "controller-tag": string;
+}
+
+export interface Macaroon {
+ [key: string]: AdditionalProperties;
+}
+
+export interface OfferUserDetails {
+ access: string;
+ "display-name": string;
+ user: string;
+}
+
+export interface PendingResourceUpload {
+ Filename: string;
+ Name: string;
+ Type: string;
+}
+
+export interface Placement {
+ directive: string;
+ scope: string;
+}
+
+export interface RelationData {
+ InScope: boolean;
+ UnitData: AdditionalProperties;
+}
+
+export interface RelationSuspendedArg {
+ message: string;
+ "relation-id": number;
+ suspended: boolean;
+}
+
+export interface RelationSuspendedArgs {
+ args: RelationSuspendedArg[];
+}
+
+export interface RemoteEndpoint {
+ interface: string;
+ limit: number;
+ name: string;
+ role: string;
+}
+
+export interface RemoteSpace {
+ "cloud-type": string;
+ name: string;
+ "provider-attributes": AdditionalProperties;
+ "provider-id": string;
+ subnets: Subnet[];
+}
+
+export interface ScaleApplicationInfo {
+ "num-units": number;
+}
+
+export interface ScaleApplicationParams {
+ "application-tag": string;
+ force: boolean;
+ scale: number;
+ "scale-change"?: number;
+}
+
+export interface ScaleApplicationResult {
+ error: Error;
+ info: ScaleApplicationInfo;
+}
+
+export interface ScaleApplicationResults {
+ results: ScaleApplicationResult[];
+}
+
+export interface ScaleApplicationsParams {
+ applications: ScaleApplicationParams[];
+}
+
+export interface SetConstraints {
+ application: string;
+ constraints: Value;
+}
+
+export interface StorageConstraints {
+ count: number;
+ pool: string;
+ size: number;
+}
+
+export interface StringResult {
+ error?: Error;
+ result: string;
+}
+
+export interface Subnet {
+ cidr: string;
+ life: string;
+ "provider-id"?: string;
+ "provider-network-id"?: string;
+ "provider-space-id"?: string;
+ "space-tag": string;
+ status?: string;
+ "vlan-tag": number;
+ zones: string[];
+}
+
+export interface UnitInfoResult {
+ error: Error;
+ result: UnitResult;
+}
+
+export interface UnitInfoResults {
+ results: UnitInfoResult[];
+}
+
+export interface UnitResult {
+ address?: string;
+ charm: string;
+ leader?: boolean;
+ life?: string;
+ machine?: string;
+ "opened-ports": string[];
+ "provider-id"?: string;
+ "public-address"?: string;
+ "relation-data"?: EndpointRelationData[];
+ tag: string;
+ "workload-version": string;
+}
+
+export interface UnitsResolved {
+ all: boolean;
+ retry: boolean;
+ tags: Entities;
+}
+
+export interface UpdateChannelArg {
+ channel: string;
+ force: boolean;
+ tag: Entity;
+}
+
+export interface UpdateChannelArgs {
+ args: UpdateChannelArg[];
+}
+
+export interface Value {
+ "allocate-public-ip": boolean;
+ arch: string;
+ container: string;
+ cores: number;
+ "cpu-power": number;
+ "image-id": string;
+ "instance-role": string;
+ "instance-type": string;
+ mem: number;
+ "root-disk": number;
+ "root-disk-source": string;
+ spaces: string[];
+ tags: string[];
+ "virt-type": string;
+ zones: string[];
+}
+
+export interface AdditionalProperties {
+ [key: string]: any;
+}
+
+/**
+ APIv19 provides the Application API facade for version 19.
+*/
+class ApplicationV19 implements Facade {
+ static NAME = "Application";
+ static VERSION = 19;
+
+ NAME = "Application";
+ VERSION = 19;
+
+ _transport: Transport;
+ _info: ConnectionInfo;
+
+ constructor(transport: Transport, info: ConnectionInfo) {
+ this._transport = transport;
+ this._info = info;
+
+ // Automatically bind all methods to instances.
+ autoBind(this);
+ }
+ /**
+ AddRelation adds a relation between the specified endpoints and returns the relation info.
+ */
+ addRelation(params: AddRelation): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "AddRelation",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ AddUnits adds a given number of units to an application.
+ */
+ addUnits(params: AddApplicationUnits): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "AddUnits",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ ApplicationsInfo returns applications information.
+ */
+ applicationsInfo(params: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "ApplicationsInfo",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ CharmConfig returns charm config for the input list of applications and
+ model generations.
+ */
+ charmConfig(
+ params: ApplicationGetArgs
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "CharmConfig",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ CharmRelations implements the server side of Application.CharmRelations.
+ */
+ charmRelations(
+ params: ApplicationCharmRelations
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "CharmRelations",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ Consume adds remote applications to the model without creating any
+ relations.
+ */
+ consume(params: ConsumeApplicationArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "Consume",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ Deploy fetches the charms from the charm store and deploys them
+ using the specified placement directives.
+ */
+ deploy(params: ApplicationsDeploy): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "Deploy",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ DeployFromRepository is a one-stop deployment method for repository
+ charms. Only a charm name is required to deploy. If argument validation
+ fails, a list of all errors found in validation will be returned. If a
+ local resource is provided, details required for uploading the validated
+ resource will be returned.
+ */
+ deployFromRepository(
+ params: DeployFromRepositoryArgs
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "DeployFromRepository",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ DestroyApplication removes a given set of applications.
+ */
+ destroyApplication(
+ params: DestroyApplicationsParams
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "DestroyApplication",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ DestroyConsumedApplications removes a given set of consumed (remote) applications.
+ */
+ destroyConsumedApplications(
+ params: DestroyConsumedApplicationsParams
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "DestroyConsumedApplications",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ DestroyRelation removes the relation between the
+ specified endpoints or an id.
+ */
+ destroyRelation(params: DestroyRelation): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "DestroyRelation",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ DestroyUnit removes a given set of application units.
+ */
+ destroyUnit(params: DestroyUnitsParams): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "DestroyUnit",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ Expose changes the juju-managed firewall to expose any ports that
+ were also explicitly marked by units as open.
+ */
+ expose(params: ApplicationExpose): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "Expose",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ Get returns the charm configuration for an application.
+ */
+ get(params: ApplicationGet): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "Get",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ GetCharmURLOrigin returns the charm URL and charm origin the given
+ application is running at present.
+ */
+ getCharmURLOrigin(params: ApplicationGet): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "GetCharmURLOrigin",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ GetConfig returns the charm config for each of the input applications.
+ */
+ getConfig(params: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "GetConfig",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ GetConstraints returns the constraints for a given application.
+ */
+ getConstraints(params: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "GetConstraints",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ Leader returns the unit name of the leader for the given application.
+ */
+ leader(params: Entity): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "Leader",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ MergeBindings merges operator-defined bindings with the current bindings for
+ one or more applications.
+ */
+ mergeBindings(params: ApplicationMergeBindingsArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "MergeBindings",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ ResolveUnitErrors marks errors on the specified units as resolved.
+ */
+ resolveUnitErrors(params: UnitsResolved): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "ResolveUnitErrors",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ ScaleApplications scales the specified application to the requested number of units.
+ */
+ scaleApplications(
+ params: ScaleApplicationsParams
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "ScaleApplications",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ SetCharm sets the charm for a given for the application.
+ */
+ setCharm(params: ApplicationSetCharm): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "SetCharm",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ SetConfigs implements the server side of Application.SetConfig. Both
+ application and charm config are set. It does not unset values in
+ Config map that are set to an empty string. Unset should be used for that.
+ */
+ setConfigs(params: ConfigSetArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "SetConfigs",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ SetConstraints sets the constraints for a given application.
+ */
+ setConstraints(params: SetConstraints): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "SetConstraints",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ SetMetricCredentials sets credentials on the application.
+ TODO (cderici) only used for metered charms in cmd MeteredDeployAPI,
+ kept for client compatibility, remove in juju 4.0
+ */
+ setMetricCredentials(
+ params: ApplicationMetricCredentials
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "SetMetricCredentials",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ SetRelationsSuspended sets the suspended status of the specified relations.
+ */
+ setRelationsSuspended(params: RelationSuspendedArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "SetRelationsSuspended",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ Unexpose changes the juju-managed firewall to unexpose any ports that
+ were also explicitly marked by units as open.
+ */
+ unexpose(params: ApplicationUnexpose): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "Unexpose",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ UnitsInfo returns unit information for the given entities (units or
+ applications).
+ */
+ unitsInfo(params: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "UnitsInfo",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig.
+ */
+ unsetApplicationsConfig(
+ params: ApplicationConfigUnsetArgs
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "UnsetApplicationsConfig",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ UpdateApplicationBase updates the application base.
+ Base for subordinates is updated too.
+ */
+ updateApplicationBase(params: UpdateChannelArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Application",
+ request: "UpdateApplicationBase",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+}
+
+export default ApplicationV19;
diff --git a/api/facades/application/index.ts b/api/facades/application/index.ts
index 2716eb956..c379b56db 100644
--- a/api/facades/application/index.ts
+++ b/api/facades/application/index.ts
@@ -4,12 +4,14 @@ import ApplicationV13 from "./ApplicationV13.js";
import ApplicationV14 from "./ApplicationV14.js";
import ApplicationV15 from "./ApplicationV15.js";
import ApplicationV18 from "./ApplicationV18.js";
+import ApplicationV19 from "./ApplicationV19.js";
export * as ApplicationV12 from "./ApplicationV12.js";
export * as ApplicationV13 from "./ApplicationV13.js";
export * as ApplicationV14 from "./ApplicationV14.js";
export * as ApplicationV15 from "./ApplicationV15.js";
export * as ApplicationV18 from "./ApplicationV18.js";
+export * as ApplicationV19 from "./ApplicationV19.js";
const Application: GenericFacade = {
name: "Application",
@@ -19,6 +21,7 @@ const Application: GenericFacade = {
ApplicationV14,
ApplicationV15,
ApplicationV18,
+ ApplicationV19,
],
};
diff --git a/api/facades/charms/CharmsV7.ts b/api/facades/charms/CharmsV7.ts
new file mode 100644
index 000000000..1dbfc95af
--- /dev/null
+++ b/api/facades/charms/CharmsV7.ts
@@ -0,0 +1,470 @@
+/**
+ Juju Charms version 7.
+ This facade is available on:
+ Models
+
+ NOTE: This file was generated using the Juju schema
+ from Juju 3.3.2 at the git SHA 65fa4c1ee5.
+ Do not manually edit this file.
+*/
+
+import type { JujuRequest } from "../../../generator/interfaces.js";
+import { ConnectionInfo, Transport } from "../../client.js";
+import { Facade } from "../../types.js";
+import { autoBind } from "../../utils.js";
+
+export interface AddCharmWithOrigin {
+ "charm-origin": CharmOrigin;
+ force: boolean;
+ url: string;
+}
+
+export interface ApplicationCharmPlacement {
+ application: string;
+ "charm-url": string;
+}
+
+export interface ApplicationCharmPlacements {
+ placements: ApplicationCharmPlacement[];
+}
+
+export interface Base {
+ channel: string;
+ name: string;
+}
+
+export interface Charm {
+ actions?: CharmActions;
+ config: Record;
+ "lxd-profile"?: CharmLXDProfile;
+ manifest?: CharmManifest;
+ meta?: CharmMeta;
+ metrics?: CharmMetrics;
+ revision: number;
+ url: string;
+}
+
+export interface CharmActionSpec {
+ description: string;
+ params: AdditionalProperties;
+}
+
+export interface CharmActions {
+ specs: Record;
+}
+
+export interface CharmBase {
+ architectures: string[];
+ channel: string;
+ name: string;
+}
+
+export interface CharmContainer {
+ mounts: CharmMount[];
+ resource: string;
+}
+
+export interface CharmDeployment {
+ "min-version": string;
+ mode: string;
+ service: string;
+ type: string;
+}
+
+export interface CharmDevice {
+ CountMax: number;
+ CountMin: number;
+ Description: string;
+ Name: string;
+ Type: string;
+}
+
+export interface CharmLXDProfile {
+ config: Record;
+ description: string;
+ devices: Record>;
+}
+
+export interface CharmManifest {
+ bases: CharmBase[];
+}
+
+export interface CharmMeta {
+ "assumes-expr"?: ExpressionTree;
+ categories?: string[];
+ containers?: Record;
+ deployment?: CharmDeployment;
+ description: string;
+ devices?: Record;
+ "extra-bindings"?: Record;
+ "min-juju-version"?: string;
+ name: string;
+ "payload-classes"?: Record;
+ peers?: Record;
+ provides?: Record;
+ requires?: Record;
+ resources?: Record;
+ series?: string[];
+ storage?: Record;
+ subordinate: boolean;
+ summary: string;
+ tags?: string[];
+ terms?: string[];
+}
+
+export interface CharmMetric {
+ description: string;
+ type: string;
+}
+
+export interface CharmMetrics {
+ metrics: Record;
+ plan: CharmPlan;
+}
+
+export interface CharmMount {
+ location: string;
+ storage: string;
+}
+
+export interface CharmOption {
+ default?: AdditionalProperties;
+ description?: string;
+ type: string;
+}
+
+export interface CharmOrigin {
+ architecture?: string;
+ base?: Base;
+ branch?: string;
+ hash?: string;
+ id: string;
+ "instance-key"?: string;
+ revision?: number;
+ risk?: string;
+ source: string;
+ track?: string;
+ type: string;
+}
+
+export interface CharmOriginResult {
+ "charm-origin": CharmOrigin;
+ error?: Error;
+}
+
+export interface CharmPayloadClass {
+ name: string;
+ type: string;
+}
+
+export interface CharmPlan {
+ required: boolean;
+}
+
+export interface CharmRelation {
+ interface: string;
+ limit: number;
+ name: string;
+ optional: boolean;
+ role: string;
+ scope: string;
+}
+
+export interface CharmResource {
+ description?: string;
+ fingerprint: number[];
+ name: string;
+ origin: string;
+ path: string;
+ revision: number;
+ size: number;
+ type: string;
+}
+
+export interface CharmResourceMeta {
+ description: string;
+ name: string;
+ path: string;
+ type: string;
+}
+
+export interface CharmResourceResult {
+ CharmResource: CharmResource;
+ ErrorResult: ErrorResult;
+ description?: string;
+ error?: Error;
+ fingerprint: number[];
+ name: string;
+ origin: string;
+ path: string;
+ revision: number;
+ size: number;
+ type: string;
+}
+
+export interface CharmResourcesResults {
+ results: CharmResourceResult[][];
+}
+
+export interface CharmStorage {
+ "count-max": number;
+ "count-min": number;
+ description: string;
+ location?: string;
+ "minimum-size": number;
+ name: string;
+ properties?: string[];
+ "read-only": boolean;
+ shared: boolean;
+ type: string;
+}
+
+export interface CharmURL {
+ url: string;
+}
+
+export interface CharmURLAndOrigin {
+ "charm-origin": CharmOrigin;
+ "charm-url": string;
+ macaroon?: Macaroon;
+}
+
+export interface CharmURLAndOrigins {
+ entities: CharmURLAndOrigin[];
+}
+
+export interface CharmsList {
+ names: string[];
+}
+
+export interface CharmsListResult {
+ "charm-urls": string[];
+}
+
+export interface DownloadInfoResult {
+ "charm-origin": CharmOrigin;
+ url: string;
+}
+
+export interface DownloadInfoResults {
+ results: DownloadInfoResult[];
+}
+
+export interface Error {
+ code: string;
+ info?: AdditionalProperties;
+ message: string;
+}
+
+export interface ErrorResult {
+ error: Error;
+}
+
+export interface ErrorResults {
+ results: ErrorResult[];
+}
+
+export interface ExpressionTree {
+ Expression: AdditionalProperties;
+}
+
+export interface IsMeteredResult {
+ metered: boolean;
+}
+
+export interface Macaroon {
+ [key: string]: AdditionalProperties;
+}
+
+export interface ResolveCharmWithChannel {
+ "charm-origin": CharmOrigin;
+ reference: string;
+ "switch-charm"?: boolean;
+}
+
+export interface ResolveCharmWithChannelResult {
+ "charm-origin": CharmOrigin;
+ error?: Error;
+ "supported-bases": Base[];
+ url: string;
+}
+
+export interface ResolveCharmWithChannelResults {
+ Results: ResolveCharmWithChannelResult[];
+}
+
+export interface ResolveCharmsWithChannel {
+ macaroon?: Macaroon;
+ resolve: ResolveCharmWithChannel[];
+}
+
+export interface AdditionalProperties {
+ [key: string]: any;
+}
+
+/**
+ APIv7 provides the Charms API facade for version 7.
+ v7 guarantees SupportedBases will be provided in ResolveCharms
+*/
+class CharmsV7 implements Facade {
+ static NAME = "Charms";
+ static VERSION = 7;
+
+ NAME = "Charms";
+ VERSION = 7;
+
+ _transport: Transport;
+ _info: ConnectionInfo;
+
+ constructor(transport: Transport, info: ConnectionInfo) {
+ this._transport = transport;
+ this._info = info;
+
+ // Automatically bind all methods to instances.
+ autoBind(this);
+ }
+ /**
+ AddCharm adds the given charm URL (which must include revision) to the
+ environment, if it does not exist yet. Local charms are not supported,
+ only charm store and charm hub URLs. See also AddLocalCharm().
+ */
+ addCharm(params: AddCharmWithOrigin): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Charms",
+ request: "AddCharm",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ CharmInfo returns information about the requested charm.
+ */
+ charmInfo(params: CharmURL): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Charms",
+ request: "CharmInfo",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ CheckCharmPlacement checks if a charm is allowed to be placed with in a
+ given application.
+ */
+ checkCharmPlacement(
+ params: ApplicationCharmPlacements
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Charms",
+ request: "CheckCharmPlacement",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ GetDownloadInfos attempts to get the bundle corresponding to the charm url
+ and origin.
+ */
+ getDownloadInfos(params: CharmURLAndOrigins): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Charms",
+ request: "GetDownloadInfos",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ IsMetered returns whether or not the charm is metered.
+ TODO (cderici) only used for metered charms in cmd MeteredDeployAPI,
+ kept for client compatibility, remove in juju 4.0
+ */
+ isMetered(params: CharmURL): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Charms",
+ request: "IsMetered",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ List returns a list of charm URLs currently in the state.
+ If supplied parameter contains any names, the result will
+ be filtered to return only the charms with supplied names.
+ */
+ list(params: CharmsList): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Charms",
+ request: "List",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ ListCharmResources returns a series of resources for a given charm.
+ */
+ listCharmResources(
+ params: CharmURLAndOrigins
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Charms",
+ request: "ListCharmResources",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ ResolveCharms resolves the given charm URLs with an optionally specified
+ preferred channel. Channel provided via CharmOrigin.
+ */
+ resolveCharms(
+ params: ResolveCharmsWithChannel
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Charms",
+ request: "ResolveCharms",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+}
+
+export default CharmsV7;
diff --git a/api/facades/charms/index.ts b/api/facades/charms/index.ts
index 31832caa2..d44a45ba5 100644
--- a/api/facades/charms/index.ts
+++ b/api/facades/charms/index.ts
@@ -3,15 +3,17 @@ import CharmsV2 from "./CharmsV2.js";
import CharmsV4 from "./CharmsV4.js";
import CharmsV5 from "./CharmsV5.js";
import CharmsV6 from "./CharmsV6.js";
+import CharmsV7 from "./CharmsV7.js";
export * as CharmsV2 from "./CharmsV2.js";
export * as CharmsV4 from "./CharmsV4.js";
export * as CharmsV5 from "./CharmsV5.js";
export * as CharmsV6 from "./CharmsV6.js";
+export * as CharmsV7 from "./CharmsV7.js";
const Charms: GenericFacade = {
name: "Charms",
- versions: [CharmsV2, CharmsV4, CharmsV5, CharmsV6],
+ versions: [CharmsV2, CharmsV4, CharmsV5, CharmsV6, CharmsV7],
};
export default Charms;
diff --git a/api/facades/client/ClientV7.ts b/api/facades/client/ClientV7.ts
new file mode 100644
index 000000000..7ef17c669
--- /dev/null
+++ b/api/facades/client/ClientV7.ts
@@ -0,0 +1,466 @@
+/**
+ Juju Client version 7.
+ 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.2 at the git SHA 65fa4c1ee5.
+ Do not manually edit this file.
+*/
+
+import type { JujuRequest } from "../../../generator/interfaces.js";
+import { ConnectionInfo, Transport } from "../../client.js";
+import { Facade } from "../../types.js";
+import { autoBind } from "../../utils.js";
+
+export interface AllWatcherId {
+ "watcher-id": string;
+}
+
+export interface ApplicationOfferStatus {
+ "active-connected-count": number;
+ "application-name": string;
+ charm: string;
+ endpoints: Record;
+ err?: Error;
+ "offer-name": string;
+ "total-connected-count": number;
+}
+
+export interface ApplicationStatus {
+ base: Base;
+ "can-upgrade-to": string;
+ charm: string;
+ "charm-channel"?: string;
+ "charm-profile": string;
+ "charm-version": string;
+ "endpoint-bindings": Record;
+ err?: Error;
+ exposed: boolean;
+ "exposed-endpoints"?: Record;
+ int?: number;
+ life: string;
+ "meter-statuses": Record;
+ "provider-id"?: string;
+ "public-address": string;
+ relations: Record;
+ status: DetailedStatus;
+ "subordinate-to": string[];
+ units: Record;
+ "workload-version": string;
+}
+
+export interface Base {
+ channel: string;
+ name: string;
+}
+
+export interface Binary {
+ Arch: string;
+ Build: number;
+ Major: number;
+ Minor: number;
+ Number: Number;
+ Patch: number;
+ Release: string;
+ Tag: string;
+}
+
+export interface BranchStatus {
+ "assigned-units": Record;
+ created: number;
+ "created-by": string;
+}
+
+export interface DetailedStatus {
+ data: AdditionalProperties;
+ err?: Error;
+ info: string;
+ kind: string;
+ life: string;
+ since: string;
+ status: string;
+ version: string;
+}
+
+export interface EndpointStatus {
+ application: string;
+ name: string;
+ role: string;
+ subordinate: boolean;
+}
+
+export interface EntityStatus {
+ data?: AdditionalProperties;
+ info: string;
+ since: string;
+ status: string;
+}
+
+export interface Error {
+ code: string;
+ info?: AdditionalProperties;
+ message: string;
+}
+
+export interface ExposedEndpoint {
+ "expose-to-cidrs": string[];
+ "expose-to-spaces": string[];
+}
+
+export interface FilesystemAttachmentDetails {
+ FilesystemAttachmentInfo: FilesystemAttachmentInfo;
+ life?: string;
+ "mount-point"?: string;
+ "read-only"?: boolean;
+}
+
+export interface FilesystemAttachmentInfo {
+ "mount-point": string;
+ "read-only": boolean;
+}
+
+export interface FilesystemDetails {
+ "filesystem-tag": string;
+ info: FilesystemInfo;
+ life?: string;
+ "machine-attachments"?: Record;
+ status: EntityStatus;
+ storage?: StorageDetails;
+ "unit-attachments"?: Record;
+ "volume-tag"?: string;
+}
+
+export interface FilesystemInfo {
+ "filesystem-id": string;
+ pool: string;
+ size: number;
+}
+
+export interface FindToolsParams {
+ agentstream: string;
+ arch: string;
+ major: number;
+ number: Number;
+ "os-type": string;
+}
+
+export interface FindToolsResult {
+ error?: Error;
+ list: Tools[];
+}
+
+export interface FullStatus {
+ applications: Record;
+ branches: Record;
+ "controller-timestamp": string;
+ filesystems?: FilesystemDetails[];
+ machines: Record;
+ model: ModelStatusInfo;
+ offers: Record;
+ relations: RelationStatus[];
+ "remote-applications": Record;
+ storage?: StorageDetails[];
+ volumes?: VolumeDetails[];
+}
+
+export interface History {
+ error?: Error;
+ statuses: DetailedStatus[];
+}
+
+export interface LXDProfile {
+ config: Record;
+ description: string;
+ devices: Record>;
+}
+
+export interface MachineStatus {
+ "agent-status": DetailedStatus;
+ base: Base;
+ constraints: string;
+ containers: Record;
+ "display-name": string;
+ "dns-name": string;
+ hardware: string;
+ "has-vote": boolean;
+ hostname?: string;
+ id: string;
+ "instance-id": string;
+ "instance-status": DetailedStatus;
+ "ip-addresses"?: string[];
+ jobs: string[];
+ "lxd-profiles"?: Record;
+ "modification-status": DetailedStatus;
+ "network-interfaces"?: Record;
+ "primary-controller-machine"?: boolean;
+ "wants-vote": boolean;
+}
+
+export interface MeterStatus {
+ color: string;
+ message: string;
+}
+
+export interface ModelStatusInfo {
+ "available-version": string;
+ "cloud-tag": string;
+ "meter-status": MeterStatus;
+ "model-status": DetailedStatus;
+ name: string;
+ region?: string;
+ sla: string;
+ type: string;
+ version: string;
+}
+
+export interface NetworkInterface {
+ "dns-nameservers"?: string[];
+ gateway?: string;
+ "ip-addresses": string[];
+ "is-up": boolean;
+ "mac-address": string;
+ space?: string;
+}
+
+export interface Number {
+ Build: number;
+ Major: number;
+ Minor: number;
+ Patch: number;
+ Tag: string;
+}
+
+export interface RelationStatus {
+ endpoints: EndpointStatus[];
+ id: number;
+ interface: string;
+ key: string;
+ scope: string;
+ status: DetailedStatus;
+}
+
+export interface RemoteApplicationStatus {
+ endpoints: RemoteEndpoint[];
+ err?: Error;
+ life: string;
+ "offer-name": string;
+ "offer-url": string;
+ relations: Record;
+ status: DetailedStatus;
+}
+
+export interface RemoteEndpoint {
+ interface: string;
+ limit: number;
+ name: string;
+ role: string;
+}
+
+export interface StatusHistoryFilter {
+ date: string;
+ delta: number;
+ exclude: string[];
+ size: number;
+}
+
+export interface StatusHistoryRequest {
+ filter: StatusHistoryFilter;
+ historyKind: string;
+ size: number;
+ tag: string;
+}
+
+export interface StatusHistoryRequests {
+ requests: StatusHistoryRequest[];
+}
+
+export interface StatusHistoryResult {
+ error?: Error;
+ history: History;
+}
+
+export interface StatusHistoryResults {
+ results: StatusHistoryResult[];
+}
+
+export interface StatusParams {
+ "include-storage"?: boolean;
+ patterns: string[];
+}
+
+export interface StorageAttachmentDetails {
+ life?: string;
+ location?: string;
+ "machine-tag": string;
+ "storage-tag": string;
+ "unit-tag": string;
+}
+
+export interface StorageDetails {
+ attachments?: Record;
+ kind: number;
+ life?: string;
+ "owner-tag": string;
+ persistent: boolean;
+ status: EntityStatus;
+ "storage-tag": string;
+}
+
+export interface Tools {
+ sha256?: string;
+ size: number;
+ url: string;
+ version: Binary;
+}
+
+export interface UnitStatus {
+ address?: string;
+ "agent-status": DetailedStatus;
+ charm: string;
+ leader?: boolean;
+ machine: string;
+ "opened-ports": string[];
+ "provider-id"?: string;
+ "public-address": string;
+ subordinates: Record;
+ "workload-status": DetailedStatus;
+ "workload-version": string;
+}
+
+export interface VolumeAttachmentDetails {
+ VolumeAttachmentInfo: VolumeAttachmentInfo;
+ "bus-address"?: string;
+ "device-link"?: string;
+ "device-name"?: string;
+ life?: string;
+ "plan-info"?: VolumeAttachmentPlanInfo;
+ "read-only"?: boolean;
+}
+
+export interface VolumeAttachmentInfo {
+ "bus-address": string;
+ "device-link": string;
+ "device-name": string;
+ "plan-info": VolumeAttachmentPlanInfo;
+ "read-only": boolean;
+}
+
+export interface VolumeAttachmentPlanInfo {
+ "device-attributes": Record;
+ "device-type": string;
+}
+
+export interface VolumeDetails {
+ info: VolumeInfo;
+ life?: string;
+ "machine-attachments"?: Record;
+ status: EntityStatus;
+ storage?: StorageDetails;
+ "unit-attachments"?: Record;
+ "volume-tag": string;
+}
+
+export interface VolumeInfo {
+ "hardware-id"?: string;
+ persistent: boolean;
+ pool?: string;
+ size: number;
+ "volume-id": string;
+ wwn?: string;
+}
+
+export interface AdditionalProperties {
+ [key: string]: any;
+}
+
+/**
+ Client serves client-specific API methods.
+*/
+class ClientV7 implements Facade {
+ static NAME = "Client";
+ static VERSION = 7;
+
+ NAME = "Client";
+ VERSION = 7;
+
+ _transport: Transport;
+ _info: ConnectionInfo;
+
+ constructor(transport: Transport, info: ConnectionInfo) {
+ this._transport = transport;
+ this._info = info;
+
+ // Automatically bind all methods to instances.
+ autoBind(this);
+ }
+ /**
+ FindTools returns a List containing all tools matching the given parameters.
+ TODO(juju 3.1) - remove, used by 2.9 client only
+ */
+ findTools(params: FindToolsParams): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Client",
+ request: "FindTools",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ FullStatus gives the information needed for juju status over the api
+ */
+ fullStatus(params: StatusParams): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Client",
+ request: "FullStatus",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ StatusHistory returns a slice of past statuses for several entities.
+ */
+ statusHistory(params: StatusHistoryRequests): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Client",
+ request: "StatusHistory",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ WatchAll initiates a watcher for entities in the connected model.
+ */
+ watchAll(params: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Client",
+ request: "WatchAll",
+ version: 7,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+}
+
+export default ClientV7;
diff --git a/api/facades/client/index.ts b/api/facades/client/index.ts
index 09b7f14f5..712a60bcb 100644
--- a/api/facades/client/index.ts
+++ b/api/facades/client/index.ts
@@ -3,15 +3,17 @@ import ClientV2 from "./ClientV2.js";
import ClientV3 from "./ClientV3.js";
import ClientV5 from "./ClientV5.js";
import ClientV6 from "./ClientV6.js";
+import ClientV7 from "./ClientV7.js";
export * as ClientV2 from "./ClientV2.js";
export * as ClientV3 from "./ClientV3.js";
export * as ClientV5 from "./ClientV5.js";
export * as ClientV6 from "./ClientV6.js";
+export * as ClientV7 from "./ClientV7.js";
const Client: GenericFacade = {
name: "Client",
- versions: [ClientV2, ClientV3, ClientV5, ClientV6],
+ versions: [ClientV2, ClientV3, ClientV5, ClientV6, ClientV7],
};
export default Client;
diff --git a/api/facades/migration-target/MigrationTargetV3.ts b/api/facades/migration-target/MigrationTargetV3.ts
new file mode 100644
index 000000000..e27fab164
--- /dev/null
+++ b/api/facades/migration-target/MigrationTargetV3.ts
@@ -0,0 +1,281 @@
+/**
+ Juju MigrationTarget version 3.
+ This facade is available on:
+ Controllers
+
+ NOTE: This file was generated using the Juju schema
+ from Juju 3.3.2 at the git SHA 65fa4c1ee5.
+ Do not manually edit this file.
+*/
+
+import type { JujuRequest } from "../../../generator/interfaces.js";
+import { ConnectionInfo, Transport } from "../../client.js";
+import { Facade } from "../../types.js";
+import { autoBind } from "../../utils.js";
+
+export interface ActivateModelArgs {
+ "controller-alias"?: string;
+ "controller-tag": string;
+ "cross-model-uuids": string[];
+ "model-tag": string;
+ "source-api-addrs": string[];
+ "source-ca-cert": string;
+}
+
+export interface AdoptResourcesArgs {
+ "model-tag": string;
+ "source-controller-version": Number;
+}
+
+export interface BytesResult {
+ result: number[];
+}
+
+export interface Error {
+ code: string;
+ info?: AdditionalProperties;
+ message: string;
+}
+
+export interface ErrorResult {
+ error: Error;
+}
+
+export interface ErrorResults {
+ results: ErrorResult[];
+}
+
+export interface MigrationModelInfo {
+ "agent-version": string;
+ "controller-agent-version": Number;
+ "facade-versions"?: Record;
+ name: string;
+ "owner-tag": string;
+ uuid: string;
+}
+
+export interface ModelArgs {
+ "model-tag": string;
+}
+
+export interface Number {
+ Build: number;
+ Major: number;
+ Minor: number;
+ Patch: number;
+ Tag: string;
+}
+
+export interface SerializedModel {
+ bytes: number[];
+ charms: string[];
+ resources: SerializedModelResource[];
+ tools: SerializedModelTools[];
+}
+
+export interface SerializedModelResource {
+ application: string;
+ "application-revision": SerializedModelResourceRevision;
+ "charmstore-revision": SerializedModelResourceRevision;
+ name: string;
+ "unit-revisions": Record;
+}
+
+export interface SerializedModelResourceRevision {
+ description: string;
+ fingerprint: string;
+ origin: string;
+ path: string;
+ revision: number;
+ size: number;
+ timestamp: string;
+ type: string;
+ username?: string;
+}
+
+export interface SerializedModelTools {
+ uri: string;
+ version: string;
+}
+
+export interface AdditionalProperties {
+ [key: string]: any;
+}
+
+/**
+ API implements the API required for the model migration
+ master worker when communicating with the target controller.
+*/
+class MigrationTargetV3 implements Facade {
+ static NAME = "MigrationTarget";
+ static VERSION = 3;
+
+ NAME = "MigrationTarget";
+ VERSION = 3;
+
+ _transport: Transport;
+ _info: ConnectionInfo;
+
+ constructor(transport: Transport, info: ConnectionInfo) {
+ this._transport = transport;
+ this._info = info;
+
+ // Automatically bind all methods to instances.
+ autoBind(this);
+ }
+ /**
+ Abort removes the specified model from the database. It is an error to
+ attempt to Abort a model that has a migration mode other than importing.
+ */
+ abort(params: ModelArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "MigrationTarget",
+ request: "Abort",
+ version: 3,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ Activate sets the migration mode of the model to "none", meaning it
+ is ready for use. It is an error to attempt to Abort a model that
+ has a migration mode other than importing. It also adds any required
+ external controller records for those controllers hosting offers used
+ by the model.
+ */
+ activate(params: ActivateModelArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "MigrationTarget",
+ request: "Activate",
+ version: 3,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ AdoptResources asks the cloud provider to update the controller
+ tags for a model's resources. This prevents the resources from
+ being destroyed if the source controller is destroyed after the
+ model is migrated away.
+ */
+ adoptResources(params: AdoptResourcesArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "MigrationTarget",
+ request: "AdoptResources",
+ version: 3,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ CACert returns the certificate used to validate the state connection.
+ */
+ cACert(params: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "MigrationTarget",
+ request: "CACert",
+ version: 3,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ CheckMachines compares the machines in state with the ones reported
+ by the provider and reports any discrepancies.
+ */
+ checkMachines(params: ModelArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "MigrationTarget",
+ request: "CheckMachines",
+ version: 3,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ Import takes a serialized Juju model, deserializes it, and
+ recreates it in the receiving controller.
+ */
+ import(params: SerializedModel): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "MigrationTarget",
+ request: "Import",
+ version: 3,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ LatestLogTime returns the time of the most recent log record
+ received by the logtransfer endpoint. This can be used as the start
+ point for streaming logs from the source if the transfer was
+ interrupted.
+
+ For performance reasons, not every time is tracked, so if the
+ target controller died during the transfer the latest log time
+ might be up to 2 minutes earlier. If the transfer was interrupted
+ in some other way (like the source controller going away or a
+ network partition) the time will be up-to-date.
+
+ Log messages are assumed to be sent in time order (which is how
+ debug-log emits them). If that isn't the case then this mechanism
+ can't be used to avoid duplicates when logtransfer is restarted.
+
+ Returns the zero time if no logs have been transferred.
+ */
+ latestLogTime(params: ModelArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "MigrationTarget",
+ request: "LatestLogTime",
+ version: 3,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ Prechecks ensure that the target controller is ready to accept a
+ model migration.
+ */
+ prechecks(params: MigrationModelInfo): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "MigrationTarget",
+ request: "Prechecks",
+ version: 3,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+}
+
+export default MigrationTargetV3;
diff --git a/api/facades/migration-target/index.ts b/api/facades/migration-target/index.ts
index 48db84b0b..c3f2e685c 100644
--- a/api/facades/migration-target/index.ts
+++ b/api/facades/migration-target/index.ts
@@ -1,13 +1,15 @@
import { GenericFacade } from "../../types";
import MigrationTargetV1 from "./MigrationTargetV1.js";
import MigrationTargetV2 from "./MigrationTargetV2.js";
+import MigrationTargetV3 from "./MigrationTargetV3.js";
export * as MigrationTargetV1 from "./MigrationTargetV1.js";
export * as MigrationTargetV2 from "./MigrationTargetV2.js";
+export * as MigrationTargetV3 from "./MigrationTargetV3.js";
const MigrationTarget: GenericFacade = {
name: "MigrationTarget",
- versions: [MigrationTargetV1, MigrationTargetV2],
+ versions: [MigrationTargetV1, MigrationTargetV2, MigrationTargetV3],
};
export default MigrationTarget;
diff --git a/api/facades/secrets/SecretsV2.ts b/api/facades/secrets/SecretsV2.ts
new file mode 100644
index 000000000..b2b736e75
--- /dev/null
+++ b/api/facades/secrets/SecretsV2.ts
@@ -0,0 +1,281 @@
+/**
+ Juju Secrets version 2.
+ This facade is available on:
+ Models
+
+ NOTE: This file was generated using the Juju schema
+ from Juju 3.3.2 at the git SHA 65fa4c1ee5.
+ Do not manually edit this file.
+*/
+
+import type { JujuRequest } from "../../../generator/interfaces.js";
+import { ConnectionInfo, Transport } from "../../client.js";
+import { Facade } from "../../types.js";
+import { autoBind } from "../../utils.js";
+
+export interface AccessInfo {
+ role: string;
+ "scope-tag": string;
+ "target-tag": string;
+}
+
+export interface CreateSecretArg {
+ UpsertSecretArg: UpsertSecretArg;
+ content?: SecretContentParams;
+ description?: string;
+ "expire-time"?: string;
+ label?: string;
+ "owner-tag": string;
+ params?: AdditionalProperties;
+ "rotate-policy"?: string;
+ uri?: string;
+}
+
+export interface CreateSecretArgs {
+ args: CreateSecretArg[];
+}
+
+export interface DeleteSecretArg {
+ label: string;
+ revisions?: number[];
+ uri: string;
+}
+
+export interface DeleteSecretArgs {
+ args: DeleteSecretArg[];
+}
+
+export interface Error {
+ code: string;
+ info?: AdditionalProperties;
+ message: string;
+}
+
+export interface ErrorResult {
+ error: Error;
+}
+
+export interface ErrorResults {
+ results: ErrorResult[];
+}
+
+export interface GrantRevokeUserSecretArg {
+ applications: string[];
+ label: string;
+ uri: string;
+}
+
+export interface ListSecretResult {
+ access?: AccessInfo[];
+ "create-time": string;
+ description?: string;
+ label?: string;
+ "latest-expire-time"?: string;
+ "latest-revision": number;
+ "next-rotate-time"?: string;
+ "owner-tag": string;
+ revisions: SecretRevision[];
+ "rotate-policy"?: string;
+ "update-time": string;
+ uri: string;
+ value?: SecretValueResult;
+ version: number;
+}
+
+export interface ListSecretResults {
+ results: ListSecretResult[];
+}
+
+export interface ListSecretsArgs {
+ filter: SecretsFilter;
+ "show-secrets": boolean;
+}
+
+export interface SecretContentParams {
+ data: Record;
+ "value-ref": SecretValueRef;
+}
+
+export interface SecretRevision {
+ "backend-name"?: string;
+ "create-time"?: string;
+ "expire-time"?: string;
+ revision: number;
+ "update-time"?: string;
+ "value-ref"?: SecretValueRef;
+}
+
+export interface SecretValueRef {
+ "backend-id": string;
+ "revision-id": string;
+}
+
+export interface SecretValueResult {
+ data: Record;
+ error: Error;
+}
+
+export interface SecretsFilter {
+ label: string;
+ "owner-tag": string;
+ revision: number;
+ uri: string;
+}
+
+export interface StringResult {
+ error?: Error;
+ result: string;
+}
+
+export interface StringResults {
+ results: StringResult[];
+}
+
+export interface UpdateUserSecretArg {
+ UpsertSecretArg: UpsertSecretArg;
+ "auto-prune"?: boolean;
+ content?: SecretContentParams;
+ description?: string;
+ "existing-label": string;
+ "expire-time"?: string;
+ label?: string;
+ params?: AdditionalProperties;
+ "rotate-policy"?: string;
+ uri: string;
+}
+
+export interface UpdateUserSecretArgs {
+ args: UpdateUserSecretArg[];
+}
+
+export interface UpsertSecretArg {
+ content: SecretContentParams;
+ description: string;
+ "expire-time": string;
+ label: string;
+ params: AdditionalProperties;
+ "rotate-policy": string;
+}
+
+export interface AdditionalProperties {
+ [key: string]: any;
+}
+
+/**
+ SecretsAPI is the backend for the Secrets facade.
+*/
+class SecretsV2 implements Facade {
+ static NAME = "Secrets";
+ static VERSION = 2;
+
+ NAME = "Secrets";
+ VERSION = 2;
+
+ _transport: Transport;
+ _info: ConnectionInfo;
+
+ constructor(transport: Transport, info: ConnectionInfo) {
+ this._transport = transport;
+ this._info = info;
+
+ // Automatically bind all methods to instances.
+ autoBind(this);
+ }
+ /**
+ CreateSecrets creates new secrets.
+ */
+ createSecrets(params: CreateSecretArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Secrets",
+ request: "CreateSecrets",
+ version: 2,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ GrantSecret grants access to a user secret.
+ */
+ grantSecret(params: GrantRevokeUserSecretArg): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Secrets",
+ request: "GrantSecret",
+ version: 2,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ ListSecrets lists available secrets.
+ */
+ listSecrets(params: ListSecretsArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Secrets",
+ request: "ListSecrets",
+ version: 2,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ RemoveSecrets remove user secret.
+ */
+ removeSecrets(params: DeleteSecretArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Secrets",
+ request: "RemoveSecrets",
+ version: 2,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ RevokeSecret revokes access to a user secret.
+ */
+ revokeSecret(params: GrantRevokeUserSecretArg): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Secrets",
+ request: "RevokeSecret",
+ version: 2,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ UpdateSecrets creates new secrets.
+ */
+ updateSecrets(params: UpdateUserSecretArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Secrets",
+ request: "UpdateSecrets",
+ version: 2,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+}
+
+export default SecretsV2;
diff --git a/api/facades/secrets/index.ts b/api/facades/secrets/index.ts
index 26eab6e26..da9ee8770 100644
--- a/api/facades/secrets/index.ts
+++ b/api/facades/secrets/index.ts
@@ -1,11 +1,13 @@
import { GenericFacade } from "../../types";
import SecretsV1 from "./SecretsV1.js";
+import SecretsV2 from "./SecretsV2.js";
export * as SecretsV1 from "./SecretsV1.js";
+export * as SecretsV2 from "./SecretsV2.js";
const Secrets: GenericFacade = {
name: "Secrets",
- versions: [SecretsV1],
+ versions: [SecretsV1, SecretsV2],
};
export default Secrets;
diff --git a/api/facades/uniter/UniterV19.ts b/api/facades/uniter/UniterV19.ts
new file mode 100644
index 000000000..2ffe3c738
--- /dev/null
+++ b/api/facades/uniter/UniterV19.ts
@@ -0,0 +1,2693 @@
+/**
+ 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.2 at the git SHA 65fa4c1ee5.
+ Do not manually edit this file.
+*/
+
+import type { JujuRequest } from "../../../generator/interfaces.js";
+import { ConnectionInfo, Transport } from "../../client.js";
+import { Facade } from "../../types.js";
+import { autoBind } from "../../utils.js";
+
+export interface APIHostPortsResult {
+ servers: HostPort[][];
+}
+
+export interface AccessInfo {
+ role: string;
+ "scope-tag": string;
+ "target-tag": string;
+}
+
+export interface Action {
+ "execution-group"?: string;
+ name: string;
+ parallel?: boolean;
+ parameters?: AdditionalProperties;
+ receiver: string;
+ tag: string;
+}
+
+export interface ActionExecutionResult {
+ "action-tag": string;
+ message?: string;
+ results?: AdditionalProperties;
+ status: string;
+}
+
+export interface ActionExecutionResults {
+ results: ActionExecutionResult[];
+}
+
+export interface ActionMessage {
+ message: string;
+ timestamp: string;
+}
+
+export interface ActionMessageParams {
+ messages: EntityString[];
+}
+
+export interface ActionResult {
+ action: Action;
+ completed: string;
+ enqueued: string;
+ error: Error;
+ log: ActionMessage[];
+ message: string;
+ output: AdditionalProperties;
+ started: string;
+ status: string;
+}
+
+export interface ActionResults {
+ results: ActionResult[];
+}
+
+export interface Address {
+ cidr?: string;
+ "config-type"?: string;
+ "is-secondary"?: boolean;
+ scope: string;
+ "space-id"?: string;
+ "space-name"?: string;
+ type: string;
+ value: string;
+}
+
+export interface ApplicationStatusResult {
+ application: StatusResult;
+ error?: Error;
+ units: Record;
+}
+
+export interface ApplicationStatusResults {
+ results: ApplicationStatusResult[];
+}
+
+export interface BoolResult {
+ error?: Error;
+ result: boolean;
+}
+
+export interface BoolResults {
+ results: BoolResult[];
+}
+
+export interface CharmRelation {
+ interface: string;
+ limit: number;
+ name: string;
+ optional: boolean;
+ role: string;
+ scope: string;
+}
+
+export interface CharmURL {
+ url: string;
+}
+
+export interface CharmURLs {
+ urls: CharmURL[];
+}
+
+export interface CloudCredential {
+ attrs?: Record;
+ "auth-type": string;
+ redacted?: string[];
+}
+
+export interface CloudSpec {
+ cacertificates?: string[];
+ credential?: CloudCredential;
+ endpoint?: string;
+ "identity-endpoint"?: string;
+ "is-controller-cloud"?: boolean;
+ name: string;
+ region?: string;
+ "skip-tls-verify"?: boolean;
+ "storage-endpoint"?: string;
+ type: string;
+}
+
+export interface CloudSpecResult {
+ error: Error;
+ result: CloudSpec;
+}
+
+export interface CommitHookChangesArg {
+ "add-storage"?: StorageAddParams[];
+ "close-ports"?: EntityPortRange[];
+ "open-ports"?: EntityPortRange[];
+ "pod-spec"?: PodSpec;
+ "relation-unit-settings"?: RelationUnitSettings[];
+ "secret-creates"?: CreateSecretArg[];
+ "secret-deletes"?: DeleteSecretArg[];
+ "secret-grants"?: GrantRevokeSecretArg[];
+ "secret-revokes"?: GrantRevokeSecretArg[];
+ "secret-track-latest"?: string[];
+ "secret-updates"?: UpdateSecretArg[];
+ "set-raw-k8s-spec"?: PodSpec;
+ tag: string;
+ "unit-state"?: SetUnitStateArg;
+ "update-network-info": boolean;
+}
+
+export interface CommitHookChangesArgs {
+ args: CommitHookChangesArg[];
+}
+
+export interface ConfigSettingsResult {
+ error?: Error;
+ settings: AdditionalProperties;
+}
+
+export interface ConfigSettingsResults {
+ results: ConfigSettingsResult[];
+}
+
+export interface CreateSecretArg {
+ UpsertSecretArg: UpsertSecretArg;
+ content?: SecretContentParams;
+ description?: string;
+ "expire-time"?: string;
+ label?: string;
+ "owner-tag": string;
+ params?: AdditionalProperties;
+ "rotate-policy"?: string;
+ uri?: string;
+}
+
+export interface CreateSecretArgs {
+ args: CreateSecretArg[];
+}
+
+export interface CreateSecretURIsArg {
+ count: number;
+}
+
+export interface DeleteSecretArg {
+ label: string;
+ revisions?: number[];
+ uri: string;
+}
+
+export interface DeleteSecretArgs {
+ args: DeleteSecretArg[];
+}
+
+export interface Endpoint {
+ "application-name": string;
+ relation: CharmRelation;
+}
+
+export interface Entities {
+ entities: Entity[];
+}
+
+export interface EntitiesCharmURL {
+ entities: EntityCharmURL[];
+}
+
+export interface Entity {
+ tag: string;
+}
+
+export interface EntityCharmURL {
+ "charm-url": string;
+ tag: string;
+}
+
+export interface EntityPortRange {
+ endpoint: string;
+ "from-port": number;
+ protocol: string;
+ tag: string;
+ "to-port": number;
+}
+
+export interface EntityStatusArgs {
+ data: AdditionalProperties;
+ info: string;
+ status: string;
+ tag: string;
+}
+
+export interface EntityString {
+ tag: string;
+ value: string;
+}
+
+export interface EntityWorkloadVersion {
+ tag: string;
+ "workload-version": string;
+}
+
+export interface EntityWorkloadVersions {
+ entities: EntityWorkloadVersion[];
+}
+
+export interface Error {
+ code: string;
+ info?: AdditionalProperties;
+ message: string;
+}
+
+export interface ErrorResult {
+ error: Error;
+}
+
+export interface ErrorResults {
+ results: ErrorResult[];
+}
+
+export interface GetLeadershipSettingsBulkResults {
+ results: GetLeadershipSettingsResult[];
+}
+
+export interface GetLeadershipSettingsResult {
+ error?: Error;
+ settings: Record;
+}
+
+export interface GetSecretConsumerInfoArgs {
+ "consumer-tag": string;
+ uris: string[];
+}
+
+export interface GetSecretContentArg {
+ label?: string;
+ peek?: boolean;
+ refresh?: boolean;
+ uri: string;
+}
+
+export interface GetSecretContentArgs {
+ args: GetSecretContentArg[];
+}
+
+export interface GoalState {
+ relations: Record>;
+ units: Record;
+}
+
+export interface GoalStateResult {
+ error: Error;
+ result: GoalState;
+}
+
+export interface GoalStateResults {
+ results: GoalStateResult[];
+}
+
+export interface GoalStateStatus {
+ since: string;
+ status: string;
+}
+
+export interface GrantRevokeSecretArg {
+ role: string;
+ "scope-tag": string;
+ "subject-tags": string[];
+ uri: string;
+}
+
+export interface GrantRevokeSecretArgs {
+ args: GrantRevokeSecretArg[];
+}
+
+export interface HostPort {
+ Address: Address;
+ cidr?: string;
+ "config-type"?: string;
+ "is-secondary"?: boolean;
+ port: number;
+ scope: string;
+ "space-id"?: string;
+ "space-name"?: string;
+ type: string;
+ value: string;
+}
+
+export interface IntResult {
+ error?: Error;
+ result: number;
+}
+
+export interface IntResults {
+ results: IntResult[];
+}
+
+export interface InterfaceAddress {
+ cidr: string;
+ hostname: string;
+ value: string;
+}
+
+export interface LifeResult {
+ error?: Error;
+ life: string;
+}
+
+export interface LifeResults {
+ results: LifeResult[];
+}
+
+export interface ListSecretResult {
+ access?: AccessInfo[];
+ "create-time": string;
+ description?: string;
+ label?: string;
+ "latest-expire-time"?: string;
+ "latest-revision": number;
+ "next-rotate-time"?: string;
+ "owner-tag": string;
+ revisions: SecretRevision[];
+ "rotate-policy"?: string;
+ "update-time": string;
+ uri: string;
+ value?: SecretValueResult;
+ version: number;
+}
+
+export interface ListSecretResults {
+ results: ListSecretResult[];
+}
+
+export interface MergeLeadershipSettingsBulkParams {
+ params: MergeLeadershipSettingsParam[];
+}
+
+export interface MergeLeadershipSettingsParam {
+ "application-tag"?: string;
+ settings: Record;
+ "unit-tag"?: string;
+}
+
+export interface MeterStatusResult {
+ code: string;
+ error?: Error;
+ info: string;
+}
+
+export interface MeterStatusResults {
+ results: MeterStatusResult[];
+}
+
+export interface Metric {
+ key: string;
+ labels?: Record;
+ time: string;
+ value: string;
+}
+
+export interface MetricBatch {
+ "charm-url": string;
+ created: string;
+ metrics: Metric[];
+ uuid: string;
+}
+
+export interface MetricBatchParam {
+ batch: MetricBatch;
+ tag: string;
+}
+
+export interface MetricBatchParams {
+ batches: MetricBatchParam[];
+}
+
+export interface ModelConfigResult {
+ config: AdditionalProperties;
+}
+
+export interface ModelResult {
+ error?: Error;
+ name: string;
+ type: string;
+ uuid: string;
+}
+
+export interface NetworkInfo {
+ addresses: InterfaceAddress[];
+ "interface-name": string;
+ "mac-address": string;
+}
+
+export interface NetworkInfoParams {
+ bindings: string[];
+ "relation-id"?: number;
+ unit: string;
+}
+
+export interface NetworkInfoResult {
+ "bind-addresses": NetworkInfo[];
+ "egress-subnets": string[];
+ error: Error;
+ "ingress-addresses": string[];
+}
+
+export interface NetworkInfoResults {
+ results: Record;
+}
+
+export interface NotifyWatchResult {
+ NotifyWatcherId: string;
+ error?: Error;
+}
+
+export interface NotifyWatchResults {
+ results: NotifyWatchResult[];
+}
+
+export interface OpenPortRangesByEndpointResult {
+ error?: Error;
+ "unit-port-ranges": Record;
+}
+
+export interface OpenPortRangesByEndpointResults {
+ results: OpenPortRangesByEndpointResult[];
+}
+
+export interface OpenUnitPortRangesByEndpoint {
+ endpoint: string;
+ "port-ranges": PortRange[];
+}
+
+export interface PodSpec {
+ spec?: string;
+ tag: string;
+}
+
+export interface PortRange {
+ "from-port": number;
+ protocol: string;
+ "to-port": number;
+}
+
+export interface RelationIds {
+ "relation-ids": number[];
+}
+
+export interface RelationResult {
+ bool?: boolean;
+ endpoint: Endpoint;
+ error?: Error;
+ id: number;
+ key: string;
+ life: string;
+ "other-application"?: string;
+}
+
+export interface RelationResults {
+ results: RelationResult[];
+}
+
+export interface RelationStatusArg {
+ message: string;
+ "relation-id": number;
+ status: string;
+ "unit-tag": string;
+}
+
+export interface RelationStatusArgs {
+ args: RelationStatusArg[];
+}
+
+export interface RelationUnit {
+ relation: string;
+ unit: string;
+}
+
+export interface RelationUnitPair {
+ "local-unit": string;
+ relation: string;
+ "remote-unit": string;
+}
+
+export interface RelationUnitPairs {
+ "relation-unit-pairs": RelationUnitPair[];
+}
+
+export interface RelationUnitSettings {
+ "application-settings": Record;
+ relation: string;
+ settings: Record;
+ unit: string;
+}
+
+export interface RelationUnitStatus {
+ "in-scope": boolean;
+ "relation-tag": string;
+ suspended: boolean;
+}
+
+export interface RelationUnitStatusResult {
+ error?: Error;
+ results: RelationUnitStatus[];
+}
+
+export interface RelationUnitStatusResults {
+ results: RelationUnitStatusResult[];
+}
+
+export interface RelationUnits {
+ "relation-units": RelationUnit[];
+}
+
+export interface RelationUnitsChange {
+ "app-changed"?: Record;
+ changed: Record;
+ departed?: string[];
+}
+
+export interface RelationUnitsWatchResult {
+ changes: RelationUnitsChange;
+ error?: Error;
+ "watcher-id": string;
+}
+
+export interface RelationUnitsWatchResults {
+ results: RelationUnitsWatchResult[];
+}
+
+export interface ResolvedModeResult {
+ error?: Error;
+ mode: string;
+}
+
+export interface ResolvedModeResults {
+ results: ResolvedModeResult[];
+}
+
+export interface SecretBackendArgs {
+ "backend-ids": string[];
+ "for-drain": boolean;
+}
+
+export interface SecretBackendConfig {
+ params?: AdditionalProperties;
+ type: string;
+}
+
+export interface SecretBackendConfigResult {
+ config?: SecretBackendConfig;
+ draining: boolean;
+ "model-controller": string;
+ "model-name": string;
+ "model-uuid": string;
+}
+
+export interface SecretBackendConfigResults {
+ "active-id": string;
+ results?: Record;
+}
+
+export interface SecretConsumerInfoResult {
+ error?: Error;
+ label: string;
+ revision: number;
+}
+
+export interface SecretConsumerInfoResults {
+ results: SecretConsumerInfoResult[];
+}
+
+export interface SecretContentParams {
+ data: Record;
+ "value-ref": SecretValueRef;
+}
+
+export interface SecretContentResult {
+ "backend-config"?: SecretBackendConfigResult;
+ content: SecretContentParams;
+ error?: Error;
+ "latest-revision"?: number;
+}
+
+export interface SecretContentResults {
+ results: SecretContentResult[];
+}
+
+export interface SecretRevision {
+ "backend-name"?: string;
+ "create-time"?: string;
+ "expire-time"?: string;
+ revision: number;
+ "update-time"?: string;
+ "value-ref"?: SecretValueRef;
+}
+
+export interface SecretRevisionArg {
+ "pending-delete": boolean;
+ revisions: number[];
+ uri: string;
+}
+
+export interface SecretRotatedArg {
+ "original-revision": number;
+ skip: boolean;
+ uri: string;
+}
+
+export interface SecretRotatedArgs {
+ args: SecretRotatedArg[];
+}
+
+export interface SecretTriggerChange {
+ "next-trigger-time": string;
+ revision?: number;
+ uri: string;
+}
+
+export interface SecretTriggerWatchResult {
+ changes: SecretTriggerChange[];
+ error?: Error;
+ "watcher-id": string;
+}
+
+export interface SecretValueRef {
+ "backend-id": string;
+ "revision-id": string;
+}
+
+export interface SecretValueResult {
+ data: Record;
+ error: Error;
+}
+
+export interface SetStatus {
+ entities: EntityStatusArgs[];
+}
+
+export interface SetUnitStateArg {
+ "charm-state"?: Record;
+ "meter-status-state"?: string;
+ "relation-state"?: Record;
+ "secret-state"?: string;
+ "storage-state"?: string;
+ tag: string;
+ "uniter-state"?: string;
+}
+
+export interface SetUnitStateArgs {
+ args: SetUnitStateArg[];
+}
+
+export interface SettingsResult {
+ error?: Error;
+ settings: Record;
+}
+
+export interface SettingsResults {
+ results: SettingsResult[];
+}
+
+export interface StatusResult {
+ data: AdditionalProperties;
+ error?: Error;
+ id: string;
+ info: string;
+ life: string;
+ since: string;
+ status: string;
+}
+
+export interface StatusResults {
+ results: StatusResult[];
+}
+
+export interface StorageAddParams {
+ name: string;
+ storage: StorageConstraints;
+ unit: string;
+}
+
+export interface StorageAttachment {
+ kind: number;
+ life: string;
+ location: string;
+ "owner-tag": string;
+ "storage-tag": string;
+ "unit-tag": string;
+}
+
+export interface StorageAttachmentId {
+ "storage-tag": string;
+ "unit-tag": string;
+}
+
+export interface StorageAttachmentIds {
+ ids: StorageAttachmentId[];
+}
+
+export interface StorageAttachmentIdsResult {
+ error?: Error;
+ result: StorageAttachmentIds;
+}
+
+export interface StorageAttachmentIdsResults {
+ results: StorageAttachmentIdsResult[];
+}
+
+export interface StorageAttachmentResult {
+ error?: Error;
+ result: StorageAttachment;
+}
+
+export interface StorageAttachmentResults {
+ results: StorageAttachmentResult[];
+}
+
+export interface StorageConstraints {
+ count: number;
+ pool: string;
+ size: number;
+}
+
+export interface StringBoolResult {
+ error?: Error;
+ ok: boolean;
+ result: string;
+}
+
+export interface StringBoolResults {
+ results: StringBoolResult[];
+}
+
+export interface StringResult {
+ error?: Error;
+ result: string;
+}
+
+export interface StringResults {
+ results: StringResult[];
+}
+
+export interface StringsResult {
+ error: Error;
+ result: string[];
+}
+
+export interface StringsWatchResult {
+ changes?: string[];
+ error?: Error;
+ "watcher-id": string;
+}
+
+export interface StringsWatchResults {
+ results: StringsWatchResult[];
+}
+
+export interface UnitRefreshResult {
+ Error: Error;
+ Life: string;
+ Resolved: string;
+ "provider-id"?: string;
+}
+
+export interface UnitRefreshResults {
+ Results: UnitRefreshResult[];
+}
+
+export interface UnitSettings {
+ version: number;
+}
+
+export interface UnitStateResult {
+ "charm-state": Record;
+ error: Error;
+ "meter-status-state": string;
+ "relation-state": Record;
+ "secret-state": string;
+ "storage-state": string;
+ "uniter-state": string;
+}
+
+export interface UnitStateResults {
+ results: UnitStateResult[];
+}
+
+export interface UpdateSecretArg {
+ UpsertSecretArg: UpsertSecretArg;
+ content?: SecretContentParams;
+ description?: string;
+ "expire-time"?: string;
+ label?: string;
+ params?: AdditionalProperties;
+ "rotate-policy"?: string;
+ uri: string;
+}
+
+export interface UpdateSecretArgs {
+ args: UpdateSecretArg[];
+}
+
+export interface UpgradeSeriesStatusParam {
+ entity: Entity;
+ message: string;
+ status: string;
+}
+
+export interface UpgradeSeriesStatusParams {
+ params: UpgradeSeriesStatusParam[];
+}
+
+export interface UpgradeSeriesStatusResult {
+ error: Error;
+ status: string;
+ target: string;
+}
+
+export interface UpgradeSeriesStatusResults {
+ results: UpgradeSeriesStatusResult[];
+}
+
+export interface UpsertSecretArg {
+ content: SecretContentParams;
+ description: string;
+ "expire-time": string;
+ label: string;
+ params: AdditionalProperties;
+ "rotate-policy": string;
+}
+
+export interface AdditionalProperties {
+ [key: string]: any;
+}
+
+/**
+ UniterAPI implements the latest version (v18) of the Uniter API.
+*/
+class UniterV19 implements Facade {
+ static NAME = "Uniter";
+ static VERSION = 19;
+
+ NAME = "Uniter";
+ VERSION = 19;
+
+ _transport: Transport;
+ _info: ConnectionInfo;
+
+ constructor(transport: Transport, info: ConnectionInfo) {
+ 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: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "APIAddresses",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ APIHostPorts returns the API server addresses.
+ */
+ aPIHostPorts(params: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "Actions",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ AddMetricBatches adds the metrics for the specified unit.
+ */
+ addMetricBatches(params: MetricBatchParams): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: CharmURLs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "ClearResolved",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ CloudAPIVersion returns the cloud API version, if available.
+ */
+ cloudAPIVersion(params: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: CommitHookChangesArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "ConfigSettings",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ CreateSecretURIs creates new secret URIs.
+ */
+ createSecretURIs(params: CreateSecretURIsArg): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "CreateSecretURIs",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ CreateSecrets creates new secrets.
+ */
+ createSecrets(params: CreateSecretArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "Destroy",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ DestroyAllSubordinates destroys all subordinates of each given unit.
+ */
+ destroyAllSubordinates(params: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: RelationUnits): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "EnterScope",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ FinishActions saves the result of a completed Action
+ */
+ finishActions(params: ActionExecutionResults): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: GetSecretConsumerInfoArgs
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "GetConsumerSecretsRevisionInfo",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+
+ */
+ getMeterStatus(params: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: SecretBackendArgs
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: GetSecretContentArgs
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "GetSecretContentInfo",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ GetSecretMetadata returns metadata for the caller's secrets.
+ */
+ getSecretMetadata(params: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: SecretRevisionArg
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "GetSecretRevisionContentInfo",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ GoalStates returns information of charm units and relations.
+ */
+ goalStates(params: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: CharmURLs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: RelationUnits): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: ActionMessageParams): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: MergeLeadershipSettingsBulkParams): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "Merge",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ ModelConfig returns the current model's configuration.
+ */
+ modelConfig(params: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "ModelConfig",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ NetworkInfo returns network interfaces/addresses for specified bindings.
+ */
+ networkInfo(params: NetworkInfoParams): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: any
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: RelationUnit): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: RelationUnitPairs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: RelationUnits): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: RelationUnits): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: RelationIds): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "RelationsStatus",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ RemoveSecrets removes the specified secrets.
+ */
+ removeSecrets(params: DeleteSecretArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "RemoveSecrets",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ RemoveStorageAttachments removes the specified storage
+ attachments from state.
+ */
+ removeStorageAttachments(
+ params: StorageAttachmentIds
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "Resolved",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ SLALevel returns the model's SLA level.
+ */
+ sLALevel(params: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: GrantRevokeSecretArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: GrantRevokeSecretArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "SecretsRevoke",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ SecretsRotated records when secrets were last rotated.
+ */
+ secretsRotated(params: SecretRotatedArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: SetStatus): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: SetStatus): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: EntitiesCharmURL): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "SetCharmURL",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ SetRelationStatus updates the status of the specified relations.
+ */
+ setRelationStatus(params: RelationStatusArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: SetUnitStateArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: SetStatus): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: SetStatus): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: UpgradeSeriesStatusParams
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: EntityWorkloadVersions): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: StorageAttachmentIds): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: StorageAttachmentIds
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "UpdateNetworkInfo",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ UpdateSecrets updates the specified secrets.
+ */
+ updateSecrets(params: UpdateSecretArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "UpgradeSeriesUnitStatus",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ Watch starts an NotifyWatcher for each given entity.
+ */
+ watch(params: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "Watch",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ WatchAPIHostPorts watches the API server addresses.
+ */
+ watchAPIHostPorts(params: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: any): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "WatchLeadershipSettings",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+
+ */
+ watchMeterStatus(params: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: RelationUnits
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: StorageAttachmentIds
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ 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: Entities): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "Uniter",
+ request: "WorkloadVersion",
+ version: 19,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+}
+
+export default UniterV19;
diff --git a/api/facades/uniter/index.ts b/api/facades/uniter/index.ts
index ed6d3f869..624a7322a 100644
--- a/api/facades/uniter/index.ts
+++ b/api/facades/uniter/index.ts
@@ -1,13 +1,15 @@
import { GenericFacade } from "../../types";
import UniterV16 from "./UniterV16.js";
import UniterV18 from "./UniterV18.js";
+import UniterV19 from "./UniterV19.js";
export * as UniterV16 from "./UniterV16.js";
export * as UniterV18 from "./UniterV18.js";
+export * as UniterV19 from "./UniterV19.js";
const Uniter: GenericFacade = {
name: "Uniter",
- versions: [UniterV16, UniterV18],
+ versions: [UniterV16, UniterV18, UniterV19],
};
export default Uniter;
diff --git a/api/facades/user-secrets-drain/UserSecretsDrainV1.ts b/api/facades/user-secrets-drain/UserSecretsDrainV1.ts
new file mode 100644
index 000000000..45dc87b36
--- /dev/null
+++ b/api/facades/user-secrets-drain/UserSecretsDrainV1.ts
@@ -0,0 +1,274 @@
+/**
+ Juju UserSecretsDrain version 1.
+ This facade is available on:
+ Controller-machine-agent
+
+ NOTE: This file was generated using the Juju schema
+ from Juju 3.3.2 at the git SHA 65fa4c1ee5.
+ Do not manually edit this file.
+*/
+
+import type { JujuRequest } from "../../../generator/interfaces.js";
+import { ConnectionInfo, Transport } from "../../client.js";
+import { Facade } from "../../types.js";
+import { autoBind } from "../../utils.js";
+
+export interface AccessInfo {
+ role: string;
+ "scope-tag": string;
+ "target-tag": string;
+}
+
+export interface ChangeSecretBackendArg {
+ content?: SecretContentParams;
+ revision: number;
+ uri: string;
+}
+
+export interface ChangeSecretBackendArgs {
+ args: ChangeSecretBackendArg[];
+}
+
+export interface Error {
+ code: string;
+ info?: AdditionalProperties;
+ message: string;
+}
+
+export interface ErrorResult {
+ error: Error;
+}
+
+export interface ErrorResults {
+ results: ErrorResult[];
+}
+
+export interface GetSecretContentArg {
+ label?: string;
+ peek?: boolean;
+ refresh?: boolean;
+ uri: string;
+}
+
+export interface GetSecretContentArgs {
+ args: GetSecretContentArg[];
+}
+
+export interface ListSecretResult {
+ access?: AccessInfo[];
+ "create-time": string;
+ description?: string;
+ label?: string;
+ "latest-expire-time"?: string;
+ "latest-revision": number;
+ "next-rotate-time"?: string;
+ "owner-tag": string;
+ revisions: SecretRevision[];
+ "rotate-policy"?: string;
+ "update-time": string;
+ uri: string;
+ value?: SecretValueResult;
+ version: number;
+}
+
+export interface ListSecretResults {
+ results: ListSecretResult[];
+}
+
+export interface NotifyWatchResult {
+ NotifyWatcherId: string;
+ error?: Error;
+}
+
+export interface SecretBackendArgs {
+ "backend-ids": string[];
+ "for-drain": boolean;
+}
+
+export interface SecretBackendConfig {
+ params?: AdditionalProperties;
+ type: string;
+}
+
+export interface SecretBackendConfigResult {
+ config?: SecretBackendConfig;
+ draining: boolean;
+ "model-controller": string;
+ "model-name": string;
+ "model-uuid": string;
+}
+
+export interface SecretBackendConfigResults {
+ "active-id": string;
+ results?: Record;
+}
+
+export interface SecretContentParams {
+ data: Record;
+ "value-ref": SecretValueRef;
+}
+
+export interface SecretContentResult {
+ "backend-config"?: SecretBackendConfigResult;
+ content: SecretContentParams;
+ error?: Error;
+ "latest-revision"?: number;
+}
+
+export interface SecretContentResults {
+ results: SecretContentResult[];
+}
+
+export interface SecretRevision {
+ "backend-name"?: string;
+ "create-time"?: string;
+ "expire-time"?: string;
+ revision: number;
+ "update-time"?: string;
+ "value-ref"?: SecretValueRef;
+}
+
+export interface SecretRevisionArg {
+ "pending-delete": boolean;
+ revisions: number[];
+ uri: string;
+}
+
+export interface SecretValueRef {
+ "backend-id": string;
+ "revision-id": string;
+}
+
+export interface SecretValueResult {
+ data: Record;
+ error: Error;
+}
+
+export interface AdditionalProperties {
+ [key: string]: any;
+}
+
+/**
+ SecretsDrainAPI is the implementation for the SecretsDrain facade.
+*/
+class UserSecretsDrainV1 implements Facade {
+ static NAME = "UserSecretsDrain";
+ static VERSION = 1;
+
+ NAME = "UserSecretsDrain";
+ VERSION = 1;
+
+ _transport: Transport;
+ _info: ConnectionInfo;
+
+ constructor(transport: Transport, info: ConnectionInfo) {
+ this._transport = transport;
+ this._info = info;
+
+ // Automatically bind all methods to instances.
+ autoBind(this);
+ }
+ /**
+ ChangeSecretBackend updates the backend for the specified secret after migration done.
+ */
+ changeSecretBackend(params: ChangeSecretBackendArgs): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "UserSecretsDrain",
+ request: "ChangeSecretBackend",
+ version: 1,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ GetSecretBackendConfigs gets the config needed to create a client to secret backends for the drain worker.
+ */
+ getSecretBackendConfigs(
+ params: SecretBackendArgs
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "UserSecretsDrain",
+ request: "GetSecretBackendConfigs",
+ version: 1,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ GetSecretContentInfo returns the secret values for the specified secrets.
+ */
+ getSecretContentInfo(
+ params: GetSecretContentArgs
+ ): Promise {
+ return new Promise((resolve, reject) => {
+ const req: JujuRequest = {
+ type: "UserSecretsDrain",
+ request: "GetSecretContentInfo",
+ version: 1,
+ params: params,
+ };
+
+ this._transport.write(req, resolve, reject);
+ });
+ }
+
+ /**
+ GetSecretRevisionContentInfo returns the secret values for the specified secret revisions.
+ */
+ getSecretRevisionContentInfo(
+ params: SecretRevisionArg
+ ): Promise