List
Returns the list of available locations.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListLocationsRequest = cloudApi.ydb.location_service.ListLocationsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.LocationServiceClient);
const result = await client.list(
ListLocationsRequest.fromPartial({
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.ydb.v1.location_service_pb2 import ListLocationsRequest
from yandex.cloud.ydb.v1.location_service_pb2_grpc import LocationServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(LocationServiceStub)
response = service.List(
ListLocationsRequest(
# page_size = 0,
# page_token = "pageToken"
)
)
print(response)
ListLocationsRequest
pageSize
: int64
The maximum number of results per page that should be returned. If the number of available
results is larger than page_size
, the service returns a next_page_token
that can be used
to get the next page of results in subsequent ListLocations requests.
Acceptable values are 0 to 1000, inclusive. Default value: 100.
pageToken
: string
Page token. Set page_token
to the next_page_token
returned by a previous ListLocations
request to get the next page of results.
ListLocationsResponse
locations
: Location
Requested list of locations.
nextPageToken
: string
This token allows you to get the next page of results for ListLocations requests,
if the number of results is larger than page_size
specified in the request.
To get the next page, specify the value of next_page_token
as a value for
the page_token
parameter in the next ListLocations request. Subsequent ListLocations
requests will have their own next_page_token
to continue paging through the results.