GetShard
Returns the specified shard.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetClusterShardRequest =
cloudApi.mdb.clickhouse_cluster_service.GetClusterShardRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ClusterServiceClient);
const result = await client.getShard(
GetClusterShardRequest.fromPartial({
clusterId: "clusterId",
shardName: "shardName",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.dataproc.v1.cluster_service_pb2_grpc import ClusterServiceStub
from yandex.cloud.mdb.clickhouse.v1.cluster_service_pb2 import GetClusterShardRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ClusterServiceStub)
response = service.GetShard(GetClusterShardRequest(cluster_id="clusterId", shard_name="shardName"))
print(response)
GetClusterShardRequest
clusterId
: string
ID of the MongoDB cluster that the shard belongs to. To get the cluster ID use a ClusterService.List request.
shardName
: string
Name of the MongoDB shard to return. To get the name of the shard use a ClusterService.ListShards request.
Shard
name
: string
Name of the shard.
clusterId
: string
ID of the cluster that the shard belongs to.