@canonical/jujulib
Version:
Juju API client
103 lines (102 loc) • 3.2 kB
JavaScript
/**
Juju MachineActions version 1.
This facade is available on:
Controller-machine-agent
Machine-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";
/**
Facade implements the machineactions interface and is the concrete
implementation of the api end point.
*/
class MachineActionsV1 {
constructor(transport, info) {
this.NAME = "MachineActions";
this.VERSION = 1;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
Actions returns the Actions by Tags passed and ensures that the machine asking
for them is the machine that has the actions
*/
actions(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineActions",
request: "Actions",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
BeginActions marks the actions represented by the passed in Tags as running.
*/
beginActions(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineActions",
request: "BeginActions",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
FinishActions saves the result of a completed Action
*/
finishActions(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineActions",
request: "FinishActions",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RunningActions lists the actions running for the entities passed in.
If we end up needing more than ListRunning at some point we could follow/abstract
what's done in the client actions package.
*/
runningActions(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineActions",
request: "RunningActions",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchActionNotifications returns a StringsWatcher for observing
incoming action calls to a machine.
*/
watchActionNotifications(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MachineActions",
request: "WatchActionNotifications",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
MachineActionsV1.NAME = "MachineActions";
MachineActionsV1.VERSION = 1;
export default MachineActionsV1;
//# sourceMappingURL=MachineActionsV1.js.map