mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-11-09 17:06:13 -06:00
feat(cli): Add disable-remote command (#10587)
* fix(remotes): improve unresponsive remote handling
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
- [Pool/Dashboard] In the CPU and RAM usage cards, show a "No data to calculate" message when there is no host or VM to rank (PR [#10386](https://github.com/vatesfr/xen-orchestra/pull/10386))
|
||||
- [i18n] Update Chinese (Simplified Han script), Czech, Danish, Dutch, German, Italian, Portuguese, Portuguese (Brasil), Russian, Slovak, Spanish, Swedish and Ukrainian translations (PR [#10464](https://github.com/vatesfr/xen-orchestra/pull/10464))
|
||||
- [i18n] Update Arabic, Danish, Finnish, Italian, Japanese, Korean, Norwegian, Persian, Polish, Portuguese (Brasil), Russian and Ukrainian translations (PR [#10641](https://github.com/vatesfr/xen-orchestra/pull/10641))
|
||||
- [CLI] Add new command to `xo-server-db` cli: `disable-remote <id>`, disables a remote while xo-server is stopped (PR [#10587](https://github.com/vatesfr/xen-orchestra/pull/10587/))
|
||||
|
||||
### Bug fixes
|
||||
|
||||
|
||||
@@ -94,6 +94,26 @@ const COMMANDS = {
|
||||
repl.on('error', reject).on('exit', resolve)
|
||||
})
|
||||
},
|
||||
|
||||
async 'disable-remote'(args) {
|
||||
const id = args[0]
|
||||
assert(id, 'disable-remote requires a remote id')
|
||||
|
||||
const db = await this.getDb('remote')
|
||||
const remote = await db.first(id)
|
||||
|
||||
assert(remote, `Remote ${id} not found`)
|
||||
|
||||
if (remote.enabled !== true && remote.enabled !== 'true') {
|
||||
process.stdout.write(`Remote ${remote.name} (${id}) already disabled\n`)
|
||||
return
|
||||
}
|
||||
|
||||
remote.enabled = false
|
||||
await db.update(remote)
|
||||
|
||||
process.stdout.write(`Remote ${remote.name} (${id}) disabled\n`)
|
||||
},
|
||||
}
|
||||
|
||||
async function main(args) {
|
||||
@@ -124,6 +144,13 @@ xo-server-db repl
|
||||
- redis: a raw node-redis instance connected to the database
|
||||
- <namespace>: an xo-collection instance to the corresponding namespace in the database
|
||||
|
||||
xo-server-db disable-remote <id>
|
||||
|
||||
Disable a remote so that xo-server does not mount it on its next start.
|
||||
|
||||
<id>
|
||||
The id of the remote to disable.
|
||||
|
||||
`)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user