Obtaining Cloud Account Usage Data

You can view the up-to-date, estimated account balance details of your services or subscriptions using the My Services API and Metering API as shown below.

Note:

The usage cost estimate is updated periodically and may not include all of your actual usage. Your monthly invoice may differ from this estimate.

Step 1: Obtain the Cloud Account ID Using My Services API

The following example shows how to obtain the Cloud Account ID using My Services API by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL.

curl -X GET -u joe@example.com -H "X-ID-TENANT-NAME:{domain}" "https://itra.oraclecloud.com/itas/{domain}/myservices/api/v1/serviceEntitlements"

In the above example, domain is the IDCS GUID that identifies the identity domain for the users within Identity Cloud Service. To obtain the IDCS GUID, go to the Users page in My Services dashboard and click on Identity Console. The URL in the browser address field will show you the IDCS GUID for your identity domain. For example:

https://idcs-105bbbdfe5644611bf7ce04496073adf.identity.oraclecloud.com/ui/v1/adminconsole/?root=users

In the above URL, idcs-105bbbdfe5644611bf7ce04496073adf is the IDCS GUID for your identity domain.

Example of Response Body

The following example shows the response body in JSON format.

{
     "items": [
         {
             "id": "cesi-511202718",                          // Unique ServiceEntitlementId
             "purchaseEntitlement": {                         // Purchase Entitlement is the entity bought by a customer
                 "subscriptionId": "511203590",
                 "id": "511203590",
                 "canonicalLink": "/itas/{domain}/myservices/api/v1/purchaseEntitlements/511203590"
             },
             "serviceDefinition": {
                 "canonicalLink": "/itas/{domain}/myservices/api/v1/serviceDefinitions/500089778",
                 "id": "500089778",
                 "name": "Storage"                            // The customer is entitled to use the Storage Service
             },
             "createdOn": "2017-12-20T16:23:23.326Z",
             "createdBy": "paul.smith@oracle.com",
             "modifiedOn": "2017-12-20T18:35:40.628Z",
             "modifiedBy": "paul.smith@oracle.com",
             "identityDomain": {                              // Identity Domain to which the Service Entitlement is associated
                 "id": "511203592",
                 "name": "myenvironment",
                 "displayName": "myenvironment"
             },
             "cloudAccount": {                                // Cloud Account to which the Service Entitlement is associated
                 "id": "cacct-be7475efc2c54995bc842d3379d35812",
                 "name": "myenvironment",
                 "canonicalLink": "/itas/{domain}/myservices/api/v1/cloudAccounts/cacct-be7475efc2c54995bc842d3379d35812"
             },
             "status": "ACTIVE",                              // Current Status
             "serviceConfigurations": {                       // Specific configuration information such as Exadata configuration
                 "canonicalLink": "/itas/{domain}/myservices/api/v1/serviceEntitlements/cesi-511202718/serviceConfigurations"
             },
             "canonicalLink": "/itas/{domain}/myservices/api/v1/serviceEntitlements/cesi-511202718"
         },
         {
             "id": "cesi-511202719",
             "purchaseEntitlement": {
                 "subscriptionId": "511203590",
                 "id": "511203590",
                 "canonicalLink": "/itas/{domain}/myservices/api/v1/purchaseEntitlements/511203590"
             },
             "serviceDefinition": {
                 "canonicalLink": "/itas/{domain}/myservices/api/v1/serviceDefinitions/500123193",
                 "id": "500123193",
                 "name": "Compute"                            // The customer is entitled to use the Compute Service
             },
             "createdOn": "2017-12-20T16:23:23.326Z",
             "createdBy": "paul.smith@oracle.com",
             "modifiedOn": "2017-12-20T18:35:40.628Z",
             "modifiedBy": "paul.smith@oracle.com",
             "identityDomain": {
                 "id": "511203592",
                 "name": "myenvironment",
                 "displayName": "myenvironment"
             },
             "cloudAccount": {
                 "id": "cacct-be7475efc2c54995bc842d3379d35812",
                 "name": "myenvironment",
                 "canonicalLink": "/itas/{domain}/myservices/api/v1/cloudAccounts/cacct-be7475efc2c54995bc842d3379d35812"
             },
             "status": "ACTIVE",
             "serviceConfigurations": {
                 "canonicalLink": "/itas/{domain}/myservices/api/v1/serviceEntitlements/cesi-511202719/serviceConfigurations"
             },
             "canonicalLink": "/itas/{domain}/myservices/api/v1/serviceEntitlements/cesi-511202719"
         },
         ...                                                  // More Service Entitlements could be displayed
     ],
 "canonicalLink": "/itas/{domain}/myservices/api/v1/serviceEntitlements",
 "hasMore": false,
 "limit": 25,
 "offset": 0
 }

