Skip to main content

Get

Returns the specified placement group.

To get the list of all available placement groups, make a List request.

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);
})();

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 : SpreadPlacementStrategy
    Anti-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.

PartitionPlacementStrategy

partitions : int64