GetUnitBalance
Returns the unit balance of the specified project.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.datasphere.v1.project_service_pb2 import GetUnitBalanceRequest
from yandex.cloud.datasphere.v1.project_service_pb2_grpc import ProjectServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ProjectServiceStub)
response = service.GetUnitBalance(GetUnitBalanceRequest(project_id="projectId"))
print(response)
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.