GetVersionByTag
Returns all versions with the specified tag.
To get the list of all available versions, make a ListVersions request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetFunctionVersionByTagRequest =
cloudApi.serverless.functions_function_service.GetFunctionVersionByTagRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.FunctionServiceClient);
const result = await client.getVersionByTag(
GetFunctionVersionByTagRequest.fromPartial({
functionId: "functionId",
// tag: "tag"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.functions.v1.function_service_pb2_grpc import FunctionServiceStub
from yandex.cloud.serverless.functions.v1.function_service_pb2 import GetFunctionVersionByTagRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(FunctionServiceStub)
response = service.GetVersionByTag(
GetFunctionVersionByTagRequest(
function_id="functionId",
# tag = "tag"
)
)
print(response)
GetFunctionVersionByTagRequest
functionId
: string
ID of the function whose versions should be listed.
To get a function ID use a FunctionService.List request.
tag
: string
Version tag.
To get the history of version tags make a FunctionService.ListTagHistory 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
: stringenvironment variable in which secret's value to be delivered.
LogOptions
disabled
: bool
Is logging from function disabled.
One of destination
Log entries destination.
logGroupId
: stringEntry should be written to log group resolved by ID.
folderId
: stringEntry 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
: EmptyTargetTarget to ignore a result
ymqTarget
: YMQTargetTarget 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
: ObjectStorageObject storage mounts
ephemeralDiskSpec
: DiskSpecWorking 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
: EmptyTargetTarget to ignore a result
ymqTarget
: YMQTargetTarget 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