[Yandex Cloud documentation](../../../../../index.md) > [Yandex Serverless Containers](../../../../index.md) > Containers API reference > [gRPC](../index.md) > [Container](index.md) > DeployRevision

# Serverless Containers Service, gRPC: ContainerService.DeployRevision

Deploys a revision for the specified container.

## gRPC request

**rpc DeployRevision ([DeployContainerRevisionRequest](#yandex.cloud.serverless.containers.v1.DeployContainerRevisionRequest)) returns ([operation.Operation](#yandex.cloud.operation.Operation))**

## DeployContainerRevisionRequest {#yandex.cloud.serverless.containers.v1.DeployContainerRevisionRequest}

```json
{
  "container_id": "string",
  "description": "string",
  "resources": {
    "memory": "int64",
    "cores": "int64",
    "core_fraction": "int64"
  },
  "execution_timeout": "google.protobuf.Duration",
  "service_account_id": "string",
  "image_spec": {
    "image_url": "string",
    "command": {
      "command": [
        "string"
      ]
    },
    "args": {
      "args": [
        "string"
      ]
    },
    "environment": "map<string, string>",
    "working_dir": "string"
  },
  "concurrency": "int64",
  "connectivity": {
    "network_id": "string",
    "subnet_ids": [
      "string"
    ]
  },
  "provision_policy": {
    "min_instances": "int64"
  },
  "secrets": [
    {
      "id": "string",
      "version_id": "string",
      "key": "string",
      // Includes only one of the fields `environment_variable`
      "environment_variable": "string"
      // end of the list of possible fields
    }
  ],
  "log_options": {
    "disabled": "bool",
    // Includes only one of the fields `log_group_id`, `folder_id`
    "log_group_id": "string",
    "folder_id": "string",
    // end of the list of possible fields
    "min_level": "Level"
  },
  "scaling_policy": {
    "zone_instances_limit": "int64",
    "zone_requests_limit": "int64"
  },
  "storage_mounts": [
    {
      "bucket_id": "string",
      "prefix": "string",
      "read_only": "bool",
      "mount_point_path": "string"
    }
  ],
  "mounts": [
    {
      "mount_point_path": "string",
      "mode": "Mode",
      // Includes only one of the fields `object_storage`, `ephemeral_disk_spec`
      "object_storage": {
        "bucket_id": "string",
        "prefix": "string"
      },
      "ephemeral_disk_spec": {
        "size": "int64",
        "block_size": "int64"
      }
      // end of the list of possible fields
    }
  ],
  "runtime": {
    // Includes only one of the fields `http`, `task`
    "http": "Http",
    "task": "Task"
    // end of the list of possible fields
  },
  "metadata_options": {
    "gce_http_endpoint": "MetadataOption",
    "aws_v1_http_endpoint": "MetadataOption"
  },
  "async_invocation_config": {
    "service_account_id": "string"
  }
}
```

#|
||Field | Description ||
|| container_id | **string**

Required field. ID of the container to create a revision for.
To get a container ID, make a [ContainerService.List](list.md#List) request. ||
|| description | **string**

Description of the revision. ||
|| resources | **[Resources](#yandex.cloud.serverless.containers.v1.Resources)**

Required field. Resources allocated to the revision. ||
|| execution_timeout | **[google.protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/duration)**

Timeout for the execution of the revision.
If the timeout is exceeded, Serverless Containers responds with a 504 HTTP code. ||
|| service_account_id | **string**

ID of the service account to associate with the revision. ||
|| image_spec | **[ImageSpec](#yandex.cloud.serverless.containers.v1.ImageSpec)**

Required field. Image configuration for the revision. ||
|| concurrency | **int64**

The number of concurrent requests allowed per container instance.
The default value is 1. ||
|| connectivity | **[Connectivity](#yandex.cloud.serverless.containers.v1.Connectivity)**

Network access. If specified the revision will be attached to specified network/subnet(s). ||
|| provision_policy | **[ProvisionPolicy](#yandex.cloud.serverless.containers.v1.ProvisionPolicy)**

Policy for provisioning instances of the revision.
The policy is only applied when the revision is ACTIVE. ||
|| secrets[] | **[Secret](#yandex.cloud.serverless.containers.v1.Secret)**

Yandex Lockbox secrets to be used by the revision. ||
|| log_options | **[LogOptions](#yandex.cloud.serverless.containers.v1.LogOptions)**

Options for logging from the container. ||
|| scaling_policy | **[ScalingPolicy](#yandex.cloud.serverless.containers.v1.ScalingPolicy)**

Policy for scaling instances of the revision. ||
|| storage_mounts[] | **[StorageMount](#yandex.cloud.serverless.containers.v1.StorageMount)**

S3 mounts to be used by the revision. ||
|| mounts[] | **[Mount](#yandex.cloud.serverless.containers.v1.Mount)**

Mounts to be used by the revision. ||
|| runtime | **[Runtime](#yandex.cloud.serverless.containers.v1.Runtime)**

The container's execution mode. ||
|| metadata_options | **[MetadataOptions](#yandex.cloud.serverless.containers.v1.MetadataOptions)**

Metadata options for the revision. ||
|| async_invocation_config | **[AsyncInvocationConfig](#yandex.cloud.serverless.containers.v1.AsyncInvocationConfig)**

Config for asynchronous invocations of the revision. ||
|#

## Resources {#yandex.cloud.serverless.containers.v1.Resources}

Resources allocated to a revision.

#|
||Field | Description ||
|| memory | **int64**

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

Acceptable values are 134217728 to 8589934592, inclusive. ||
|| cores | **int64**

Number of cores available to the revision.

Acceptable values are 0 to 4, inclusive. ||
|| core_fraction | **int64**

Specifies baseline performance for a core in percent, multiple of 5%.
Should be 100% for cores > 1.

Acceptable values are 0 to 100, inclusive. ||
|#

## ImageSpec {#yandex.cloud.serverless.containers.v1.ImageSpec}

Revision image specification.

#|
||Field | Description ||
|| image_url | **string**

Required field. Image URL, that is used by the revision. ||
|| command | **[Command](#yandex.cloud.serverless.containers.v1.Command)**

Override for the image's ENTRYPOINT. ||
|| args | **[Args](#yandex.cloud.serverless.containers.v1.Args)**

Override for the image's CMD. ||
|| environment | **object** (map<**string**, **string**>)

Additional environment for the container.

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

Override for the image's WORKDIR. ||
|#

## Command {#yandex.cloud.serverless.containers.v1.Command}

#|
||Field | Description ||
|| 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. ||
|#

## Args {#yandex.cloud.serverless.containers.v1.Args}

#|
||Field | Description ||
|| 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. ||
|#

## Connectivity {#yandex.cloud.serverless.containers.v1.Connectivity}

Revision connectivity specification.

#|
||Field | Description ||
|| network_id | **string**

Network the revision will have access to. ||
|| subnet_ids[] | **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 {#yandex.cloud.serverless.containers.v1.ProvisionPolicy}

#|
||Field | Description ||
|| min_instances | **int64**

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

## Secret {#yandex.cloud.serverless.containers.v1.Secret}

Secret that is available to the container at run time.

#|
||Field | Description ||
|| id | **string**

ID of Yandex Lockbox secret. ||
|| version_id | **string**

ID of Yandex Lockbox secret. ||
|| key | **string**

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

Environment variable in which secret's value is delivered.

Includes only one of the fields `environment_variable`. ||
|#

## LogOptions {#yandex.cloud.serverless.containers.v1.LogOptions}

#|
||Field | Description ||
|| disabled | **bool**

Is logging from container disabled. ||
|| log_group_id | **string**

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})? `.

Includes only one of the fields `log_group_id`, `folder_id`.

Log entries destination. ||
|| folder_id | **string**

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})? `.

Includes only one of the fields `log_group_id`, `folder_id`.

Log entries destination. ||
|| min_level | enum **Level**

Minimum log entry level.
See [LogLevel.Level](../../../../../logging/api-ref/grpc/Export/get.md#yandex.cloud.logging.v1.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. ||
|#

## ScalingPolicy {#yandex.cloud.serverless.containers.v1.ScalingPolicy}

#|
||Field | Description ||
|| zone_instances_limit | **int64**

Upper limit for instance count in each zone.
0 means no limit. ||
|| zone_requests_limit | **int64**

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

## StorageMount {#yandex.cloud.serverless.containers.v1.StorageMount}

#|
||Field | Description ||
|| bucket_id | **string**

Required field. S3 bucket name for mounting.

The string length in characters must be 3-63. Value must match the regular expression ` [-.0-9a-zA-Z]* `. ||
|| prefix | **string**

S3 bucket prefix for mounting. ||
|| read_only | **bool**

Is mount read only. ||
|| mount_point_path | **string**

Required field. Mount point path inside the container for mounting.

The string length in characters must be 1-300. Value must match the regular expression ` [-_0-9a-zA-Z/]* `. ||
|#

## Mount {#yandex.cloud.serverless.containers.v1.Mount}

Mount contains an information about version's external storage mount

#|
||Field | Description ||
|| mount_point_path | **string**

Required field. The absolute mount point path inside the container for mounting.

The string length in characters must be 1-300. Value must match the regular expression ` [-_0-9a-zA-Z/]* `. ||
|| mode | enum **Mode**

Mount's mode

- `READ_ONLY`: Mount is available for read access only.
- `READ_WRITE`: Mount is available for both read and write access. ||
|| object_storage | **[ObjectStorage](#yandex.cloud.serverless.containers.v1.Mount.ObjectStorage)**

Object storage mounts

Includes only one of the fields `object_storage`, `ephemeral_disk_spec`.

Target mount option ||
|| ephemeral_disk_spec | **[DiskSpec](#yandex.cloud.serverless.containers.v1.Mount.DiskSpec)**

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

Includes only one of the fields `object_storage`, `ephemeral_disk_spec`.

Target mount option ||
|#

## ObjectStorage {#yandex.cloud.serverless.containers.v1.Mount.ObjectStorage}

ObjectStorage as a mount

#|
||Field | Description ||
|| bucket_id | **string**

Required field. ObjectStorage bucket name for mounting.

The string length in characters must be 3-63. Value must match the regular expression ` [-.0-9a-zA-Z]* `. ||
|| prefix | **string**

ObjectStorage bucket prefix for mounting. ||
|#

## DiskSpec {#yandex.cloud.serverless.containers.v1.Mount.DiskSpec}

Disk as a mount

#|
||Field | Description ||
|| size | **int64**

The size of disk for mount in bytes

Value must be greater than 0. ||
|| block_size | **int64**

Optional block size of disk for mount in bytes ||
|#

## Runtime {#yandex.cloud.serverless.containers.v1.Runtime}

The container's execution mode

#|
||Field | Description ||
|| http | **[Http](#yandex.cloud.serverless.containers.v1.Runtime.Http)**

The classic one. You need to run an HTTP server inside the container.

Includes only one of the fields `http`, `task`. ||
|| task | **[Task](#yandex.cloud.serverless.containers.v1.Runtime.Task)**

We run a process from ENTRYPOINT inside the container for each user request.

Includes only one of the fields `http`, `task`. ||
|#

## Http {#yandex.cloud.serverless.containers.v1.Runtime.Http}

#|
||Field | Description ||
|| Empty | > ||
|#

## Task {#yandex.cloud.serverless.containers.v1.Runtime.Task}

#|
||Field | Description ||
|| Empty | > ||
|#

## MetadataOptions {#yandex.cloud.serverless.containers.v1.MetadataOptions}

#|
||Field | Description ||
|| gce_http_endpoint | enum **MetadataOption**

Enabled access to GCE flavored metadata

- `ENABLED`: Option is enabled
- `DISABLED`: Option is disabled ||
|| aws_v1_http_endpoint | enum **MetadataOption**

Enabled access to AWS flavored metadata (IMDSv1)

- `ENABLED`: Option is enabled
- `DISABLED`: Option is disabled ||
|#

## AsyncInvocationConfig {#yandex.cloud.serverless.containers.v1.AsyncInvocationConfig}

#|
||Field | Description ||
|| service_account_id | **string**

Optional id of service account with permission to invoke container. ||
|#

## operation.Operation {#yandex.cloud.operation.Operation}

```json
{
  "id": "string",
  "description": "string",
  "created_at": "google.protobuf.Timestamp",
  "created_by": "string",
  "modified_at": "google.protobuf.Timestamp",
  "done": "bool",
  "metadata": "google.protobuf.Any",
  // Includes only one of the fields `error`, `response`
  "error": "google.rpc.Status",
  "response": "google.protobuf.Any"
  // end of the list of possible fields
}
```

An Operation resource. For more information, see [Operation](../../../../../api-design-guide/concepts/operation.md).

#|
||Field | Description ||
|| id | **string**

ID of the operation. ||
|| description | **string**

Description of the operation. 0-256 characters long. ||
|| created_at | **[google.protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp)**

Creation timestamp. ||
|| created_by | **string**

ID of the user or service account who initiated the operation. ||
|| modified_at | **[google.protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp)**

The time when the Operation resource was last modified. ||
|| done | **bool**

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 | **[google.protobuf.Any](https://developers.google.com/protocol-buffers/docs/proto3#any)**

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 | **[google.rpc.Status](https://cloud.google.com/tasks/docs/reference/rpc/google.rpc#status)**

The error result of the operation in case of failure or cancellation.

Includes only one of the fields `error`, `response`.

The operation result.
If `done == false` and there was no failure detected, neither `error` nor `response` is set.
If `done == false` and there was a failure detected, `error` is set.
If `done == true`, exactly one of `error` or `response` is set. ||
|| response | **[google.protobuf.Any](https://developers.google.com/protocol-buffers/docs/proto3#any)**

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](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#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.

Includes only one of the fields `error`, `response`.

The operation result.
If `done == false` and there was no failure detected, neither `error` nor `response` is set.
If `done == false` and there was a failure detected, `error` is set.
If `done == true`, exactly one of `error` or `response` is set. ||
|#