Cloud Functions Service, gRPC: FunctionService.CreateVersion
- gRPC request
- CreateFunctionVersionRequest
- Resources
- Package
- Connectivity
- Secret
- LogOptions
- StorageMount
- AsyncInvocationConfig
- ResponseTarget
- EmptyTarget
- YMQTarget
- Mount
- ObjectStorage
- DiskSpec
- operation.Operation
- CreateFunctionVersionMetadata
- Version
- Resources
- Connectivity
- Secret
- LogOptions
- StorageMount
- AsyncInvocationConfig
- ResponseTarget
- EmptyTarget
- YMQTarget
- Mount
- ObjectStorage
- DiskSpec
Creates a version for the specified function.
gRPC request
rpc CreateVersion (CreateFunctionVersionRequest) returns (operation.Operation)
CreateFunctionVersionRequest
{
"functionId": "string",
"runtime": "string",
"description": "string",
"entrypoint": "string",
"resources": {
"memory": "int64"
},
"executionTimeout": "google.protobuf.Duration",
"serviceAccountId": "string",
// Includes only one of the fields `package`, `content`, `versionId`
"package": {
"bucketName": "string",
"objectName": "string",
"sha256": "string"
},
"content": "bytes",
"versionId": "string",
// end of the list of possible fields
"environment": "string",
"tag": [
"string"
],
"connectivity": {
"networkId": "string",
"subnetId": [
"string"
]
},
"namedServiceAccounts": "string",
"secrets": [
{
"id": "string",
"versionId": "string",
"key": "string",
// Includes only one of the fields `environmentVariable`
"environmentVariable": "string"
// end of the list of possible fields
}
],
"logOptions": {
"disabled": "bool",
// Includes only one of the fields `logGroupId`, `folderId`
"logGroupId": "string",
"folderId": "string",
// end of the list of possible fields
"minLevel": "Level"
},
"storageMounts": [
{
"bucketId": "string",
"prefix": "string",
"mountPointName": "string",
"readOnly": "bool"
}
],
"asyncInvocationConfig": {
"retriesCount": "int64",
"successTarget": {
// Includes only one of the fields `emptyTarget`, `ymqTarget`
"emptyTarget": "EmptyTarget",
"ymqTarget": {
"queueArn": "string",
"serviceAccountId": "string"
}
// end of the list of possible fields
},
"failureTarget": {
// Includes only one of the fields `emptyTarget`, `ymqTarget`
"emptyTarget": "EmptyTarget",
"ymqTarget": {
"queueArn": "string",
"serviceAccountId": "string"
}
// end of the list of possible fields
},
"serviceAccountId": "string"
},
"tmpfsSize": "int64",
"concurrency": "int64",
"mounts": [
{
"name": "string",
"mode": "Mode",
// Includes only one of the fields `objectStorage`, `ephemeralDiskSpec`
"objectStorage": {
"bucketId": "string",
"prefix": "string"
},
"ephemeralDiskSpec": {
"size": "int64",
"blockSize": "int64"
}
// end of the list of possible fields
}
]
}
Field |
Description |
functionId |
string Required field. ID of the function to create a version for. To get a function ID, make a FunctionService.List request. |
runtime |
string Required field. Runtime environment for the version. |
description |
string Description of the version |
entrypoint |
string Required field. Entrypoint of the version. |
resources |
Required field. Resources allocated to the version. |
executionTimeout |
Required field. 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 to associate with the version. |
package |
Functions deployment package. Includes only one of the fields Source of the deployment package for the version. |
content |
bytes Content of the deployment package. Includes only one of the fields Source of the deployment package for the version. |
versionId |
string ID of the version to be copied from. Source version must belong to the same folder as the created version Includes only one of the fields Source of the deployment package for the version. |
environment |
string Environment settings for the version. |
tag[] |
string Function version tags. For details, see Version tag. |
connectivity |
Function version connectivity. If specified the version will be attached to specified network/subnet(s). |
namedServiceAccounts |
string Additional service accounts to be used by the version. |
secrets[] |
Yandex Lockbox secrets to be used by the version. |
logOptions |
Options for logging from the function |
storageMounts[] |
S3 mounts to be used by the version. |
asyncInvocationConfig |
Config for asynchronous invocations of the version |
tmpfsSize |
int64 Optional size of in-memory mounted /tmp directory in bytes. 0 or in range from 512 MiB to 3/4 of resources.memory. |
concurrency |
int64 The maximum number of requests processed by a function instance at the same time |
mounts[] |
Mounts to be used by the version. |
Resources
Resources allocated to a version.
Field |
Description |
memory |
int64 Amount of memory available to the version, specified in bytes, multiple of 128MB. |
Package
Version deployment package.
Field |
Description |
bucketName |
string Required field. Name of the bucket that stores the code for the version. |
objectName |
string Required field. Name of the object in the bucket that stores the code for the version. |
sha256 |
string SHA256 hash of the version deployment package. |
Connectivity
Version connectivity specification.
Field |
Description |
networkId |
string Network the version will have access to. |
subnetId[] |
string Complete list of subnets (from the same network) the version can be attached to. |
Secret
Secret for serverless function.
Field |
Description |
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. |
environmentVariable |
string environment variable in which secret's value to be delivered. Includes only one of the fields |
LogOptions
Field |
Description |
disabled |
bool Is logging from function disabled. |
logGroupId |
string Entry should be written to log group resolved by ID. Includes only one of the fields Log entries destination. |
folderId |
string Entry should be written to default log group for specified folder. Includes only one of the fields Log entries destination. |
minLevel |
enum Level Minimum log entry level. See LogLevel.Level for details.
|
StorageMount
Field |
Description |
bucketId |
string Required field. S3 bucket name for mounting. |
prefix |
string S3 bucket prefix for mounting. |
mountPointName |
string Required field. Mount point directory name (not path) for mounting. |
readOnly |
bool Is mount read only. |
AsyncInvocationConfig
Field |
Description |
retriesCount |
int64 Number of retries of version invocation |
successTarget |
Required field. Target for successful result of the version's invocation |
failureTarget |
Required field. Target for unsuccessful result, if all retries failed |
serviceAccountId |
string Service account which can invoke version |
ResponseTarget
Target to which a result of an invocation will be sent
Field |
Description |
emptyTarget |
Target to ignore a result Includes only one of the fields |
ymqTarget |
Target to send a result to ymq Includes only one of the fields |
EmptyTarget
Field |
Description |
Empty |
YMQTarget
Field |
Description |
queueArn |
string Required field. Queue ARN |
serviceAccountId |
string Required field. Service account which has write permission on the queue. |
Mount
Mount contains an information about version's external storage mount
Field |
Description |
name |
string Required field. Unique mount point name. Device will be mounted into /function/storage/ |
mode |
enum Mode Mount's mode
|
objectStorage |
Object storage mounts Includes only one of the fields Target mount option |
ephemeralDiskSpec |
Working disk (worker-local non-shared read-write NBS disk templates) Includes only one of the fields Target mount option |
ObjectStorage
ObjectStorage as a mount
Field |
Description |
bucketId |
string Required field. ObjectStorage bucket name for mounting. |
prefix |
string ObjectStorage bucket prefix for mounting. |
DiskSpec
Disk as a mount
Field |
Description |
size |
int64 The size of disk for mount in bytes |
blockSize |
int64 Optional block size of disk for mount in bytes |
operation.Operation
{
"id": "string",
"description": "string",
"createdAt": "google.protobuf.Timestamp",
"createdBy": "string",
"modifiedAt": "google.protobuf.Timestamp",
"done": "bool",
"metadata": {
"functionVersionId": "string"
},
// Includes only one of the fields `error`, `response`
"error": "google.rpc.Status",
"response": {
"id": "string",
"functionId": "string",
"description": "string",
"createdAt": "google.protobuf.Timestamp",
"runtime": "string",
"entrypoint": "string",
"resources": {
"memory": "int64"
},
"executionTimeout": "google.protobuf.Duration",
"serviceAccountId": "string",
"imageSize": "int64",
"status": "Status",
"tags": [
"string"
],
"environment": "string",
"connectivity": {
"networkId": "string",
"subnetId": [
"string"
]
},
"namedServiceAccounts": "string",
"secrets": [
{
"id": "string",
"versionId": "string",
"key": "string",
// Includes only one of the fields `environmentVariable`
"environmentVariable": "string"
// end of the list of possible fields
}
],
"logOptions": {
"disabled": "bool",
// Includes only one of the fields `logGroupId`, `folderId`
"logGroupId": "string",
"folderId": "string",
// end of the list of possible fields
"minLevel": "Level"
},
"storageMounts": [
{
"bucketId": "string",
"prefix": "string",
"mountPointName": "string",
"readOnly": "bool"
}
],
"asyncInvocationConfig": {
"retriesCount": "int64",
"successTarget": {
// Includes only one of the fields `emptyTarget`, `ymqTarget`
"emptyTarget": "EmptyTarget",
"ymqTarget": {
"queueArn": "string",
"serviceAccountId": "string"
}
// end of the list of possible fields
},
"failureTarget": {
// Includes only one of the fields `emptyTarget`, `ymqTarget`
"emptyTarget": "EmptyTarget",
"ymqTarget": {
"queueArn": "string",
"serviceAccountId": "string"
}
// end of the list of possible fields
},
"serviceAccountId": "string"
},
"tmpfsSize": "int64",
"concurrency": "int64",
"mounts": [
{
"name": "string",
"mode": "Mode",
// Includes only one of the fields `objectStorage`, `ephemeralDiskSpec`
"objectStorage": {
"bucketId": "string",
"prefix": "string"
},
"ephemeralDiskSpec": {
"size": "int64",
"blockSize": "int64"
}
// end of the list of possible fields
}
]
}
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
Field |
Description |
id |
string ID of the operation. |
description |
string Description of the operation. 0-256 characters long. |
createdAt |
Creation timestamp. |
createdBy |
string ID of the user or service account who initiated the operation. |
modifiedAt |
The time when the Operation resource was last modified. |
done |
bool If the value is |
metadata |
Service-specific metadata associated with the operation. |
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
response |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |
CreateFunctionVersionMetadata
Field |
Description |
functionVersionId |
string ID of the version that is being created. |
Version
Version of a function. For details about the concept, see Function versions.
Field |
Description |
id |
string ID of the version. |
functionId |
string ID of the function that the version belongs to. |
description |
string Description of the version. |
createdAt |
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 |
resources |
Resources allocated to the version. |
executionTimeout |
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 |
enum Status Status of the version.
|
tags[] |
string Version tags. For details, see Version tag. |
environment |
string Environment settings for the version. |
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[] |
Yandex Lockbox secrets to be used by the version. |
logOptions |
Options for logging from the function |
storageMounts[] |
S3 mounts to be used by the version. |
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[] |
Mounts to be used by the version. |
Resources
Resources allocated to a version.
Field |
Description |
memory |
int64 Amount of memory available to the version, specified in bytes, multiple of 128MB. |
Connectivity
Version connectivity specification.
Field |
Description |
networkId |
string Network the version will have access to. |
subnetId[] |
string Complete list of subnets (from the same network) the version can be attached to. |
Secret
Secret for serverless function.
Field |
Description |
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. |
environmentVariable |
string environment variable in which secret's value to be delivered. Includes only one of the fields |
LogOptions
Field |
Description |
disabled |
bool Is logging from function disabled. |
logGroupId |
string Entry should be written to log group resolved by ID. Includes only one of the fields Log entries destination. |
folderId |
string Entry should be written to default log group for specified folder. Includes only one of the fields Log entries destination. |
minLevel |
enum Level Minimum log entry level. See LogLevel.Level for details.
|
StorageMount
Field |
Description |
bucketId |
string Required field. S3 bucket name for mounting. |
prefix |
string S3 bucket prefix for mounting. |
mountPointName |
string Required field. Mount point directory name (not path) for mounting. |
readOnly |
bool Is mount read only. |
AsyncInvocationConfig
Field |
Description |
retriesCount |
int64 Number of retries of version invocation |
successTarget |
Required field. Target for successful result of the version's invocation |
failureTarget |
Required field. Target for unsuccessful result, if all retries failed |
serviceAccountId |
string Service account which can invoke version |
ResponseTarget
Target to which a result of an invocation will be sent
Field |
Description |
emptyTarget |
Target to ignore a result Includes only one of the fields |
ymqTarget |
Target to send a result to ymq Includes only one of the fields |
EmptyTarget
Field |
Description |
Empty |
YMQTarget
Field |
Description |
queueArn |
string Required field. Queue ARN |
serviceAccountId |
string Required field. Service account which has write permission on the queue. |
Mount
Mount contains an information about version's external storage mount
Field |
Description |
name |
string Required field. Unique mount point name. Device will be mounted into /function/storage/ |
mode |
enum Mode Mount's mode
|
objectStorage |
Object storage mounts Includes only one of the fields Target mount option |
ephemeralDiskSpec |
Working disk (worker-local non-shared read-write NBS disk templates) Includes only one of the fields Target mount option |
ObjectStorage
ObjectStorage as a mount
Field |
Description |
bucketId |
string Required field. ObjectStorage bucket name for mounting. |
prefix |
string ObjectStorage bucket prefix for mounting. |
DiskSpec
Disk as a mount
Field |
Description |
size |
int64 The size of disk for mount in bytes |
blockSize |
int64 Optional block size of disk for mount in bytes |