@canonical/jujulib
Version:
Juju API client
57 lines (56 loc) • 1.64 kB
JavaScript
/**
Juju Resources version 1.
This facade is available on:
Models
NOTE: This file was generated using the Juju schema
from Juju 2.9-rc3 at the git SHA cb361902f8.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
Facade is the public API facade for resources.
*/
class ResourcesV1 {
constructor(transport, info) {
this.NAME = "Resources";
this.VERSION = 1;
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.
*/
addPendingResources(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Resources",
request: "AddPendingResources",
version: 1,
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: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
ResourcesV1.NAME = "Resources";
ResourcesV1.VERSION = 1;
export default ResourcesV1;
//# sourceMappingURL=ResourcesV1.js.map