Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
Yandex Serverless Containers
  • Comparison with other Yandex Cloud services
  • Getting started
  • Step-by-step instructions
  • Concepts
  • Practical guidelines
  • Access management
  • Pricing policy
  • Containers API reference
    • Authentication in the API
    • gRPC
    • REST
      • Overview
      • Container
        • Overview
        • create
        • delete
        • deployRevision
        • get
        • getRevision
        • list
        • listAccessBindings
        • listOperations
        • listRevisions
        • rollback
        • setAccessBindings
        • update
        • updateAccessBindings
  • API Triggers reference
  • Questions and answers
  1. Containers API reference
  2. REST
  3. Container
  4. deployRevision

Serverless Containers Service, REST: Container.deployRevision

Written by
Yandex Cloud
  • HTTP request
  • Body parameters
  • Response

Deploys a revision for the specified container.

HTTP request

POST https://serverless-containers.api.cloud.yandex.net/containers/v1/revisions:deploy

Body parameters

{
  "containerId": "string",
  "description": "string",
  "resources": {
    "memory": "string",
    "cores": "string",
    "coreFraction": "string"
  },
  "executionTimeout": "string",
  "serviceAccountId": "string",
  "imageSpec": {
    "imageUrl": "string",
    "command": {
      "command": [
        "string"
      ]
    },
    "args": {
      "args": [
        "string"
      ]
    },
    "environment": "object",
    "workingDir": "string"
  },
  "concurrency": "string",
  "secrets": [
    {
      "id": "string",
      "versionId": "string",
      "key": "string",
      "environmentVariable": "string"
    }
  ],
  "connectivity": {
    "networkId": "string",
    "subnetIds": [
      "string"
    ]
  },
  "provisionPolicy": {
    "minInstances": "string"
  },
  "scalingPolicy": {
    "zoneInstancesLimit": "string",
    "zoneRequestsLimit": "string"
  },
  "logOptions": {
    "disabled": true,
    "minLevel": "string",

    // `logOptions` includes only one of the fields `logGroupId`, `folderId`
    "logGroupId": "string",
    "folderId": "string",
    // end of the list of possible fields`logOptions`

  }
}
Field Description
containerId string

Required. ID of the container to create a revision for.

To get a container ID, make a list request.

description string

Description of the revision.

resources object

Required. Resources allocated to the revision.

Resources allocated to a revision.

resources.
memory
string (int64)

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

Acceptable values are 134217728 to 4294967296, inclusive.

resources.
cores
string (int64)

Number of cores available to the revision.

Acceptable values are 0 to 1, inclusive.

resources.
coreFraction
string (int64)

Specifies baseline performance for a core in percent.

Acceptable values are 0 to 100, inclusive.

executionTimeout string

Timeout for the execution of the revision.

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

The maximum value is 600 seconds.

serviceAccountId string

ID of the service account to associate with the revision.

imageSpec object

Required. Image configuration for the revision.

Revision image specification.

imageSpec.
imageUrl
string

Required. Image URL, that is used by the revision.

imageSpec.
command
object

Override for the image's ENTRYPOINT.

imageSpec.
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.

imageSpec.
args
object

Override for the image's CMD.

imageSpec.
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.

imageSpec.
environment
object

Additional environment for the container.

Each key must match the regular expression [a-zA-Z][a-zA-Z0-9_]*. The maximum string length in characters for each value is 4096.

imageSpec.
workingDir
string

Override for the image's WORKDIR.

concurrency string (int64)

The number of concurrent requests allowed per container instance.

The default value is 1.

secrets[] object

Yandex Lockbox secrets to be used by the revision.

secrets[].
id
string

ID of Yandex Lockbox secret.

secrets[].
versionId
string

ID of Yandex Lockbox secret.

secrets[].
key
string

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

secrets[].
environmentVariable
string

Environment variable in which secret's value is delivered.

connectivity object

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

Revision connectivity specification.

connectivity.
networkId
string

Network the revision will have access to.

connectivity.
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.

The string length in characters for each value must be greater than 0.

provisionPolicy object

Policy for provisioning instances of the revision.

The policy is only applied when the revision is ACTIVE.

provisionPolicy.
minInstances
string (int64)

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

scalingPolicy object

Policy for scaling instances of the revision.

scalingPolicy.
zoneInstancesLimit
string (int64)

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

scalingPolicy.
zoneRequestsLimit
string (int64)

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

logOptions object

Options for logging from the container.

logOptions.
disabled
boolean (boolean)

Is logging from container disabled.

logOptions.
minLevel
string
Minimum log entry level. See [LogLevel.Level] for details.
  • TRACE: Trace log level.

    Possible use case: verbose logging of some business logic.

  • DEBUG: Debug log level.

    Possible use case: debugging special cases in application logic.

  • INFO: Info log level.

    Mostly used for information messages.

  • WARN: Warn log level.

    May be used to alert about significant events.

  • ERROR: Error log level.

    May be used to alert about errors in infrastructure, logic, etc.

  • FATAL: Fatal log level.

    May be used to alert about unrecoverable failures and events.

logOptions.
logGroupId
string
logOptions includes only one of the fields logGroupId, folderId

Entry should be written to log group resolved by ID.

Value must match the regular expression ([a-zA-Z][-a-zA-Z0-9_.]{0,63})?.

logOptions.
folderId
string
logOptions includes only one of the fields logGroupId, folderId

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

Value must match the regular expression ([a-zA-Z][-a-zA-Z0-9_.]{0,63})?.

Response

HTTP Code: 200 - OK

{
  "id": "string",
  "description": "string",
  "createdAt": "string",
  "createdBy": "string",
  "modifiedAt": "string",
  "done": true,
  "metadata": "object",

  //  includes only one of the fields `error`, `response`
  "error": {
    "code": "integer",
    "message": "string",
    "details": [
      "object"
    ]
  },
  "response": "object",
  // 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 string (date-time)

Creation timestamp.

String in RFC3339 text format. The range of possible values is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z, i.e. from 0 to 9 digits for fractions of a second.

To work with values in this field, use the APIs described in the Protocol Buffers reference. In some languages, built-in datetime utilities do not support nanosecond precision (9 digits).

createdBy string

ID of the user or service account who initiated the operation.

modifiedAt string (date-time)

The time when the Operation resource was last modified.

String in RFC3339 text format. The range of possible values is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z, i.e. from 0 to 9 digits for fractions of a second.

To work with values in this field, use the APIs described in the Protocol Buffers reference. In some languages, built-in datetime utilities do not support nanosecond precision (9 digits).

done boolean (boolean)

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

metadata object

Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.

error object
The error result of the operation in case of failure or cancellation.
includes only one of the fields error, response
error.
code
integer (int32)

Error code. An enum value of google.rpc.Code.

error.
message
string

An error message.

error.
details[]
object

A list of messages that carry the error details.

response object
includes only one of the fields error, response

The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.

Was the article helpful?

Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
In this article:
  • HTTP request
  • Body parameters
  • Response