UNPKG

@canonical/jujulib

Version:

Juju API client

63 lines (62 loc) 1.92 kB
/** Juju Singular 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"; /** Facade allows controller machines to request exclusive rights to administer some specific model or controller for a limited time. */ class SingularV2 { constructor(transport, info) { this.NAME = "Singular"; this.VERSION = 2; this._transport = transport; this._info = info; // Automatically bind all methods to instances. autoBind(this); } /** Claim makes the supplied singular-controller lease requests. (In practice, any requests not for the connection's model or controller, or not on behalf of the connected ModelManager machine, will be rejected.) */ claim(params) { return new Promise((resolve, reject) => { const req = { type: "Singular", request: "Claim", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** Wait waits for the singular-controller lease to expire for all supplied entities. (In practice, any requests that do not refer to the connection's model or controller will be rejected.) */ wait(params) { return new Promise((resolve, reject) => { const req = { type: "Singular", request: "Wait", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } } SingularV2.NAME = "Singular"; SingularV2.VERSION = 2; export default SingularV2; //# sourceMappingURL=SingularV2.js.map