Skip to main content

GetVersion

Returns the specified version of a function.

To get the list of available version, make a ListVersions request.

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

const GetFunctionVersionRequest =
cloudApi.serverless.functions_function_service.GetFunctionVersionRequest;

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

const result = await client.getVersion(
GetFunctionVersionRequest.fromPartial({
functionVersionId: "functionVersionId",
})
);
console.log(result);
})();

GetFunctionVersionRequest

functionVersionId : string

ID of the version to return.

To get a version ID make a FunctionService.ListVersions request.

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