@canonical/jujulib
Version:
Juju API client
198 lines (197 loc) • 6.08 kB
JavaScript
/**
Juju MigrationMaster 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 2.8.2 at the git SHA 516c1904ce.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
API implements the API required for the model migration
master worker.
*/
class MigrationMasterV2 {
constructor(transport, info) {
this.NAME = "MigrationMaster";
this.VERSION = 2;
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: 2,
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: 2,
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: 2,
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: 2,
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: 2,
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: 2,
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: 2,
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: 2,
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: 2,
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: 2,
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: 2,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
MigrationMasterV2.NAME = "MigrationMaster";
MigrationMasterV2.VERSION = 2;
export default MigrationMasterV2;
//# sourceMappingURL=MigrationMasterV2.js.map