Get
Returns the specified container.
To get the list of all available containers, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetContainerRequest =
cloudApi.serverless.containers_container_service.GetContainerRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ContainerServiceClient);
const result = await client.get(
GetContainerRequest.fromPartial({
containerId: "containerId",
})
);
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 GetContainerRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ContainerServiceStub)
response = service.Get(GetContainerRequest(container_id="containerId"))
print(response)
GetContainerRequest
containerId
: string
ID of the container to return.
To get a container ID make a ContainerService.List request.
Container
Status
STATUS_UNSPECIFIED
CREATING
Container is being created.
ACTIVE
Container is ready for use.
DELETING
Container is being deleted.
ERROR
Container 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.