@canonical/jujulib
Version:
Juju API client
190 lines (189 loc) • 5.73 kB
JavaScript
/**
Juju Undertaker 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";
/**
UndertakerAPI implements the API used by the model undertaker worker.
*/
class UndertakerV1 {
constructor(transport, info) {
this.NAME = "Undertaker";
this.VERSION = 1;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
CloudSpec returns the model's cloud spec.
*/
cloudSpec(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Undertaker",
request: "CloudSpec",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetCloudSpec constructs the CloudSpec for a validated and authorized model.
*/
getCloudSpec(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Undertaker",
request: "GetCloudSpec",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ModelConfig returns the current model's configuration.
*/
modelConfig(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Undertaker",
request: "ModelConfig",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ModelInfo returns information on the model needed by the undertaker worker.
*/
modelInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Undertaker",
request: "ModelInfo",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ProcessDyingModel checks if a dying model has any machines or applications.
If there are none, the model's life is changed from dying to dead.
*/
processDyingModel(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Undertaker",
request: "ProcessDyingModel",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RemoveModel removes any records of this model from Juju.
*/
removeModel(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Undertaker",
request: "RemoveModel",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetStatus sets the status of each given entity.
*/
setStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Undertaker",
request: "SetStatus",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchCloudSpecsChanges returns a watcher for cloud spec changes.
*/
watchCloudSpecsChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Undertaker",
request: "WatchCloudSpecsChanges",
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: "Undertaker",
request: "WatchForModelConfigChanges",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchModel creates a watcher for the current model.
*/
watchModel(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Undertaker",
request: "WatchModel",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchModelResources creates watchers for changes to the lifecycle of an
model's machines and applications and storage.
*/
watchModelResources(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Undertaker",
request: "WatchModelResources",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
UndertakerV1.NAME = "Undertaker";
UndertakerV1.VERSION = 1;
export default UndertakerV1;
//# sourceMappingURL=UndertakerV1.js.map