List
Retrieves the list of placement groups in the specified folder.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListDiskPlacementGroupsRequest =
cloudApi.compute.disk_placement_group_service.ListDiskPlacementGroupsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.DiskPlacementGroupServiceClient);
const result = await client.list(
ListDiskPlacementGroupsRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter",
// orderBy: "orderBy"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.compute.v1.disk_placement_group_service_pb2_grpc import (
DiskPlacementGroupServiceStub,
)
from yandex.cloud.compute.v1.disk_placement_group_service_pb2 import ListDiskPlacementGroupsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(DiskPlacementGroupServiceStub)
response = service.List(
ListDiskPlacementGroupsRequest(
folder_id="folderId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter",
# order_by = "orderBy"
)
)
print(response)
ListDiskPlacementGroupsRequest
folderId
: string
ID of the folder to list placement groups in. To get the folder ID, use yandex.cloud.resourcemanager.v1.FolderService.List request.
pageSize
: int64
The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListDiskPlacementGroupsResponse.next_page_token that can be used to get the next page of results in subsequent list requests.
pageToken
: string
Page token. To get the next page of results, set page_token to the ListDiskPlacementGroupsResponse.next_page_token returned by a previous list request.
filter
: string
A filter expression that filters resources listed in the response.
The expression consists of one or more conditions united by AND
operator: <condition1> [AND <condition2> [<...> AND <conditionN>]]
.
Each condition has the form <field> <operator> <value>
, where:
<field>
is the field name. Currently you can use filtering only on the limited number of fields.<operator>
is a logical operator, one of=
,!=
,IN
,NOT IN
.<value>
represents a value. String values should be written in double ("
) or single ('
) quotes. C-style escape sequences are supported (\"
turns to"
,\'
to'
,\\
to backslash).
orderBy
: string
By which column the listing should be ordered and in which direction, format is "createdAt desc". "id asc" if omitted. The default sorting order is ascending
ListDiskPlacementGroupsResponse
diskPlacementGroups
: DiskPlacementGroup
Lists placement groups for the specified folder.
nextPageToken
: string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListDiskPlacementGroupsRequest.page_size, use next_page_token as the value for the ListDiskPlacementGroupsRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.
DiskPlacementGroup
Status
STATUS_UNSPECIFIED
CREATING
READY
DELETING
id
: string
ID of the placement group.
folderId
: string
ID of the folder that the placement group belongs to.
createdAt
: google.protobuf.Timestamp
Creation timestamp in RFC3339 text format.
name
: string
Name of the placement group. The name is unique within the folder.
description
: string
Description of the placement group.
labels
: string
Resource labels as key:value
pairs.
zoneId
: string
ID of the availability zone where the placement group resides.
status
: Status
Current status of the placement group
One of placementStrategy
Placement strategy.
spreadPlacementStrategy
: DiskSpreadPlacementStrategyDistribute disks over distinct failure domains.
partitionPlacementStrategy
: DiskPartitionPlacementStrategyDistribute disks over partitions.