View Resource Usage for an Account

get

/metering/api/v1/usage/{accountId}

Retrieve details of resource usage of all service entitlements in a given account.

Request

Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

Success
Body ()
Root Schema : AccountUsageRecord
Type: object
Title: AccountUsageRecord
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : UsageRecord
Type: object
Title: UsageRecord
Show Source
Nested Schema : endTimeUtc
Type: object
Nested Schema : startTimeUtc
Type: object
Nested Schema : usage
Type: array
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : Usage
Type: object
Title: Usage
Show Source

Default Response

Unexpected error.
Back to Top

Examples

cURL Command

The following example shows how to retrieve details about resource usage for a given account by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL.

Enter the command on a single line. Line breaks are used in this example for readability.

curl -X GET 
     -u joe@example.com 
     -H "X-ID-TENANT-NAME:myDomain" 
     "https://itra.oraclecloud.com/metering/api/v1/usage/sseyz05242hng?serviceName=JAAS&resourceName=JCS_SUITE_PAAS_GP_OCPU_HOUR&dataCenter=US001&startTime=2017-06-01T00:00:00.000Z&endTime=2017-06-03T00:00:00.000Z&usageType=TOTAL&timeZone=Asia/Kolkata"

Ensure that the timezone you specify in the cURL command matches the timezone in Oracle Cloud My Services.

Example of Request Body

There is no request body to submit with the HTTP request.

Example of Response Body

The following example shows the response body in JSON format.

{
    "accountId": "sseyz05242hng",
    "canonicalLink": "/metering/api/v1/usage/sseyz05242hng?serviceName=JAAS&resourceName=JCS_SUITE_PAAS_GP_OCPU_HOUR&dataCenter=US001&startTime=2017-06-01T00:00:00.000Z&endTime=2017-06-03T00:00:00.000Z&usageType=TOTAL&timeZone=Asia/Kolkata",
    "items": [
        {
            "serviceName": "JAAS",
            "dataCenter": "US001",
            "startTimeUtc": "2017-06-01T00:30:00.000",
            "endTimeUtc": "2017-06-03T00:30:00.000",
            "usage": [
                {
                    "quantity": 90,
                    "resourceName": "JCS_SUITE_PAAS_GP_OCPU_HOUR",
                    "units": "OCPU Hours"
                }
            ],
            "entityId": "504299074",
            "entityType": "SERVICE_ENTITLEMENT"
        }
    ]
}
Back to Top