@canonical/jujulib
Version:
Juju API client
271 lines (270 loc) • 9.07 kB
JavaScript
/**
Juju RemoteRelations 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";
/**
API provides access to the remote relations API facade.
*/
class RemoteRelationsV2 {
constructor(transport, info) {
this.NAME = "RemoteRelations";
this.VERSION = 2;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
ConsumeRemoteRelationChanges consumes changes to settings originating
from the remote/offering side of relations.
*/
consumeRemoteRelationChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "ConsumeRemoteRelationChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ConsumeRemoteSecretChanges updates the local model with secret revision changes
originating from the remote/offering model.
*/
consumeRemoteSecretChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "ConsumeRemoteSecretChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ControllerAPIInfoForModels returns the controller api connection details for the specified models.
*/
controllerAPIInfoForModels(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "ControllerAPIInfoForModels",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ControllerConfig returns the controller's configuration.
*/
controllerConfig(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "ControllerConfig",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ExportEntities allocates unique, remote entity IDs for the given entities in the local model.
*/
exportEntities(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "ExportEntities",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
GetTokens returns the token associated with the entities with the given tags for the given models.
*/
getTokens(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "GetTokens",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ImportRemoteEntities adds entities to the remote entities collection with the specified opaque tokens.
*/
importRemoteEntities(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "ImportRemoteEntities",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Relations returns information about the cross-model relations with the specified keys
in the local model.
*/
relations(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "Relations",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RemoteApplications returns the current state of the remote applications with
the specified names in the local model.
*/
remoteApplications(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "RemoteApplications",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SaveMacaroons saves the macaroons for the given entities.
*/
saveMacaroons(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "SaveMacaroons",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetRemoteApplicationsStatus sets the status for the specified remote applications.
*/
setRemoteApplicationsStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "SetRemoteApplicationsStatus",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
UpdateControllersForModels changes the external controller records for the
associated model entities. This is used when the remote relations worker gets
redirected following migration of an offering model.
*/
updateControllersForModels(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "UpdateControllersForModels",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchLocalRelationChanges starts a RemoteRelationWatcher for each
specified relation, returning the watcher IDs and initial values,
or an error if the remote relations couldn't be watched.
*/
watchLocalRelationChanges(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "WatchLocalRelationChanges",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchRemoteApplicationRelations starts a StringsWatcher for watching the relations of
each specified application in the local model, and returns the watcher IDs
and initial values, or an error if the services' relations could not be
watched.
*/
watchRemoteApplicationRelations(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "WatchRemoteApplicationRelations",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchRemoteApplications starts a strings watcher that notifies of the addition,
removal, and lifecycle changes of remote applications in the model; and
returns the watcher ID and initial IDs of remote applications, or an error if
watching failed.
*/
watchRemoteApplications(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "WatchRemoteApplications",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchRemoteRelations starts a strings watcher that notifies of the addition,
removal, and lifecycle changes of remote relations in the model; and
returns the watcher ID and initial IDs of remote relations, or an error if
watching failed.
*/
watchRemoteRelations(params) {
return new Promise((resolve, reject) => {
const req = {
type: "RemoteRelations",
request: "WatchRemoteRelations",
version: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
RemoteRelationsV2.NAME = "RemoteRelations";
RemoteRelationsV2.VERSION = 2;
export default RemoteRelationsV2;
//# sourceMappingURL=RemoteRelationsV2.js.map