UNPKG

@canonical/jujulib

Version:
302 lines (299 loc) 9.24 kB
/** Juju Controller version 3. This facade is available on: Controller-machine-agent Machine-agent Unit-agent Controllers 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"; /** ControllerAPIv3 provides the v3 Controller API. */ class ControllerV3 { constructor(transport, info) { this.NAME = "Controller"; this.VERSION = 3; this._transport = transport; this._info = info; // Automatically bind all methods to instances. autoBind(this); } /** AllModels allows controller administrators to get the list of all the models in the controller. */ allModels(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "AllModels", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** CloudSpec returns the model's cloud spec. */ cloudSpec(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "CloudSpec", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** ControllerAPIInfoForModels returns the controller api connection details for the specified models. */ controllerAPIInfoForModels(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "ControllerAPIInfoForModels", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** ControllerConfig returns the controller's configuration. */ controllerConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "ControllerConfig", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** DestroyController destroys the controller. The v3 implementation of DestroyController ignores the DestroyStorage field of the arguments, and unconditionally destroys all storage in the controller. See ControllerAPIv4.DestroyController for more details. */ destroyController(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "DestroyController", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** GetCloudSpec constructs the CloudSpec for a validated and authorized model. */ getCloudSpec(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "GetCloudSpec", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** GetControllerAccess returns the level of access the specified users have on the controller. */ getControllerAccess(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "GetControllerAccess", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** HostedModelConfigs returns all the information that the client needs in order to connect directly with the host model's provider and destroy it directly. */ hostedModelConfigs(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "HostedModelConfigs", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** IdentityProviderURL isn't on the v6 API. */ identityProviderURL(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "IdentityProviderURL", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** InitiateMigration attempts to begin the migration of one or more models to other controllers. */ initiateMigration(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "InitiateMigration", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** ListBlockedModels returns a list of all models on the controller which have a block in place. The resulting slice is sorted by model name, then owner. Callers must be controller administrators to retrieve the list. */ listBlockedModels(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "ListBlockedModels", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelConfig returns the model config for the controller model. For information on the current model, use client.ModelGet */ modelConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "ModelConfig", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelStatus is a legacy method call to ensure that we preserve backward compatibility. TODO (anastasiamac 2017-10-26) This should be made obsolete/removed. */ modelStatus(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "ModelStatus", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModifyControllerAccess changes the model access granted to users. */ modifyControllerAccess(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "ModifyControllerAccess", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** MongoVersion isn't on the v5 API. */ mongoVersion(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "MongoVersion", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** RemoveBlocks removes all the blocks in the controller. */ removeBlocks(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "RemoveBlocks", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchAllModels starts watching events for all models in the controller. The returned AllWatcherId should be used with Next on the AllModelWatcher endpoint to receive deltas. */ watchAllModels(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "WatchAllModels", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchCloudSpecsChanges returns a watcher for cloud spec changes. */ watchCloudSpecsChanges(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "WatchCloudSpecsChanges", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } } ControllerV3.NAME = "Controller"; ControllerV3.VERSION = 3; export default ControllerV3; //# sourceMappingURL=ControllerV3.js.map