v1

latestSwagger 2.02026-08-04232286653.5 KB
VMs

Updates a VM in the project and returns the async operation.

patch/projects/{project_id}/compute/vms/instances/{vm_id}

Path parameters

project_idstring required

ID of the project that owns the VM.

vm_idstring required

ID of the VM.

Request body

action'START' | 'STOP' | 'RESET' | 'RESERVE' | 'UNRESERVE' | 'UPDATE' required

Action to perform on the VM: START, STOP, RESET, RESERVE, UNRESERVE, or UPDATE. RESERVE and UNRESERVE operations are done synchronously, and so will have succeeded with a 200 response.

commitment_periodinteger

CommitmentPeriod is deprecated, please use reservationID instead

maintenance_policystring

New host maintenance policy for the VM: manual, stop-vm, or unspecified.

reservation_idstring

ID of the reservation to use for the VM.

typestring

New VM type to change the VM to.

Example request

{
  "action": "START",
  "maintenance_policy": "manual,stop-vm,unspecified",
  "network_interfaces": [
    {
      "id": "ca39e669-47ee-456b-968d-303234fbf99f",
      "interface_type": "ethernet",
      "ips": [
        {
          "private_ipv4": {
            "address": "10.1.2.3"
          },
          "public_ipv4": {
            "address": "121.0.0.0",
            "id": "1ce839b7-3fab-46f9-8e54-7a6bb4ac1ffc",
            "type": "dynamic"
          }
        }
      ],
      "mac_address": "00:00:5e:00:53:af",
      "name": "network-interface-1",
      "network": "1ce839b7-3fab-46f9-8e54-7a6bb4ac1ffc",
      "subnet": "1ce839b7-3fab-46f9-8e54-7a6bb4ac1ffc"
    }
  ],
  "reservation_id": "804bf3a2-81f2-4d78-9a9e-dc6a55ed33d8",
  "type": "a100.2x"
}

Response

Example response

{
  "operation": {
    "completed_at": "2021-12-03T19:59:34Z",
    "metadata": "{}",
    "operation_id": "F6EF489C-086E-458D-B812-7962964A28C9",
    "result": "{}",
    "started_at": "2021-12-03T19:58:34Z",
    "state": "IN_PROGRESS"
  }
}