Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Compute Cloud
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
    • API authentication
      • Overview
        • Overview
        • Get
        • List
        • Create
        • Update
        • Delete
        • UpdateMetadata
        • GetSerialPortOutput
        • Stop
        • Start
        • Restart
        • AttachDisk
        • DetachDisk
        • AttachFilesystem
        • DetachFilesystem
        • AddOneToOneNat
        • RemoveOneToOneNat
        • UpdateNetworkInterface
        • AttachNetworkInterface
        • DetachNetworkInterface
        • ListOperations
        • SimulateMaintenanceEvent
        • Move
        • Relocate
        • ListAccessBindings
        • SetAccessBindings
        • UpdateAccessBindings
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • HTTP request
  • Path parameters
  • Body parameters
  • ResourcesSpec
  • SchedulingPolicy
  • NetworkSettings
  • PlacementPolicy
  • HostAffinityRule
  • MetadataOptions
  • SerialPortSettings
  • Application
  • ContainerSolutionSpec
  • Secret
  • BackupSpec
  • Response
  • Status
  1. API reference
  2. REST
  3. Instance
  4. Update

Compute Cloud API, REST: Instance.Update

Written by
Yandex Cloud
Improved by
Updated at June 1, 2026
  • HTTP request
  • Path parameters
  • Body parameters
  • ResourcesSpec
  • SchedulingPolicy
  • NetworkSettings
  • PlacementPolicy
  • HostAffinityRule
  • MetadataOptions
  • SerialPortSettings
  • Application
  • ContainerSolutionSpec
  • Secret
  • BackupSpec
  • Response
  • Status

Updates the specified instance.

HTTP requestHTTP request

PATCH https://compute.api.cloud.yandex.net/compute/v1/instances/{instanceId}

Path parametersPath parameters

Field

Description

instanceId

string

Required field. ID of the Instance resource to update.
To get the instance ID, use a InstanceService.List request.
The length must be less than or equal to 50.
This field is required.

Body parametersBody parameters

{
  "updateMask": "string",
  "name": "string",
  "description": "string",
  "labels": "object",
  "platformId": "string",
  "resourcesSpec": {
    "memory": "string",
    "cores": "string",
    "coreFraction": "string",
    "gpus": "string"
  },
  "metadata": "object",
  "schedulingPolicy": {
    "preemptible": "boolean"
  },
  "serviceAccountId": "string",
  "networkSettings": {
    "type": "string"
  },
  "placementPolicy": {
    "placementGroupId": "string",
    "placementGroupPartition": "string",
    "hostAffinityRules": [
      {
        "key": "string",
        "op": "string",
        "values": [
          "string"
        ]
      }
    ]
  },
  "maintenancePolicy": "string",
  "maintenanceGracePeriod": "string",
  "metadataOptions": {
    "gceHttpEndpoint": "string",
    "awsV1HttpEndpoint": "string",
    "gceHttpToken": "string",
    "awsV1HttpToken": "string",
    "awsV2HttpEndpoint": "string",
    "awsV2HttpToken": "string"
  },
  "serialPortSettings": {
    "sshAuthorization": "string"
  },
  "application": {
    // Includes only one of the fields `containerSolution`
    "containerSolution": {
      "productId": "string",
      "secrets": "object",
      "environment": "object"
    },
    // end of the list of possible fields
    "cloudbackup": {
      "enabled": "boolean",
      "initialPolicyIds": [
        "string"
      ],
      "recoveryFromBackup": "boolean",
      "backupId": "string",
      "instanceRegistrationId": "string"
    }
  },
  "reservedInstancePoolId": "string"
}

Field

Description

updateMask

string (field-mask)

A comma-separated names off ALL fields to be updated.
Only the specified fields will be changed. The others will be left untouched.
If the field is specified in updateMask and no value for that field was sent in the request,
the field's value will be reset to the default. The default value for most fields is null or 0.

If updateMask is not sent in the request, all fields' values will be updated.
Fields specified in the request will be updated to provided values.
The rest of the fields will be reset to the default.

