config/sysinv/cgts-client/cgts-client/cgtsclient/v1/restore.py
Dan Voiculeasa 99616a7f72 Introduce CLI commands for system restore control
Introduce 3 new sysinv commands: restore-show, restore-start,
restore-complete.

When doing a restore, the system will be put automatically into a
restore state by the restore playbook. After all the nodes are up
and unlocked the user must do a `system restore-complete` to get
out of the system restore state.

Note: In the case of multi-nodes setups helm overrides may have been
detected so apps will be auto-applied after exiting the restore
state. The auto apply is started by a periodic audit thread.

Depends-On: I44fc4aaa528e372a84115714f271b4f5e063f86e
Partial-Bug: 1887648
Change-Id: I7b7fab99d457056032dbbd612363cd5036736cda
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
2020-10-09 16:54:04 +03:00

26 lines
545 B
Python

#
# Copyright (c) 2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# -*- encoding: utf-8 -*-
#
from cgtsclient.common import base
class RestoreManager(base.Manager):
path = '/v1/restore'
def get(self):
return self._json_get(self.path, {})
def start(self):
_, body = self.api.json_request('PATCH', self.path, body={'action': 'start'})
return body
def complete(self):
_, body = self.api.json_request('PATCH', self.path, body={'action': 'complete'})
return body