/v1/projects/{project_id}/qemu/vms/{vm_id}

GET /v1/projects/{project_id}/qemu/vms/{vm_id}

Get a Qemu.instance

Parameters

  • project_id: UUID for the project
  • vm_id: UUID for the instance

Response status codes

  • 200: Success
  • 400: Invalid request
  • 404: Instance doesn’t exist

Output

Name Mandatory Type Description
adapter_type string QEMU adapter type
adapters integer number of adapters
console integer console TCP port
cpu_throttling integer Percentage of CPU allowed for QEMU
hda_disk_image string QEMU hda disk image path
hdb_disk_image string QEMU hdb disk image path
hdc_disk_image string QEMU hdc disk image path
hdd_disk_image string QEMU hdd disk image path
initrd string QEMU initrd path
kernel_command_line string QEMU kernel command line
kernel_image string QEMU kernel image path
legacy_networking boolean Use QEMU legagy networking commands (-net syntax)
name string QEMU VM instance name
options string Additional QEMU options
process_priority enum Possible values: realtime, very high, high, normal, low, very low
project_id string Project uuid
qemu_path string path to QEMU
ram integer amount of RAM in MB
vm_id string QEMU VM uuid

Sample session

curl -i -X GET 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/e3935d2d-2bf9-4cde-8c7e-0bd1d74c3dad'

GET /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/e3935d2d-2bf9-4cde-8c7e-0bd1d74c3dad HTTP/1.1



HTTP/1.1 200
CONNECTION: keep-alive
CONTENT-LENGTH: 597
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.1.rc2
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}

{
    "adapter_type": "e1000",
    "adapters": 1,
    "console": 2000,
    "cpu_throttling": 0,
    "hda_disk_image": "",
    "hdb_disk_image": "",
    "hdc_disk_image": "",
    "hdd_disk_image": "",
    "initrd": "",
    "kernel_command_line": "",
    "kernel_image": "",
    "legacy_networking": false,
    "name": "PC TEST 1",
    "options": "",
    "process_priority": "low",
    "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
    "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpyasp9636/qemu_x42",
    "ram": 256,
    "vm_id": "e3935d2d-2bf9-4cde-8c7e-0bd1d74c3dad"
}

PUT /v1/projects/{project_id}/qemu/vms/{vm_id}

Update a Qemu.instance

Parameters

  • project_id: UUID for the project
  • vm_id: UUID for the instance

Response status codes

  • 200: Instance updated
  • 400: Invalid request
  • 404: Instance doesn’t exist
  • 409: Conflict

Input

Name Mandatory Type Description
adapter_type ['string', 'null'] QEMU adapter type
adapters ['integer', 'null'] number of adapters
console ['integer', 'null'] console TCP port
cpu_throttling ['integer', 'null'] Percentage of CPU allowed for QEMU
hda_disk_image ['string', 'null'] QEMU hda disk image path
hdb_disk_image ['string', 'null'] QEMU hdb disk image path
hdc_disk_image ['string', 'null'] QEMU hdc disk image path
hdd_disk_image ['string', 'null'] QEMU hdd disk image path
initrd ['string', 'null'] QEMU initrd path
kernel_command_line ['string', 'null'] QEMU kernel command line
kernel_image ['string', 'null'] QEMU kernel image path
legacy_networking ['boolean', 'null'] Use QEMU legagy networking commands (-net syntax)
name ['string', 'null'] QEMU VM instance name
options ['string', 'null'] Additional QEMU options
process_priority enum Possible values: realtime, very high, high, normal, low, very low, null
qemu_path ['string', 'null'] Path to QEMU
ram ['integer', 'null'] amount of RAM in MB

Output

Name Mandatory Type Description
adapter_type string QEMU adapter type
adapters integer number of adapters
console integer console TCP port
cpu_throttling integer Percentage of CPU allowed for QEMU
hda_disk_image string QEMU hda disk image path
hdb_disk_image string QEMU hdb disk image path
hdc_disk_image string QEMU hdc disk image path
hdd_disk_image string QEMU hdd disk image path
initrd string QEMU initrd path
kernel_command_line string QEMU kernel command line
kernel_image string QEMU kernel image path
legacy_networking boolean Use QEMU legagy networking commands (-net syntax)
name string QEMU VM instance name
options string Additional QEMU options
process_priority enum Possible values: realtime, very high, high, normal, low, very low
project_id string Project uuid
qemu_path string path to QEMU
ram integer amount of RAM in MB
vm_id string QEMU VM uuid

Sample session

curl -i -X PUT 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/e5b90e65-6f6a-4d44-b2d8-3a5c3a4a626b' -d '{"console": 2001, "hdb_disk_image": "/tmp/hdb", "name": "test", "ram": 1024}'

PUT /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/e5b90e65-6f6a-4d44-b2d8-3a5c3a4a626b HTTP/1.1
{
    "console": 2001,
    "hdb_disk_image": "/tmp/hdb",
    "name": "test",
    "ram": 1024
}


HTTP/1.1 200
CONNECTION: keep-alive
CONTENT-LENGTH: 601
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.1.rc2
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}

{
    "adapter_type": "e1000",
    "adapters": 1,
    "console": 2001,
    "cpu_throttling": 0,
    "hda_disk_image": "",
    "hdb_disk_image": "/tmp/hdb",
    "hdc_disk_image": "",
    "hdd_disk_image": "",
    "initrd": "",
    "kernel_command_line": "",
    "kernel_image": "",
    "legacy_networking": false,
    "name": "test",
    "options": "",
    "process_priority": "low",
    "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
    "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpyasp9636/qemu_x42",
    "ram": 1024,
    "vm_id": "e5b90e65-6f6a-4d44-b2d8-3a5c3a4a626b"
}

DELETE /v1/projects/{project_id}/qemu/vms/{vm_id}

Delete a Qemu.instance

Parameters

  • project_id: UUID for the project
  • vm_id: UUID for the instance

Response status codes

  • 400: Invalid request
  • 404: Instance doesn’t exist
  • 204: Instance deleted

Sample session

curl -i -X DELETE 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/6537c17b-2e47-46f9-b96b-6fc66382709f'

DELETE /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/6537c17b-2e47-46f9-b96b-6fc66382709f HTTP/1.1



HTTP/1.1 204
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.1.rc2
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}