@canonical/jujulib
Version:
Juju API client
152 lines (151 loc) • 5.13 kB
JavaScript
/**
Juju CrossModelRelations 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 3.3 at the git SHA 65fa4c1ee5.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
CrossModelRelationsAPI provides access to the CrossModelRelations API facade.
*/
class CrossModelRelationsV2 {
constructor(transport, info) {
this.NAME = "CrossModelRelations";
this.VERSION = 2;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
PublishIngressNetworkChanges publishes changes to the required
ingress addresses to the model hosting the offer in the relation.
*/
publishIngressNetworkChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CrossModelRelations",
request: "PublishIngressNetworkChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
PublishRelationChanges publishes relation changes to the
model hosting the remote application involved in the relation.
*/
publishRelationChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CrossModelRelations",
request: "PublishRelationChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RegisterRemoteRelations sets up the model to participate
in the specified relations. This operation is idempotent.
*/
registerRemoteRelations(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CrossModelRelations",
request: "RegisterRemoteRelations",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchConsumedSecretsChanges returns a watcher which notifies of changes to any secrets
for the specified remote consumers.
*/
watchConsumedSecretsChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CrossModelRelations",
request: "WatchConsumedSecretsChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which
connections will originate for the relation, change.
Each event contains the entire set of addresses which are required for ingress for the relation.
*/
watchEgressAddressesForRelations(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CrossModelRelations",
request: "WatchEgressAddressesForRelations",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchOfferStatus starts an OfferStatusWatcher for
watching the status of an offer.
*/
watchOfferStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CrossModelRelations",
request: "WatchOfferStatus",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchRelationChanges starts a RemoteRelationChangesWatcher for each
specified relation, returning the watcher IDs and initial values,
or an error if the remote relations couldn't be watched.
*/
watchRelationChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CrossModelRelations",
request: "WatchRelationChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchRelationsSuspendedStatus starts a RelationStatusWatcher for
watching the life and suspended status of a relation.
*/
watchRelationsSuspendedStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "CrossModelRelations",
request: "WatchRelationsSuspendedStatus",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
CrossModelRelationsV2.NAME = "CrossModelRelations";
CrossModelRelationsV2.VERSION = 2;
export default CrossModelRelationsV2;
//# sourceMappingURL=CrossModelRelationsV2.js.map