View Resource Usage Cost for An Account

get

/metering/api/v1/usagecost/{accountId}

Retrieve details of resource usage cost for all subscriptions in a given account.

Request

Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

Success
Body ()
Root Schema : AccountUsageCostRecord
Type: object
Title: AccountUsageCostRecord
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : UsageCostRecord
Type: object
Title: UsageCostRecord
Show Source
Nested Schema : costs
Type: array
Show Source
Nested Schema : dataCenterId
Type: object
Datacenter Id
Nested Schema : endTimeUtc
Type: object
End time of the interval for which cost is returned.
Nested Schema : lastComputationDate
Type: object
Time at which cost was synced from billing system.
Nested Schema : startTimeUtc
Type: object
Start time of the interval for which cost is returned.
Nested Schema : items
Type: array
Show Source
Nested Schema : UsageCost
Type: object
Title: UsageCost
Show Source

Default Response

Unexpected error.
Back to Top

Examples

The following examples show how to retrieve resource usage cost for a given account by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL. This section contains the following examples:
  • Retrieve Usage Cost for Hourly Usage

  • Retrieve Usage Cost for Daily Usage

  • Retrieve Usage Cost for Monthly Usage

  • Retrieve Total Usage Cost

Retrieve Usage Cost for Hourly Usage

cURL Command

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/usagecost/cacct-b08a16eb7b034d99b1bd6de5f62fd302?startTime=2018-02-25T00:00:00.000Z&endTime=2018-05-24T00:00:00.000Z&timeZone=America/Los_Angeles&usageType=HOURLY"

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": "cacct-b08a16eb7b034d99b1bd6de5f62fd302",
    "canonicalLink": "/metering/api/v1/usagecost/cacct-b08a16eb7b034d99b1bd6de5f62fd302?startTime=2018-02-25T00:00:00.000Z&endTime=2018-05-24T00:00:00.000Z&timeZone=America/Los_Angeles&usageType=HOURLY",
    "items": [
        {
            "costs": [
                {
                    "computedAmount": 0.02,
                    "computedQuantity": 0.5171082258064517,
                    "overagesFlag": "N",
                    "unitPrice": 0.0425,
                    "computeType": "Usage"
                }
            ],
            "currency": "USD",
            "endTimeUtc": "2018-02-25T01:00:00.000",
            "gsiProductId": "B88322",
            "quantity": 0.5171082258064517,
            "resourceName": "PIC_BLOCK_STORAGE_STANDARD",
            "serviceName": "COMPUTEBAREMETAL",
            "startTimeUtc": "2018-02-25T00:00:00.000",
            "subscriptionId": "1822956",
            "subscriptionType": "PRODUCTION",
            "lastComputationDate": "2018-02-25T04:30:51.000",
            "serviceEntitlementId": "519450352",
            "entitlementEndDate": null,
            "entitlementStartDate": null
        },
        {
            "costs": [
                {
                    "computedAmount": 0.02,
                    "computedQuantity": 0.5171082258064517,
                    "overagesFlag": "N",
                    "unitPrice": 0.0425,
                    "computeType": "Usage"
                }
            ],
            "currency": "USD",
            "endTimeUtc": "2018-02-25T02:00:00.000",
            "gsiProductId": "B88322",
            "quantity": 0.5171082258064517,
            "resourceName": "PIC_BLOCK_STORAGE_STANDARD",
            "serviceName": "COMPUTEBAREMETAL",
            "startTimeUtc": "2018-02-25T01:00:00.000",
            "subscriptionId": "1822956",
            "subscriptionType": "PRODUCTION",
            "lastComputationDate": "2018-02-25T05:28:44.000",
            "serviceEntitlementId": "519450352",
            "entitlementEndDate": null,
            "entitlementStartDate": null
        },
        {
            "costs": [
                {
                    "computedAmount": 0.02,
                    "computedQuantity": 0.5171082258064517,
                    "overagesFlag": "N",
                    "unitPrice": 0.0425,
                    "computeType": "Usage"
                }
            ],
            "currency": "USD",
            "endTimeUtc": "2018-02-25T03:00:00.000",
            "gsiProductId": "B88322",
            "quantity": 0.5171082258064517,
            "resourceName": "PIC_BLOCK_STORAGE_STANDARD",
            "serviceName": "COMPUTEBAREMETAL",
            "startTimeUtc": "2018-02-25T02:00:00.000",
            "subscriptionId": "1822956",
            "subscriptionType": "PRODUCTION",
            "lastComputationDate": "2018-02-25T06:28:54.000",
            "serviceEntitlementId": "519450352",
            "entitlementEndDate": null,
            "entitlementStartDate": null
        },
        {
            "costs": [
                {
                    "computedAmount": 0.02,
                    "computedQuantity": 0.5171082258064517,
                    "overagesFlag": "N",
                    "unitPrice": 0.0425,
                    "computeType": "Usage"
                }
            ],
            "currency": "USD",
            "endTimeUtc": "2018-02-25T04:00:00.000",
            "gsiProductId": "B88322",
            "quantity": 0.5171082258064517,
            "resourceName": "PIC_BLOCK_STORAGE_STANDARD",
            "serviceName": "COMPUTEBAREMETAL",
            "startTimeUtc": "2018-02-25T03:00:00.000",
            "subscriptionId": "1822956",
            "subscriptionType": "PRODUCTION",
            "lastComputationDate": "2018-02-25T07:28:50.000",
            "serviceEntitlementId": "519450352",
            "entitlementEndDate": null,
            "entitlementStartDate": null
        },
        {
            "costs": [
                {
                    "computedAmount": 0.02,
                    "computedQuantity": 0.5171082258064517,
                    "overagesFlag": "N",
                    "unitPrice": 0.0425,
                    "computeType": "Usage"
                }
            ],
            "currency": "USD",
            "endTimeUtc": "2018-02-25T05:00:00.000",
            "gsiProductId": "B88322",
            "quantity": 0.5171082258064517,
            "resourceName": "PIC_BLOCK_STORAGE_STANDARD",
            "serviceName": "COMPUTEBAREMETAL",
            "startTimeUtc": "2018-02-25T04:00:00.000",
            "subscriptionId": "1822956",
            "subscriptionType": "PRODUCTION",
            "lastComputationDate": "2018-02-25T08:28:44.000",
            "serviceEntitlementId": "519450352",
            "entitlementEndDate": null,
            "entitlementStartDate": null
        },
        ...                      // More Usage Costs items could be displayed
   ]
}

