koigrid 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/commands/db.js +10 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to the koigrid CLI are documented here. Format: [Keep a Chan
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.20.0] — 2026-11-29
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `koigrid db maintenance <id>` shows `host_move` (koigrid moves a single-node database to another machine before its machine reboots, same address, a short interruption); `koigrid db maintenance <id> apply host_move` does it now, and `defer` defers whichever of `host_move` or `host_reboot` is pending.
|
|
12
|
+
|
|
7
13
|
## [0.19.0] — 2026-11-29
|
|
8
14
|
|
|
9
15
|
### Added
|
package/dist/commands/db.js
CHANGED
|
@@ -880,17 +880,21 @@ export async function db(a) {
|
|
|
880
880
|
need();
|
|
881
881
|
const act = a.positionals[1];
|
|
882
882
|
if (act === 'defer') {
|
|
883
|
-
// El reinicio de la máquina de una base de un solo miembro (ficha 3f180891)
|
|
883
|
+
// El reinicio de la máquina de una base de un solo miembro (ficha 3f180891), o su traslado antes de ese reinicio
|
|
884
|
+
// (host_move, ficha c077d417): se aplaza el que esté pendiente.
|
|
884
885
|
const until = a.positionals[2];
|
|
885
|
-
const
|
|
886
|
+
const actual = await api(`/databases/${encodeURIComponent(id)}`);
|
|
887
|
+
const pendientes = ((actual.database || actual).pendingMaintenance ?? []);
|
|
888
|
+
const action = pendientes.some((m) => m.action === 'host_move') ? 'host_move' : 'host_reboot';
|
|
889
|
+
const r = await api(`/databases/${encodeURIComponent(id)}/maintenance/defer`, { method: 'POST', body: { action, ...(until ? { until } : {}) } });
|
|
886
890
|
if (json)
|
|
887
891
|
return console.log(JSON.stringify(r, null, 2));
|
|
888
|
-
return console.log(green(`✓ reinicio de la máquina aplazado: no antes de ${r.deferredUntil}`));
|
|
892
|
+
return console.log(green(`✓ ${action === 'host_move' ? 'traslado a otra máquina' : 'reinicio de la máquina'} aplazado: no antes de ${r.deferredUntil}`));
|
|
889
893
|
}
|
|
890
894
|
if (act === 'apply') {
|
|
891
895
|
const action = a.positionals[2];
|
|
892
896
|
if (!action)
|
|
893
|
-
throw new Error('usage: koigrid db maintenance <id> apply <resize|replication_verify_ca|minor_upgrade|dcs_tls|ca_rotation>');
|
|
897
|
+
throw new Error('usage: koigrid db maintenance <id> apply <resize|replication_verify_ca|minor_upgrade|host_move|dcs_tls|ca_rotation>');
|
|
894
898
|
const r = await api(`/databases/${encodeURIComponent(id)}/maintenance/apply`, { method: 'POST', body: { action } });
|
|
895
899
|
if (json)
|
|
896
900
|
return console.log(JSON.stringify(r, null, 2));
|
|
@@ -910,6 +914,8 @@ export async function db(a) {
|
|
|
910
914
|
console.log(` impact: ${m.impact}`);
|
|
911
915
|
if (m.action === 'host_reboot')
|
|
912
916
|
console.log(` happens at ${m.autoAppliesAt} (${m.window}) · defer: koigrid db maintenance ${id} defer [<ISO date>]`);
|
|
917
|
+
else if (m.action === 'host_move')
|
|
918
|
+
console.log(` happens at ${m.autoAppliesAt} (${m.window}) · now: koigrid db maintenance ${id} apply host_move · defer: koigrid db maintenance ${id} defer [<ISO date>]`);
|
|
913
919
|
else
|
|
914
920
|
console.log(` applies automatically at ${m.autoAppliesAt} (window ${m.window} UTC) · now: koigrid db maintenance ${id} apply ${m.action}`);
|
|
915
921
|
}
|