@canonical/jujulib
Version:
Juju API client
215 lines (211 loc) • 6.21 kB
JavaScript
/**
Juju Agent version 2.
This facade is available on:
Controller-machine-agent
Machine-agent
Unit-agent
NOTE: This file was generated using the Juju schema
from Juju 2.8.2 at the git SHA 516c1904ce.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
AgentAPIV2 implements the version 2 of the API provided to an agent.
*/
class AgentV2 {
constructor(transport, info) {
this.NAME = "Agent";
this.VERSION = 2;
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: 2,
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: 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: "Agent",
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: "Agent",
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: "Agent",
request: "GetCloudSpec",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
*/
getEntities(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Agent",
request: "GetEntities",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
*/
isMaster(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Agent",
request: "IsMaster",
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: "Agent",
request: "ModelConfig",
version: 2,
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: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
*/
stateServingInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Agent",
request: "StateServingInfo",
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: "Agent",
request: "WatchCloudSpecsChanges",
version: 2,
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: 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: "Agent",
request: "WatchForModelConfigChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
AgentV2.NAME = "Agent";
AgentV2.VERSION = 2;
export default AgentV2;
//# sourceMappingURL=AgentV2.js.map