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
-
accountId: string
Account name, starts with cacct.
Query Parameters
-
componentId: string
Components are usage attributes passed by services. Not applicable to aggregated usage.
-
dataCenter: string
Datacenter.
-
dcAggEnabled: string
Y if output needs to be grouped per datacenter.
-
endTime: string
Specifies the endpoint of the interval for which usage is being returned in given timezone.
-
endTimeUtc: string
Specifies the endpoint of the interval for which usage is being returned in UTC.
-
quantity: number
Used for filtering usage by quantity.
-
reservationId: integer
Used for filtering usage based on reservationId.
-
resourceName: string
Resource Name
-
serviceEntitlementId: string
Service Entitlement Id
-
serviceName: string
Service Name
-
startTime: string
Specifies the start time of the interval for which usage is returned in supplied timezone.
-
startTimeUtc: string
-
timeZone: string
Timezone.
-
tzd: string
Timezone descriptor.
-
units: string
Units.
-
usageSource: string
To be used to filter raw usage by usageSource, which is non null if some service is reportin usage on behalf of another service.
-
usageType: string
UsageType can be TOTAL, HOURLY or DAILY. Defaults to TOTAL.
Response
Supported Media Types
- application/vnd.com.oracle.oraclecloud.metering.usage+json
200 Response
Success
Nested Schema : UsageRecord
Type:
object
Title:
Show Source
UsageRecord
-
canonicalLink(optional):
string
-
componentId(optional):
string
-
componentType(optional):
string
-
dataCenter(optional):
string
-
endTimeUtc(optional):
object endTimeUtc
-
entityId(optional):
string
-
entityType(optional):
string
Title:
EntityType
Allowed Values:[ "SERVICE_INSTANCE", "SERVICE_ENTITLEMENT" ]
-
reservationId(optional):
string
-
serviceName(optional):
string
-
startTimeUtc(optional):
object startTimeUtc
-
usage(optional):
array usage
Nested Schema : endTimeUtc
Type:
object
Nested Schema : startTimeUtc
Type:
object
Default Response
Unexpected error.
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" } ] }