Skip to content
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
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down