UNPKG

@canonical/jujulib

Version:

Juju API client

316 lines (314 loc) 9.82 kB
/** Juju Controller version 6. 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"; /** ControllerAPIv6 provides the v6 Controller API. The only difference between this and v7 is that v6 doesn't have the IdentityProviderURL method. */ class ControllerV6 { constructor(transport, info) { this.NAME = "Controller"; this.VERSION = 6; 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: 6, 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: 6, params: params, }; this._transport.write(req, resolve, reject); }); } /** ConfigSet changes the value of specified controller configuration settings. Only some settings can be changed after bootstrap. Settings that aren't specified in the params are left unchanged. */ configSet(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "ConfigSet", version: 6, 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: 6, 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: 6, params: params, }; this._transport.write(req, resolve, reject); }); } /** DestroyController destroys the controller. If the args specify the destruction of the models, this method will attempt to do so. Otherwise, if the controller has any non-empty, non-Dead hosted models, then an error with the code params.CodeHasHostedModels will be transmitted. */ destroyController(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "DestroyController", version: 6, 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: 6, 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: 6, 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: 6, 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: 6, 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: 6, 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: 6, 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: 6, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelStatus returns a summary of the model. */ modelStatus(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "ModelStatus", version: 6, 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: 6, params: params, }; this._transport.write(req, resolve, reject); }); } /** MongoVersion allows the introspection of the mongo version per controller */ mongoVersion(params) { return new Promise((resolve, reject) => { const req = { type: "Controller", request: "MongoVersion", version: 6, 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: 6, 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: 6, 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: 6, params: params, }; this._transport.write(req, resolve, reject); }); } } ControllerV6.NAME = "Controller"; ControllerV6.VERSION = 6; export default ControllerV6; //# sourceMappingURL=ControllerV6.js.map