@canonical/jujulib
Version:
Juju API client
339 lines (335 loc) • 10.7 kB
JavaScript
/**
Juju Controller version 8.
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";
/**
ControllerAPIv8 provides the v8 Controller API. The only difference
between this and v9 is that v8 doesn't have the model summary watchers.
*/
class ControllerV8 {
constructor(transport, info) {
this.NAME = "Controller";
this.VERSION = 8;
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: 8,
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: 8,
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: 8,
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: 8,
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: 8,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ControllerVersion returns the version information associated with this
controller binary.
NOTE: the implementation intentionally does not check for SuperuserAccess
as the Version is known even to users with login access.
*/
controllerVersion(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Controller",
request: "ControllerVersion",
version: 8,
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: 8,
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: 8,
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: 8,
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: 8,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
IdentityProviderURL returns the URL of the configured external identity
provider for this controller or an empty string if no external identity
provider has been configured when the controller was bootstrapped.
NOTE: the implementation intentionally does not check for SuperuserAccess
as the URL is known even to users with login access.
*/
identityProviderURL(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Controller",
request: "IdentityProviderURL",
version: 8,
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: 8,
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: 8,
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: 8,
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: 8,
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: 8,
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: 8,
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: 8,
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: 8,
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: 8,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
ControllerV8.NAME = "Controller";
ControllerV8.VERSION = 8;
export default ControllerV8;
//# sourceMappingURL=ControllerV8.js.map