@canonical/jujulib
Version:
Juju API client
70 lines (69 loc) • 1.86 kB
JavaScript
/**
Juju Block version 2.
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 implements Block interface and is the concrete
implementation of the api end point.
*/
class BlockV2 {
constructor(transport, info) {
this.NAME = "Block";
this.VERSION = 2;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
List implements Block.List().
*/
list(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Block",
request: "List",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SwitchBlockOff implements Block.SwitchBlockOff().
*/
switchBlockOff(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Block",
request: "SwitchBlockOff",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SwitchBlockOn implements Block.SwitchBlockOn().
*/
switchBlockOn(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Block",
request: "SwitchBlockOn",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
BlockV2.NAME = "Block";
BlockV2.VERSION = 2;
export default BlockV2;
//# sourceMappingURL=BlockV2.js.map