HCP Tenant Management Help


Example: Creating an empty directory

Here’s a sample HTTP PUT request that creates a new directory named graphics in the quarterly_rpts directory.

Request with curl command line

curl -k -iX PUT
    -H "Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d"
    "https://finance.europe.hcp.example.com/rest/quarterly_rpts/graphics
    ?type=directory"

Request in Python using PycURL

import pycurl
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Authorization: HCP
  bXl1c2Vy:3f3c6784e97531774380db177774ac8d"])
curl.setopt(pycurl.URL, "https://finance.europe.hcp.example.com \
  /rest/quarterly_rpts/graphics?type=directory")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.CUSTOMREQUEST, "PUT")
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()

 

Request headers

PUT /rest/quarterly_rpts/graphics?type=directory HTTP/1.1
Host: finance.europe.hcp.example.com
Authorizaton: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d

Response headers

HTTP/1.1 201 Created
X-HCP-ServicedBySystem: hcp.example.com
Location: /rest/quarterly_rpts/graphics
Content-Length: 0

© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.