Skip to main content

List

Retrieves the list of availability zones.

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

const ListZonesRequest = cloudApi.compute.zone_service.ListZonesRequest;

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

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

ListZonesRequest

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

ListZonesResponse

zones : Zone

List of availability zones.

nextPageToken : string

This token allows you to get the next page of results for list requests. If the number of results is larger than ListZonesRequest.page_size, use the ListZonesRequest.page_token as the value for the ListZonesRequest.page_token query parameter in the next list request. Subsequent list requests will have their own ListZonesRequest.page_token to continue paging through the results.

Zone

Availability zone. For more information, see Availability zones.

Status
  • STATUS_UNSPECIFIED

  • UP

    Zone is available. You can access the resources allocated in this zone.

  • DOWN

    Zone is not available.

id : string

ID of the zone.

regionId : string

ID of the region.

status : Status

Status of the zone.