UNPKG

@canonical/jujulib

Version:

Juju API client

57 lines (56 loc) 1.69 kB
/** Juju Resources version 2. This facade is available on: Models NOTE: This file was generated using the Juju schema from Juju 3.0-beta4 at the git SHA a13ab81a. Do not manually edit this file. */ import { autoBind } from "../../utils.js"; /** API is the public API facade for resources. */ class ResourcesV2 { constructor(transport, info) { this.NAME = "Resources"; this.VERSION = 2; 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, CharmStore and Local charms. */ addPendingResources(params) { return new Promise((resolve, reject) => { const req = { type: "Resources", request: "AddPendingResources", version: 2, 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: 2, params: params, }; this._transport.write(req, resolve, reject); }); } } ResourcesV2.NAME = "Resources"; ResourcesV2.VERSION = 2; export default ResourcesV2; //# sourceMappingURL=ResourcesV2.js.map