@canonical/jujulib
Version:
Juju API client
622 lines (616 loc) • 17.8 kB
TypeScript
/**
Juju Application version 14.
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-beta4 at the git SHA a13ab81a.
Do not manually edit this file.
*/
import { ConnectionInfo, Transport } from "../../client.js";
import { Facade } from "../../types.js";
export interface AddApplicationUnits {
application: string;
"attach-storage"?: string[];
"num-units": number;
placement: Placement[];
policy?: string;
}
export interface AddApplicationUnitsResults {
units: string[];
}
export interface AddRelation {
endpoints: string[];
"via-cidrs"?: string[];
}
export interface AddRelationResults {
endpoints: Record<string, CharmRelation>;
}
export interface ApplicationCharmRelations {
application: string;
}
export interface ApplicationCharmRelationsResults {
"charm-relations": string[];
}
export interface ApplicationConfigUnsetArgs {
Args: ApplicationUnset[];
}
export interface ApplicationConstraint {
constraints: Value;
error?: Error;
}
export interface ApplicationDeploy {
Force: boolean;
application: string;
"attach-storage"?: string[];
channel: string;
"charm-origin"?: CharmOrigin;
"charm-url": string;
config?: Record<string, string>;
"config-yaml": string;
constraints: Value;
devices?: Record<string, Constraints>;
"endpoint-bindings"?: Record<string, string>;
"num-units": number;
placement?: Placement[];
policy?: string;
resources?: Record<string, string>;
series: string;
storage?: Record<string, Constraints>;
}
export interface ApplicationDestroy {
application: string;
}
export interface ApplicationExpose {
application: string;
"exposed-endpoints"?: Record<string, ExposedEndpoint>;
}
export interface ApplicationGet {
application: string;
branch: string;
}
export interface ApplicationGetArgs {
args: ApplicationGet[];
}
export interface ApplicationGetConfigResults {
Results: ConfigResult[];
}
export interface ApplicationGetConstraintsResults {
results: ApplicationConstraint[];
}
export interface ApplicationGetResults {
application: string;
"application-config"?: AdditionalProperties;
channel: string;
charm: string;
config: AdditionalProperties;
constraints: Value;
"endpoint-bindings"?: Record<string, string>;
series: string;
}
export interface ApplicationInfoResult {
error?: Error;
result?: ApplicationResult;
}
export interface ApplicationInfoResults {
results: ApplicationInfoResult[];
}
export interface ApplicationMergeBindings {
"application-tag": string;
bindings: Record<string, string>;
force: boolean;
}
export interface ApplicationMergeBindingsArgs {
args: ApplicationMergeBindings[];
}
export interface ApplicationMetricCredential {
application: string;
"metrics-credentials": number[];
}
export interface ApplicationMetricCredentials {
creds: ApplicationMetricCredential[];
}
export interface ApplicationOfferDetails {
"application-description": string;
bindings?: Record<string, string>;
endpoints?: RemoteEndpoint[];
"offer-name": string;
"offer-url": string;
"offer-uuid": string;
"source-model-tag": string;
spaces?: RemoteSpace[];
users?: OfferUserDetails[];
}
export interface ApplicationResult {
channel?: string;
charm?: string;
constraints?: Value;
"endpoint-bindings"?: Record<string, string>;
exposed: boolean;
"exposed-endpoints"?: Record<string, ExposedEndpoint>;
life: string;
principal: boolean;
remote: boolean;
series?: string;
tag: string;
}
export interface ApplicationSetCharm {
application: string;
channel: string;
"charm-origin"?: CharmOrigin;
"charm-url": string;
"config-settings"?: Record<string, string>;
"config-settings-yaml"?: string;
"endpoint-bindings"?: Record<string, string>;
force: boolean;
"force-series": boolean;
"force-units": boolean;
generation: string;
"resource-ids"?: Record<string, string>;
"storage-constraints"?: Record<string, StorageConstraints>;
}
export interface ApplicationUnexpose {
application: string;
"exposed-endpoints": string[];
}
export interface ApplicationUnset {
application: string;
branch: string;
options: string[];
}
export interface ApplicationsDeploy {
applications: ApplicationDeploy[];
}
export interface CharmOrigin {
architecture?: string;
branch?: string;
hash?: string;
id: string;
"instance-key"?: string;
os?: string;
revision?: number;
risk?: string;
series?: string;
source: string;
track?: string;
type: string;
}
export interface CharmRelation {
interface: string;
limit: number;
name: string;
optional: boolean;
role: string;
scope: string;
}
export interface CharmURLOriginResult {
"charm-origin": CharmOrigin;
error?: Error;
url: string;
}
export interface ConfigResult {
config: AdditionalProperties;
error?: Error;
}
export interface ConfigSet {
application: string;
config: Record<string, string>;
"config-yaml": string;
generation: string;
}
export interface ConfigSetArgs {
Args: ConfigSet[];
}
export interface Constraints {
Count: number;
Pool: string;
Size: number;
}
export interface ConsumeApplicationArg {
ApplicationOfferDetails: ApplicationOfferDetails;
"application-alias"?: string;
"application-description": string;
bindings?: Record<string, string>;
endpoints?: RemoteEndpoint[];
"external-controller"?: ExternalControllerInfo;
macaroon?: Macaroon;
"offer-name": string;
"offer-url": string;
"offer-uuid": string;
"source-model-tag": string;
spaces?: RemoteSpace[];
users?: OfferUserDetails[];
}
export interface ConsumeApplicationArgs {
args?: ConsumeApplicationArg[];
}
export interface DestroyApplicationInfo {
"destroyed-storage"?: Entity[];
"destroyed-units"?: Entity[];
"detached-storage"?: Entity[];
}
export interface DestroyApplicationParams {
"application-tag": string;
"destroy-storage"?: boolean;
force: boolean;
"max-wait"?: number;
}
export interface DestroyApplicationResult {
error?: Error;
info?: DestroyApplicationInfo;
}
export interface DestroyApplicationResults {
results?: DestroyApplicationResult[];
}
export interface DestroyApplicationUnits {
"unit-names": string[];
}
export interface DestroyApplicationsParams {
applications: DestroyApplicationParams[];
}
export interface DestroyConsumedApplicationParams {
"application-tag": string;
force?: boolean;
"max-wait"?: number;
}
export interface DestroyConsumedApplicationsParams {
applications: DestroyConsumedApplicationParams[];
}
export interface DestroyRelation {
endpoints?: string[];
force?: boolean;
"max-wait"?: number;
"relation-id": number;
}
export interface DestroyUnitInfo {
"destroyed-storage"?: Entity[];
"detached-storage"?: Entity[];
}
export interface DestroyUnitParams {
"destroy-storage"?: boolean;
force: boolean;
"max-wait"?: number;
"unit-tag": string;
}
export interface DestroyUnitResult {
error?: Error;
info?: DestroyUnitInfo;
}
export interface DestroyUnitResults {
results?: DestroyUnitResult[];
}
export interface DestroyUnitsParams {
units: DestroyUnitParams[];
}
export interface EndpointRelationData {
ApplicationData: AdditionalProperties;
"cross-model": boolean;
endpoint: string;
"related-endpoint": string;
"relation-id": number;
"unit-relation-data": Record<string, RelationData>;
}
export interface Entities {
entities: Entity[];
}
export interface Entity {
tag: string;
}
export interface Error {
code: string;
info?: AdditionalProperties;
message: string;
}
export interface ErrorResult {
error?: Error;
}
export interface ErrorResults {
results: ErrorResult[];
}
export interface ExposedEndpoint {
"expose-to-cidrs"?: string[];
"expose-to-spaces"?: string[];
}
export interface ExternalControllerInfo {
addrs: string[];
"ca-cert": string;
"controller-alias": string;
"controller-tag": string;
}
export interface Macaroon {
[key: string]: AdditionalProperties;
}
export interface OfferUserDetails {
access: string;
"display-name": string;
user: string;
}
export interface Placement {
directive: string;
scope: string;
}
export interface RelationData {
InScope: boolean;
UnitData: AdditionalProperties;
}
export interface RelationSuspendedArg {
message: string;
"relation-id": number;
suspended: boolean;
}
export interface RelationSuspendedArgs {
args: RelationSuspendedArg[];
}
export interface RemoteEndpoint {
interface: string;
limit: number;
name: string;
role: string;
}
export interface RemoteSpace {
"cloud-type": string;
name: string;
"provider-attributes": AdditionalProperties;
"provider-id": string;
subnets: Subnet[];
}
export interface ScaleApplicationInfo {
"num-units": number;
}
export interface ScaleApplicationParams {
"application-tag": string;
force: boolean;
scale: number;
"scale-change"?: number;
}
export interface ScaleApplicationResult {
error?: Error;
info?: ScaleApplicationInfo;
}
export interface ScaleApplicationResults {
results?: ScaleApplicationResult[];
}
export interface ScaleApplicationsParams {
applications: ScaleApplicationParams[];
}
export interface SetConstraints {
application: string;
constraints: Value;
}
export interface StorageConstraints {
count?: number;
pool?: string;
size?: number;
}
export interface StringResult {
error?: Error;
result: string;
}
export interface Subnet {
cidr: string;
life: string;
"provider-id"?: string;
"provider-network-id"?: string;
"provider-space-id"?: string;
"space-tag": string;
status?: string;
"vlan-tag": number;
zones: string[];
}
export interface UnitInfoResult {
error?: Error;
result?: UnitResult;
}
export interface UnitInfoResults {
results: UnitInfoResult[];
}
export interface UnitResult {
address?: string;
charm: string;
leader?: boolean;
life?: string;
machine?: string;
"opened-ports": string[];
"provider-id"?: string;
"public-address"?: string;
"relation-data"?: EndpointRelationData[];
tag: string;
"workload-version": string;
}
export interface UnitsResolved {
all?: boolean;
retry?: boolean;
tags?: Entities;
}
export interface UpdateSeriesArg {
force: boolean;
series: string;
tag: Entity;
}
export interface UpdateSeriesArgs {
args: UpdateSeriesArg[];
}
export interface Value {
"allocate-public-ip"?: boolean;
arch?: string;
container?: string;
cores?: number;
"cpu-power"?: number;
"instance-role"?: string;
"instance-type"?: string;
mem?: number;
"root-disk"?: number;
"root-disk-source"?: string;
spaces?: string[];
tags?: string[];
"virt-type"?: string;
zones?: string[];
}
export interface AdditionalProperties {
[key: string]: any;
}
/**
APIv14 provides the Application API facade for version 14.
*/
declare class ApplicationV14 implements Facade {
static NAME: string;
static VERSION: number;
NAME: string;
VERSION: number;
_transport: Transport;
_info: ConnectionInfo;
constructor(transport: Transport, info: ConnectionInfo);
/**
AddRelation adds a relation between the specified endpoints and returns the relation info.
*/
addRelation(params: AddRelation): Promise<AddRelationResults>;
/**
AddUnits adds a given number of units to an application.
*/
addUnits(params: AddApplicationUnits): Promise<AddApplicationUnitsResults>;
/**
ApplicationsInfo returns applications information.
*/
applicationsInfo(params: Entities): Promise<ApplicationInfoResults>;
/**
CharmConfig returns charm config for the input list of applications and
model generations.
*/
charmConfig(params: ApplicationGetArgs): Promise<ApplicationGetConfigResults>;
/**
CharmRelations implements the server side of Application.CharmRelations.
*/
charmRelations(params: ApplicationCharmRelations): Promise<ApplicationCharmRelationsResults>;
/**
Consume adds remote applications to the model without creating any
relations.
*/
consume(params: ConsumeApplicationArgs): Promise<ErrorResults>;
/**
Deploy fetches the charms from the charm store and deploys them
using the specified placement directives.
*/
deploy(params: ApplicationsDeploy): Promise<ErrorResults>;
/**
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: ApplicationDestroy): Promise<any>;
/**
DestroyApplication removes a given set of applications.
*/
destroyApplication(params: DestroyApplicationsParams): Promise<DestroyApplicationResults>;
/**
DestroyConsumedApplications removes a given set of consumed (remote) applications.
*/
destroyConsumedApplications(params: DestroyConsumedApplicationsParams): Promise<ErrorResults>;
/**
DestroyRelation removes the relation between the
specified endpoints or an id.
*/
destroyRelation(params: DestroyRelation): Promise<any>;
/**
DestroyUnit removes a given set of application units.
*/
destroyUnit(params: DestroyUnitsParams): Promise<DestroyUnitResults>;
/**
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: DestroyApplicationUnits): Promise<any>;
/**
Expose changes the juju-managed firewall to expose any ports that
were also explicitly marked by units as open.
*/
expose(params: ApplicationExpose): Promise<any>;
/**
Get returns the charm configuration for an application.
*/
get(params: ApplicationGet): Promise<ApplicationGetResults>;
/**
GetCharmURLOrigin returns the charm URL and charm origin the given
application is running at present.
*/
getCharmURLOrigin(params: ApplicationGet): Promise<CharmURLOriginResult>;
/**
GetConfig returns the charm config for each of the input applications.
*/
getConfig(params: Entities): Promise<ApplicationGetConfigResults>;
/**
GetConstraints returns the constraints for a given application.
*/
getConstraints(params: Entities): Promise<ApplicationGetConstraintsResults>;
/**
Leader returns the unit name of the leader for the given application.
*/
leader(params: Entity): Promise<StringResult>;
/**
MergeBindings merges operator-defined bindings with the current bindings for
one or more applications.
*/
mergeBindings(params: ApplicationMergeBindingsArgs): Promise<ErrorResults>;
/**
ResolveUnitErrors marks errors on the specified units as resolved.
*/
resolveUnitErrors(params: UnitsResolved): Promise<ErrorResults>;
/**
ScaleApplications scales the specified application to the requested number of units.
*/
scaleApplications(params: ScaleApplicationsParams): Promise<ScaleApplicationResults>;
/**
SetCharm sets the charm for a given for the application.
*/
setCharm(params: ApplicationSetCharm): Promise<any>;
/**
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: ConfigSetArgs): Promise<ErrorResults>;
/**
SetConstraints sets the constraints for a given application.
*/
setConstraints(params: SetConstraints): Promise<any>;
/**
SetMetricCredentials sets credentials on the application.
*/
setMetricCredentials(params: ApplicationMetricCredentials): Promise<ErrorResults>;
/**
SetRelationsSuspended sets the suspended status of the specified relations.
*/
setRelationsSuspended(params: RelationSuspendedArgs): Promise<ErrorResults>;
/**
Unexpose changes the juju-managed firewall to unexpose any ports that
were also explicitly marked by units as open.
*/
unexpose(params: ApplicationUnexpose): Promise<any>;
/**
UnitsInfo returns unit information for the given entities (units or
applications).
*/
unitsInfo(params: Entities): Promise<UnitInfoResults>;
/**
UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig.
*/
unsetApplicationsConfig(params: ApplicationConfigUnsetArgs): Promise<ErrorResults>;
/**
UpdateApplicationSeries updates the application series. Series for
subordinates updated too.
*/
updateApplicationSeries(params: UpdateSeriesArgs): Promise<ErrorResults>;
}
export default ApplicationV14;