Esempio n. 1
0
 def create_snapshot(self, fs_id, snapshot_name):
     data = {
         "PARENTTYPE": "40",
         "PARENTID": fs_id,
         "NAME": huawei_utils.snapshot_name(snapshot_name),
     }
     result = self.call("/FSSNAPSHOT", "POST", data)
     _assert_result(result, 'Create snapshot %s error.', data)
     return result['data']['ID']
Esempio n. 2
0
 def rename_snapshot(self, snapshot_id, new_name):
     url = "/FSSNAPSHOT/%s" % snapshot_id
     data = {"NAME": huawei_utils.snapshot_name(new_name)}
     result = self.call(url, "PUT", data)
     _assert_result(result, 'Rename snapshot %s error.', snapshot_id)