White Papers

Configuration details
68 Dell Storage Manager REST API Cookbook | 3089-WP-SAN
volFolderList[os.path.basename("/Unix/Solaris")]["SC 4"]['instanceId'],
"SC 9 - 101")
print("")
5.4 _DispAllVolsMapped
This code can be injected into the working code sample shown in section 5 replacing the placeholder,
"===== YOUR CODE GOES HERE =====".
This code receives a server object name as input, queries all SC Series arrays managed by the DSM
installation, and displays each storage array where this server object exists, how many volumes are mapped
to this server object, and the individual names of each volume object along with their unique index ID value
and path.
def _DispAllVolsMapped(srvName):
"""
Receives the server object name as srvName, and applies this to
all known objects in the scListdictionary querying for all
volume objects mapped to this server object
"""
print("INFO: Querying all SC arrays for server object %s") % (srvName)
print("")
for key in scList:
print("=== %s") % (key)
volsMapped = {}
payload = {}
if srvList[srvName].has_key(key):
REST = 'StorageCenter/ScServer/%s/MappingList' %
srvList[srvName][key]['instanceId']
completeURL = '%s%s' % (baseURL,
REST if REST[0] != '/' else REST[1:])
json_data = connection.get(completeURL
,headers=header
,verify=verify_cert)
stdout = json.loads(json_data.text)
if (len(stdout)) > 0:
for i in range(len(stdout)):
if (stdout[i]['volume']['instanceId']) in volsMapped:
continue
else:
volsMapped[stdout[i]['volume']['instanceId']] = {}
volsMapped[stdout[i]['volume']['instanceId']]
['instanceName'] =
stdout[i]['volume']['instanceName']
else:
print("INFO: Srv obj %s on %s is not mapped to any volumes") %
(srvName, key)
print("INFO: Volumes mapped: %s") % (len(volsMapped))
print("%-30s %-15s %s") % ("Volume Name", "InstanceId", "Path")
for vol_key in volsMapped: