White Papers

Configuration details
17 Dell Storage Manager REST API Cookbook | 3089-WP-SAN
# execute REST API call via the HTTP GET method
json_data = connection.get(completeURL
,headers=header
,verify=verify_cert)
stdout = json.loads(json_data.text)
osList = {}
print "Name\t\t\t\t\tinstanceId\t\tscName"
for i in range(len(stdout)):
print "%s\t\t\t\t%s\t\t%s" % (stdout[i]['instanceName']
,stdout[i]['instanceId']
,stdout[i]['scName'])
osList[stdout[i]['instanceName']] = {}
osList[stdout[i]['instanceName']]['instanceId'] = stdout[i]['instanceId']
osList[stdout[i]['instanceName']]['scName'] = stdout[i]['scName']
STDOUT
Name instanceId scName
Windows 2012 862.12 SC 4
Windows 2012 MPIO 862.13 SC 4
HP UX 11i v3 862.22 SC 4
AIX 7.1 MPIO 716.46 SC 18
Red Hat Linux 7.x 101.66 SC 9
[snip]
2.4 Putting it together
The remainder of section 2 presents several components of DSM REST API shown in earlier subsections of
section 2.
A sample script is provided in section 5 that shows how these components can be assembled and used. For
further information on the sample script, see section 5.
2.5 Console output
The control flow between the Python script and the DSM Data Collector happens with HTTP/REST API calls
while the data flow exchange is contained within JSON-based data structures.
REST API calls to and from the DSM Data Collector can return either HTTP response codes or data.
A complete list of HTTP response codes are available at http://www.restapitutorial.com/httpstatuscodes.html.
REST API calls are implemented by the various methods discussed in this section, and each generates
STDOUT to the console.
To execute the command and discard any return codes or data, run the following:
connection.get(completeURL, headers=header, verify=verify_cert)