Skip to main content

ListVersions

Retrieves the list of versions for the specified function, or of all function versions in the specified folder.

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

const ListFunctionsVersionsRequest =
cloudApi.serverless.functions_function_service.ListFunctionsVersionsRequest;

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

const result = await client.listVersions(
ListFunctionsVersionsRequest.fromPartial({
// folderId: "folderId",
// functionId: "functionId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();

ListFunctionsVersionsRequest

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 ListFunctionsVersionsResponse.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 ListFunctionsVersionsResponse.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 Version.status and Version.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".

ListFunctionsVersionsResponse

versions : Version

List of versions for the specified folder or function.

nextPageToken : string

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

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

Version

Version of a function. For details about the concept, see Function versions.

Status
  • STATUS_UNSPECIFIED

  • CREATING

    Version is being created.

  • ACTIVE

    Version is ready to use.

  • OBSOLETE

    Version will be deleted soon.

  • DELETING

    Version is being deleted.

id : string

ID of the version.

functionId : string

ID of the function that the version belongs to.

description : string

Description of the version.

createdAt : google.protobuf.Timestamp

Creation timestamp for the version.

runtime : string

ID of the runtime environment for the function.

Supported environments and their identifiers are listed in the Runtime environments.

entrypoint : string

Entrypoint for the function: the name of the function to be called as the handler.

Specified in the format <function file name>.<handler name>, for example, index.myFunction.

resources : Resources

Resources allocated to the version.

executionTimeout : google.protobuf.Duration

Timeout for the execution of the version.

If the timeout is exceeded, Cloud Functions responds with a 504 HTTP code.

serviceAccountId : string

ID of the service account associated with the version.

imageSize : int64

Final size of the deployment package after unpacking.

status : Status

Status of the version.

tags : string

Version tags. For details, see Version tag.

environment : string

Environment settings for the version.

connectivity : Connectivity

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

namedServiceAccounts : string

Additional service accounts to be used by the version.

secrets : Secret

Yandex Lockbox secrets to be used by the version.

logOptions : LogOptions

Options for logging from the function

storageMounts : StorageMount

S3 mounts to be used by the version.

asyncInvocationConfig : AsyncInvocationConfig

Config for asynchronous invocations of the version

tmpfsSize : int64

Optional size of in-memory mounted /tmp directory in bytes.

concurrency : int64

The maximum number of requests processed by a function instance at the same time

mounts : Mount

Mounts to be used by the version.

Resources

Resources allocated to a version.

memory : int64

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

Connectivity

Version connectivity specification.

networkId : string

Network the version will have access to. It's essential to specify network with subnets in all availability zones.

subnetId : string

Complete list of subnets (from the same network) the version can be attached to. It's essential to specify at least one subnet for each availability zones.

Secret

Secret for serverless function.

id : string

ID of Yandex Lockbox secret.

versionId : string

ID of Yandex Lockbox version.

key : string

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

One of reference

  • environmentVariable : string

    environment variable in which secret's value to be delivered.

LogOptions

disabled : bool

Is logging from function 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.

mountPointName : string

Mount point directory name (not path) for mounting.

readOnly : bool

Is mount read only.

AsyncInvocationConfig

ResponseTarget

Target to which a result of an invocation will be sent

One of target

  • emptyTarget : EmptyTarget

    Target to ignore a result

  • ymqTarget : YMQTarget

    Target to send a result to ymq

retriesCount : int64

Number of retries of version invocation

successTarget : ResponseTarget

Target for successful result of the version's invocation

failureTarget : ResponseTarget

Target for unsuccessful result, if all retries failed

serviceAccountId : string

Service account which can invoke version

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

name : string

Unique mount point name. Device will be mounted into /function/storage/<name>

mode : Mode

Mount's mode

  • objectStorage : ObjectStorage

    Object storage mounts

  • ephemeralDiskSpec : DiskSpec

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

EmptyTarget

YMQTarget

queueArn : string

Queue ARN

serviceAccountId : string

Service account which has write permission on the queue.

ResponseTarget

Target to which a result of an invocation will be sent

  • emptyTarget : EmptyTarget

    Target to ignore a result

  • ymqTarget : YMQTarget

    Target to send a result to ymq

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