HCP System Management Help
Here’s a sample GET request that retrieves a list of the HCP tenants and default-namespace directories on the local system, hcp-ma.example.com, that are eligible to be included in the active/active replication link named MA-CA. The request writes the list of local candidates to a file named local-candidates.xml. The request is made using a system-level user account that includes the administrator role.
Request with cURL command line
curl -k -H "Accept: application/xml"
-H "Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382" "https://admin.hcp-ma.example.com:9090/mapi/services/replication/links/
MA-CA/localCandidates?prettyprint" > local-candidates.xml
Request in Python using PycURL
import pycurl
filehandle = open("local-candidates.xml", 'wb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Accept: application/xml",
"Authorization: HCP \
YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382"])
curl.setopt(pycurl.URL,
"https://admin.hcp-ma.example.com:9090/mapi/services/" +
"replication/links/MA-CA/localCandidates?prettyprint")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.WRITEFUNCTION, filehandle.write)
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()
filehandle.close()
Request headers
GET /mapi/services/replication/links/MA-CA/localCandidates?prettyprint HTTP/1.1
Host: admin.hcp-ma.example.com:9090
Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382
Accept: application/xml
Response headers
HTTP/1.1 200 OK
Content-Type: application/xml
X-HCP-SoftwareVersion: 7.0.0.16
Content-Length: 330
Response body in XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<content>
<defaultNamespaceDirectories>
<name>brochures_2012</name>
<name>brochures_2013</name>
<name>brochures_2014</name>
</defaultNamespaceDirectories>
<tenants>
<name>Finance</name>
<name>HR</name>
<name>Sales-Mktg</name>
</tenants>
</content>
Trademarks and Legal Disclaimer
© 2017 Hitachi Vantara Corporation. All rights reserved.