@canonical/jujulib
Version:
Juju API client
78 lines (77 loc) • 2.39 kB
JavaScript
/**
Juju StatusHistory version 2.
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 is the concrete implementation of the Pruner endpoint.
*/
class StatusHistoryV2 {
constructor(transport, info) {
this.NAME = "StatusHistory";
this.VERSION = 2;
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: "StatusHistory",
request: "ModelConfig",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Prune endpoint removes status history 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: "StatusHistory",
request: "Prune",
version: 2,
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: "StatusHistory",
request: "WatchForModelConfigChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
StatusHistoryV2.NAME = "StatusHistory";
StatusHistoryV2.VERSION = 2;
export default StatusHistoryV2;
//# sourceMappingURL=StatusHistoryV2.js.map