Method update

Updates the specified instance.

HTTP request

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

Path parameters

Parameter Description
instanceId Required. ID of the Instance resource to update. To get the instance ID, use a list request. The maximum string length in characters is 50.

Body parameters

{
  "updateMask": "string",
  "name": "string",
  "description": "string",
  "labels": "object",
  "platformId": "string",
  "resourcesSpec": {
    "memory": "string",
    "cores": "string",
    "coreFraction": "string",
    "gpus": "string"
  },
  "metadata": "object",
  "serviceAccountId": "string"
}
Field Description
updateMask string

Field mask that specifies which fields of the Instance resource are going to be updated.

A comma-separated names off ALL fields to be updated. Оnly 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.

Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9].

description string

Description of the instance.

The maximum string length in characters is 256.

labels object

Resource labels as key:value pairs.

Existing set of labels is completely replaced by the provided set.

No more than 64 per resource. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z].

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 object

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.

resourcesSpec.
memory
string (int64)

Required. The amount of memory available to the instance, specified in bytes.

The maximum value is 274877906944.

resourcesSpec.
cores
string (int64)

Required. The number of cores available to the instance.

Value must be one of 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 or 32.

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

Value must be one of 0, 5, 20, 50 or 100.

resourcesSpec.
gpus
string (int64)

The number of GPUs available to the instance.

Value must be one of 0, 1, 2 or 4.

metadata object

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 only restriction placed on values is that their size 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.

serviceAccountId string

ID of the service account to use for authentication inside the instance. To get the service account ID, use a list request.

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.

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.

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

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

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.