HCP Tenant Management Help


Example 2: Sending object or version data with an annotation (Unix)

Here’s a Unix command line that uses an HTTP PUT request to store the object data and an annotation for a file named Q1_2012.ppt. The request stores the object in the quarterly_rpts directory.

The cat command appends the contents of the Q1_2012-custom-metadata.xml file to the contents of the Q1_2012.ppt file. The result is piped to a curl command that sends the data to HCP and saves the content of Q1_2012-custom-metadata.xml in an annotation named report_data.

Unix command line

cat Q1_2012.ppt Q1_2012-custom-metadata.xml | curl -k -iT -
    -H "X-HCP-Size: `stat -c %s Q1_2012.ppt`"
    -H "Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d"
    "https://finance.europe.hcp.example.com/rest/quarterly_rpts/Q1_2012.ppt
    ?type=whole-object&annotation=report_data"

Request headers

PUT /rest/quarterly_rpts/Q1_2012.ppt?type=whole-object&annotaton=report_data
    HTTP/1.1
Host: /finance.europe.hcp.example.com
Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d
X-HCP-Size: 678685
Content-Length: 678900

Response headers

HTTP/1.1 201 Created
X-HCP-ServicedBySystem: hcp.example.com
ETag: "9c604138ffb0f308a8552a3752e5a1be"
Location: /rest/quarterly_rpts/Q1_2012.ppt
X-HCP-VersionId: 79885459513089
X-HCP-VersionCreateTimeMilliseconds: 1494364634616
X-HCP-Hash: SHA-256 E830B86212A66A792A79D58BB185EE63A4FADA76BB8A1...
X-HCP-CustomMetadataHash: SHA-256 86212A6692A79D5B185EE63A4DA76BBC...
X-HCP-Time: 1334862493
Content-Length: 0

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