Retrieve Usage Cost for Daily Usage

cURL Command

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

curl -X GET 
     -u joe@example.com:Mypassword1! 
     -H "X-ID-TENANT-NAME:myDomain" 
     "https://itra.oraclecloud.com/metering/api/v1/usagecost/cacct-b08a16eb7b034d99b1bd6de5f62fd302?startTime=2017-04-20T00:00:00.000Z&endTime=2017-04-22T00:00:00.000Z&usageType=DAILY&timeZone=America/New_York"

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": "cacct-b08a16eb7b034d99b1bd6de5f62fd302",
    "canonicalLink": "/metering/api/v1/usagecost/cacct-b08a16eb7b034d99b1bd6de5f62fd302?startTime=2017-04-20T00:00:00.000Z&endTime=2017-04-22T00:00:00.000Z&usageType=DAILY&timeZone=America/New_York",
    "items": [
        {
            "costs": [
                {
                    "computedAmount": 0.48,
                    "computedQuantity": 7.741935483870968,
                    "overagesFlag": "Y",
                    "unitPrice": 0.0651
                },
                {
                    "computedAmount": 0.16,
                    "computedQuantity": 2.5806451612903225,
                    "overagesFlag": "N",
                    "unitPrice": 0.0651
                }
            ],
            "currency": "USD",
            "endTimeUtc": "2017-04-21T00:00:00.000",
            "gsiProductId": "B87080",
            "resourceName": "BDCSCE_EE_PAAS_ANY_GB_HOUR",
            "serviceName": "BDCSCE",
            "startTimeUtc": "2017-04-20T00:00:00.000",
            "subscriptionId": "1507007",
            "subscriptionType": "PRODUCTION",
            "lastComputationDate": null
        },
        {
            "costs": [
                {
                    "computedAmount": 0.8,
                    "computedQuantity": 12.903225806451612,
                    "overagesFlag": "Y",
                    "unitPrice": 0.0651
                },
                {
                    "computedAmount": 0.2,
                    "computedQuantity": 3.225806451612903,
                    "overagesFlag": "N",
                    "unitPrice": 0.0651
                }
            ],
            "currency": "USD",
            "endTimeUtc": "2017-04-22T00:00:00.000",
            "gsiProductId": "B87080",
            "resourceName": "BDCSCE_EE_PAAS_ANY_GB_HOUR",
            "serviceName": "BDCSCE",
            "startTimeUtc": "2017-04-21T00:00:00.000",
            "subscriptionId": "1507007",
            "subscriptionType": "PRODUCTION",
            "lastComputationDate": null
        },
        {
            "costs": [
                {
                    "computedAmount": 3.28,
                    "computedQuantity": 32.806451612903224,
                    "overagesFlag": "N",
                    "unitPrice": 0.1
                },
                {
                    "computedAmount": 9.84,
                    "computedQuantity": 98.41935483870968,
                    "overagesFlag": "Y",
                    "unitPrice": 0.1
                }
            ],
            "currency": "USD",
            "endTimeUtc": "2017-04-21T00:00:00.000",
            "gsiProductId": "B87795",
            "resourceName": "BDCSCE_EE_PAAS_ANY_SSD_GB_HOUR",
            "serviceName": "BDCSCE",
            "startTimeUtc": "2017-04-20T00:00:00.000",
            "subscriptionId": "1507007",
            "subscriptionType": "PRODUCTION",
            "lastComputationDate": null
        },
        {
            "costs": [
                {
                    "computedAmount": 4.36,
                    "computedQuantity": 43.60806451612903,
                    "overagesFlag": "N",
                    "unitPrice": 0.1
                },
                {
                    "computedAmount": 16.14,
                    "computedQuantity": 161.43225806451613,
                    "overagesFlag": "Y",
                    "unitPrice": 0.1
                }
            ],
            "currency": "USD",
            "endTimeUtc": "2017-04-22T00:00:00.000",
            "gsiProductId": "B87795",
            "resourceName": "BDCSCE_EE_PAAS_ANY_SSD_GB_HOUR",
            "serviceName": "BDCSCE",
            "startTimeUtc": "2017-04-21T00:00:00.000",
            "subscriptionId": "1507007",
            "subscriptionType": "PRODUCTION",
            "lastComputationDate": null
        }
    ]
}

