ListHosts
Retrieves the list of hosts in the specified cluster.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListClusterHostsRequest =
cloudApi.dataproc.cluster_service.ListClusterHostsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ClusterServiceClient);
const result = await client.listHosts(
ListClusterHostsRequest.fromPartial({
// clusterId: "clusterId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.dataproc.v1.cluster_service_pb2_grpc import ClusterServiceStub
from yandex.cloud.dataproc.v1.cluster_service_pb2 import ListClusterHostsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ClusterServiceStub)
response = service.ListHosts(
ListClusterHostsRequest(
# cluster_id = "clusterId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListClusterHostsRequest
clusterId
: string
ID of the cluster to list hosts for.
To get a cluster ID, make a ClusterService.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 ListClusterHostsResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100.
pageToken
: string
Page token. To get the next page of results, set page_token to the ListClusterHostsResponse.next_page_token returned by a previous list request.
filter
: string
A filter expression that filters hosts listed in the response.
The expression must specify:
- The field name. Currently you can use filtering only on Cluster.name field.
- An
=
operator. - The value in double quotes (
"
). Must be 3-63 characters long and match the regular expression[a-z][-a-z0-9]{1,61}[a-z0-9]
. Example of a filter:name=my-host
ListClusterHostsResponse
hosts
: Host
Requested list of hosts.
nextPageToken
: string
Token for getting the next page of the list. If the number of results is greater than
the specified ListClusterHostsRequest.page_size, use next_page_token
as the value
for the ListClusterHostsRequest.page_token parameter in the next list request.
Each subsequent page will have its own next_page_token
to continue paging through the results.
Host
A Data Proc host. For details about the concept, see documentation.
name
: string
Name of the Data Proc host. The host name is assigned by Data Proc at creation time and cannot be changed. The name is generated to be unique across all Data Proc hosts that exist on the platform, as it defines the FQDN of the host.
subclusterId
: string
ID of the Data Proc subcluster that the host belongs to.
health
: Health
Status code of the aggregated health of the host.
computeInstanceId
: string
ID of the Compute virtual machine that is used as the Data Proc host.
role
: Role
Role of the host in the cluster.