Skip to main content

List

List avaliable host types.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const ListHostTypesRequest =
cloudApi.compute.host_type_service.ListHostTypesRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.HostTypeServiceClient);

const result = await client.list(
ListHostTypesRequest.fromPartial({
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();

ListHostTypesRequest

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 ListHostTypesResponse.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 ListHostTypesResponse.next_page_token returned by a previous list request.

ListHostTypesResponse

hostTypes : HostType

Lists host types.

nextPageToken : string

Token for getting the next page of the list. If the number of results is greater than the specified ListHostTypesRequest.page_size, use next_page_token as the value for the ListHostTypesRequest.page_token parameter in the next list request.

Each subsequent page will have its own next_page_token to continue paging through the results.

HostType

Represents host resources. Note: Platform can use hosts with different number of memory and cores. TODO: Do we need sockets here?

id : string

Unique type identifier.

cores : int64

Total number of cores available for instances.

memory : int64

Ammount of memory available for instances.

disks : int64

Number of local disks available for instances

diskSize : int64

Size of each local disk