Retrieve Usage Cost for Monthly Usage

cURL Command

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

curl -X GET 
     -u joe@example.com:Mypassword1! 
     -H "X-ID-TENANT-NAME:myDomain" 
     "https://itra.oraclecloud.com/metering/api/v1/usagecost/cacct-b08a16eb7b034d99b1bd6de5f62fd302?startTime=2017-03-20T00:00:00.000Z&endTime=2017-05-22T00:00:00.000Z&usageType=MONTHLY&timeZone=America/New_York"

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":"cacct-b08a16eb7b034d99b1bd6de5f62fd302",
	"canonicalLink":"/metering/api/v1/usagecost/cacct-b08a16eb7b034d99b1bd6de5f62fd302?startTime=2017-03-20T00:00:00.000Z&endTime=2017-05-22T00:00:00.000Z&usageType=MONTHLY&timeZone=America/New_York",
	"items":[ 
	{ 
		"costs":[ 
			{ 
			"computedAmount":-4.16,
			"computedQuantity":67.09677419354838,
			"overagesFlag":"N",
			"unitPrice":-0.0651
			},
		{ 
		"computedAmount":3.92,
		"computedQuantity":63.225806451612904,
		"overagesFlag":"Y",
		"unitPrice":0.0651
		},
		{ 
		"computedAmount":4.52,
		"computedQuantity":72.90322580645162,
		"overagesFlag":"N",
		"unitPrice":0.0651
		}
		],
		"currency":"USD",
		"endTimeUtc":"2017-04-30T20:00:00.000",
		"gsiProductId":"B87080",
		"resourceName":"BDCSCE_EE_PAAS_ANY_GB_HOUR",
		"serviceName":"BDCSCE",
		"startTimeUtc":"2017-03-31T20:00:00.000",
		"subscriptionId":"1507007",
		"subscriptionType":"PRODUCTION",
		"lastComputationDate":null
		},
		{ 
		"costs":[ 
		{ 
		"computedAmount":-390.59,
		"computedQuantity":1210.649721016739,
		"overagesFlag":"N",
		"unitPrice":-0.3226
		},
		{ 
		"computedAmount":2.37,
		"computedQuantity":7.350278983261,
		"overagesFlag":"Y",
		"unitPrice":0.3226
		},
		{ 
		"computedAmount":390.59,
		"computedQuantity":1210.649721016739,
		"overagesFlag":"N",
		"unitPrice":0.3226
		}
		],
		"currency":"USD",
		"endTimeUtc":"2017-04-30T20:00:00.000",
		"gsiProductId":"B87079",
		"resourceName":"BDCSCE_EE_PAAS_ANY_OCPU_HOUR",
		"serviceName":"BDCSCE",
		"startTimeUtc":"2017-03-31T20:00:00.000",
		"subscriptionId":"1507007",
		"subscriptionType":"PRODUCTION",
		"lastComputationDate":null
		},
		{ 
		"costs":[ 
		{ 
		"computedAmount":80.1,
		"computedQuantity":801.158064516129,
		"overagesFlag":"Y",
		"unitPrice":0.1
		},
		{ 
		"computedAmount":-100.52,
		"computedQuantity":1004.1370967741935,
		"overagesFlag":"N",
		"unitPrice":-0.1
		},
		{ 
		"computedAmount":108.16,
		"computedQuantity":1080.5516129032258,
		"overagesFlag":"N",
		"unitPrice":0.1
		}
		],
		"currency":"USD",
		"endTimeUtc":"2017-04-30T20:00:00.000",
		"gsiProductId":"B87795",
		"resourceName":"BDCSCE_EE_PAAS_ANY_SSD_GB_HOUR",
		"serviceName":"BDCSCE",
		"startTimeUtc":"2017-03-31T20:00:00.000",
		"subscriptionId":"1507007",
		"subscriptionType":"PRODUCTION",
		"lastComputationDate":null
		}
	]
}

