@canonical/jujulib
Version:
Juju API client
269 lines (267 loc) • 8.17 kB
JavaScript
/**
Juju Action version 6.
This facade is available on:
Models
NOTE: This file was generated using the Juju schema
from Juju 2.9-rc3 at the git SHA cb361902f8.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
APIv6 provides the Action API facade for version 6.
*/
class ActionV6 {
constructor(transport, info) {
this.NAME = "Action";
this.VERSION = 6;
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: 6,
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: 6,
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: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Enqueue takes a list of Actions and queues them up to be executed by
the designated ActionReceiver, returning the params.Action for each
enqueued Action, or an error if there was a problem enqueueing the
Action.
*/
enqueue(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "Enqueue",
version: 6,
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 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: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
FindActionTagsByPrefix takes a list of string prefixes and finds
corresponding ActionTags that match that prefix.
TODO(juju3) - rename API method since we only need prefix matching for UUIDs
*/
findActionTagsByPrefix(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "FindActionTagsByPrefix",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
*/
findActionsByNames(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "FindActionsByNames",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ListAll takes a list of Entities representing ActionReceivers and
returns all of the Actions that have been enqueued or run by each of
those Entities.
*/
listAll(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "ListAll",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ListCompleted takes a list of Entities representing ActionReceivers
and returns all of the Actions that have been run on each of those
Entities.
*/
listCompleted(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "ListCompleted",
version: 6,
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: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ListPending takes a list of Entities representing ActionReceivers
and returns all of the Actions that are enqueued for each of those
Entities.
*/
listPending(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "ListPending",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ListRunning takes a list of Entities representing ActionReceivers and
returns all of the Actions that have are running on each of those
Entities.
*/
listRunning(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Action",
request: "ListRunning",
version: 6,
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: 6,
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: 6,
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: 6,
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: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
ActionV6.NAME = "Action";
ActionV6.VERSION = 6;
export default ActionV6;
//# sourceMappingURL=ActionV6.js.map