Unsolved
1 Rookie
•
2 Posts
0
769
May 2nd, 2021 08:00
UNITY Rest API How to do HostAccess ? !
Hello ALL , I got Problem With UNITY Rest API , I am confused to modify lun to do access new host.
Below is my code
import requests
url = "https:// XXX.XX.XX.xx /api/instances/storageResource/sv_4/action/lunModify"
payload={}
files={}
headers = {
'Accept': 'application/json',
'Content-type': 'application/json',
'X-EMC-REST-CLIENT': 'true',
'EMC-CSRF-TOKEN': '{ {csrfToken}}',
'Authorization': 'Basic YWRtaW46MXFheiNFREM=',
'Cookie': 'MOD_AUTH_CAS_S=c3e9fe8aef83becd06c8b5a30cc8017e21cfa905; mod_sec_emc=value1&CJLhT%2BYTc2P3DiJcInUZItoohMiPDUwRdGORHAs8rt%2FPZCCkPW%2FsYUHdxOG5KBuW%0A&value2&c42a1d35a912885e6b05681074dd53a93b6aa1630154f6b15c0a1af31d4d9e56&value3&1'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
But after that I just got below , But I can do same id and password to do query lun
This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.



DELL-Sam L
Moderator
•
7.7K Posts
0
May 3rd, 2021 12:00
Hello HermesChiang,
Are you getting any error code when you run the command? Have you reviewed any of the following docs?
https://dell.to/3aZd7N4
https://dell.to/3gZ8iqY