UNPKG

@canonical/jujulib

Version:
57 lines (56 loc) 1.67 kB
/** Juju Resources version 3. This facade is available on: 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 public API facade for resources. */ class ResourcesV3 { constructor(transport, info) { this.NAME = "Resources"; this.VERSION = 3; this._transport = transport; this._info = info; // Automatically bind all methods to instances. autoBind(this); } /** AddPendingResources adds the provided resources (info) to the Juju model in a pending state, meaning they are not available until resolved. Handles CharmHub and Local charms. */ addPendingResources(params) { return new Promise((resolve, reject) => { const req = { type: "Resources", request: "AddPendingResources", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** ListResources returns the list of resources for the given application. */ listResources(params) { return new Promise((resolve, reject) => { const req = { type: "Resources", request: "ListResources", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } } ResourcesV3.NAME = "Resources"; ResourcesV3.VERSION = 3; export default ResourcesV3; //# sourceMappingURL=ResourcesV3.js.map