Budget

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

Package : spaceone.api.cost_analysis.v1

Budget

Budget Methods:

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

  • 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

  • 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 >}}

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

  • 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

  • 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 >}}

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

  • 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

  • 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 >}}

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

  • budget_id (string) Required

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

{{< /tabs >}}

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

  • budget_id (string) Required

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

{{< tab "Response Example" >}}

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 >}}

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

  • 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

  • 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 >}}

stat

POST /cost-analysis/v1/budget/stat

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

BudgetNotification

  • threshold (float) Required

  • unit (Unit) Required

  • notification_type (NotificationType) Required

BudgetQuery

  • query (Query)

  • budget_id (string)

  • name (string)

  • time_unit (TimeUnit)

  • workspace_id (string)

  • project_id (string)

  • data_source_id (string)

BudgetRequest

  • budget_id (string) Required

BudgetStatQuery

  • query (StatisticsQuery) Required

BudgetsInfo

  • results (BudgetInfo) Repeated Required

  • total_count (int32) Required

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)

PlannedLimit

  • date (string) Required

  • limit (float) Required

ProviderFilter

  • state (State) Required

  • providers (string) Repeated Required

SetBudgetNotificationRequest

  • budget_id (string) Required

  • notifications (BudgetNotification) Repeated Required

UpdateBudgetRequest

  • budget_id (string) Required

  • name (string)

  • limit (float)

  • planned_limits (PlannedLimit) Repeated

  • tags (Struct)

Last updated