Get
Returns the specified placement group.
To get the list of all available placement groups, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetPlacementGroupRequest =
cloudApi.compute.placement_group_service.GetPlacementGroupRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.PlacementGroupServiceClient);
const result = await client.get(
GetPlacementGroupRequest.fromPartial({
// placementGroupId: "placementGroupId"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.compute.v1.placement_group_service_pb2 import GetPlacementGroupRequest
from yandex.cloud.compute.v1.placement_group_service_pb2_grpc import PlacementGroupServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(PlacementGroupServiceStub)
response = service.Get(
GetPlacementGroupRequest(
# placement_group_id = "placementGroupId"
)
)
print(response)
GetPlacementGroupRequest
placementGroupId
: string
ID of the placement group to return.
To get a placement group ID make a PlacementGroupService.List request.
PlacementGroup
id
: string
ID of the placement group. Generated at creation time.
folderId
: string
ID of the folder that the placement group belongs to.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
name
: string
Name of the placement group. The name is unique within the folder.
description
: string
Description of the placement group. 0-256 characters long.
labels
: string
Placement group labels as key:value
pairs.
One of placementStrategy
Placement strategy. To specify a placement strategy, send the corresponding field containing approriate structure.
spreadPlacementStrategy
: SpreadPlacementStrategyAnti-affinity placement strategy (`spread`). Instances are distributed
over distinct failure domains.
partitionPlacementStrategy
: PartitionPlacementStrategy
SpreadPlacementStrategy
This is an empty structure that must be passed to explicitly specify the required placement strategy.