@canonical/jujulib
Version:
Juju API client
132 lines (131 loc) • 3.97 kB
JavaScript
/**
Juju CAASAgent version 2.
This facade is available on:
Controller-machine-agent
Machine-agent
Unit-agent
Models
NOTE: This file was generated using the Juju schema
from Juju 3.3 at the git SHA 65fa4c1ee5.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
FacadeV2 is the V2 facade of the caas agent
*/
class CAASAgentV2 {
constructor(transport, info) {
this.NAME = "CAASAgent";
this.VERSION = 2;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
CloudSpec returns the model's cloud spec.
*/
cloudSpec(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CAASAgent",
request: "CloudSpec",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ControllerAPIInfoForModels returns the controller api connection details for the specified models.
*/
controllerAPIInfoForModels(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CAASAgent",
request: "ControllerAPIInfoForModels",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ControllerConfig returns the controller's configuration.
*/
controllerConfig(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CAASAgent",
request: "ControllerConfig",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetCloudSpec constructs the CloudSpec for a validated and authorized model.
*/
getCloudSpec(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CAASAgent",
request: "GetCloudSpec",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ModelConfig returns the current model's configuration.
*/
modelConfig(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CAASAgent",
request: "ModelConfig",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchCloudSpecsChanges returns a watcher for cloud spec changes.
*/
watchCloudSpecsChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CAASAgent",
request: "WatchCloudSpecsChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchForModelConfigChanges returns a NotifyWatcher that observes
changes to the model configuration.
Note that although the NotifyWatchResult contains an Error field,
it's not used because we are only returning a single watcher,
so we use the regular error return.
*/
watchForModelConfigChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CAASAgent",
request: "WatchForModelConfigChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
CAASAgentV2.NAME = "CAASAgent";
CAASAgentV2.VERSION = 2;
export default CAASAgentV2;
//# sourceMappingURL=CAASAgentV2.js.map