Skip to main content

ListRevisions

Retrieves the list of revisions for the specified container, or of all container revisions in the specified folder.

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

const ListContainersRevisionsRequest =
cloudApi.serverless.containers_container_service
.ListContainersRevisionsRequest;

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

const result = await client.listRevisions(
ListContainersRevisionsRequest.fromPartial({
// folderId: "folderId",
// containerId: "containerId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();

ListContainersRevisionsRequest

One of id

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

filter : string

A filter expression that filters resources listed in the response.

The expression must specify:

  1. The field name. Currently filtering can only be applied to the Revision.status and Revision.runtime fields.
  2. An = operator.
  3. 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: status="ACTIVE".

ListContainersRevisionsResponse

revisions : Revision

List of revisions for the specified folder or container.

nextPageToken : string

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

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

Revision

Status
  • STATUS_UNSPECIFIED

  • CREATING

    Revision is being created.

  • ACTIVE

    Revision is currently used by the container.

  • OBSOLETE

    Revision is not used by the container. May be deleted later.

id : string

ID of the revision.

containerId : string

ID of the container that the revision belongs to.

description : string

Description of the revision.

createdAt : google.protobuf.Timestamp

Creation timestamp for the revision.

image : Image

Image configuration for the revision.

resources : Resources

Resources allocated to the revision.

executionTimeout : google.protobuf.Duration

Timeout for the execution of the revision.

If the timeout is exceeded, Serverless Containers responds with a 504 HTTP code.

concurrency : int64

The number of concurrent requests allowed per container instance.

serviceAccountId : string

ID of the service account associated with the revision.

status : Status

Status of the revision.

secrets : Secret

Yandex Lockbox secrets to be used by the revision.

connectivity : Connectivity

Network access. If specified the revision will be attached to specified network/subnet(s).

provisionPolicy : ProvisionPolicy

Policy for provisioning instances of the revision.

The policy is only applied when the revision is ACTIVE.

scalingPolicy : ScalingPolicy

Policy for scaling instances of the revision.

logOptions : LogOptions

Options for logging from the container.

storageMounts : StorageMount

S3 mounts to be used by the revision.

mounts : Mount

Mounts to be used by the revision.

Image

Revision image specification.

imageUrl : string

Image URL, that is used by the revision.

imageDigest : string

Digest of the image. Calculated at creation time.

command : Command

Override for the image's ENTRYPOINT.

args : Args

Override for the image's CMD.

environment : string

Additional environment for the container.

workingDir : string

Override for the image's WORKDIR.

Resources

Resources allocated to a revision.

memory : int64

Amount of memory available to the revision, specified in bytes, multiple of 128MB.

cores : int64

Number of cores available to the revision.

coreFraction : int64

Specifies baseline performance for a core in percent, multiple of 5%. Should be 100% for cores > 1.

Secret

Secret that is available to the container at run time.

id : string

ID of Yandex Lockbox secret.

versionId : string

ID of Yandex Lockbox secret.

key : string

Key in secret's payload, which value to be delivered into container environment.

One of reference

  • environmentVariable : string

    Environment variable in which secret's value is delivered.

Connectivity

Revision connectivity specification.

networkId : string

Network the revision will have access to.

subnetIds : string

The list of subnets (from the same network) the revision can be attached to.

Deprecated, it is sufficient to specify only network_id, without the list of subnet_ids.

ProvisionPolicy

minInstances : int64

Minimum number of guaranteed provisioned container instances for all zones in total.

ScalingPolicy

zoneInstancesLimit : int64

Upper limit for instance count in each zone. 0 means no limit.

zoneRequestsLimit : int64

Upper limit of requests count in each zone. 0 means no limit.

LogOptions

disabled : bool

Is logging from container disabled.

One of destination

Log entries destination.

  • logGroupId : string

    Entry should be written to log group resolved by ID.

  • folderId : string

    Entry should be written to default log group for specified folder.

minLevel : yandex.cloud.logging.v1.LogLevel.Level

Minimum log entry level.

See LogLevel.Level for details.

StorageMount

bucketId : string

S3 bucket name for mounting.

prefix : string

S3 bucket prefix for mounting.

readOnly : bool

Is mount read only.

mountPointPath : string

Mount point path inside the container for mounting.

Mount

Mount contains an information about version's external storage mount

Mode
  • MODE_UNSPECIFIED

  • READ_ONLY

  • READ_WRITE

ObjectStorage

ObjectStorage as a mount

bucketId : string

ObjectStorage bucket name for mounting.

prefix : string

ObjectStorage bucket prefix for mounting.

DiskSpec

Disk as a mount

size : int64

The size of disk for mount in bytes

blockSize : int64

Optional block size of disk for mount in bytes

mountPointPath : string

The absolute mount point path inside the container for mounting.

mode : Mode

Mount's mode

One of target

Target mount option

  • objectStorage : ObjectStorage

    Object storage mounts

  • ephemeralDiskSpec : DiskSpec

    Working disk (worker-local non-shared read-write NBS disk templates)

Command

command : string

Command that will override ENTRYPOINT of an image.

Commands will be executed as is. The runtime will not substitute environment variables or execute shell commands. If one wants to do that, they should invoke shell interpreter with an appropriate shell script.

Args

args : string

Arguments that will override CMD of an image.

Arguments will be passed as is. The runtime will not substitute environment variables or execute shell commands. If one wants to do that, they should invoke shell interpreter with an appropriate shell script.

ObjectStorage

ObjectStorage as a mount

bucketId : string

ObjectStorage bucket name for mounting.

prefix : string

ObjectStorage bucket prefix for mounting.

DiskSpec

Disk as a mount

size : int64

The size of disk for mount in bytes

blockSize : int64

Optional block size of disk for mount in bytes