Set
Sets the unit balance and the limits of the specified folder budget.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const SetFolderBudgetRequest =
cloudApi.datasphere.folder_budget_service.SetFolderBudgetRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.FolderBudgetServiceClient);
const result = await client.set(
SetFolderBudgetRequest.fromPartial({
folderId: "folderId",
// setMask: {
// paths: ["paths"]
// },
// unitBalance: {
// value: 0
// },
// maxUnitsPerHour: {
// value: 0
// },
// maxUnitsPerExecution: {
// value: 0
// }
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.datasphere.v1.folder_budget_service_pb2_grpc import FolderBudgetServiceStub
from yandex.cloud.datasphere.v1.folder_budget_service_pb2 import SetFolderBudgetRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(FolderBudgetServiceStub)
response = service.Set(
SetFolderBudgetRequest(
folder_id="folderId",
# set_mask = FieldMask.FromJsonString("field1,field2"),
# unit_balance = Int64Value(
# value = 0
# ),
# max_units_per_hour = Int64Value(
# value = 0
# ),
# max_units_per_execution = Int64Value(
# value = 0
# )
)
)
print(response)
SetFolderBudgetRequest
folderId
: string
ID of the folder to set a budget for.
setMask
: google.protobuf.FieldMask
Field mask that specifies which fields of the budget are going to be set.
unitBalance
: google.protobuf.Int64Value
The number of units available in the folder.
maxUnitsPerHour
: google.protobuf.Int64Value
The number of units that can be spent per hour.
maxUnitsPerExecution
: google.protobuf.Int64Value
The number of units that can be spent on one execution.