UNPKG

@canonical/jujulib

Version:

Juju API client

526 lines (521 loc) 16 kB
/** Juju Application version 12. 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.8.2 at the git SHA 516c1904ce. Do not manually edit this file. */ import { autoBind } from "../../utils.js"; /** APIv12 provides the Application API facade for version 12. It adds the UnitsInfo method. */ class ApplicationV12 { constructor(transport, info) { this.NAME = "Application"; this.VERSION = 12; 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, params: params, }; this._transport.write(req, resolve, reject); }); } /** GetCharmURL returns the charm URL the given application is running at present. */ getCharmURL(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "GetCharmURL", version: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, params: params, }; this._transport.write(req, resolve, reject); }); } /** Set implements the server side of Application.Set. It does not unset values that are set to an empty string. Unset should be used for that. */ set(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "Set", version: 12, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetApplicationsConfig implements the server side of Application.SetApplicationsConfig. It does not unset values that are set to an empty string. Unset should be used for that. */ setApplicationsConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "SetApplicationsConfig", version: 12, 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: 12, 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: 12, 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: 12, 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: 12, 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: 12, params: params, }; this._transport.write(req, resolve, reject); }); } /** UnitsInfo returns unit information. */ unitsInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "UnitsInfo", version: 12, params: params, }; this._transport.write(req, resolve, reject); }); } /** Unset implements the server side of Client.Unset. */ unset(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "Unset", version: 12, 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: 12, params: params, }; this._transport.write(req, resolve, reject); }); } /** Update updates the application attributes, including charm URL, minimum number of units, charm config and constraints. All parameters in params.ApplicationUpdate except the application name are optional. */ update(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "Update", version: 12, params: params, }; this._transport.write(req, resolve, reject); }); } /** UpdateApplicationSeries updates the application series. Series for subordinates updated too. */ updateApplicationSeries(params) { return new Promise((resolve, reject) => { const req = { type: "Application", request: "UpdateApplicationSeries", version: 12, params: params, }; this._transport.write(req, resolve, reject); }); } } ApplicationV12.NAME = "Application"; ApplicationV12.VERSION = 12; export default ApplicationV12; //# sourceMappingURL=ApplicationV12.js.map