@canonical/jujulib
Version:
Juju API client
181 lines (180 loc) • 5.89 kB
JavaScript
/**
Juju MachineManager version 6.
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.0-beta1 at the git SHA 61c87ab7e1.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
MachineManagerAPIV6 defines the Version 6 of Machine Manager API.
Changes input parameters to DestroyMachineWithParams and ForceDestroyMachine.
*/
class MachineManagerV6 {
constructor(transport, info) {
this.NAME = "MachineManager";
this.VERSION = 6;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
AddMachines adds new machines with the supplied parameters.
*/
addMachines(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineManager",
request: "AddMachines",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
DestroyMachine removes a set of machines from the model.
*/
destroyMachine(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineManager",
request: "DestroyMachine",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
DestroyMachineWithParams removes a set of machines from the model.
*/
destroyMachineWithParams(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineManager",
request: "DestroyMachineWithParams",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ForceDestroyMachine forcibly removes a set of machines from the model.
TODO (anastasiamac 2019-4-24) From Juju 3.0 this call will be removed in favour of DestroyMachinesWithParams.
Also from ModelManger v6 this call is less useful as it does not support MaxWait customisation.
*/
forceDestroyMachine(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineManager",
request: "ForceDestroyMachine",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetUpgradeSeriesMessages returns all new messages associated with upgrade
series events. Messages that have already been retrieved once are not
returned by this method.
*/
getUpgradeSeriesMessages(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineManager",
request: "GetUpgradeSeriesMessages",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
InstanceTypes returns instance type information for the cloud and region
in which the current model is deployed.
*/
instanceTypes(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineManager",
request: "InstanceTypes",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
UpgradeSeriesComplete marks a machine as having completed a managed series
upgrade.
*/
upgradeSeriesComplete(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineManager",
request: "UpgradeSeriesComplete",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
UpgradeSeriesPrepare prepares a machine for a OS series upgrade.
*/
upgradeSeriesPrepare(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineManager",
request: "UpgradeSeriesPrepare",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
UpgradeSeriesValidate validates that the incoming arguments correspond to a
valid series upgrade for the target machine.
If they do, a list of the machine's current units is returned for use in
soliciting user confirmation of the command.
*/
upgradeSeriesValidate(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineManager",
request: "UpgradeSeriesValidate",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchUpgradeSeriesNotifications returns a watcher that fires on upgrade
series events.
*/
watchUpgradeSeriesNotifications(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineManager",
request: "WatchUpgradeSeriesNotifications",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
MachineManagerV6.NAME = "MachineManager";
MachineManagerV6.VERSION = 6;
export default MachineManagerV6;
//# sourceMappingURL=MachineManagerV6.js.map