hpe-storage / python-3parclient

This is a python client that talks to the HPE Alletra 9000 and HPE Primera and HPE 3PAR storage array via REST.
Apache License 2.0
48 stars 70 forks source link

Fixed a defect where body would be undefined when removing volume from RCG using PUT call #62

Closed farhan7500 closed 5 years ago

farhan7500 commented 5 years ago

Sample test:

from hpe3parclient import client
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
storage_system_ip_1 = '192.168.67.7'
wsapi_url_1 = 'https://%s:8080/api/v1' % storage_system_ip_1
storage_system_ip_2 = '192.168.67.5'
wsapi_url_2 = 'https://%s:8080/api/v1' % storage_system_ip_2

client_obj_1 = client.HPE3ParClient(wsapi_url_1)
client_obj_2 = client.HPE3ParClient(wsapi_url_2)

client_obj_1.login('3paradm', '3pardata')
client_obj_2.login('3paradm', '3pardata')

client_obj_1.createVolume('demo_volume_1', 'FC_r1', 1024)
client_obj_2.createVolume('demo_volume_1', 'FC_r1', 1024)
client_obj_1.createVolume('demo_volume_2', 'FC_r1', 1024)
client_obj_2.createVolume('demo_volume_2', 'FC_r1', 1024)

client_obj_1.createRemoteCopyGroup('demo_rcg', [{'targetName': 'CSSOS-SSA05','mode': 1}])
client_obj_1.addVolumeToRemoteCopyGroup('demo_rcg', 'demo_volume_1', [{"targetName": "CSSOS-SSA05", "secVolumeName": "demo_volume_1"}],None, True)
client_obj_1.addVolumeToRemoteCopyGroup('demo_rcg', 'demo_volume_2', [{"targetName": "CSSOS-SSA05", "secVolumeName": "demo_volume_2"}],None, True)

client_obj_1.setSSHOptions(storage_system_ip_1, '3paradm', '3pardata')
client_obj_1.removeVolumeFromRemoteCopyGroup('demo_rcg', 'demo_volume_1', None, True)