> For the complete documentation index, see [llms.txt](https://cloudforet.gitbook.io/cloudforet-apis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cloudforet.gitbook.io/cloudforet-apis/content/en/cost_analysis/v1/budget.md).

# Budget

A Budget is a planned amount of cost expenditure for reduction and prediction of infrastructure costs.

> **Package : spaceone.api.cost\_analysis.v1**

\ <br>

## Budget

**Budget Methods:**

| Method                                                                                                                                      | Request                                                                                                                                                        | Response                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [**create**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#create)                      | [CreateBudgetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#createbudgetrequest)                   | [BudgetInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetinfo)   |
| [**update**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#update)                      | [UpdateBudgetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#updatebudgetrequest)                   | [BudgetInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetinfo)   |
| [**set\_notification**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#set_notification) | [SetBudgetNotificationRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#setbudgetnotificationrequest) | [BudgetInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetinfo)   |
| [**delete**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#delete)                      | [BudgetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetrequest)                               | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#empty)             |
| [**get**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#get)                            | [BudgetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetrequest)                               | [BudgetInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetinfo)   |
| [**list**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#list)                          | [BudgetQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetquery)                                   | [BudgetsInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetsinfo) |
| [**stat**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#stat)                          | [BudgetStatQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetstatquery)                           | [Struct](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#struct)           |

<br>

### create

Creates a new Budget. When creating a Budget, it should be set for a specific ProjectGroup or Project. The budgeted amount and date of the `planned_limits` should be specified on a monthly or yearly basis.

> **POST** /cost-analysis/v1/budget/create

{{< tabs " create " >}}

{{< tab "Request Example" >}}

[CreateBudgetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#createbudgetrequest)

* **data\_source\_id** (string) `Required`
* **time\_unit** (TimeUnit) `Required`
* **start** (string) `Required`
* **end** (string) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **name** (string)
* **limit** (float)
* **planned\_limits** (PlannedLimit) `Repeated`
* **provider\_filter** (ProviderFilter)
* **notifications** (BudgetNotification) `Repeated`
* **tags** (Struct)
* **workspace\_id** (string)
* **project\_id** (string)

{{< highlight json >}} { "name": "Cloudforet-Budget", "planned\_limits": \[{"date": "2022-01", "limit": 1000.0}, {"date": "2022-02", "limit": 1100.0}, {"date": "2022-03", "limit": 1200.0}, {"date": "2022-04", "limit": 1300.0}, {"date": "2022-05", "limit": 1400.0}, {"date": "2022-06", "limit": 1500.0}, {"date": "2022-07", "limit": 1600.0}, {"date": "2022-08", "limit": 1700.0}, {"date": "2022-09", "limit": 1800.0}, {"date": "2022-10", "limit": 1900.0}, {"date": "2022-11", "limit": 2000.0}, {"date": "2022-12", "limit": 2100.0}], "time\_unit": "MONTHLY", "start": "2022-01", "end": "2022-12", "project\_group\_id": "pg-812c90990877", "data\_source\_id": "ds-fcba92ca73b1" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[BudgetInfo](#BUDGETINFO)

* **budget\_id** (string) `Required`
* **name** (string) `Required`
* **limit** (float) `Required`
* **planned\_limits** (PlannedLimit) `Repeated` `Required`
* **currency** (string) `Required`
* **provider\_filter** (ProviderFilter) `Required`
* **time\_unit** (TimeUnit) `Required`
* **start** (string) `Required`
* **end** (string) `Required`
* **notifications** (BudgetNotification) `Repeated` `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **data\_source\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "budget\_id": "budget-d51b6b6a9910", "name": "Cloudforet-Budget", "limit": 18600.0, "planned\_limits": \[ { "date": "2022-01", "limit": 1000.0 }, { "date": "2022-02", "limit": 1100.0 }, { "date": "2022-03", "limit": 1200.0 }, { "date": "2022-04", "limit": 1300.0 }, { "date": "2022-05", "limit": 1400.0 }, { "date": "2022-06", "limit": 1500.0 }, { "date": "2022-07", "limit": 1600.0 }, { "date": "2022-08", "limit": 1700.0 }, { "date": "2022-09", "limit": 1800.0 }, { "date": "2022-10", "limit": 1900.0 }, { "date": "2022-11", "limit": 2000.0 }, { "date": "2022-12", "limit": 2100.0 } ], "currency": "USD", "provider\_filter": { "state": "ENABLED", "providers": \[ "aws", "google\_cloud" ] }, "time\_unit": "MONTHLY", "start": "2022-01", "end": "2022-12", "tags": {}, "project\_group\_id": "pg-812c90990877", "data\_source\_id": "ds-fcba92ca73b1", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-18T09:30:56.901Z", "updated\_at": "2022-07-18T09:30:56.901Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### update

Updates a specific Budget. You can make changes in the budgeted amount of the time period specified while creating the resource.

> **POST** /cost-analysis/v1/budget/update

{{< tabs " update " >}}

{{< tab "Request Example" >}}

[UpdateBudgetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#updatebudgetrequest)

* **budget\_id** (string) `Required`
* **name** (string)
* **limit** (float)
* **planned\_limits** (PlannedLimit) `Repeated`
* **tags** (Struct)

{{< highlight json >}} { "budget\_id": "budget-d51b6b6a9910", "name": "Cloudforet-Budget-test", "limit": 15000.0, "planned\_limits": \[{"date": "2022-01", "limit": 500.0}, {"date": "2022-02", "limit": 500.0}, {"date": "2022-03", "limit": 500.0}, {"date": "2022-04", "limit": 500.0}, {"date": "2022-05", "limit": 500.0}, {"date": "2022-06", "limit": 500.0}, {"date": "2022-07", "limit": 500.0}, {"date": "2022-08", "limit": 500.0}, {"date": "2022-09", "limit": 500.0}], "end": "2022-12", "tags": {} } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[BudgetInfo](#BUDGETINFO)

* **budget\_id** (string) `Required`
* **name** (string) `Required`
* **limit** (float) `Required`
* **planned\_limits** (PlannedLimit) `Repeated` `Required`
* **currency** (string) `Required`
* **provider\_filter** (ProviderFilter) `Required`
* **time\_unit** (TimeUnit) `Required`
* **start** (string) `Required`
* **end** (string) `Required`
* **notifications** (BudgetNotification) `Repeated` `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **data\_source\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "budget\_id": "budget-d51b6b6a9910", "name": "Cloudforet-Budget", "limit": 18600.0, "planned\_limits": \[ { "date": "2022-01", "limit": 1000.0 }, { "date": "2022-02", "limit": 1100.0 }, { "date": "2022-03", "limit": 1200.0 }, { "date": "2022-04", "limit": 1300.0 }, { "date": "2022-05", "limit": 1400.0 }, { "date": "2022-06", "limit": 1500.0 }, { "date": "2022-07", "limit": 1600.0 }, { "date": "2022-08", "limit": 1700.0 }, { "date": "2022-09", "limit": 1800.0 }, { "date": "2022-10", "limit": 1900.0 }, { "date": "2022-11", "limit": 2000.0 }, { "date": "2022-12", "limit": 2100.0 } ], "currency": "USD", "provider\_filter": { "state": "ENABLED", "providers": \[ "aws", "google\_cloud" ] }, "time\_unit": "MONTHLY", "start": "2022-01", "end": "2022-12", "tags": {}, "project\_group\_id": "pg-812c90990877", "data\_source\_id": "ds-fcba92ca73b1", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-18T09:30:56.901Z", "updated\_at": "2022-07-18T09:30:56.901Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### set\_notification

Sets a notification on a specific Budget. Sets a threshold on the budget, and if the cost exceeds the threshold, a notification is raised.

> **POST** /cost-analysis/v1/budget/set-notification

{{< tabs " set\_notification " >}}

{{< tab "Request Example" >}}

[SetBudgetNotificationRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#setbudgetnotificationrequest)

* **budget\_id** (string) `Required`
* **notifications** (BudgetNotification) `Repeated` `Required`

{{< highlight json >}} { "budget\_id": "budget-4c8606da4521", "notifications": \[ { "threshold": 20.0, "unit": "PERCENT", "notification\_type": "CRITICAL" }, { "threshold": 1000.0, "unit": "ACTUAL\_COST", "notification\_type": "WARNING" } ] } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[BudgetInfo](#BUDGETINFO)

* **budget\_id** (string) `Required`
* **name** (string) `Required`
* **limit** (float) `Required`
* **planned\_limits** (PlannedLimit) `Repeated` `Required`
* **currency** (string) `Required`
* **provider\_filter** (ProviderFilter) `Required`
* **time\_unit** (TimeUnit) `Required`
* **start** (string) `Required`
* **end** (string) `Required`
* **notifications** (BudgetNotification) `Repeated` `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **data\_source\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "budget\_id": "budget-d51b6b6a9910", "name": "Cloudforet-Budget", "limit": 18600.0, "planned\_limits": \[ { "date": "2022-01", "limit": 1000.0 }, { "date": "2022-02", "limit": 1100.0 }, { "date": "2022-03", "limit": 1200.0 }, { "date": "2022-04", "limit": 1300.0 }, { "date": "2022-05", "limit": 1400.0 }, { "date": "2022-06", "limit": 1500.0 }, { "date": "2022-07", "limit": 1600.0 }, { "date": "2022-08", "limit": 1700.0 }, { "date": "2022-09", "limit": 1800.0 }, { "date": "2022-10", "limit": 1900.0 }, { "date": "2022-11", "limit": 2000.0 }, { "date": "2022-12", "limit": 2100.0 } ], "currency": "USD", "provider\_filter": { "state": "ENABLED", "providers": \[ "aws", "google\_cloud" ] }, "time\_unit": "MONTHLY", "start": "2022-01", "end": "2022-12", "tags": {}, "project\_group\_id": "pg-812c90990877", "data\_source\_id": "ds-fcba92ca73b1", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-18T09:30:56.901Z", "updated\_at": "2022-07-18T09:30:56.901Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### delete

Deletes a specific Budget. You must specify the `budget_id` of the Budget to delete.

> **POST** /cost-analysis/v1/budget/delete

{{< tabs " delete " >}}

{{< tab "Request Example" >}}

[BudgetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetrequest)

* **budget\_id** (string) `Required`

{{< highlight json >}} { "budget\_id": "budget-d51b6b6a9910" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### get

Gets a specific Budget. Prints detailed information about the Budget, including `planned_limits` of the project group or project for the pre-defined period.

> **POST** /cost-analysis/v1/budget/get

{{< tabs " get " >}}

{{< tab "Request Example" >}}

[BudgetRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetrequest)

* **budget\_id** (string) `Required`

{{< highlight json >}} { "budget\_id": "budget-d51b6b6a9910" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[BudgetInfo](#BUDGETINFO)

* **budget\_id** (string) `Required`
* **name** (string) `Required`
* **limit** (float) `Required`
* **planned\_limits** (PlannedLimit) `Repeated` `Required`
* **currency** (string) `Required`
* **provider\_filter** (ProviderFilter) `Required`
* **time\_unit** (TimeUnit) `Required`
* **start** (string) `Required`
* **end** (string) `Required`
* **notifications** (BudgetNotification) `Repeated` `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **data\_source\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "budget\_id": "budget-d51b6b6a9910", "name": "Cloudforet-Budget", "limit": 18600.0, "planned\_limits": \[ { "date": "2022-01", "limit": 1000.0 }, { "date": "2022-02", "limit": 1100.0 }, { "date": "2022-03", "limit": 1200.0 }, { "date": "2022-04", "limit": 1300.0 }, { "date": "2022-05", "limit": 1400.0 }, { "date": "2022-06", "limit": 1500.0 }, { "date": "2022-07", "limit": 1600.0 }, { "date": "2022-08", "limit": 1700.0 }, { "date": "2022-09", "limit": 1800.0 }, { "date": "2022-10", "limit": 1900.0 }, { "date": "2022-11", "limit": 2000.0 }, { "date": "2022-12", "limit": 2100.0 } ], "currency": "USD", "provider\_filter": { "state": "ENABLED", "providers": \[ "aws", "google\_cloud" ] }, "time\_unit": "MONTHLY", "start": "2022-01", "end": "2022-12", "tags": {}, "project\_group\_id": "pg-812c90990877", "data\_source\_id": "ds-fcba92ca73b1", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-07-18T09:30:56.901Z", "updated\_at": "2022-07-18T09:30:56.901Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### list

Gets a list of all Budgets. You can use a query to get a filtered list of Budgets.

> **POST** /cost-analysis/v1/budget/list

{{< tabs " list " >}}

{{< tab "Request Example" >}}

[BudgetQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/cost_analysis/v1/Budget/README.md#budgetquery)

* **query** (Query)
* **budget\_id** (string)
* **name** (string)
* **time\_unit** (TimeUnit)
* **workspace\_id** (string)
* **project\_id** (string)
* **data\_source\_id** (string)

{{< highlight json >}} { "query": {} } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[BudgetsInfo](#BUDGETSINFO)

* **results** (BudgetInfo) `Repeated` `Required`
* **total\_count** (int32) `Required`

{{< highlight json >}} { "results": \[ { "budget\_id": "budget-409e33836ea2", "name": "Budget 2 - Monthly", "limit": 18600.0, "planned\_limits": \[ { "date": "2022-01", "limit": 1000.0 }, { "date": "2022-02", "limit": 1100.0 }, { "date": "2022-03", "limit": 1200.0 }, { "date": "2022-04", "limit": 1300.0 }, { "date": "2022-05", "limit": 1400.0 }, { "date": "2022-06", "limit": 1500.0 }, { "date": "2022-07", "limit": 1600.0 }, { "date": "2022-08", "limit": 1700.0 }, { "date": "2022-09", "limit": 1800.0 }, { "date": "2022-10", "limit": 1900.0 }, { "date": "2022-11", "limit": 2000.0 }, { "date": "2022-12", "limit": 2100.0 } ], "currency": "USD", "provider\_filter": { "state": "ENABLED", "providers": \[ "aws", "google\_cloud" ] }, "time\_unit": "MONTHLY", "start": "2022-01", "end": "2022-12", "tags": {}, "project\_group\_id": "pg-812c90990877", "data\_source\_id": "ds-fcba92ca73b1", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-04-12T06:09:56.917Z", "updated\_at": "2022-04-12T06:09:56.917Z" } ], "total\_count": 6 } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### stat

> **POST** /cost-analysis/v1/budget/stat

\ <br>

## Message

### BudgetInfo

* **budget\_id** (string) `Required`
* **name** (string) `Required`
* **limit** (float) `Required`
* **planned\_limits** (PlannedLimit) `Repeated` `Required`
* **currency** (string) `Required`
* **provider\_filter** (ProviderFilter) `Required`
* **time\_unit** (TimeUnit) `Required`
* **start** (string) `Required`
* **end** (string) `Required`
* **notifications** (BudgetNotification) `Repeated` `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **project\_id** (string) `Required`
* **data\_source\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

  <br>

### BudgetNotification

* **threshold** (float) `Required`
* **unit** (Unit) `Required`
* **notification\_type** (NotificationType) `Required`

  <br>

### BudgetQuery

* **query** (Query)
* **budget\_id** (string)
* **name** (string)
* **time\_unit** (TimeUnit)
* **workspace\_id** (string)
* **project\_id** (string)
* **data\_source\_id** (string)

  <br>

### BudgetRequest

* **budget\_id** (string) `Required`

  <br>

### BudgetStatQuery

* **query** (StatisticsQuery) `Required`

  <br>

### BudgetsInfo

* **results** (BudgetInfo) `Repeated` `Required`
* **total\_count** (int32) `Required`

  <br>

### CreateBudgetRequest

* **data\_source\_id** (string) `Required`
* **time\_unit** (TimeUnit) `Required`
* **start** (string) `Required`
* **end** (string) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **name** (string)
* **limit** (float)
* **planned\_limits** (PlannedLimit) `Repeated`
* **provider\_filter** (ProviderFilter)
* **notifications** (BudgetNotification) `Repeated`
* **tags** (Struct)
* **workspace\_id** (string)
* **project\_id** (string)

  <br>

### PlannedLimit

* **date** (string) `Required`
* **limit** (float) `Required`

  <br>

### ProviderFilter

* **state** (State) `Required`
* **providers** (string) `Repeated` `Required`

  <br>

### SetBudgetNotificationRequest

* **budget\_id** (string) `Required`
* **notifications** (BudgetNotification) `Repeated` `Required`

  <br>

### UpdateBudgetRequest

* **budget\_id** (string) `Required`
* **name** (string)
* **limit** (float)
* **planned\_limits** (PlannedLimit) `Repeated`
* **tags** (Struct)

  <br>
