@canonical/jujulib
Version:
Juju API client
174 lines (173 loc) • 5.2 kB
JavaScript
/**
Juju Deployer version 1.
This facade is available on:
Controller-machine-agent
Machine-agent
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";
/**
DeployerAPI provides access to the Deployer API facade.
*/
class DeployerV1 {
constructor(transport, info) {
this.NAME = "Deployer";
this.VERSION = 1;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
APIAddresses returns the list of addresses used to connect to the API.
*/
aPIAddresses(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Deployer",
request: "APIAddresses",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
APIHostPorts returns the API server addresses.
*/
aPIHostPorts(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Deployer",
request: "APIHostPorts",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ConnectionInfo returns all the address information that the
deployer task needs in one call.
*/
connectionInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Deployer",
request: "ConnectionInfo",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Life returns the life status of every supplied entity, where available.
*/
life(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Deployer",
request: "Life",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ModelUUID returns the model UUID that this facade is deploying into.
It is implemented here directly as a result of removing it from
embedded APIAddresser *without* bumping the facade version.
It should be blanked when this facade version is next incremented.
*/
modelUUID(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Deployer",
request: "ModelUUID",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Remove removes every given entity from state, calling EnsureDead
first, then Remove. It will fail if the entity is not present.
*/
remove(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Deployer",
request: "Remove",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetPasswords sets the given password for each supplied entity, if possible.
*/
setPasswords(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Deployer",
request: "SetPasswords",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetStatus sets the status of the specified entities.
*/
setStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Deployer",
request: "SetStatus",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchAPIHostPorts watches the API server addresses.
*/
watchAPIHostPorts(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Deployer",
request: "WatchAPIHostPorts",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchUnits starts a StringsWatcher to watch all units belonging to
to any entity (machine or service) passed in args.
*/
watchUnits(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Deployer",
request: "WatchUnits",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
DeployerV1.NAME = "Deployer";
DeployerV1.VERSION = 1;
export default DeployerV1;
//# sourceMappingURL=DeployerV1.js.map