@canonical/jujulib
Version:
Juju API client
73 lines (72 loc) • 2.12 kB
JavaScript
/**
Juju Charms version 2.
This facade is available on:
Models
NOTE: This file was generated using the Juju schema
from Juju 2.8.2 at the git SHA 516c1904ce.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
API implements the charms interface and is the concrete
implementation of the API end point.
*/
class CharmsV2 {
constructor(transport, info) {
this.NAME = "Charms";
this.VERSION = 2;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
CharmInfo returns information about the requested charm.
NOTE: thumper 2016-06-29, this is not a bulk call and probably should be.
*/
charmInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Charms",
request: "CharmInfo",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
IsMetered returns whether or not the charm is metered.
*/
isMetered(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Charms",
request: "IsMetered",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
List returns a list of charm URLs currently in the state.
If supplied parameter contains any names, the result will be filtered
to return only the charms with supplied names.
*/
list(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Charms",
request: "List",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
CharmsV2.NAME = "Charms";
CharmsV2.VERSION = 2;
export default CharmsV2;
//# sourceMappingURL=CharmsV2.js.map