Here's a sample GET request that retrieves an erasure coding topology named ex-corp-4. The request writes the output to a file named ex-corp-4.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 bGdyZWVu:35dc4c4aa08fe0deab7e292e00eb8e97" "https://admin.hcp-us.example.com:9090/mapi/services/erasureCoding/ ecTopologies/ex-corp-4?verbose=true&prettyprint" > ex-corp-4.xml
Request in Python using PycURL
import pycurl filehandle = open("ex-corp-4.xml", 'wb') curl = pycurl.Curl() curl.setopt(pycurl.HTTPHEADER, ["Accept: application/xml", "Authorization: HCP bGdyZWVu:35dc4c4aa08fe0deab7e292e00eb8e97"]) curl.setopt(pycurl.URL, "https://admin.hcp-us.example.com:9090/mapi/services/" + "erasureCoding/ecTopologies/ex-corp-4?verbose=true&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/erasureCoding/ecTopologies/ex-corp-4?verbose=true&prettyprint HTTP/1.1 Host: admin.hcp-us.example.com:9090 Authorization: HCP bGdyZWVu:35dc4c4aa08fe0deab7e292e00eb8e97 Accept: application/xml
Response headers
HTTP/1.1 200 OK Content-Type: application/xml X-HCP-SoftwareVersion: 9.0.0.2 Content-Length: 2402
Response body in XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ecTopology> <description>Erasure coding topology for the US, Europe, Canada, and Africa-North divisions.</description> <erasureCodedObjects>3289</erasureCodedObjects> <erasureCodingDelay>10</erasureCodingDelay> <fullCopy>false</fullCopy> <hcpSystems> <name>hcp-an.example.com</name> <name>hcp-ca.example.com</name> <name>hcp-eu.example.com</name> <name>hcp-us.example.com</name> </hcpSystems> <id>faa9b2e5-a8b0-4211-ac83-6a25dff50800</id> <minimumObjectSize>4096</minimumObjectSize> <name>ex-corp-4</name> <protectionStatus>HEALTHY</protectionStatus> <readStatus>HEALTHY</readStatus> <replicationLinks> <replicationLink> <hcpSystems> <name>hcp-ca.example.com</name> <name>hcp-eu.example.com</name> </hcpSystems> <name>eu-ca</name> <pausedTenantsCount>0</pausedTenantsCount> <state>HEALTHY</state> <uuid>7ae4101c-6e29-426e-ae71-9a7a529f019d</uuid> </replicationLink> <replicationLink> <hcpSystems> <name>hcp-eu.example.com</name> <name>hcp-us.example.com</name> </hcpSystems> <name>us-eu</name> <pausedTenantsCount>0</pausedTenantsCount> <state>HEALTHY</state> <uuid>32871da5-2355-458a-90f5-1717aa684d6f</uuid> </replicationLink> <replicationLink> <hcpSystems> <name>hcp-an.example.com</name> <name>hcp-us.example.com</name> </hcpSystems> <name>us-an</name> <pausedTenantsCount>0</pausedTenantsCount> <state>HEALTHY</state> <uuid>c8c875ad-dbfe-437d-abd3-862a6c719894</uuid> </replicationLink> <replicationLink> <hcpSystems> <name>hcp-an.example.com</name> <name>hcp-ca.example.com</name> </hcpSystems> <name>ca-an</name> <pausedTenantsCount>0</pausedTenantsCount> <state>HEALTHY</state> <uuid>a1f21e03-fb46-48cc-967e-b0cedf80bb20</uuid> </replicationLink> </replicationLinks> <restorePeriod>5</restorePeriod> <state>ACTIVE</state> <tenants> <name>research-dev</name> <name>sales-mktg</name> <name>exec</name> <name>finance</name> </tenants> <type>RING</type> </ecTopology>