Skip to content

CH: implement updatevv #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions hpe3parclient/client.py
Original file line number Diff line number Diff line change
@@ -91,6 +91,7 @@ class HPE3ParClient(object):
GROW_VOLUME = 3
PROMOTE_VIRTUAL_COPY = 4
VIRTUAL_COPY = 3
UPDATE_VIRTUAL_COPY = 7

TUNE_VOLUME = 6
TPVV = 1
@@ -890,6 +891,29 @@ def promoteVirtualCopy(self, snapshot, optional=None):
response, body = self.http.put('/volumes/%s' % snapshot, body=info)
return body

def updateVirtualCopy(self, snapshots, readOnly=False):
"""Update a virtual volume snapshot

:param snapshots: the list of snapshot names

:param readOnly: Specifies that if the virtual copy is read-write, the
command updates the read-only parent volume also

:raises: :class:`~hpe3parclient.exceptions.HTTPForbidden`
- UNLICENSED_FEATURE: This system is not licensed with promote
"""
if isinstance(snapshots, str):
snapshots = [snapshots, ]
info = {
'action': self.UPDATE_VIRTUAL_COPY,
'parameters': {
'volumeSnapshotList': snapshots,
'readOnly': readOnly
}
}
response, body = self.http.post('/volumes/', body=info)
return body

def copyVolume(self, src_name, dest_name, dest_cpg, optional=None):
"""Copy/Clone a volume.