@canonical/jujulib
Version:
Juju API client
229 lines (228 loc) • 7.13 kB
JavaScript
/**
Juju MigrationMaster version 3.
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 implements the API required for the model migration
master worker.
*/
class MigrationMasterV3 {
constructor(transport, info) {
this.NAME = "MigrationMaster";
this.VERSION = 3;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
Export serializes the model associated with the API connection.
*/
export(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "Export",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
MigrationStatus returns the details and progress of the latest
model migration.
*/
migrationStatus(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "MigrationStatus",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
MinionReportTimeout returns the configuration value for this controller that
indicates how long the migration master worker should wait for minions to
reported on phases of a migration.
*/
minionReportTimeout(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "MinionReportTimeout",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
MinionReports returns details of the reports made by migration
minions to the controller for the current migration phase.
*/
minionReports(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "MinionReports",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ModelInfo returns essential information about the model to be
migrated.
*/
modelInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "ModelInfo",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Prechecks performs pre-migration checks on the model and
(source) controller.
*/
prechecks(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "Prechecks",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ProcessRelations processes any relations that need updating after an export.
This should help fix any remoteApplications that have been migrated.
*/
processRelations(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "ProcessRelations",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Reap removes all documents for the model associated with the API
connection.
*/
reap(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "Reap",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetPhase sets the phase of the active model migration. The provided
phase must be a valid phase value, for example QUIESCE" or
"ABORT". See the core/migration package for the complete list.
*/
setPhase(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "SetPhase",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SetStatusMessage sets a human readable status message containing
information about the migration's progress. This will be shown in
status output shown to the end user.
*/
setStatusMessage(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "SetStatusMessage",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
SourceControllerInfo returns the details required to connect to
the source controller for model migration.
*/
sourceControllerInfo(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "SourceControllerInfo",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Watch starts watching for an active migration for the model
associated with the API connection. The returned id should be used
with the NotifyWatcher facade to receive events.
*/
watch(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "Watch",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchMinionReports sets up a watcher which reports when a report
for a migration minion has arrived.
*/
watchMinionReports(params) {
return new Promise((resolve, reject) => {
const req = {
type: "MigrationMaster",
request: "WatchMinionReports",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
MigrationMasterV3.NAME = "MigrationMaster";
MigrationMasterV3.VERSION = 3;
export default MigrationMasterV3;
//# sourceMappingURL=MigrationMasterV3.js.map