name

string

Name of the instance.
The value must match the regular expression: |[a-z]([-_a-z0-9]{0,61}[a-z0-9])?.

description

string

Description of the instance.
The length must be less than or equal to 256.

labels

object (map<string, string>)

Resource labels as key:value pairs.
Existing set of labels is completely replaced by the provided set.
Each map key must match the regular expression: [a-z][-_./\\@0-9a-z]*.
Each map value must match the regular expression: [-_./\\@0-9a-z]*.
The length of each map key must be between 1 and 63.
The length of each map value must be less than or equal to 63.
The number of elements must be less than or equal to 64.

platformId

string

ID of the hardware platform configuration for the instance.
This field affects the available values in resourcesSpec field.
Platforms allows you to create various types of instances: with a large amount of memory,
with a large number of cores, with a burstable performance.
For more information, see Platforms.

resourcesSpec

ResourcesSpec

Computing resources of the instance, such as the amount of memory and number of cores.
To get a list of available values, see Levels of core performance.

metadata

object (map<string, string>)

The metadata key:value pairs that will be assigned to this instance. This includes custom metadata and predefined keys.
The total size of all keys and values must be less than 512 KB.
Existing set of metadata is completely replaced by the provided set.
Values are free-form strings, and only have meaning as interpreted by the programs which configure the instance.
The values must be 256 KB or less.
For example, you may use the metadata in order to provide your public SSH key to the instance.
For more information, see Metadata.

schedulingPolicy

SchedulingPolicy

Scheduling policy configuration.

serviceAccountId

string

ID of the service account to use for authentication inside the instance.
To get the service account ID, use a yandex.cloud.iam.v1.ServiceAccountService.List request.

networkSettings

NetworkSettings

Network settings.

placementPolicy

PlacementPolicy

Placement policy configuration.

maintenancePolicy

enum (MaintenancePolicy)

Behaviour on maintenance events

  • RESTART: Restart instance to move it to another host during maintenance
  • MIGRATE: Use live migration to move instance to another host during maintenance

maintenanceGracePeriod

string (duration)

Time between notification via metadata service and maintenance
The value must satisfy: 1s-24h.

metadataOptions

MetadataOptions

Options allow user to configure access to instance's metadata

serialPortSettings

SerialPortSettings

Serial port settings

application

Application

Instance application settings.

reservedInstancePoolId

string

ID of the reserved instance pool that the instance should belong to.
Attaching/detaching running instance will increase/decrease the size of the reserved instance pool.
Attaching/detaching stopped instance will leave the size of the reserved instance pool unchanged. Starting such attached instance will use resources from the reserved instance pool.
Reserved instance pool resource configuration must match the resource configuration of the instance.
The length must be less than or equal to 50.

ResourcesSpecResourcesSpec

Field

Description

memory

string (int64)

The amount of memory available to the instance, specified in bytes.
The value must be less than or equal to 274877906944.
This field is required.

cores

string (int64)

The number of cores available to the instance.
The value must satisfy: 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,40,44,48,52,56,60,64,68,72,76,80.
This field is required.

coreFraction

string (int64)

Baseline level of CPU performance with the ability to burst performance above that baseline level.
This field sets baseline performance for each core.
For example, if you need only 5% of the CPU performance, you can set core_fraction=5.
For more information, see Levels of core performance.
The value must satisfy: 0,5,20,50,100.

gpus

string (int64)

The number of GPUs available to the instance.
The value must satisfy: 0,1,2,4.

SchedulingPolicySchedulingPolicy

Field

Description

preemptible

boolean

True for short-lived compute instances. For more information, see Preemptible VMs.

NetworkSettingsNetworkSettings

Field

Description

type

enum (Type)

Network Type

  • STANDARD: Standard network.
  • SOFTWARE_ACCELERATED: Software accelerated network.
  • HARDWARE_ACCELERATED: Hardware accelerated network (not available yet, reserved for future use).

PlacementPolicyPlacementPolicy

Field

Description

placementGroupId

string

Placement group ID.

placementGroupPartition

