Skip to main content

SetUnitBalance

Sets the unit balance of the specified project.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const SetUnitBalanceRequest =
cloudApi.datasphere.project_service.SetUnitBalanceRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ProjectServiceClient);

const result = await client.setUnitBalance(
SetUnitBalanceRequest.fromPartial({
projectId: "projectId",
// unitBalance: {
// value: 0
// }
})
);
console.log(result);
})();

SetUnitBalanceRequest

projectId : string

ID of the project to set the unit balance for.

unitBalance : google.protobuf.Int64Value

The number of units available to the project.

Empty