Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Children Display
alltrue
styleh3
pageSuperb Cloud API

PUT /virtual_machines/:id 

Edit specified virtual server

Sections:

Table of Contents
maxLevel4
minLevel2
includeResponse.*|JSON.*|XML.*

Request Parameters

label - the VS name

memory -  the amount of RAM allocated to this VS in Mb

cpus - the number of CPUs of this VS

cpu_shares - CPU priority percentage

cpu_units - the amount of CPU units per core if the CPU priority is replaced with CPU units in user billing plan.

allow_migration - set 1 to migrate a VS to a hypervisor with sufficient resources if a hypervisor has insufficient space to resize. Otherwise, set 0. 

allow_cold_resize – set 1 to switch to cold resize when hot resize failed

admin_note – admin notes on the VS.

note – regular notes on the VS.

If the VS is modified successfully, an HTTP 204 response is returned. If scheduling for changes fails, an HTTP 422 response is returned.

Response Parameters

Info
If the VS is modified successfully, an HTTP 204 response is returned. If scheduling for changes fails, an HTTP 422 response is returned.

JSON Request example

Code Block
languagebash
themeRDark
 curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"virtual_machine":{"label":"Test_API_Edit","memory":"512","cpu_shares":"40","cpus":"4","allow_migration":"1","primary_disk_min_iops":"600","swap_disk_min_iops":"600","allow_cold_resize":"1"}}' --url <api_url>/virtual_machines/:id.json

XML Request example

Code Block
languagebash
themeRDark
 curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<?xml version="1.0" encoding="UTF-8"?><virtual_machine><label>Test_API_Edit</label><memory>512</memory><cpu_shares>40</cpu_shares><cpus>4</cpus><allow_migration>1</allow_migration><allow_cold_resize>1</allow_cold_resize><primary_disk_min_iops>600</primary_disk_min_iops><swap_disk_min_iops>600</swap_disk_min_iops></virtual_machine>' --url <api_url>/virtual_machines/:id.xml