List
Retrieves the list of containers in the specified folder.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListContainersRequest =
cloudApi.serverless.containers_container_service.ListContainersRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ContainerServiceClient);
const result = await client.list(
ListContainersRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.containers.v1.container_service_pb2_grpc import ContainerServiceStub
from yandex.cloud.serverless.containers.v1.container_service_pb2 import ListContainersRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ContainerServiceStub)
response = service.List(
ListContainersRequest(
folder_id="folderId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListContainersRequest
folderId : string
ID of the folder to list containers in.
To get a folder ID make a 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 pageSize, the service returns a ListContainersResponse.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 pageToken to the
ListContainersResponse.next_page_token returned by a previous list request.
filter : string
A filter expression that filters containers listed in the response.
The expression must specify:
- The field name. Currently filtering can only be applied to the Container.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-container".
ListContainersResponse
containers : Container
List of containers in the specified folder.
nextPageToken : string
Token for getting the next page of the list. If the number of results is greater than
the specified ListContainersRequest.page_size, use nextPageToken as the value
for the ListContainersRequest.page_token parameter in the next list request.
Each subsequent page will have its own nextPageToken to continue paging through the results.
Container
Status
STATUS_UNSPECIFIEDCREATINGContainer is being created.
ACTIVEContainer is ready for use.
DELETINGContainer is being deleted.
ERRORContainer failed. The only allowed action is delete.
id : string
ID of the container. Generated at creation time.
folderId : string
ID of the folder that the container belongs to.
createdAt : google.protobuf.Timestamp
Creation timestamp for the container.
name : string
Name of the container. The name is unique within the folder.
description : string
Description of the container.
labels : string
Container labels as key:value pairs.
url : string
URL that needs to be requested to call the container.
status : Status
Status of the container.