Example: Retiring an erasure coding topology
Here's a sample POST request that retires an erasure coding topology named ex-corp-4. The request is made using a system-level user account that includes the administrator role.
Request with cURL command line
curl -k -d "<ecTopology/>" -H "Authorization: HCP bGdyZWVu:35dc4c4aa08fe0deab7e292e00eb8e97" "https://admin.hcp-us.example.com:9090/mapi/services/erasureCoding/ ecTopologies/ex-corp-4?retire"
Request in Python using PycURL
import pycurl curl = pycurl.Curl() curl.setopt(pycurl.HTTPHEADER, ["Authorization: HCP \ bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"]) curl.setopt(pycurl.URL, "https://admin.hcp-us.example.com:9090/mapi/services/" + "erasureCoding/ecTopologies/ex-corp-4?retire") curl.setopt(pycurl.SSL_VERIFYPEER, 0) curl.setopt(pycurl.SSL_VERIFYHOST, 0) curl.setopt(pycurl.CUSTOMREQUEST, "POST") curl.perform() print curl.getinfo(pycurl.RESPONSE_CODE) curl.close()
Request headers
POST /mapi/services/erasureCoding/ecTopologies/ex-corp-4?retire HTTP/1.1 Host: admin.hcp-us.example.com:9090 Authorization: HCP bGdyZWVu:35dc4c4aa08fe0deab7e292e00eb8e97 Accept: */* Content-Length: 13 Content-Type: application/x-www-form-urlencoded
Response headers
HTTP/1.1 200 OK X-HCP-SoftwareVersion: 9.0.0.2 Content-Length: 0