Skip to main content

Set

Sets the unit balance and the limits of the specified folder budget.

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);
})();

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.

Empty