parent
f263097008
commit
851182a92e
@ -54,6 +54,25 @@ setDefaultSr.params = {
|
||||
setDefaultSr.resolve = {
|
||||
sr: ['sr', 'SR']
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
export async function setPoolMaster ({ host }) {
|
||||
await this.hasPermissions(this.user.id, [ [ host.$pool, 'administrate' ] ])
|
||||
|
||||
await this.getXapi(host).setPoolMaster(host._xapiId)
|
||||
}
|
||||
|
||||
setPoolMaster.params = {
|
||||
host: {
|
||||
type: 'string'
|
||||
}
|
||||
}
|
||||
|
||||
setPoolMaster.resolve = {
|
||||
host: ['host', 'host']
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
export async function installPatch ({pool, patch: patchUuid}) {
|
||||
|
@ -350,6 +350,12 @@ export default class Xapi extends XapiBase {
|
||||
|
||||
// =================================================================
|
||||
|
||||
async setPoolMaster (hostId) {
|
||||
await this.call('pool.designate_new_master', this.getObject(hostId).$ref)
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
|
||||
async joinPool (masterAddress, masterUsername, masterPassword, force = false) {
|
||||
await this.call(
|
||||
force ? 'pool.join_force' : 'pool.join',
|
||||
|
Loading…
Reference in New Issue
Block a user