string (int64)

Placement group partition

hostAffinityRules[]

HostAffinityRule

List of affinity rules. Scheduler will attempt to allocate instances according to order of rules.

HostAffinityRuleHostAffinityRule

Affinity definition

Field

Description

key

string

Affinity label or one of reserved values - 'yc.hostId', 'yc.hostGroupId'

op

enum (Operator)

Include or exclude action

  • IN: Include action
  • NOT_IN: Exclude action

values[]

string

Affinity value or host ID or host group ID

MetadataOptionsMetadataOptions

Field

Description

gceHttpEndpoint

enum (MetadataOption)

Enabled access to GCE flavored metadata

  • ENABLED: Option is enabled
  • DISABLED: Option is disabled

awsV1HttpEndpoint

enum (MetadataOption)

Enabled access to AWS flavored metadata (IMDSv1)

  • ENABLED: Option is enabled
  • DISABLED: Option is disabled

gceHttpToken

enum (MetadataOption)

Enabled access to IAM credentials with GCE flavored metadata

  • ENABLED: Option is enabled
  • DISABLED: Option is disabled

awsV1HttpToken

enum (MetadataOption)

Enabled access to IAM credentials with AWS flavored metadata (IMDSv1)

  • ENABLED: Option is enabled
  • DISABLED: Option is disabled

awsV2HttpEndpoint

enum (MetadataOption)

Enabled access to AWS flavored metadata with session token (IMDSv2)

  • ENABLED: Option is enabled
  • DISABLED: Option is disabled

awsV2HttpToken

enum (MetadataOption)

Enabled access to STS credentials with AWS flavored metadata with session token (IMDSv2)

  • ENABLED: Option is enabled
  • DISABLED: Option is disabled

SerialPortSettingsSerialPortSettings

Field

Description

sshAuthorization

enum (SSHAuthorization)

Authentication and authorization in serial console when using SSH protocol

  • INSTANCE_METADATA: Authentication and authorization using SSH keys in instance metadata
  • OS_LOGIN: Authentication and authorization using Oslogin service

ApplicationApplication

Field

Description

containerSolution

ContainerSolutionSpec

Container specification.

Includes only one of the fields containerSolution.

cloudbackup

BackupSpec

Backup settings.

ContainerSolutionSpecContainerSolutionSpec

Field

Description

productId

string

ID of the product.
The length must be less than or equal to 50.
This field is required.

secrets

object (map<string, Secret>)

A list of the secrets.
The length of each map key must be less than or equal to 100.
The number of elements must be less than or equal to 100.

environment

object (map<string, string>)

A list of the environmets.
The length of each map key must be less than or equal to 100.
The length of each map value must be less than or equal to 10000.
The number of elements must be less than or equal to 100.

SecretSecret

Field

Description

id

string

ID of the secret.
The length must be less than or equal to 50.
This field is required.

key

string

Name of the key.
The length must be less than or equal to 256.
This field is required.

versionId

string

Version of the secret.
The length must be less than or equal to 50.

BackupSpecBackupSpec

Field

Description

enabled

boolean

If true, backup is enabled.

initialPolicyIds[]

string

A list of policy IDs to apply after resource registration.
The length of each element must be between 1 and 50.
The number of elements must be less than or equal to 50.

recoveryFromBackup

boolean

If true, recovery from backup starts on instance.

backupId

string

ID of the backup to recover from.
The length must be less than or equal to 100.

instanceRegistrationId

string

ID of the instance registration for cloud backup agent installation.
The length must be less than or equal to 100.

ResponseResponse

HTTP Code: 200 - OK

{
  "id": "string",
  "description": "string",
  "createdAt": "string",
  "createdBy": "string",
  "modifiedAt": "string",
  "done": "boolean",
  "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

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

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

object

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.

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.

StatusStatus

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

Field

Description

code

integer (int32)

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

message

string

An error message.

details[]

object

A list of messages that carry the error details.

Was the article helpful?

Previous
Create
Next
Delete
© 2026 Direct Cursus Technology L.L.C.