From the response body obtain the cloud account ID which will be used to obtain the usage data in step 2. In the above example, the cloud account ID is cacct-be7475efc2c54995bc842d3379d35812.

Step 2: Obtain the Resource Usage Cost for your Cloud Account Using Metering API

The following example shows how to obtain the resource usage cost for your cloud account using Metering API by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL.

curl -X GET -u joe@example.com -H "X-ID-TENANT-NAME:{domain}" "https://itra.oraclecloud.com/metering/api/v1/usagecost/cacct-be7475efc2c54995bc842d3379d35812?serviceName=Compute&startTime=2018-03-03T23:00:00.000&endTime=2018-04-04T00:00:00.000&usageType=DAILY&timeZone=Europe/London&dcAggEnabled=Y&computeTypeEnabled=Y"

Example of Response Body

The following example shows the response body in JSON format.

{  
   "accountId":"cacct-be7475efc2c54995bc842d3379d35812",
   "canonicalLink":"/metering/api/v1/usagecost/cacct-be7475efc2c54995bc842d3379d35812?serviceName=Compute&startTime=2018-03-03T23:00:00.000&endTime=2018-04-04T00:00:00.000&usageType=DAILY&timeZone=Europe/London&dcAggEnabled=Y&computeTypeEnabled=Y",
   "items":[  
      {  
         "costs":[  
            {  
               "computedAmount":29.44,
               "computedQuantity":23.0,
               "overagesFlag":"Y",
               "unitPrice":1.275,
               "computeType":"PAYG"
            }
         ],
         "currency":"USD",
         "endTimeUtc":"2018-03-04T23:00:00.000",
         "gsiProductId":"B87820",
         "resourceName":"FC_10GB_PORT",
         "serviceName":"Compute",
         "startTimeUtc":"2018-03-03T23:00:00.000",
         "subscriptionId":"511203590",
         "subscriptionType":"PRODUCTION",
         "lastComputationDate":null,
         "dataCenterId":"US001",
         "serviceEntitlementId":"cesi-511202718",
         "entitlementEndDate":null,
         "entitlementStartDate":null
      },
      {  
         "costs":[  
            {  
               "computedAmount":30.72,
               "computedQuantity":24.0,
               "overagesFlag":"Y",
               "unitPrice":1.275,
               "computeType":"PAYG"
            }
         ],
         "currency":"USD",
         "endTimeUtc":"2018-03-05T23:00:00.000",
         "gsiProductId":"B87820",
         "resourceName":"FC_10GB_PORT",
         "serviceName":"Compute",
         "startTimeUtc":"2018-03-04T23:00:00.000",
         "subscriptionId":"511203590",
         "subscriptionType":"PRODUCTION",
         "lastComputationDate":null,
         "dataCenterId":"US001",
         "serviceEntitlementId":"cesi-511202718",
         "entitlementEndDate":null,
         "entitlementStartDate":null
      },
      {  
         "costs":[  
            {  
               "computedAmount":30.72,
               "computedQuantity":24.0,
               "overagesFlag":"Y",
               "unitPrice":1.275,
               "computeType":"PAYG"
            }
         ],
         "currency":"USD",
         "endTimeUtc":"2018-03-06T23:00:00.000",
         "gsiProductId":"B87820",
         "resourceName":"FC_10GB_PORT",
         "serviceName":"Compute",
         "startTimeUtc":"2018-03-05T23:00:00.000",
         "subscriptionId":"511203590",
         "subscriptionType":"PRODUCTION",
         "lastComputationDate":null,
         "dataCenterId":"US001",
         "serviceEntitlementId":"cesi-511202718",
         "entitlementEndDate":null,
         "entitlementStartDate":null
      },
      ...                      // More Usage Costs items could be displayed
   ]
}