Get cost per resource pool


Obtains the usage cost per resource pool within a specified interval. The interval can be monthly, quarterly, half-yearly, or yearly.

Cost per resource pool

Request details

HTTP method: POST

Request URL: https://<host_name>/cloudcost/api/v1/budgets/resource_pools/costs

Examplehttps://portal.us1.onbmc.com//cloudcost/api/v1/budgets/resource_pools/costs

HeaderSee HTTP request and response headers for header information, such as required authorization token.

Request body properties

Property

Type

Required

Description

start_date

Long

Yes

The date from when you want to view the resource pool cost.

to_date

Long

Yes

The date up to when you want to view the resource pool cost.

size

Integer

No

The number of resource pools for which you want to fetch the cost. The default is 20. Any integer greater than 0 is accepted.

from

Integer

No

The resource pool from which you want to fetch the cost. The default is 0. Any integer that is 0 or greater is accepted. For example, if the available resource pools are 100 and you specify size as 10 and from as 1, the response will contain the cost for the first 10 resource pools.

sort

String

No

Sort the result by created_at in the ascending or descending order. The default is "desc." Accepted values are 'asc' or 'desc' or "all".

filters

String

No

Filter on the resource attributes or tags.

resource_pool_ids

String

Yes

The resource pool IDs.

Sample request

{
"start_date": 1622502300000,
"to_date": 162509759889,
"size": 1,
"from": 0,
"sort": "actual_cost:desc",
"filters": "all",
"resource_pool_ids": [
"3a36aef2-xy64-43f9-be8a-77f7771d3fe9"
]
}

Sample response

{
"200": {
"total": 0,
"resource_pools": [
{
"resource_pool_id": "2c36aef2-ca64-43f9-be8a-30f7771d3fe9",
"actual_cost": 54.909973,
"forecast_cost": 553.17883,
"resource_pool_name": "ATOM Project",
"number_of_resources": 213,
"dirty": false,
"tag": "without_budget"
}
]
},
"404": []
}

Status codes and messages

HTTP code

Description

200

OK

401

Unauthorized

400

Bad request

403

Forbidden

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*