Billing API, gRPC: BudgetService.Create
Creates a budget for the specified billing account.
gRPC request
rpc Create (CreateBudgetRequest) returns (operation.Operation)
CreateBudgetRequest
{
"billing_account_id": "string",
"name": "string",
// Includes only one of the fields `cost_budget_spec`, `expense_budget_spec`, `balance_budget_spec`
"cost_budget_spec": {
"amount": "string",
"notification_user_account_ids": [
"string"
],
"threshold_rules": [
{
"type": "ThresholdType",
"amount": "string",
"notification_user_account_ids": [
"string"
]
}
],
"filter": {
"service_ids": [
"string"
],
"cloud_folders_filters": [
{
"cloud_id": "string",
"folder_ids": [
"string"
]
}
]
},
// Includes only one of the fields `reset_period`, `start_date`
"reset_period": "ResetPeriodType",
"start_date": "string",
// end of the list of possible fields
"end_date": "string"
},
"expense_budget_spec": {
"amount": "string",
"notification_user_account_ids": [
"string"
],
"threshold_rules": [
{
"type": "ThresholdType",
"amount": "string",
"notification_user_account_ids": [
"string"
]
}
],
"filter": {
"service_ids": [
"string"
],
"cloud_folders_filters": [
{
"cloud_id": "string",
"folder_ids": [
"string"
]
}
]
},
// Includes only one of the fields `reset_period`, `start_date`
"reset_period": "ResetPeriodType",
"start_date": "string",
// end of the list of possible fields
"end_date": "string"
},
"balance_budget_spec": {
"amount": "string",
"notification_user_account_ids": [
"string"
],
"threshold_rules": [
{
"type": "ThresholdType",
"amount": "string",
"notification_user_account_ids": [
"string"
]
}
],
"start_date": "string",
"end_date": "string"
}
// end of the list of possible fields
}
Field |
Description |
billing_account_id |
string Required field. ID of the billing account to list budgets corresponding to. |
name |
string Required field. Name of the budget. |
cost_budget_spec |
Cost budget specification. Includes only one of the fields Specification of the budget. |
expense_budget_spec |
Expense budget specification. Includes only one of the fields Specification of the budget. |
balance_budget_spec |
Balance budget specification. Includes only one of the fields Specification of the budget. |
CostBudgetSpec
Cost budget specification describes budget that can be used to control cost of cloud resources usage.
Field |
Description |
amount |
string Required field. Max cost threshold of the budget. Amount currency is the same as corresponding yandex.cloud.billing.v1.BillingAccount.currency. |
notification_user_account_ids[] |
string IDs of the yandex.cloud.iam.v1.UserAccount. |
threshold_rules[] |
List of the ThresholdRule. |
filter |
Filter that can be used for specific resources selection. Only consumption cost of selected resources are used for the budget calculation. |
reset_period |
enum ResetPeriodType Periodic start type that resets budget after specified period is finished. Includes only one of the fields Start type of the budget.
|
start_date |
string Custom start date of the budget. Includes only one of the fields Start type of the budget. |
end_date |
string Required field. End date of the budget. |
ThresholdRule
Rules that define intermediate cost thresholds of the budget.
Field |
Description |
type |
enum ThresholdType Required field. Type of the rule.
|
amount |
string Required field. Amount of the rule.
|
notification_user_account_ids[] |
string IDs of the yandex.cloud.iam.v1.UserAccount. |
ConsumptionFilter
Filter that can be used for specific resources selection.
Field |
Description |
service_ids[] |
string IDs of the yandex.cloud.billing.v1.Service. |
cloud_folders_filters[] |
Cloud and folders consumption filter. |
CloudFoldersConsumptionFilter
Filter that can be used for specific cloud and its folders selection.
Field |
Description |
cloud_id |
string ID of the yandex.cloud.resourcemanager.v1.Cloud. |
folder_ids[] |
string IDs of the yandex.cloud.resourcemanager.v1.Folder. |
ExpenseBudgetSpec
Expense budget specification describes budget that can be used to control expense of cloud resources usage.
Field |
Description |
amount |
string Required field. Max expense threshold of the budget. Amount currency is the same as corresponding yandex.cloud.billing.v1.BillingAccount.currency. |
notification_user_account_ids[] |
string IDs of the yandex.cloud.iam.v1.UserAccount. |
threshold_rules[] |
List of the ThresholdRule. |
filter |
Filter that can be used for specific resources selection. Only consumption expense of selected resources are used for the budget calculation. |
reset_period |
enum ResetPeriodType Periodic start type that resets budget after specified period is finished. Includes only one of the fields Start type of the budget.
|
start_date |
string Custom start date of the budget. Includes only one of the fields Start type of the budget. |
end_date |
string Required field. End date of the budget. |
BalanceBudgetSpec
Balance budget specification describes budget that can be used to control yandex.cloud.billing.v1.BillingAccount.balance.
Field |
Description |
amount |
string Required field. Max balance threshold of the budget. Amount currency is the same as corresponding yandex.cloud.billing.v1.BillingAccount.currency. |
notification_user_account_ids[] |
string IDs of the yandex.cloud.iam.v1.UserAccount. |
threshold_rules[] |
List of the ThresholdRule. |
start_date |
string Start_date of the budget. |
end_date |
string Required field. End date of the budget. |
operation.Operation
{
"id": "string",
"description": "string",
"created_at": "google.protobuf.Timestamp",
"created_by": "string",
"modified_at": "google.protobuf.Timestamp",
"done": "bool",
"metadata": {
"budget_id": "string"
},
// Includes only one of the fields `error`, `response`
"error": "google.rpc.Status",
"response": {
"id": "string",
"name": "string",
"created_at": "google.protobuf.Timestamp",
"billing_account_id": "string",
"status": "BudgetStatus",
// Includes only one of the fields `cost_budget`, `expense_budget`, `balance_budget`
"cost_budget": {
"amount": "string",
"notification_user_account_ids": [
"string"
],
"threshold_rules": [
{
"type": "ThresholdType",
"amount": "string",
"notification_user_account_ids": [
"string"
]
}
],
"filter": {
"service_ids": [
"string"
],
"cloud_folders_filters": [
{
"cloud_id": "string",
"folder_ids": [
"string"
]
}
]
},
// Includes only one of the fields `reset_period`, `start_date`
"reset_period": "ResetPeriodType",
"start_date": "string",
// end of the list of possible fields
"end_date": "string"
},
"expense_budget": {
"amount": "string",
"notification_user_account_ids": [
"string"
],
"threshold_rules": [
{
"type": "ThresholdType",
"amount": "string",
"notification_user_account_ids": [
"string"
]
}
],
"filter": {
"service_ids": [
"string"
],
"cloud_folders_filters": [
{
"cloud_id": "string",
"folder_ids": [
"string"
]
}
]
},
// Includes only one of the fields `reset_period`, `start_date`
"reset_period": "ResetPeriodType",
"start_date": "string",
// end of the list of possible fields
"end_date": "string"
},
"balance_budget": {
"amount": "string",
"notification_user_account_ids": [
"string"
],
"threshold_rules": [
{
"type": "ThresholdType",
"amount": "string",
"notification_user_account_ids": [
"string"
]
}
],
"start_date": "string",
"end_date": "string"
}
// end of the list of possible fields
}
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
Field |
Description |
id |
string ID of the operation. |
description |
string Description of the operation. 0-256 characters long. |
created_at |
Creation timestamp. |
created_by |
string ID of the user or service account who initiated the operation. |
modified_at |
The time when the Operation resource was last modified. |
done |
bool If the value is |
metadata |
Service-specific metadata associated with the operation. |
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
response |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |
CreateBudgetMetadata
Field |
Description |
budget_id |
string ID of the budget. |
Budget
A Budget resource. For more information, see [/docs/billing/concepts/budget].
Field |
Description |
id |
string ID of the budget. |
name |
string Name of the budget. |
created_at |
Creation timestamp. |
billing_account_id |
string ID of the billing account that the budget belongs to. |
status |
enum BudgetStatus Status of the budget.
|
cost_budget |
Cost budget specification. Includes only one of the fields Specification of the budget. |
expense_budget |
Expense budget specification. Includes only one of the fields Specification of the budget. |
balance_budget |
Balance budget specification. Includes only one of the fields Specification of the budget. |
CostBudgetSpec
Cost budget specification describes budget that can be used to control cost of cloud resources usage.
Field |
Description |
amount |
string Required field. Max cost threshold of the budget. Amount currency is the same as corresponding yandex.cloud.billing.v1.BillingAccount.currency. |
notification_user_account_ids[] |
string IDs of the yandex.cloud.iam.v1.UserAccount. |
threshold_rules[] |
List of the ThresholdRule. |
filter |
Filter that can be used for specific resources selection. Only consumption cost of selected resources are used for the budget calculation. |
reset_period |
enum ResetPeriodType Periodic start type that resets budget after specified period is finished. Includes only one of the fields Start type of the budget.
|
start_date |
string Custom start date of the budget. Includes only one of the fields Start type of the budget. |
end_date |
string Required field. End date of the budget. |
ThresholdRule
Rules that define intermediate cost thresholds of the budget.
Field |
Description |
type |
enum ThresholdType Required field. Type of the rule.
|
amount |
string Required field. Amount of the rule.
|
notification_user_account_ids[] |
string IDs of the yandex.cloud.iam.v1.UserAccount. |
ConsumptionFilter
Filter that can be used for specific resources selection.
Field |
Description |
service_ids[] |
string IDs of the yandex.cloud.billing.v1.Service. |
cloud_folders_filters[] |
Cloud and folders consumption filter. |
CloudFoldersConsumptionFilter
Filter that can be used for specific cloud and its folders selection.
Field |
Description |
cloud_id |
string ID of the yandex.cloud.resourcemanager.v1.Cloud. |
folder_ids[] |
string IDs of the yandex.cloud.resourcemanager.v1.Folder. |
ExpenseBudgetSpec
Expense budget specification describes budget that can be used to control expense of cloud resources usage.
Field |
Description |
amount |
string Required field. Max expense threshold of the budget. Amount currency is the same as corresponding yandex.cloud.billing.v1.BillingAccount.currency. |
notification_user_account_ids[] |
string IDs of the yandex.cloud.iam.v1.UserAccount. |
threshold_rules[] |
List of the ThresholdRule. |
filter |
Filter that can be used for specific resources selection. Only consumption expense of selected resources are used for the budget calculation. |
reset_period |
enum ResetPeriodType Periodic start type that resets budget after specified period is finished. Includes only one of the fields Start type of the budget.
|
start_date |
string Custom start date of the budget. Includes only one of the fields Start type of the budget. |
end_date |
string Required field. End date of the budget. |
BalanceBudgetSpec
Balance budget specification describes budget that can be used to control yandex.cloud.billing.v1.BillingAccount.balance.
Field |
Description |
amount |
string Required field. Max balance threshold of the budget. Amount currency is the same as corresponding yandex.cloud.billing.v1.BillingAccount.currency. |
notification_user_account_ids[] |
string IDs of the yandex.cloud.iam.v1.UserAccount. |
threshold_rules[] |
List of the ThresholdRule. |
start_date |
string Start_date of the budget. |
end_date |
string Required field. End date of the budget. |