Update budget


Updates the budget for a resource pool.

This topic includes the following sections:

HTTP method: PUT

Request URLhttps://portal.us1.onbmc.com/cloudcost/api/v1/budgets/resource_pools/{resource_pool_id}/budget

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

Path Parameters

Parameter

Type

Required

Description

resource_pool_id

String

Yes

Resource Pool ID

Query Parameters

None

Request

Request body properties

Property

Type

Required

Description

enabled

Boolean

No

When set to true, the budget is calculated for the resource pool based on the configuration.

When set to false, the budget calculation is ignored with the assumption that budget is not set for the resource pool.

Default value is true.

cycle

String

Yes

Enum of duration.

Possible values are monthly, quarterly, half_yearly, yearly

budget_amount

List (budgets)

Yes

Array of budget amounts. Array size depends on the cycle.

Example: If budget is quarterly, there must be 4 entries.

thresholds_underspenders

Integer

Yes

A number between 0 and 100 identifying the boundary for underspenders.

If the actual cost goes below this number, this resource pool is be tagged as underspender.

thresholds_overspenders

Integer

Yes

A number between 0 and 100 identifying the boundary for overspenders.

If the actual cost goes beyond this number, this resource pool is be tagged as overspender.

Example request JSON

{
 "budget_amount": [
    {
     "amount": 300,
     "start_time": 1514764800000,
     "end_time": 1546214400000
    },
    {
     "amount": 300,
     "start_time": 1514764800000,
     "end_time": 1546214400000
    },
    {
     "amount": 300,
     "start_time": 1514764800000,
     "end_time": 1546214400000
    },
    {
     "amount": 300,
     "start_time": 1514764800000,
     "end_time": 1546214400000
    }
  ],
 "cycle": "QUARTERLY",
 "enabled": true,
 "thresholds_overspenders": 50,
 "thresholds_underspenders": 10
}

Response

Example response JSON

{
 "enabled: true,
  "
cycle": "QUARTERLY",
  "
resource_pool_id": "12345-abcde",
  "
budget_amount": [
    {
      "
end_time": 1546214400000,
      "
start_time": 1514764800000,
      "
amount": 300
    },
    {
      "
end_time": 1546214400000,
      "
start_time": 1514764800000,
      "
amount": 300
    },
    {
      "
end_time": 1546214400000,
      "
start_time": 1514764800000,
      "
amount": 300
    },
    {
      "
end_time": 1546214400000,
      "
start_time": 1514764800000,
      "
amount": 300
    }
  ],
  "
thresholds_underspenders": 10,
  "
thresholds_overspenders": 50
}

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*

BMC Helix Cloud Cost