UNPKG

@canonical/jujulib

Version:
234 lines (233 loc) 6.97 kB
/** Juju CAASOperator 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"; /** Facade is the CAAS operator API facade. */ class CAASOperatorV1 { constructor(transport, info) { this.NAME = "CAASOperator"; 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: "CAASOperator", 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: "CAASOperator", request: "APIHostPorts", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } /** Charm returns the charm info for all given applications. */ charm(params) { return new Promise((resolve, reject) => { const req = { type: "CAASOperator", request: "Charm", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } /** CurrentModel returns the name and UUID for the current juju model. */ currentModel(params) { return new Promise((resolve, reject) => { const req = { type: "CAASOperator", request: "CurrentModel", 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: "CAASOperator", request: "Life", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelUUID returns the model UUID that this facade is used to operate. 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: "CAASOperator", 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: "CAASOperator", request: "Remove", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetPodSpec sets the container specs for a set of applications. TODO(juju3) - remove */ setPodSpec(params) { return new Promise((resolve, reject) => { const req = { type: "CAASOperator", request: "SetPodSpec", 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: "CAASOperator", request: "SetStatus", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetTools updates the recorded tools version for the agents. */ setTools(params) { return new Promise((resolve, reject) => { const req = { type: "CAASOperator", request: "SetTools", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } /** Watch starts an NotifyWatcher for each given entity. */ watch(params) { return new Promise((resolve, reject) => { const req = { type: "CAASOperator", request: "Watch", 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: "CAASOperator", request: "WatchAPIHostPorts", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchContainerStart starts a StringWatcher to watch for container start events on the CAAS api for a specific application and container. */ watchContainerStart(params) { return new Promise((resolve, reject) => { const req = { type: "CAASOperator", request: "WatchContainerStart", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchUnits starts a StringsWatcher to watch changes to the lifecycle states of units for the specified applications in this model. */ watchUnits(params) { return new Promise((resolve, reject) => { const req = { type: "CAASOperator", request: "WatchUnits", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } } CAASOperatorV1.NAME = "CAASOperator"; CAASOperatorV1.VERSION = 1; export default CAASOperatorV1; //# sourceMappingURL=CAASOperatorV1.js.map