@canonical/jujulib
Version:
Juju API client
78 lines (77 loc) • 2.36 kB
JavaScript
/**
Juju ActionPruner version 1.
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.3 at the git SHA 65fa4c1ee5.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
API provides access to the action pruner API.
*/
class ActionPrunerV1 {
constructor(transport, info) {
this.NAME = "ActionPruner";
this.VERSION = 1;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
ModelConfig returns the current model's configuration.
*/
modelConfig(params) {
return new Promise((resolve, reject) => {
const req = {
type: "ActionPruner",
request: "ModelConfig",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Prune endpoint removes action entries until
only the ones newer than now - p.MaxHistoryTime remain and
the history is smaller than p.MaxHistoryMB.
*/
prune(params) {
return new Promise((resolve, reject) => {
const req = {
type: "ActionPruner",
request: "Prune",
version: 1,
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: "ActionPruner",
request: "WatchForModelConfigChanges",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
ActionPrunerV1.NAME = "ActionPruner";
ActionPrunerV1.VERSION = 1;
export default ActionPrunerV1;
//# sourceMappingURL=ActionPrunerV1.js.map