UNPKG

@canonical/jujulib

Version:
494 lines (487 loc) 14.8 kB
/** Juju Client version 2. This facade is available on: Controller-machine-agent Machine-agent Unit-agent Models 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"; /** Client serves client-specific API methods. */ class ClientV2 { constructor(transport, info) { this.NAME = "Client"; this.VERSION = 2; this._transport = transport; this._info = info; // Automatically bind all methods to instances. autoBind(this); } /** APIHostPorts returns the API host/port addresses stored in state. */ aPIHostPorts(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "APIHostPorts", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** AbortCurrentUpgrade aborts and archives the current upgrade synchronisation record, if any. */ abortCurrentUpgrade(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "AbortCurrentUpgrade", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** NOTE: AddCharm is deprecated as of juju 2.9 and charms facade version 3. Please discontinue use and move to the charms facade version. TODO: remove in juju 3.0 */ addCharm(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "AddCharm", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** AddCharmWithAuthorization adds the given charm URL (which must include revision) to the model, if it does not exist yet. Local charms are not supported, only charm store URLs. See also AddLocalCharm(). The authorization macaroon, args.CharmStoreMacaroon, may be omitted, in which case this call is equivalent to AddCharm. NOTE: AddCharmWithAuthorization is deprecated as of juju 2.9 and charms facade version 3. Please discontinue use and move to the charms facade version. TODO: remove in juju 3.0 */ addCharmWithAuthorization(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "AddCharmWithAuthorization", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** AddMachines adds new machines with the supplied parameters. */ addMachines(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "AddMachines", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** AddMachinesV2 adds new machines with the supplied parameters. */ addMachinesV2(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "AddMachinesV2", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** AgentVersion returns the current version that the API server is running. */ agentVersion(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "AgentVersion", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** CACert returns the certificate used to validate the state connection. */ cACert(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "CACert", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** DestroyMachines removes a given set of machines. */ destroyMachines(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "DestroyMachines", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** FindTools returns a List containing all tools matching the given parameters. */ findTools(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "FindTools", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** FullStatus gives the information needed for juju status over the api */ fullStatus(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "FullStatus", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** GetBundleChanges returns the list of changes required to deploy the given bundle data. The changes are sorted by requirements, so that they can be applied in order. This call is deprecated, clients should use the GetChanges endpoint on the Bundle facade. Note: any new feature in the future like devices will never be supported here. */ getBundleChanges(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "GetBundleChanges", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** GetModelConstraints returns the constraints for the model. */ getModelConstraints(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "GetModelConstraints", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** InjectMachines injects a machine into state with provisioned status. */ injectMachines(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "InjectMachines", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelGet implements the server-side part of the model-config CLI command. */ modelGet(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "ModelGet", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelInfo returns information about the current model. */ modelInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "ModelInfo", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelSet implements the server-side part of the set-model-config CLI command. */ modelSet(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "ModelSet", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelUnset implements the server-side part of the set-model-config CLI command. */ modelUnset(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "ModelUnset", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelUserInfo returns information on all users in the model. */ modelUserInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "ModelUserInfo", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** PrivateAddress implements the server side of Client.PrivateAddress. */ privateAddress(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "PrivateAddress", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** ProvisioningScript returns a shell script that, when run, provisions a machine agent on the machine executing the script. */ provisioningScript(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "ProvisioningScript", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** PublicAddress implements the server side of Client.PublicAddress. */ publicAddress(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "PublicAddress", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** ResolveCharm resolves the best available charm URLs with series, for charm locations without a series specified. NOTE: ResolveCharms is deprecated as of juju 2.9 and charms facade version 3. Please discontinue use and move to the charms facade version. TODO: remove in juju 3.0 */ resolveCharms(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "ResolveCharms", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** Resolved implements the server side of Client.Resolved. */ resolved(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "Resolved", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** RetryProvisioning marks a provisioning error as transient on the machines. */ retryProvisioning(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "RetryProvisioning", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** SLALevel returns the current sla level for the model. */ sLALevel(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "SLALevel", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetModelAgentVersion sets the model agent version. */ setModelAgentVersion(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "SetModelAgentVersion", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetModelConstraints sets the constraints for the model. */ setModelConstraints(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "SetModelConstraints", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetSLALevel sets the sla level on the model. */ setSLALevel(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "SetSLALevel", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** StatusHistory returns a slice of past statuses for several entities. */ statusHistory(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "StatusHistory", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchAll initiates a watcher for entities in the connected model. */ watchAll(params) { return new Promise((resolve, reject) => { const req = { type: "Client", request: "WatchAll", version: 2, params: params, }; this._transport.write(req, resolve, reject); }); } } ClientV2.NAME = "Client"; ClientV2.VERSION = 2; export default ClientV2; //# sourceMappingURL=ClientV2.js.map