Retrieve Total Usage Cost

cURL Command

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

curl -X GET 
     -u joe@example.com:Mypassword1! 
     -H "X-ID-TENANT-NAME:myDomain" 
     "https://itra.oraclecloud.com/metering/api/v1/usagecost/cacct-b08a16eb7b034d99b1bd6de5f62fd302?serviceName=JAAS&resourceName=JCS_SUITE_PAAS_GP_OCPU_HOUR&dataCenter=US001&startTime=2017-04-20T00:00:00.000Z&endTime=2017-04-22T00:00:00.000Z&usageType=TOTAL&timeZone=America/New_York"

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":"cacct-b08a16eb7b034d99b1bd6de5f62fd302",
	"canonicalLink":"/metering/api/v1/usagecost/cacct-b08a16eb7b034d99b1bd6de5f62fd302?serviceName=JAAS&resourceName=JCS_SUITE_PAAS_GP_OCPU_HOUR&dataCenter=US001&startTime=2017-04-20T00:00:00.000Z&endTime=2017-04-22T00:00:00.000Z&usageType=TOTAL&timeZone=America/New_York",
	"items":[ 
	{ 
		"costs":[ 
		{ 
		"computedAmount":0.36,
		"computedQuantity":5.806451612903226,
		"overagesFlag":"N",
		"unitPrice":0.0651
		},
		{ 
		"computedAmount":1.28,
		"computedQuantity":20.64516129032258,
		"overagesFlag":"Y",
		"unitPrice":0.0651
		}
		],
		"currency":"USD",
		"endTimeUtc":"2017-04-22T00:00:00.000",
		"gsiProductId":"B87080",
		"resourceName":"BDCSCE_EE_PAAS_ANY_GB_HOUR",
		"serviceName":"BDCSCE",
		"startTimeUtc":"2017-04-20T00:00:00.000",
		"subscriptionId":"1507007",
		"subscriptionType":"PRODUCTION",
		"lastComputationDate":null
		},
		{ 
		"costs":[ 
		{ 
		"computedAmount":25.98,
		"computedQuantity":259.8516129032258,
		"overagesFlag":"Y",
		"unitPrice":0.1
		},
		{ 
		"computedAmount":7.64,
		"computedQuantity":76.41451612903226,
		"overagesFlag":"N",
		"unitPrice":0.1
		}
		],
		"currency":"USD",
		"endTimeUtc":"2017-04-22T00:00:00.000",
		"gsiProductId":"B87795",
		"resourceName":"BDCSCE_EE_PAAS_ANY_SSD_GB_HOUR",
		"serviceName":"BDCSCE",
		"startTimeUtc":"2017-04-20T00:00:00.000",
		"subscriptionId":"1507007",
		"subscriptionType":"PRODUCTION",
		"lastComputationDate":null
		}
	]
}
Back to Top