SetUnitBalance
Sets the unit balance of the specified project.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.datasphere.v1.project_service_pb2_grpc import ProjectServiceStub
from yandex.cloud.datasphere.v1.project_service_pb2 import SetUnitBalanceRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ProjectServiceStub)
response = service.SetUnitBalance(
SetUnitBalanceRequest(
project_id="projectId",
# unit_balance = Int64Value(
# value = 0
# )
)
)
print(response)
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.