Setting up consumption limits for a folder
Written by
DataSphere allows you to set consumption limits for projects in your folder. For more information about the types of limits, see Cost management.
To use the examples, install gRPCurl and get the authorization data for your account:
- Instructions for a Yandex account.
- Instructions for a service account.
- Instructions for a federated account.
Specify the received IAM token when accessing Yandex Cloud resources via the API. Pass the IAM token in the Authorization
header in the following format:
Authorization: Bearer <IAM token>
API
To manage limits for all folder projects, use the Get and Set API methods.
View folder limits:
grpcurl -rpc-header "Authorization: Bearer <IAM token>" \
-d '{"folder_id": "<folder_id>"}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v1.FolderBudgetService/Get
Set limits for the folder:
grpcurl -rpc-header "Authorization: Bearer <IAM token>" \
-d '{"folder_id": "<folder_id>", "set_mask": {"paths": ["unit_balance"]}, "unit_balance":10}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v1.FolderBudgetService/Set
Delete folder limits:
grpcurl -rpc-header "Authorization: Bearer <IAM token>" \
-d '{"folder_id": "<folder_id>", "set_mask": {"paths": ["unit_balance"]}}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v1.FolderBudgetService/Set
Delete all limits for the folder:
grpcurl -rpc-header "Authorization: Bearer <IAM token>" \
-d '{"folder_id": "<folder_id>"}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v1.FolderBudgetService/Set