From 41c77424b750b5c44ab70c951ceff8b8897f96b9 Mon Sep 17 00:00:00 2001 From: Kristian Feldsam Date: Sun, 8 May 2022 22:06:52 +0200 Subject: [PATCH] Added createSnapshotOfRemoteCopyGroup Signed-off-by: Kristian Feldsam --- docs/api/hpe3parclient/client.rst | 1 + hpe3parclient/client.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/docs/api/hpe3parclient/client.rst b/docs/api/hpe3parclient/client.rst index f72eedaf..d1c004e5 100644 --- a/docs/api/hpe3parclient/client.rst +++ b/docs/api/hpe3parclient/client.rst @@ -94,4 +94,5 @@ .. automethod:: synchronizeRemoteCopyGroup .. automethod:: recoverRemoteCopyGroupFromDisaster .. automethod:: toggleRemoteCopyConfigMirror + .. automethod:: createSnapshotOfRemoteCopyGroup .. automethod:: getVolumeSnapshots diff --git a/hpe3parclient/client.py b/hpe3parclient/client.py index 275c63d9..b4f911e6 100644 --- a/hpe3parclient/client.py +++ b/hpe3parclient/client.py @@ -4214,6 +4214,34 @@ def toggleRemoteCopyConfigMirror(self, target, mirror_config=True): except exceptions.HTTPBadRequest as ex: pass + def createSnapshotOfRemoteCopyGroup( + self, name, rcg_name, read_only=False): + """Create a snapshot of an existing Remote Copy Group Volume Set. + + :param name: Name of the Snapshot. The vvname pattern is described in + "VV Name Patterns" in the HPE 3PAR Command Line Interface + Reference, which is available at the following + website: http://www.hp.com/go/storage/docs + + :param rcg_name: Name of the remote copy group + :type rcg_name: string + + :param read_only: Read-Only + :type read_only: bool + """ + cmd = ['createsv', '-rcopy'] + + if read_only: + cmd.append('-ro') + + cmd.append(name) + cmd.append(rcg_name) + + response = self._run(cmd) + if response != []: + raise exceptions.SSHException(response) + return response + def getVolumeSnapshots(self, name, live_test=True): """ Shows all snapshots associated with a given volume.