White Papers

Configuration details
20 Dell Storage Manager REST API Cookbook | 3089-WP-SAN
stdout = json.loads(json_data.text)
print stdout
#srvFolderList = {} created earlier in Section 2.3.4
srvFolderList[stdout['name']] = {}
srvFolderList[stdout['name']]['instanceId'] = stdout['instanceId']
srvFolderList[stdout['name']]['parent'] = 'Servers'
STDOUT
{u'status': u'Up', u'deleteAllowed': True, u'name': u'RestTest', u'parent':
{u'instanceId': u'101.0', u'instanceName': u'Servers', u'objectType':
u'ScServerFolder'}, u'instanceId': u'101.33', u'scName': u'SC 9', u'notes':
u'Created via REST API', u'scSerialNumber': 101, u'instanceName': u'RestTest',
u'okToDelete': True, u'folderPath': u'', u'root': False, u'statusMessage': u'',
u'objectType': u'ScServerFolder'}
3.1.2 Modify a server folder
The following code can be used to either modify the name or the parent folder of the server folder object or to
modify both concurrently. The payload['Name'] and payload['Parent'] attributes both contain string-based
values where the former represents the desired name of the folder object and the latter represents the
instanceId value of the parent folder.
# rename server folder object
payload = {}
# user-defined string / new folder name
payload['Name'] = 'RestTest_001'
# Storage Center instanceId + ".0" represents (/) the root level folder
payload['Parent'] = scList['SC 9']['instanceId'] + ".0"
REST = '/StorageCenter/ScServerFolder/%s' %
srvFolderList['RestTest']['instanceId']
completeURL = '%s%s' % (baseURL, REST if REST[0] != '/' else REST[1:])
json_data = connection.put(completeURL
,data=json.dumps(payload
,ensure_ascii=False).encode('utf-8')
,headers=header
,verify=verify_cert)
stdout = json.loads(json_data.text)
print stdout
srvFolderList[payload['Name']] = {}