/v1/projects/{project_id}/qemu/vms/{vm_id} — GNS3 1.3.dev1 documentation

### Navigation

- index
- next |
- previous |
- GNS3 1.3.dev1 documentation »
- Qemu »

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

Contents

- /v1/projects/{project_id}/qemu/vms/{vm_id}
  - GET /v1/projects/{project_id}/qemu/vms/{vm_id}
    - Parameters
    - Response status codes
    - Output
    - Sample session
  - PUT /v1/projects/{project_id}/qemu/vms/{vm_id}
    - Parameters
    - Response status codes
    - Input
    - Output
    - Sample session
  - DELETE /v1/projects/{project_id}/qemu/vms/{vm_id}
    - Parameters
    - Response status codes
    - Sample session

## 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
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)
monitor | ✔ | integer | monitor TCP port
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/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/4532d770-23a0-4858-bbab-d8a8b3a17deb'

    GET /projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/4532d770-23a0-4858-bbab-d8a8b3a17deb HTTP/1.1

    HTTP/1.1 200
    CONNECTION: keep-alive
    CONTENT-LENGTH: 566
    CONTENT-TYPE: application/json
    DATE: Thu, 08 Jan 2015 16:09:15 GMT
    SERVER: Python/3.4 GNS3/1.3.dev1
    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": "",
        "initrd": "",
        "kernel_command_line": "",
        "kernel_image": "",
        "legacy_networking": false,
        "monitor": 2001,
        "name": "PC TEST 1",
        "options": "",
        "process_priority": "low",
        "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
        "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmph25p8xei/qemu_x42",
        "ram": 256,
        "vm_id": "4532d770-23a0-4858-bbab-d8a8b3a17deb"
    }

## 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
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)
monitor |  | ['integer', 'null'] | monitor TCP port
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
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)
monitor | ✔ | integer | monitor TCP port
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/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/a68a00de-a264-4cc0-821c-301af5059ea4' -d '{"console": 2002, "hdb_disk_image": "hdb", "name": "test", "ram": 1024}'

    PUT /projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/a68a00de-a264-4cc0-821c-301af5059ea4 HTTP/1.1
    {
        "console": 2002,
        "hdb_disk_image": "hdb",
        "name": "test",
        "ram": 1024
    }

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

    {
        "adapter_type": "e1000",
        "adapters": 1,
        "console": 2002,
        "cpu_throttling": 0,
        "hda_disk_image": "",
        "hdb_disk_image": "hdb",
        "initrd": "",
        "kernel_command_line": "",
        "kernel_image": "",
        "legacy_networking": false,
        "monitor": 2001,
        "name": "test",
        "options": "",
        "process_priority": "low",
        "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
        "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmph25p8xei/qemu_x42",
        "ram": 1024,
        "vm_id": "a68a00de-a264-4cc0-821c-301af5059ea4"
    }

## 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/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/da298f63-4d5b-44a7-8672-ec6642009725'

    DELETE /projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/da298f63-4d5b-44a7-8672-ec6642009725 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.dev1
    X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}

### Navigation

- index
- next |
- previous |
- GNS3 1.3.dev1 documentation »
- Qemu »