UNPKG

@canonical/jujulib

Version:
215 lines (211 loc) 6.21 kB
/** Juju Agent version 3. This facade is available on: Controller-machine-agent Machine-agent Unit-agent 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"; /** AgentAPI implements the version 3 of the API provided to an agent. */ class AgentV3 { constructor(transport, info) { this.NAME = "Agent"; this.VERSION = 3; this._transport = transport; this._info = info; // Automatically bind all methods to instances. autoBind(this); } /** ClearReboot will clear the reboot flag on provided machines, if it exists. */ clearReboot(params) { return new Promise((resolve, reject) => { const req = { type: "Agent", request: "ClearReboot", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** CloudSpec returns the model's cloud spec. */ cloudSpec(params) { return new Promise((resolve, reject) => { const req = { type: "Agent", request: "CloudSpec", version: 3, 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: "Agent", request: "ControllerAPIInfoForModels", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** ControllerConfig returns the controller's configuration. */ controllerConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Agent", request: "ControllerConfig", version: 3, 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: "Agent", request: "GetCloudSpec", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** */ getEntities(params) { return new Promise((resolve, reject) => { const req = { type: "Agent", request: "GetEntities", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** */ isMaster(params) { return new Promise((resolve, reject) => { const req = { type: "Agent", request: "IsMaster", version: 3, 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: "Agent", request: "ModelConfig", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetPasswords sets the given password for each supplied entity, if possible. */ setPasswords(params) { return new Promise((resolve, reject) => { const req = { type: "Agent", request: "SetPasswords", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** */ stateServingInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Agent", request: "StateServingInfo", version: 3, 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: "Agent", request: "WatchCloudSpecsChanges", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchCredentials watches for changes to the specified credentials. */ watchCredentials(params) { return new Promise((resolve, reject) => { const req = { type: "Agent", request: "WatchCredentials", version: 3, 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: "Agent", request: "WatchForModelConfigChanges", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } } AgentV3.NAME = "Agent"; AgentV3.VERSION = 3; export default AgentV3; //# sourceMappingURL=AgentV3.js.map