Listing namespace statistics
You use the HTTP GET method to list statistics for a namespace. The values returned include information such as the total and used capacity of the namespace and the number of objects with annotations.
Request header
GET /proc/statistics HTTP/1.1
Response headers
This operation does not return any request-specific response headers.
Response body
namespaceName
The namespace name.
totalCapacityBytes
The number of bytes of storage allocated to the namespace. This is the total space available for all data stored in the namespace, including object data, metadata, and the redundant data required to satisfy the namespace DPL.
usedCapacityBytes
The number of bytes currently occupied by all data stored in the namespace, including object data, metadata, and any redundant data required to satisfy the namespace DPL.
softQuotaPercent
The percent of the
totalCapacityBytes
value at which HCP notifies the tenant that free storage space for the namespace is running low.objectCount
The number of objects, including old versions of objects, stored in the namespace.
The object count includes versions of objects that were deleted, but not delete markers. For example, if you create an object, add a version, delete the object while versioning is enabled but without specifying a version ID, and then add a new version of the object, the object count increases by three.
shredObjectCount
The number of objects and versions that have been deleted and are waiting to be shredded.
shredObjectBytes
The number of bytes occupied by the objects and versions that are waiting to be shredded.
customMetadataObjectCount
The number of objects and versions that have one or more annotations.
customMetadataObjectBytes
The number of bytes occupied by custom metadata in all annotations for all objects.
Return codes
If you request information about a namespace to which you do not have access, HCP returns an HTTP 401 (Unauthorized) error code.
Example: Listing statistics for a namespace
Here’s a sample HTTP GET request that retrieves statistics for the finance namespace owned by the europe tenant in the hcp.example.com system.
Request with curl command line
curl -k -H "Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d" "https://finance.europe.hcp.example.com/proc/statistics"
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 \ /proc/statistics") curl.setopt(pycurl.SSL_VERIFYPEER, 0) curl.setopt(pycurl.SSL_VERIFYHOST, 0) curl.perform() print curl.getinfo(pycurl.RESPONSE_CODE) curl.close()
Request headers
GET /proc/statistics HTTP/1.1 Host: /finance.europe.hcp.example.com Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d Content-Length: 1286
Response headers
HTTP/1.1 200 OK X-HCP-Time: 1334326410 Content-Length: 565
Response body
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="/static/xsl/proc-statistics.xsl"?> <statistics xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/static/xsd/proc-statistics.xsd" namespaceName="finance" totalCapacity="10737418240" usedCapacity="932454739" softQuota="85" objectCount="43230" shredObjectCount="0" shredObjectBytes="0" customMetadataObjectCount="6754" customMetadataObjectBytes="894893" />