Skip to main content

GetUnitBalance

Returns the unit balance of the specified project.

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

const GetUnitBalanceRequest =
cloudApi.datasphere.project_service.GetUnitBalanceRequest;

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

const result = await client.getUnitBalance(
GetUnitBalanceRequest.fromPartial({
projectId: "projectId",
})
);
console.log(result);
})();

GetUnitBalanceRequest

projectId : string

ID of the project to return the unit balance for.

GetUnitBalanceResponse

unitBalance : google.protobuf.Int64Value

The number of units available to the project.