Skip to content

Commit

Permalink
SnapVlm: Add response object for state
Browse files Browse the repository at this point in the history
  • Loading branch information
ghernadi committed Oct 12, 2022
1 parent 60ba569 commit 63c7898
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion linstor-common
25 changes: 25 additions & 0 deletions linstor/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,31 @@ def create_datetime(self):
def uuid(self):
return self._rest_data.get("uuid")

@property
def snapshot_volumes(self):
return [SnapshotVolume(x) for x in self._rest_data.get("snapshot_volumes", [])]


class SnapshotVolume(RESTMessageResponse):
def __init__(self, data):
super(SnapshotVolume, self).__init__(data)

@property
def uuid(self):
return self._rest_data.get("uuid")

@property
def vlm_nr(self):
return self._rest_data.get("vlm_nr")

@property
def state(self):
return self._rest_data.get("state")

@property
def properties(self):
return self._rest_data.get("props", {})


class SnapshotDefinition(RESTMessageResponse):
def __init__(self, data):
Expand Down

0 comments on commit 63c7898

Please sign in to comment.