Example: Adding a tenant to an erasure coding topology

Content Platform Tenant Management Help

Version
9.7.x
File Size
4269 KB
Audience
anonymous
Part Number
MK-95HCPH002-19

Here's a sample GET request that adds a tenant named finance to 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 -X PUT
    -H "Authorization: HCP bGdyZWVu:35dc4c4aa08fe0deab7e292e00eb8e97"
    "https://admin.hcp-us.example.com:9090/mapi/services/erasureCoding/
        ecTopologies/ex-corp-4/tenants/finance"

Request in Python using PycURL

import pycurl
import os
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Authorization: HCP \
  bGdyZWVu:35dc4c4aa08fe0deab7e292e00eb8e97"])
curl.setopt(pycurl.URL,
  "https://admin.hcp-us.example.com:9090/mapi/services/" +
  "erasureCoding/ecTopologies/ex-corp-4/tenants/finance")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.UPLOAD, 1)
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()

Request headers

PUT /mapi/services/erasureCoding/ecTopologies/ex-corp-4/tenants/finance HTTP/1.1
Host: admin.hcp-us.example.com:9090
Authorization: HCP bGdyZWVu:35dc4c4aa08fe0deab7e292e00eb8e97
Accept:*/*

Response headers

HTTP/1.1 200 OK
X-HCP-SoftwareVersion: 9.0.0.2
Content-Length: 0