White Papers

Configuration details
18 Dell Storage Manager REST API Cookbook | 3089-WP-SAN
To execute the command and print return codes or data to STDOUT, run the following:
print connection.post
(completeURL
,data=json.dumps(payload
,ensure_ascii=False).encode('utf-8')
,headers=header
,verify=verify_cert)
To execute the command and capture any return codes or data in the variable json_data for further parsing
and analysis, run the following:
json_data = connection.post
(completeURL
,data=json.dumps(payload
,ensure_ascii=False).encode('utf-8')
,headers=header
,verify=verify_cert)
# stdout is returned as a JSON data structure and needs to be converted back
# to a Python dictionary data structure to extract its key value pairs
stdout = json.loads(json_data.text)
print stdout['instanceId']
2.5.1 HTTP response codes
Response codes are in a single line of data entry; the output here represents successful completion of the
previously executed REST API call.
<Response [200]>
2.5.2 Python dictionary data structure
The following example data structure results from the prior command:
{u'instanceId': u'101.8683', u'scSerialNumber': 101, u'replicationSource':
False, u'liveVolume': False, u'vpdId': 8248, u'objectType': u'ScVolume',
u'volumeFolderPath': u'Unix/Linux/RestTest/', u'hostCacheEnabled': False,
u'inRecycleBin': False, u'instanceName': u'DSM_Rest_00', u'statusMessage ':
u'', u'status': u'Down', u'storageType': {u'instanceId': u'101.1',
u'instanceName': u'Assigned - Redundant - 2 MB', u'objectType':
u'ScStorageType'}, u'cmmDestination': False, u'replicationDestination': False,
u'volumeFolder': {u'instanceId': u'101.221', u'instanceName': u'RestTest',
u'objectType': u'ScVolumeFolder'}, u'deviceId':
u'6000d310000065000000000000002038', u'active': False,
u'portableVolumeDestination': False, u'deleteAllowed': True, u'name':
u'DSM_Rest_00', u'scName': u'SC 9', u'secureDataUsed': False, u'serialNumber':
u'00000065-00002038', u'replayAllowed': False, u'flashOptimized': False,
u'configuredSize': u'10737418240 Bytes', u'mapped': False, u'cmmSource': False}
Note: The Python pprint module can also be used to reformat this data into more console-friendly output with
the import pprint and pprint.pprint(stdout) statements.