Compute Cloud API, REST: Instance.Update
Updates the specified instance.
HTTP request
PATCH https://compute.api.cloud.yandex.net/compute/v1/instances/{instanceId}
Path parameters
|
Field |
Description |
|
instanceId |
string Required field. ID of the Instance resource to update. |
Body 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. If |
|
name |
string Name of the instance. |
|
description |
string Description of the instance. |
|
labels |
object (map<string, string>) Resource labels as |
|
platformId |
string ID of the hardware platform configuration for the instance. |
|
resourcesSpec |
Computing resources of the instance, such as the amount of memory and number of cores. |
|
metadata |
object (map<string, string>) The metadata |
|
schedulingPolicy |
Scheduling policy configuration. |
|
serviceAccountId |
string ID of the service account to use for authentication inside the instance. |
|
networkSettings |
Network settings. |
|
placementPolicy |
Placement policy configuration. |
|
maintenancePolicy |
enum (MaintenancePolicy) Behaviour on maintenance events
|
|
maintenanceGracePeriod |
string (duration) Time between notification via metadata service and maintenance |
|
metadataOptions |
Options allow user to configure access to instance's metadata |
|
serialPortSettings |
Serial port settings |
|
application |
Instance application settings. |
|
reservedInstancePoolId |
string ID of the reserved instance pool that the instance should belong to. |
ResourcesSpec
|
Field |
Description |
|
memory |
string (int64) The amount of memory available to the instance, specified in bytes. |
|
cores |
string (int64) The number of cores available to the instance. |
|
coreFraction |
string (int64) Baseline level of CPU performance with the ability to burst performance above that baseline level. |
|
gpus |
string (int64) The number of GPUs available to the instance. |
SchedulingPolicy
|
Field |
Description |
|
preemptible |
boolean True for short-lived compute instances. For more information, see Preemptible VMs. |
NetworkSettings
|
Field |
Description |
|
type |
enum (Type) Network Type
|
PlacementPolicy
|
Field |
Description |
|
placementGroupId |
string Placement group ID. |
|
placementGroupPartition |
string (int64) Placement group partition |
|
hostAffinityRules[] |
List of affinity rules. Scheduler will attempt to allocate instances according to order of rules. |
HostAffinityRule
Affinity definition
|
Field |
Description |
|
key |
string Affinity label or one of reserved values - 'yc.hostId', 'yc.hostGroupId' |
|
op |
enum (Operator) Include or exclude action
|
|
values[] |
string Affinity value or host ID or host group ID |
MetadataOptions
|
Field |
Description |
|
gceHttpEndpoint |
enum (MetadataOption) Enabled access to GCE flavored metadata
|
|
awsV1HttpEndpoint |
enum (MetadataOption) Enabled access to AWS flavored metadata (IMDSv1)
|
|
gceHttpToken |
enum (MetadataOption) Enabled access to IAM credentials with GCE flavored metadata
|
|
awsV1HttpToken |
enum (MetadataOption) Enabled access to IAM credentials with AWS flavored metadata (IMDSv1)
|
|
awsV2HttpEndpoint |
enum (MetadataOption) Enabled access to AWS flavored metadata with session token (IMDSv2)
|
|
awsV2HttpToken |
enum (MetadataOption) Enabled access to STS credentials with AWS flavored metadata with session token (IMDSv2)
|
SerialPortSettings
|
Field |
Description |
|
sshAuthorization |
enum (SSHAuthorization) Authentication and authorization in serial console when using SSH protocol
|
Application
|
Field |
Description |
|
containerSolution |
Container specification. Includes only one of the fields |
|
cloudbackup |
Backup settings. |
ContainerSolutionSpec
|
Field |
Description |
|
productId |
string ID of the product. |
|
secrets |
object (map<string, Secret>) A list of the secrets. |
|
environment |
object (map<string, string>) A list of the environmets. |
Secret
|
Field |
Description |
|
id |
string ID of the secret. |
|
key |
string Name of the key. |
|
versionId |
string Version of the secret. |
BackupSpec
|
Field |
Description |
|
enabled |
boolean If true, backup is enabled. |
|
initialPolicyIds[] |
string A list of policy IDs to apply after resource registration. |
|
recoveryFromBackup |
boolean If true, recovery from backup starts on instance. |
|
backupId |
string ID of the backup to recover from. |
|
instanceRegistrationId |
string ID of the instance registration for cloud backup agent installation. |
Response
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 To work with values in this field, use the APIs described in the |
|
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 To work with values in this field, use the APIs described in the |
|
done |
boolean If the value is |
|
metadata |
object 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 |
object The normal response of the operation in case of success. Includes only one of the fields The operation result. |
Status
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. |