Skip to content

Commit

Permalink
ADCM-2773 Add maintenance_mode field for Host entity (#114)
Browse files Browse the repository at this point in the history
* ADCM-2773 Add `maintenance_mode` field for `Host` entity

* ADCM-2773 Fixed `maintenance_mode` field for `Host`

* ADCM-2773 Change `maintenance_mode` property to the `set_maintenance_mode` method

* ADCM-2776 Added `disabling_cause` for `Action`

* ADCM-2773 Added `ui_options` and `config` fields for `Upgrade`

Co-authored-by: Sealwing <[email protected]>
  • Loading branch information
a-alferov and Sealwing committed May 20, 2022
1 parent eb9a391 commit 7671c16
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/adcm_client/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ class Upgrade(BaseAPIObject):
state_available = None
state_on_success = None
from_edition = None
ui_options = None
config = None

def do(self, **args) -> Optional['Task']:
"""
Expand Down Expand Up @@ -1019,6 +1021,11 @@ class Host(_BaseObject):
description = None
bundle_id = None
status = None
maintenance_mode: str = None

def maintenance_mode_set(self, value: str) -> None:
self._api.objects.host.partial_update(host_id=self.id, maintenance_mode=value)
self.reread()

def __repr__(self):
return f"<Host {self.fqdn} form provider - {self.provider_id} at {id(self)}>"
Expand Down Expand Up @@ -1100,6 +1107,7 @@ class Action(BaseAPIObject):
allow_to_terminate = None
partial_execution = None
host_action = None
disabling_cause = None

def __repr__(self):
return f"<Action {self.name} at {id(self)}>"
Expand Down

0 comments on commit 7671c16

Please sign in to comment.