UNPKG

@canonical/jujulib

Version:
494 lines (489 loc) 15 kB
/** Juju Application version 15. This facade is available on: Controller-machine-agent Machine-agent Unit-agent Models NOTE: This file was generated using the Juju schema from Juju 3.0 at the git SHA deb94d4. Do not manually edit this file. */ import { autoBind } from "../../utils.js"; /** APIv15 provides the Application API facade for version 15. */ class ApplicationV15 { constructor(transport, info) { this.NAME = "Application"; this.VERSION = 15; this._transport = transport; this._info = info; // Automatically bind all methods to instances. autoBind(this); } /** AddRelation adds a relation between the specified endpoints and returns the relation info. */ addRelation(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "AddRelation", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** AddUnits adds a given number of units to an application. */ addUnits(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "AddUnits", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** ApplicationsInfo returns applications information. */ applicationsInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "ApplicationsInfo", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** CharmConfig returns charm config for the input list of applications and model generations. */ charmConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "CharmConfig", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** CharmRelations implements the server side of Application.CharmRelations. */ charmRelations(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "CharmRelations", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** Consume adds remote applications to the model without creating any relations. */ consume(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "Consume", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** Deploy fetches the charms from the charm store and deploys them using the specified placement directives. */ deploy(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "Deploy", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** Destroy destroys a given application, local or remote. NOTE(axw) this exists only for backwards compatibility, for API facade versions 1-3; clients should prefer its successor, DestroyApplication, below. Until all consumers have been updated, or we bump a major version, we can't drop this. TODO(axw) 2017-03-16 #1673323 Drop this in Juju 3.0. */ destroy(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "Destroy", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** DestroyApplication removes a given set of applications. */ destroyApplication(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "DestroyApplication", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** DestroyConsumedApplications removes a given set of consumed (remote) applications. */ destroyConsumedApplications(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "DestroyConsumedApplications", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** DestroyRelation removes the relation between the specified endpoints or an id. */ destroyRelation(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "DestroyRelation", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** DestroyUnit removes a given set of application units. */ destroyUnit(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "DestroyUnit", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** DestroyUnits removes a given set of application units. NOTE(axw) this exists only for backwards compatibility, for API facade versions 1-3; clients should prefer its successor, DestroyUnit, below. Until all consumers have been updated, or we bump a major version, we can't drop this. TODO(axw) 2017-03-16 #1673323 Drop this in Juju 3.0. */ destroyUnits(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "DestroyUnits", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** Expose changes the juju-managed firewall to expose any ports that were also explicitly marked by units as open. */ expose(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "Expose", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** Get returns the charm configuration for an application. */ get(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "Get", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** GetCharmURLOrigin returns the charm URL and charm origin the given application is running at present. */ getCharmURLOrigin(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "GetCharmURLOrigin", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** GetConfig returns the charm config for each of the input applications. */ getConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "GetConfig", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** GetConstraints returns the constraints for a given application. */ getConstraints(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "GetConstraints", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** Leader returns the unit name of the leader for the given application. */ leader(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "Leader", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** MergeBindings merges operator-defined bindings with the current bindings for one or more applications. */ mergeBindings(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "MergeBindings", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** ResolveUnitErrors marks errors on the specified units as resolved. */ resolveUnitErrors(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "ResolveUnitErrors", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** ScaleApplications scales the specified application to the requested number of units. */ scaleApplications(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "ScaleApplications", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetCharm sets the charm for a given for the application. */ setCharm(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "SetCharm", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetConfigs implements the server side of Application.SetConfig. Both application and charm config are set. It does not unset values in Config map that are set to an empty string. Unset should be used for that. */ setConfigs(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "SetConfigs", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetConstraints sets the constraints for a given application. */ setConstraints(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "SetConstraints", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetMetricCredentials sets credentials on the application. */ setMetricCredentials(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "SetMetricCredentials", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetRelationsSuspended sets the suspended status of the specified relations. */ setRelationsSuspended(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "SetRelationsSuspended", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** Unexpose changes the juju-managed firewall to unexpose any ports that were also explicitly marked by units as open. */ unexpose(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "Unexpose", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** UnitsInfo returns unit information for the given entities (units or applications). */ unitsInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "UnitsInfo", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig. */ unsetApplicationsConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "UnsetApplicationsConfig", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } /** UpdateApplicationBase updates the application base. Base for subordinates is updated too. */ updateApplicationBase(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "UpdateApplicationBase", version: 15, params: params, }; this._transport.write(req, resolve, reject); }); } } ApplicationV15.NAME = "Application"; ApplicationV15.VERSION = 15; export default ApplicationV15; //# sourceMappingURL=ApplicationV15.js.map