@canonical/jujulib
Version:
Juju API client
158 lines (157 loc) • 4.66 kB
JavaScript
/**
Juju Action version 7.
This facade is available on:
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";
/**
APIv7 provides the Action API facade for version 7.
*/
class ActionV7 {
constructor(transport, info) {
this.NAME = "Action";
this.VERSION = 7;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
Actions takes a list of ActionTags, and returns the full Action for
each ID.
*/
actions(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "Actions",
version: 7,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ApplicationsCharmsActions returns a slice of charm Actions for a slice of
services.
*/
applicationsCharmsActions(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "ApplicationsCharmsActions",
version: 7,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Cancel attempts to cancel enqueued Actions from running.
*/
cancel(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "Cancel",
version: 7,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
EnqueueOperation takes a list of Actions and queues them up to be executed as
an operation, each action running as a task on the designated ActionReceiver.
We return the ID of the overall operation and each individual task.
*/
enqueueOperation(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "EnqueueOperation",
version: 7,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ListOperations fetches the called actions for specified apps/units.
*/
listOperations(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "ListOperations",
version: 7,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Operations fetches the specified operation ids.
*/
operations(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "Operations",
version: 7,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Run the commands specified on the machines identified through the
list of machines, units and services.
*/
run(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "Run",
version: 7,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RunOnAllMachines attempts to run the specified command on all the machines.
*/
runOnAllMachines(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "RunOnAllMachines",
version: 7,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchActionsProgress creates a watcher that reports on action log messages.
*/
watchActionsProgress(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "WatchActionsProgress",
version: 7,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
ActionV7.NAME = "Action";
ActionV7.VERSION = 7;
export default ActionV7;
//# sourceMappingURL=ActionV7.js.map