Welcome to API documentation!¶
Warning
The API is not stable, feel free to post comments on our website https://gns3.com/
Communications¶
All the communication are done over HTTP using JSON.
Errors¶
In case of error a standard HTTP error is raise and you got a JSON like that
{
"status": 409,
"message": "Conflict"
}
Sample session using curl¶
Warning
Beware the output of this sample is truncated in order to simplify the understanding. Please read the documentation for the exact output.
You can check the server version with a simple curl command:
# curl "http://localhost:3080/v1/version"
{
"version": "1.3.dev1"
}
The next step is to create a project.
# curl -X POST "http://localhost:3080/v1/projects" -d '{"name": "test"}'
{
"project_id": "42f9feee-3217-4104-981e-85d5f0a806ec",
"temporary": false,
"name": "Test"
}
With this project id we can now create two VPCS VM.
# curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms" -d '{"name": "VPCS 1"}'
{
"console": 2000,
"name": "VPCS 1",
"project_id": "42f9feee-3217-4104-981e-85d5f0a806ec",
"vm_id": "24d2e16b-fbef-4259-ae34-7bc21a41ee28"
}%
# curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms" -d '{"name": "VPCS 2"}'
{
"console": 2001,
"name": "VPCS 2",
"vm_id": "daefc24a-103c-4717-8e01-6517d931c1ae"
}
Now we need to link the two VPCS. The first step is to allocate on the remote servers two UDP ports.
# curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/ports/udp" -d '{}'
{
"udp_port": 10000
}
# curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/ports/udp" -d '{}'
{
"udp_port": 10001
}
We can create the bidirectionnal communication between the two VPCS. The communication is made by creating two UDP tunnels.
# curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms/24d2e16b-fbef-4259-ae34-7bc21a41ee28/adapters/0/ports/0/nio" -d '{"lport": 10000, "rhost": "127.0.0.1", "rport": 10001, "type": "nio_udp"}'
{
"lport": 10000,
"rhost": "127.0.0.1",
"rport": 10001,
"type": "nio_udp"
}
# curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms/daefc24a-103c-4717-8e01-6517d931c1ae/adapters/0/ports/0/nio" -d '{"lport": 10001, "rhost": "127.0.0.1", "rport": 10000, "type": "nio_udp"}'
{
"lport": 10001,
"rhost": "127.0.0.1",
"rport": 10000,
"type": "nio_udp"
}
Now we can start the two VM
# curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms/24d2e16b-fbef-4259-ae34-7bc21a41ee28/start" -d "{}"
# curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms/daefc24a-103c-4717-8e01-6517d931c1ae/start" -d '{}'
Everything should be started now. You can connect via telnet to the different VM. The port is the field console in the create VM request.
# telnet 127.0.0.1 2000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Welcome to Virtual PC Simulator, version 0.6
Dedicated to Daling.
Build time: Dec 29 2014 12:51:46
Copyright (c) 2007-2014, Paul Meng (mirnshi@gmail.com)
All rights reserved.
VPCS is free software, distributed under the terms of the "BSD" licence.
Source code and license can be found at vpcs.sf.net.
For more information, please visit wiki.freecode.com.cn.
Press '?' to get help.
VPCS> ip 192.168.1.1
Checking for duplicate address...
PC1 : 192.168.1.1 255.255.255.0
VPCS> disconnect
Good-bye
Connection closed by foreign host.
# telnet 127.0.0.1 2001
telnet 127.0.0.1 2001
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Welcome to Virtual PC Simulator, version 0.6
Dedicated to Daling.
Build time: Dec 29 2014 12:51:46
Copyright (c) 2007-2014, Paul Meng (mirnshi@gmail.com)
All rights reserved.
VPCS is free software, distributed under the terms of the "BSD" licence.
Source code and license can be found at vpcs.sf.net.
For more information, please visit wiki.freecode.com.cn.
Press '?' to get help.
VPCS> ip 192.168.1.2
Checking for duplicate address...
PC1 : 192.168.1.2 255.255.255.0
VPCS> ping 192.168.1.1
84 bytes from 192.168.1.1 icmp_seq=1 ttl=64 time=0.179 ms
84 bytes from 192.168.1.1 icmp_seq=2 ttl=64 time=0.218 ms
84 bytes from 192.168.1.1 icmp_seq=3 ttl=64 time=0.190 ms
84 bytes from 192.168.1.1 icmp_seq=4 ttl=64 time=0.198 ms
84 bytes from 192.168.1.1 icmp_seq=5 ttl=64 time=0.185 ms
VPCS> disconnect
Good-bye
Connection closed by foreign host.
Limitations¶
Concurrency¶
A VM can’t process multiple request in the same time. But you can make multiple request on multiple VM. It’s transparent for the client when the first request on a VM start a lock is acquire for this VM id and released for the next request at the end. You can safely send all the requests in the same time and let the server manage an efficent concurrency.
We think it can be a little slower for some operations, but it’s remove a big complexity for the client due to the fact only some command on some VM can be concurrent.
Authentication¶
In this version of the API you have no authentification system. If you listen on your network interface instead of localhost be carefull. Due to the nature of the multiple supported VM it’s easy for an user to upload and run code on your machine.
Notifications¶
You can receive notification from the server if you listen the HTTP stream /notifications.
The available notification are: * ping * vm.created * vm.started * vm.stopped * log.error
Glossary¶
VM¶
A Virtual Machine (Dynamips, IOU, Qemu, VPCS...)
Adapter¶
The physical network interface. The adapter can contain multiple ports.
Port¶
A port is an opening on network adapter that cable plug into.
For example a VM can have a serial and an ethernet adapter plugged in. The ethernet adapter can have 4 ports.
API Endpoints¶
Config¶
/v1/config/reload¶
POST /v1/config/reload¶
Check if version is the same as the server
Response status codes¶
- 201: Config reload
- 403: Config reload refused
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/config/reload' -d '{}'
POST /v1/config/reload HTTP/1.1
{}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/config/reload
Docker¶
/v1/projects/{project_id}/docker/images¶
Contents
POST /v1/projects/{project_id}/docker/images¶
Create a new Docker container
Parameters¶
- project_id: UUID for the project
Response status codes¶
- 400: Invalid request
- 201: Instance created
- 409: Conflict
/v1/projects/{project_id}/docker/images/{id}¶
Contents
DELETE /v1/projects/{project_id}/docker/images/{id}¶
Delete a Docker container
Parameters¶
- id: ID for the container
- project_id: UUID for the project
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Instance deleted
/v1/projects/{project_id}/docker/images/{id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Contents
POST /v1/projects/{project_id}/docker/images/{id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Add a NIO to a Docker container
Parameters¶
- id: ID of the container
- adapter_number: Adapter where the nio should be added
- project_id: UUID for the project
- port_number: Port on the adapter
Response status codes¶
- 400: Invalid request
- 201: NIO created
- 404: Instance doesn’t exist
DELETE /v1/projects/{project_id}/docker/images/{id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Remove a NIO from a Docker container
Parameters¶
- id: ID of the container
- adapter_number: Adapter where the nio should be added
- project_id: UUID for the project
- port_number: Port on the adapter
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: NIO deleted
/v1/projects/{project_id}/docker/images/{id}/reload¶
Contents
POST /v1/projects/{project_id}/docker/images/{id}/reload¶
Restart a Docker container
Parameters¶
- id: ID of the container
- project_id: UUID of the project
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Instance restarted
/v1/projects/{project_id}/docker/images/{id}/start¶
Contents
POST /v1/projects/{project_id}/docker/images/{id}/start¶
Start a Docker container
Parameters¶
- id: ID of the container
- project_id: UUID of the project
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Instance started
/v1/projects/{project_id}/docker/images/{id}/stop¶
Contents
POST /v1/projects/{project_id}/docker/images/{id}/stop¶
Stop a Docker container
Parameters¶
- id: ID of the container
- project_id: UUID of the project
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Instance stopped
/v1/projects/{project_id}/docker/images/{id}/suspend¶
Contents
POST /v1/projects/{project_id}/docker/images/{id}/suspend¶
Pause a Docker container
Parameters¶
- id: ID of the container
- project_id: UUID of the project
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Instance paused
Dynamips device¶
/v1/projects/{project_id}/dynamips/devices¶
Contents
POST /v1/projects/{project_id}/dynamips/devices¶
Create a new Dynamips device instance
Parameters¶
- project_id: UUID for the project
Response status codes¶
- 400: Invalid request
- 201: Instance created
- 409: Conflict
/v1/projects/{project_id}/dynamips/devices/{device_id}¶
Contents
GET /v1/projects/{project_id}/dynamips/devices/{device_id}¶
Get a Dynamips device instance
Parameters¶
- device_id: UUID for the instance
- project_id: UUID for the project
Response status codes¶
- 200: Success
- 400: Invalid request
- 404: Instance doesn’t exist
PUT /v1/projects/{project_id}/dynamips/devices/{device_id}¶
Update a Dynamips device instance
Parameters¶
- device_id: UUID for the instance
- project_id: UUID for the project
Response status codes¶
- 200: Instance updated
- 400: Invalid request
- 404: Instance doesn’t exist
- 409: Conflict
DELETE /v1/projects/{project_id}/dynamips/devices/{device_id}¶
Delete a Dynamips device instance
Parameters¶
- device_id: UUID for the instance
- project_id: UUID for the project
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Instance deleted
/v1/projects/{project_id}/dynamips/devices/{device_id}/ports/{port_number:d+}/nio¶
Contents
POST /v1/projects/{project_id}/dynamips/devices/{device_id}/ports/{port_number:d+}/nio¶
Add a NIO to a Dynamips device instance
Parameters¶
- device_id: UUID for the instance
- project_id: UUID for the project
- port_number: Port on the device
Response status codes¶
- 400: Invalid request
- 201: NIO created
- 404: Instance doesn’t exist
Input¶
Generic Ethernet Network Input/Output
Name | Mandatory | Type | Description |
---|---|---|---|
ethernet_device | ✔ | string | Ethernet device name e.g. eth0 |
type | ✔ | enum | Possible values: nio_generic_ethernet |
Linux Ethernet Network Input/Output
Name | Mandatory | Type | Description |
---|---|---|---|
ethernet_device | ✔ | string | Ethernet device name e.g. eth0 |
type | ✔ | enum | Possible values: nio_linux_ethernet |
NULL Network Input/Output
Name | Mandatory | Type | Description |
---|---|---|---|
type | ✔ | enum | Possible values: nio_null |
TAP Network Input/Output
Name | Mandatory | Type | Description |
---|---|---|---|
tap_device | ✔ | string | TAP device name e.g. tap0 |
type | ✔ | enum | Possible values: nio_tap |
UDP Network Input/Output
Name | Mandatory | Type | Description |
---|---|---|---|
lport | ✔ | integer | Local port |
rhost | ✔ | string | Remote host |
rport | ✔ | integer | Remote port |
type | ✔ | enum | Possible values: nio_udp |
DELETE /v1/projects/{project_id}/dynamips/devices/{device_id}/ports/{port_number:d+}/nio¶
Remove a NIO from a Dynamips device instance
Parameters¶
- device_id: UUID for the instance
- project_id: UUID for the project
- port_number: Port on the device
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: NIO deleted
/v1/projects/{project_id}/dynamips/devices/{device_id}/ports/{port_number:d+}/start_capture¶
Contents
POST /v1/projects/{project_id}/dynamips/devices/{device_id}/ports/{port_number:d+}/start_capture¶
Start a packet capture on a Dynamips device instance
Parameters¶
- device_id: UUID for the instance
- project_id: UUID for the project
- port_number: Port on the device
Response status codes¶
- 200: Capture started
- 400: Invalid request
- 404: Instance doesn’t exist
/v1/projects/{project_id}/dynamips/devices/{device_id}/ports/{port_number:d+}/stop_capture¶
Contents
POST /v1/projects/{project_id}/dynamips/devices/{device_id}/ports/{port_number:d+}/stop_capture¶
Stop a packet capture on a Dynamips device instance
Parameters¶
- device_id: UUID for the instance
- project_id: UUID for the project
- port_number: Port on the device
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Capture stopped
Dynamips vm¶
/v1/dynamips/vms¶
GET /v1/dynamips/vms¶
Retrieve the list of Dynamips VMS
Response status codes¶
- 200: List of Dynamips VM retrieved
/v1/projects/{project_id}/dynamips/vms¶
Contents
POST /v1/projects/{project_id}/dynamips/vms¶
Create a new Dynamips VM instance
Parameters¶
- project_id: UUID for the project
Response status codes¶
- 400: Invalid request
- 201: Instance created
- 409: Conflict
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
auto_delete_disks | boolean | automatically delete nvram and disk files | |
aux | integer | auxiliary console TCP port | |
chassis | string | router chassis model | |
clock_divisor | integer | clock divisor | |
console | integer | console TCP port | |
disk0 | integer | disk0 size in MB | |
disk1 | integer | disk1 size in MB | |
dynamips_id | integer | ID to use with Dynamips | |
exec_area | integer | exec area value | |
idlemax | integer | idlemax value | |
idlepc | string | Idle-PC value | |
idlesleep | integer | idlesleep value | |
image | ✔ | string | path to the IOS image |
image_md5sum | ['string', 'null'] | checksum of the IOS image | |
iomem | integer | I/O memory percentage | |
mac_addr | string | base MAC address | |
midplane | enum | Possible values: std, vxr | |
mmap | boolean | MMAP feature | |
name | ✔ | string | Dynamips VM instance name |
npe | enum | Possible values: npe-100, npe-150, npe-175, npe-200, npe-225, npe-300, npe-400, npe-g2 | |
nvram | integer | amount of NVRAM in KB | |
platform | ✔ | string | platform |
power_supplies | array | Power supplies status | |
private_config | string | path to the IOS private configuration file | |
private_config_base64 | string | private configuration base64 encoded | |
private_config_content | string | Content of IOS private configuration file | |
ram | ✔ | integer | amount of RAM in MB |
sensors | array | Temperature sensors | |
slot0 | Network module slot 0 | ||
slot1 | Network module slot 1 | ||
slot2 | Network module slot 2 | ||
slot3 | Network module slot 3 | ||
slot4 | Network module slot 4 | ||
slot5 | Network module slot 5 | ||
slot6 | Network module slot 6 | ||
sparsemem | boolean | sparse memory feature | |
startup_config | string | path to the IOS startup configuration file | |
startup_config_base64 | string | startup configuration base64 encoded | |
startup_config_content | string | Content of IOS startup configuration file | |
system_id | string | system ID | |
vm_id | Dynamips VM instance identifier | ||
wic0 | Network module WIC slot 0 | ||
wic1 | Network module WIC slot 0 | ||
wic2 | Network module WIC slot 0 |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
auto_delete_disks | boolean | automatically delete nvram and disk files | |
aux | ['integer', 'null'] | auxiliary console TCP port | |
chassis | string | router chassis model | |
clock_divisor | integer | clock divisor | |
console | integer | console TCP port | |
disk0 | integer | disk0 size in MB | |
disk1 | integer | disk1 size in MB | |
dynamips_id | ✔ | integer | ID to use with Dynamips |
exec_area | integer | exec area value | |
idlemax | integer | idlemax value | |
idlepc | string | Idle-PC value | |
idlesleep | integer | idlesleep value | |
image | string | path to the IOS image | |
image_md5sum | ['string', 'null'] | checksum of the IOS image | |
iomem | integer | I/O memory percentage | |
mac_addr | string | base MAC address | |
midplane | enum | Possible values: std, vxr | |
mmap | boolean | MMAP feature | |
name | ✔ | string | Dynamips VM instance name |
npe | enum | Possible values: npe-100, npe-150, npe-175, npe-200, npe-225, npe-300, npe-400, npe-g2 | |
nvram | integer | amount of NVRAM in KB | |
platform | string | platform | |
power_supplies | array | Power supplies status | |
private_config | string | path to the IOS private configuration file | |
private_config_base64 | string | private configuration base64 encoded | |
project_id | ✔ | string | Project UUID |
ram | integer | amount of RAM in MB | |
sensors | array | Temperature sensors | |
slot0 | Network module slot 0 | ||
slot1 | Network module slot 1 | ||
slot2 | Network module slot 2 | ||
slot3 | Network module slot 3 | ||
slot4 | Network module slot 4 | ||
slot5 | Network module slot 5 | ||
slot6 | Network module slot 6 | ||
sparsemem | boolean | sparse memory feature | |
startup_config | string | path to the IOS startup configuration file | |
startup_config_base64 | string | startup configuration base64 encoded | |
system_id | string | system ID | |
vm_directory | string | ||
vm_id | ✔ | string | Dynamips router instance UUID |
wic0 | Network module WIC slot 0 | ||
wic1 | Network module WIC slot 0 | ||
wic2 | Network module WIC slot 0 |
/v1/projects/{project_id}/dynamips/vms/{vm_id}¶
GET /v1/projects/{project_id}/dynamips/vms/{vm_id}¶
Get a Dynamips VM 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 |
---|---|---|---|
auto_delete_disks | boolean | automatically delete nvram and disk files | |
aux | ['integer', 'null'] | auxiliary console TCP port | |
chassis | string | router chassis model | |
clock_divisor | integer | clock divisor | |
console | integer | console TCP port | |
disk0 | integer | disk0 size in MB | |
disk1 | integer | disk1 size in MB | |
dynamips_id | ✔ | integer | ID to use with Dynamips |
exec_area | integer | exec area value | |
idlemax | integer | idlemax value | |
idlepc | string | Idle-PC value | |
idlesleep | integer | idlesleep value | |
image | string | path to the IOS image | |
image_md5sum | ['string', 'null'] | checksum of the IOS image | |
iomem | integer | I/O memory percentage | |
mac_addr | string | base MAC address | |
midplane | enum | Possible values: std, vxr | |
mmap | boolean | MMAP feature | |
name | ✔ | string | Dynamips VM instance name |
npe | enum | Possible values: npe-100, npe-150, npe-175, npe-200, npe-225, npe-300, npe-400, npe-g2 | |
nvram | integer | amount of NVRAM in KB | |
platform | string | platform | |
power_supplies | array | Power supplies status | |
private_config | string | path to the IOS private configuration file | |
private_config_base64 | string | private configuration base64 encoded | |
project_id | ✔ | string | Project UUID |
ram | integer | amount of RAM in MB | |
sensors | array | Temperature sensors | |
slot0 | Network module slot 0 | ||
slot1 | Network module slot 1 | ||
slot2 | Network module slot 2 | ||
slot3 | Network module slot 3 | ||
slot4 | Network module slot 4 | ||
slot5 | Network module slot 5 | ||
slot6 | Network module slot 6 | ||
sparsemem | boolean | sparse memory feature | |
startup_config | string | path to the IOS startup configuration file | |
startup_config_base64 | string | startup configuration base64 encoded | |
system_id | string | system ID | |
vm_directory | string | ||
vm_id | ✔ | string | Dynamips router instance UUID |
wic0 | Network module WIC slot 0 | ||
wic1 | Network module WIC slot 0 | ||
wic2 | Network module WIC slot 0 |
PUT /v1/projects/{project_id}/dynamips/vms/{vm_id}¶
Update a Dynamips VM 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 |
---|---|---|---|
auto_delete_disks | boolean | automatically delete nvram and disk files | |
aux | integer | auxiliary console TCP port | |
chassis | string | router chassis model | |
clock_divisor | integer | clock divisor | |
console | integer | console TCP port | |
disk0 | integer | disk0 size in MB | |
disk1 | integer | disk1 size in MB | |
exec_area | integer | exec area value | |
idlemax | integer | idlemax value | |
idlepc | string | Idle-PC value | |
idlesleep | integer | idlesleep value | |
image | string | path to the IOS image | |
image_md5sum | ['string', 'null'] | checksum of the IOS image | |
iomem | integer | I/O memory percentage | |
mac_addr | string | base MAC address | |
midplane | enum | Possible values: std, vxr | |
mmap | boolean | MMAP feature | |
name | string | Dynamips VM instance name | |
npe | enum | Possible values: npe-100, npe-150, npe-175, npe-200, npe-225, npe-300, npe-400, npe-g2 | |
nvram | integer | amount of NVRAM in KB | |
platform | string | platform | |
power_supplies | array | Power supplies status | |
private_config_base64 | string | private configuration base64 encoded | |
private_config_content | string | Content of IOS private configuration file | |
ram | integer | amount of RAM in MB | |
sensors | array | Temperature sensors | |
slot0 | Network module slot 0 | ||
slot1 | Network module slot 1 | ||
slot2 | Network module slot 2 | ||
slot3 | Network module slot 3 | ||
slot4 | Network module slot 4 | ||
slot5 | Network module slot 5 | ||
slot6 | Network module slot 6 | ||
sparsemem | boolean | sparse memory feature | |
startup_config_base64 | string | startup configuration base64 encoded | |
startup_config_content | string | Content of IOS startup configuration file | |
system_id | string | system ID | |
wic0 | Network module WIC slot 0 | ||
wic1 | Network module WIC slot 0 | ||
wic2 | Network module WIC slot 0 |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
auto_delete_disks | boolean | automatically delete nvram and disk files | |
aux | ['integer', 'null'] | auxiliary console TCP port | |
chassis | string | router chassis model | |
clock_divisor | integer | clock divisor | |
console | integer | console TCP port | |
disk0 | integer | disk0 size in MB | |
disk1 | integer | disk1 size in MB | |
dynamips_id | ✔ | integer | ID to use with Dynamips |
exec_area | integer | exec area value | |
idlemax | integer | idlemax value | |
idlepc | string | Idle-PC value | |
idlesleep | integer | idlesleep value | |
image | string | path to the IOS image | |
image_md5sum | ['string', 'null'] | checksum of the IOS image | |
iomem | integer | I/O memory percentage | |
mac_addr | string | base MAC address | |
midplane | enum | Possible values: std, vxr | |
mmap | boolean | MMAP feature | |
name | ✔ | string | Dynamips VM instance name |
npe | enum | Possible values: npe-100, npe-150, npe-175, npe-200, npe-225, npe-300, npe-400, npe-g2 | |
nvram | integer | amount of NVRAM in KB | |
platform | string | platform | |
power_supplies | array | Power supplies status | |
private_config | string | path to the IOS private configuration file | |
private_config_base64 | string | private configuration base64 encoded | |
project_id | ✔ | string | Project UUID |
ram | integer | amount of RAM in MB | |
sensors | array | Temperature sensors | |
slot0 | Network module slot 0 | ||
slot1 | Network module slot 1 | ||
slot2 | Network module slot 2 | ||
slot3 | Network module slot 3 | ||
slot4 | Network module slot 4 | ||
slot5 | Network module slot 5 | ||
slot6 | Network module slot 6 | ||
sparsemem | boolean | sparse memory feature | |
startup_config | string | path to the IOS startup configuration file | |
startup_config_base64 | string | startup configuration base64 encoded | |
system_id | string | system ID | |
vm_directory | string | ||
vm_id | ✔ | string | Dynamips router instance UUID |
wic0 | Network module WIC slot 0 | ||
wic1 | Network module WIC slot 0 | ||
wic2 | Network module WIC slot 0 |
DELETE /v1/projects/{project_id}/dynamips/vms/{vm_id}¶
Delete a Dynamips VM 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
/v1/projects/{project_id}/dynamips/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
POST /v1/projects/{project_id}/dynamips/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Add a NIO to a Dynamips VM instance
Parameters¶
- adapter_number: Adapter where the nio should be added
- port_number: Port on the adapter
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 201: NIO created
- 404: Instance doesn’t exist
DELETE /v1/projects/{project_id}/dynamips/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Remove a NIO from a Dynamips VM instance
Parameters¶
- adapter_number: Adapter from where the nio should be removed
- port_number: Port on the adapter
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: NIO deleted
/v1/projects/{project_id}/dynamips/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/start_capture¶
Contents
POST /v1/projects/{project_id}/dynamips/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/start_capture¶
Start a packet capture on a Dynamips VM instance
Parameters¶
- adapter_number: Adapter to start a packet capture
- port_number: Port on the adapter
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 200: Capture started
- 400: Invalid request
- 404: Instance doesn’t exist
/v1/projects/{project_id}/dynamips/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/stop_capture¶
Contents
POST /v1/projects/{project_id}/dynamips/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/stop_capture¶
Stop a packet capture on a Dynamips VM instance
Parameters¶
- adapter_number: Adapter to stop a packet capture
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Capture stopped
/v1/projects/{project_id}/dynamips/vms/{vm_id}/auto_idlepc¶
Contents
GET /v1/projects/{project_id}/dynamips/vms/{vm_id}/auto_idlepc¶
Retrieve the idlepc proposals
Response status codes¶
- 200: Best Idle-pc value found
- 400: Invalid request
- 404: Instance doesn’t exist
/v1/projects/{project_id}/dynamips/vms/{vm_id}/configs¶
Contents
GET /v1/projects/{project_id}/dynamips/vms/{vm_id}/configs¶
Retrieve the startup and private configs content
Response status codes¶
- 200: Configs retrieved
- 400: Invalid request
- 404: Instance doesn’t exist
/v1/projects/{project_id}/dynamips/vms/{vm_id}/configs/save¶
Contents
POST /v1/projects/{project_id}/dynamips/vms/{vm_id}/configs/save¶
Save the startup and private configs content
Response status codes¶
- 200: Configs saved
- 400: Invalid request
- 404: Instance doesn’t exist
/v1/projects/{project_id}/dynamips/vms/{vm_id}/idlepc_proposals¶
Contents
GET /v1/projects/{project_id}/dynamips/vms/{vm_id}/idlepc_proposals¶
Retrieve the idlepc proposals
Response status codes¶
- 200: Idle-PCs retrieved
- 400: Invalid request
- 404: Instance doesn’t exist
/v1/projects/{project_id}/dynamips/vms/{vm_id}/reload¶
Contents
POST /v1/projects/{project_id}/dynamips/vms/{vm_id}/reload¶
Reload a Dynamips VM 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 reloaded
/v1/projects/{project_id}/dynamips/vms/{vm_id}/resume¶
Contents
POST /v1/projects/{project_id}/dynamips/vms/{vm_id}/resume¶
Resume a suspended Dynamips VM 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 resumed
/v1/projects/{project_id}/dynamips/vms/{vm_id}/start¶
Contents
POST /v1/projects/{project_id}/dynamips/vms/{vm_id}/start¶
Start a Dynamips VM 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 started
/v1/projects/{project_id}/dynamips/vms/{vm_id}/stop¶
Contents
POST /v1/projects/{project_id}/dynamips/vms/{vm_id}/stop¶
Stop a Dynamips VM 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 stopped
/v1/projects/{project_id}/dynamips/vms/{vm_id}/suspend¶
Contents
POST /v1/projects/{project_id}/dynamips/vms/{vm_id}/suspend¶
Suspend a Dynamips VM 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 suspended
File¶
/v1/files/stream¶
GET /v1/files/stream¶
Stream a file from the server
Response status codes¶
- 200: File retrieved
- 409: Can’t access to file
- 404: File doesn’t exist
Iou¶
/v1/iou/vms¶
GET /v1/iou/vms¶
Retrieve the list of IOU VMS
Response status codes¶
- 200: List of IOU VM retrieved
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/iou/vms'
GET /v1/iou/vms HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 72
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/iou/vms
[
{
"filename": "iou.bin",
"path": "iou.bin"
}
]
/v1/projects/{project_id}/iou/vms¶
Contents
POST /v1/projects/{project_id}/iou/vms¶
Create a new IOU instance
Parameters¶
- project_id: UUID for the project
Response status codes¶
- 400: Invalid request
- 201: Instance created
- 409: Conflict
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
console | ['integer', 'null'] | console TCP port | |
ethernet_adapters | integer | How many ethernet adapters are connected to the IOU | |
iourc_content | ['string', 'null'] | Content of the iourc file. Ignored if Null | |
l1_keepalives | ['boolean', 'null'] | Always up ethernet interface | |
md5sum | ['string', 'null'] | Checksum of iou binary | |
name | ✔ | string | IOU VM name |
nvram | ['integer', 'null'] | Allocated NVRAM KB | |
path | ✔ | string | Path of iou binary |
private_config | ['string', 'null'] | Path to the private-config of IOU | |
private_config_content | ['string', 'null'] | Private-config of IOU | |
ram | ['integer', 'null'] | Allocated RAM MB | |
serial_adapters | integer | How many serial adapters are connected to the IOU | |
startup_config | ['string', 'null'] | Path to the startup-config of IOU | |
startup_config_content | ['string', 'null'] | Startup-config of IOU | |
use_default_iou_values | ['boolean', 'null'] | Use default IOU values | |
vm_id | IOU VM identifier |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
console | ✔ | integer | console TCP port |
ethernet_adapters | ✔ | integer | How many ethernet adapters are connected to the IOU |
iourc_path | ['string', 'null'] | Path of the iourc file used by remote servers | |
l1_keepalives | ✔ | boolean | Always up ethernet interface |
md5sum | ✔ | ['string', 'null'] | Checksum of iou binary |
name | ✔ | string | IOU VM name |
nvram | ✔ | integer | Allocated NVRAM KB |
path | ✔ | string | Path of iou binary |
private_config | ✔ | ['string', 'null'] | Path of the private-config content relative to project directory |
project_id | ✔ | string | Project UUID |
ram | ✔ | integer | Allocated RAM MB |
serial_adapters | ✔ | integer | How many serial adapters are connected to the IOU |
startup_config | ✔ | ['string', 'null'] | Path of the startup-config content relative to project directory |
use_default_iou_values | ✔ | ['boolean', 'null'] | Use default IOU values |
vm_directory | string | ||
vm_id | ✔ | string | IOU VM UUID |
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms' -d '{"name": "PC TEST 1", "path": "iou.bin", "startup_config_content": "hostname test", "vm_id": "afa904bc-8968-4e7c-87b6-11d92174f1e6"}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms HTTP/1.1
{
"name": "PC TEST 1",
"path": "iou.bin",
"startup_config_content": "hostname test",
"vm_id": "afa904bc-8968-4e7c-87b6-11d92174f1e6"
}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 626
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms
{
"console": 2001,
"ethernet_adapters": 2,
"iourc_path": null,
"l1_keepalives": false,
"md5sum": null,
"name": "PC TEST 1",
"nvram": 128,
"path": "iou.bin",
"private_config": null,
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"ram": 256,
"serial_adapters": 2,
"startup_config": "startup-config.cfg",
"use_default_iou_values": true,
"vm_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp2yt9sd1l/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/iou/afa904bc-8968-4e7c-87b6-11d92174f1e6",
"vm_id": "afa904bc-8968-4e7c-87b6-11d92174f1e6"
}
/v1/projects/{project_id}/iou/vms/{vm_id}¶
Contents
GET /v1/projects/{project_id}/iou/vms/{vm_id}¶
Get a IOU 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 |
---|---|---|---|
console | ✔ | integer | console TCP port |
ethernet_adapters | ✔ | integer | How many ethernet adapters are connected to the IOU |
iourc_path | ['string', 'null'] | Path of the iourc file used by remote servers | |
l1_keepalives | ✔ | boolean | Always up ethernet interface |
md5sum | ✔ | ['string', 'null'] | Checksum of iou binary |
name | ✔ | string | IOU VM name |
nvram | ✔ | integer | Allocated NVRAM KB |
path | ✔ | string | Path of iou binary |
private_config | ✔ | ['string', 'null'] | Path of the private-config content relative to project directory |
project_id | ✔ | string | Project UUID |
ram | ✔ | integer | Allocated RAM MB |
serial_adapters | ✔ | integer | How many serial adapters are connected to the IOU |
startup_config | ✔ | ['string', 'null'] | Path of the startup-config content relative to project directory |
use_default_iou_values | ✔ | ['boolean', 'null'] | Use default IOU values |
vm_directory | string | ||
vm_id | ✔ | string | IOU VM UUID |
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/82f6e25c-6960-421d-9567-a7453642935b'
GET /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/82f6e25c-6960-421d-9567-a7453642935b HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 610
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}
{
"console": 2001,
"ethernet_adapters": 2,
"iourc_path": null,
"l1_keepalives": false,
"md5sum": null,
"name": "PC TEST 1",
"nvram": 128,
"path": "iou.bin",
"private_config": null,
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"ram": 256,
"serial_adapters": 2,
"startup_config": null,
"use_default_iou_values": true,
"vm_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp2yt9sd1l/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/iou/82f6e25c-6960-421d-9567-a7453642935b",
"vm_id": "82f6e25c-6960-421d-9567-a7453642935b"
}
PUT /v1/projects/{project_id}/iou/vms/{vm_id}¶
Update a IOU 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 |
---|---|---|---|
console | ['integer', 'null'] | console TCP port | |
ethernet_adapters | ['integer', 'null'] | How many ethernet adapters are connected to the IOU | |
iourc_content | ['string', 'null'] | Content of the iourc file. Ignored if Null | |
l1_keepalives | ['boolean', 'null'] | Always up ethernet interface | |
md5sum | ['string', 'null'] | Checksum of iou binary | |
name | ['string', 'null'] | IOU VM name | |
nvram | ['integer', 'null'] | Allocated NVRAM KB | |
path | ['string', 'null'] | Path of iou binary | |
private_config_content | ['string', 'null'] | Private-config of IOU | |
ram | ['integer', 'null'] | Allocated RAM MB | |
serial_adapters | ['integer', 'null'] | How many serial adapters are connected to the IOU | |
startup_config_content | ['string', 'null'] | Startup-config of IOU | |
use_default_iou_values | ['boolean', 'null'] | Use default IOU values |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
console | ✔ | integer | console TCP port |
ethernet_adapters | ✔ | integer | How many ethernet adapters are connected to the IOU |
iourc_path | ['string', 'null'] | Path of the iourc file used by remote servers | |
l1_keepalives | ✔ | boolean | Always up ethernet interface |
md5sum | ✔ | ['string', 'null'] | Checksum of iou binary |
name | ✔ | string | IOU VM name |
nvram | ✔ | integer | Allocated NVRAM KB |
path | ✔ | string | Path of iou binary |
private_config | ✔ | ['string', 'null'] | Path of the private-config content relative to project directory |
project_id | ✔ | string | Project UUID |
ram | ✔ | integer | Allocated RAM MB |
serial_adapters | ✔ | integer | How many serial adapters are connected to the IOU |
startup_config | ✔ | ['string', 'null'] | Path of the startup-config content relative to project directory |
use_default_iou_values | ✔ | ['boolean', 'null'] | Use default IOU values |
vm_directory | string | ||
vm_id | ✔ | string | IOU VM UUID |
Sample session¶
curl -i -X PUT 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/6438493a-152d-4cb0-b8d2-fcfe1f6bf540' -d '{"console": 2002, "ethernet_adapters": 4, "iourc_content": "test", "l1_keepalives": true, "name": "test", "nvram": 2048, "ram": 512, "serial_adapters": 0, "startup_config_content": "hostname test", "use_default_iou_values": true}'
PUT /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/6438493a-152d-4cb0-b8d2-fcfe1f6bf540 HTTP/1.1
{
"console": 2002,
"ethernet_adapters": 4,
"iourc_content": "test",
"l1_keepalives": true,
"name": "test",
"nvram": 2048,
"ram": 512,
"serial_adapters": 0,
"startup_config_content": "hostname test",
"use_default_iou_values": true
}
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 685
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}
{
"console": 2002,
"ethernet_adapters": 4,
"iourc_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpyrljan4a/iourc",
"l1_keepalives": true,
"md5sum": null,
"name": "test",
"nvram": 2048,
"path": "iou.bin",
"private_config": null,
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"ram": 512,
"serial_adapters": 0,
"startup_config": "startup-config.cfg",
"use_default_iou_values": true,
"vm_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp2yt9sd1l/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/iou/6438493a-152d-4cb0-b8d2-fcfe1f6bf540",
"vm_id": "6438493a-152d-4cb0-b8d2-fcfe1f6bf540"
}
DELETE /v1/projects/{project_id}/iou/vms/{vm_id}¶
Delete a IOU 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/iou/vms/0813062d-a796-44ef-a5ed-e690c633012e'
DELETE /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/0813062d-a796-44ef-a5ed-e690c633012e HTTP/1.1
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}
/v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Contents
- /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio
POST /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Add a NIO to a IOU instance
Parameters¶
- adapter_number: Network adapter where the nio is located
- port_number: Port where the nio should be added
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 201: NIO created
- 404: Instance doesn’t exist
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/eea449ce-e25b-4beb-b50f-fcd77241a97b/adapters/1/ports/0/nio' -d '{"ethernet_device": "bridge0", "type": "nio_generic_ethernet"}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/eea449ce-e25b-4beb-b50f-fcd77241a97b/adapters/1/ports/0/nio HTTP/1.1
{
"ethernet_device": "bridge0",
"type": "nio_generic_ethernet"
}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 72
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
{
"ethernet_device": "bridge0",
"type": "nio_generic_ethernet"
}
DELETE /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Remove a NIO from a IOU instance
Parameters¶
- adapter_number: Network adapter where the nio is located
- port_number: Port from where the nio should be removed
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: NIO deleted
Sample session¶
curl -i -X DELETE 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/8759140f-eb6f-4f3b-9a7f-86c79ec747b9/adapters/1/ports/0/nio'
DELETE /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/8759140f-eb6f-4f3b-9a7f-86c79ec747b9/adapters/1/ports/0/nio HTTP/1.1
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
/v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/start_capture¶
Contents
POST /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/start_capture¶
Start a packet capture on a IOU VM instance
Parameters¶
- adapter_number: Adapter to start a packet capture
- port_number: Port on the adapter
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 200: Capture started
- 400: Invalid request
- 404: Instance doesn’t exist
- 409: VM not started
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
capture_file_name | ✔ | string | Capture file name |
data_link_type | ✔ | string | PCAP data link type |
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/14a4f240-54e7-47f7-b9e7-3640528415fe/adapters/0/ports/0/start_capture' -d '{"capture_file_name": "test.pcap", "data_link_type": "DLT_EN10MB"}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/14a4f240-54e7-47f7-b9e7-3640528415fe/adapters/0/ports/0/start_capture HTTP/1.1
{
"capture_file_name": "test.pcap",
"data_link_type": "DLT_EN10MB"
}
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 158
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/start_capture
{
"pcap_file_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp2yt9sd1l/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/captures/test.pcap"
}
/v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/stop_capture¶
Contents
POST /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/stop_capture¶
Stop a packet capture on a IOU VM instance
Parameters¶
- adapter_number: Adapter to stop a packet capture
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Capture stopped
- 409: VM not started
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/992e1579-2232-4aac-93ef-970c3bb67966/adapters/0/ports/0/stop_capture' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/992e1579-2232-4aac-93ef-970c3bb67966/adapters/0/ports/0/stop_capture HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/stop_capture
/v1/projects/{project_id}/iou/vms/{vm_id}/configs¶
Contents
GET /v1/projects/{project_id}/iou/vms/{vm_id}/configs¶
Retrieve the startup and private configs content
Response status codes¶
- 200: Configs retrieved
- 400: Invalid request
- 404: Instance doesn’t exist
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
private_config_content | ['string', 'null'] | Content of the private configuration file | |
startup_config_content | ['string', 'null'] | Content of the startup configuration file |
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/9ff2d283-1365-4422-93e7-e14c56b809cb/configs'
GET /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/9ff2d283-1365-4422-93e7-e14c56b809cb/configs HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 40
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}/configs
{
"startup_config_content": "TEST"
}
/v1/projects/{project_id}/iou/vms/{vm_id}/configs/save¶
Contents
POST /v1/projects/{project_id}/iou/vms/{vm_id}/configs/save¶
Save the startup and private configs content
Response status codes¶
- 200: Configs saved
- 400: Invalid request
- 404: Instance doesn’t exist
/v1/projects/{project_id}/iou/vms/{vm_id}/reload¶
Contents
POST /v1/projects/{project_id}/iou/vms/{vm_id}/reload¶
Reload a IOU 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 reloaded
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/7f23517b-b45e-4e7b-b908-c501c36abe16/reload' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/7f23517b-b45e-4e7b-b908-c501c36abe16/reload HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}/reload
/v1/projects/{project_id}/iou/vms/{vm_id}/start¶
Contents
POST /v1/projects/{project_id}/iou/vms/{vm_id}/start¶
Start a IOU 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 started
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
iourc_content | ['string', 'null'] | Content of the iourc file. Ignored if Null |
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/2923f599-894a-4b18-a9eb-17a389298f84/start' -d '{"iourc_content": "test"}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/2923f599-894a-4b18-a9eb-17a389298f84/start HTTP/1.1
{
"iourc_content": "test"
}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}/start
/v1/projects/{project_id}/iou/vms/{vm_id}/stop¶
Contents
POST /v1/projects/{project_id}/iou/vms/{vm_id}/stop¶
Stop a IOU 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 stopped
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/ff05b41f-cd2b-4b33-90be-9362430b68ae/stop' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/vms/ff05b41f-cd2b-4b33-90be-9362430b68ae/stop HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}/stop
Network¶
/v1/interfaces¶
GET /v1/interfaces¶
List all the network interfaces available on the server
Response status codes¶
- 200: OK
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/interfaces'
GET /v1/interfaces HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 1012
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/interfaces
[
{
"id": "bridge0",
"ip_address": "",
"name": "bridge0"
},
{
"id": "en0",
"ip_address": "",
"name": "en0"
},
{
"id": "en1",
"ip_address": "192.168.84.114",
"name": "en1"
},
{
"id": "en2",
"ip_address": "",
"name": "en2"
},
{
"id": "fw0",
"ip_address": "",
"name": "fw0"
},
{
"id": "lo0",
"ip_address": "127.0.0.1",
"name": "lo0"
},
{
"id": "p2p0",
"ip_address": "",
"name": "p2p0"
},
{
"id": "vboxnet0",
"ip_address": "172.16.43.1",
"name": "vboxnet0"
},
{
"id": "vboxnet1",
"ip_address": "192.168.59.3",
"name": "vboxnet1"
},
{
"id": "vboxnet2",
"ip_address": "",
"name": "vboxnet2"
},
{
"id": "vboxnet3",
"ip_address": "192.168.99.1",
"name": "vboxnet3"
}
]
/v1/projects/{project_id}/ports/udp¶
Contents
POST /v1/projects/{project_id}/ports/udp¶
Allocate an UDP port on the server
Parameters¶
- project_id: The UUID of the project
Response status codes¶
- 201: UDP port allocated
- 404: The project doesn’t exist
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/ports/udp' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/ports/udp HTTP/1.1
{}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 25
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/ports/udp
{
"udp_port": 10000
}
Project¶
/v1/projects¶
Contents
GET /v1/projects¶
List projects opened on the server
Response status codes¶
- 200: Project list
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/projects'
GET /v1/projects HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 656
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects
[
{
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpmwnekqxo",
"name": "test",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpmwnekqxo/00010203-0405-0607-0809-0a0b0c0d0e0b",
"project_id": "00010203-0405-0607-0809-0a0b0c0d0e0b",
"temporary": false
},
{
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpmwnekqxo",
"name": "test",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpmwnekqxo/00010203-0405-0607-0809-0a0b0c0d0e0f",
"project_id": "00010203-0405-0607-0809-0a0b0c0d0e0f",
"temporary": false
}
]
POST /v1/projects¶
Create a new project on the server
Response status codes¶
- 201: Project created
- 409: Project already created
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
name | ['string', 'null'] | Project name | |
path | ['string', 'null'] | Project directory | |
project_id | ['string', 'null'] | Project UUID | |
temporary | boolean | If project is a temporary project |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
location | ✔ | string | Base directory where the project should be created on remote server |
name | ['string', 'null'] | Project name | |
path | string | Directory of the project on the server | |
project_id | ✔ | string | Project UUID |
temporary | ✔ | boolean | If project is a temporary project |
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects' -d '{"name": "test"}'
POST /v1/projects HTTP/1.1
{
"name": "test"
}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 297
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects
{
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpp319gdgn",
"name": "test",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpp319gdgn/054e6ecb-1e9d-4c74-ad08-1209264bd96d",
"project_id": "054e6ecb-1e9d-4c74-ad08-1209264bd96d",
"temporary": false
}
/v1/projects/{project_id}¶
Contents
GET /v1/projects/{project_id}¶
Get project information
Parameters¶
- project_id: The UUID of the project
Response status codes¶
- 200: Success
- 404: The project doesn’t exist
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
location | ✔ | string | Base directory where the project should be created on remote server |
name | ['string', 'null'] | Project name | |
path | string | Directory of the project on the server | |
project_id | ✔ | string | Project UUID |
temporary | ✔ | boolean | If project is a temporary project |
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/projects/00010203-0405-0607-0809-0a0b0c0d0e02'
GET /v1/projects/00010203-0405-0607-0809-0a0b0c0d0e02 HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 297
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}
{
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpchvw88rg",
"name": "test",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpchvw88rg/00010203-0405-0607-0809-0a0b0c0d0e02",
"project_id": "00010203-0405-0607-0809-0a0b0c0d0e02",
"temporary": false
}
PUT /v1/projects/{project_id}¶
Update a project
Parameters¶
- project_id: The UUID of the project
Response status codes¶
- 200: The project has been updated
- 403: You are not allowed to modify this property
- 404: The project doesn’t exist
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
name | ['string', 'null'] | Project name | |
path | ['string', 'null'] | Path of the project on the server (work only with --local) | |
temporary | boolean | If project is a temporary project |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
location | ✔ | string | Base directory where the project should be created on remote server |
name | ['string', 'null'] | Project name | |
path | string | Directory of the project on the server | |
project_id | ✔ | string | Project UUID |
temporary | ✔ | boolean | If project is a temporary project |
Sample session¶
curl -i -X PUT 'http://localhost:8000/v1/projects/9d7dccbb-0fc0-40d0-9420-912733dcbf74' -d '{"name": "second_name", "path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-110/test_update_path_project_non_l0"}'
PUT /v1/projects/9d7dccbb-0fc0-40d0-9420-912733dcbf74 HTTP/1.1
{
"name": "second_name",
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-110/test_update_path_project_non_l0"
}
HTTP/1.1 403
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 100
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}
{
"message": "You are not allowed to modify the project directory location",
"status": 403
}
DELETE /v1/projects/{project_id}¶
Delete a project from disk
Parameters¶
- project_id: The UUID of the project
Response status codes¶
- 404: The project doesn’t exist
- 204: Changes have been written on disk
Sample session¶
curl -i -X DELETE 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80'
DELETE /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80 HTTP/1.1
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}
/v1/projects/{project_id}/close¶
Contents
POST /v1/projects/{project_id}/close¶
Close a project
Parameters¶
- project_id: The UUID of the project
Response status codes¶
- 404: The project doesn’t exist
- 204: The project has been closed
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/close' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/close HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/close
/v1/projects/{project_id}/commit¶
Contents
POST /v1/projects/{project_id}/commit¶
Write changes on disk
Parameters¶
- project_id: The UUID of the project
Response status codes¶
- 404: The project doesn’t exist
- 204: Changes have been written on disk
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/commit' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/commit HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/commit
/v1/projects/{project_id}/files¶
Contents
GET /v1/projects/{project_id}/files¶
List files of a project
Parameters¶
- project_id: The UUID of the project
Response status codes¶
- 200: Return list of files
- 404: The project doesn’t exist
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/files'
GET /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/files HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 204
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/files
[
{
"md5sum": "ad0234829205b9033196ba818f7a872b",
"path": "test.txt"
},
{
"md5sum": "098f6bcd4621d373cade4e832627b4f6",
"path": "vm-1/dynamips/test.bin"
}
]
/v1/projects/{project_id}/files/{path:.+}¶
Contents
GET /v1/projects/{project_id}/files/{path:.+}¶
Get a file of a project
Parameters¶
- project_id: The UUID of the project
Response status codes¶
- 200: Return the file
- 403: Permission denied
- 404: The file doesn’t exist
/v1/projects/{project_id}/notifications¶
Contents
GET /v1/projects/{project_id}/notifications¶
Receive notifications about the projects
Parameters¶
- project_id: The UUID of the project
Response status codes¶
- 200: End of stream
- 404: The project doesn’t exist
Qemu¶
/v1/projects/{project_id}/qemu/vms¶
Contents
POST /v1/projects/{project_id}/qemu/vms¶
Create a new Qemu VM instance
Parameters¶
- project_id: UUID for the project
Response status codes¶
- 400: Invalid request
- 201: Instance created
- 409: Conflict
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
acpi_shutdown | ['boolean', 'null'] | ACPI shutdown support | |
adapter_type | ['string', 'null'] | QEMU adapter type | |
adapters | ['integer', 'null'] | number of adapters | |
boot_priority | enum | Possible values: c, d, n, cn, cd | |
cdrom_image | string | QEMU cdrom image path | |
cdrom_image_md5sum | ['string', 'null'] | QEMU cdrom image checksum | |
console | ['integer', 'null'] | console TCP port | |
console_type | enum | Possible values: telnet, vnc | |
cpu_throttling | ['integer', 'null'] | Percentage of CPU allowed for QEMU | |
cpus | ['integer', 'null'] | number of vCPUs | |
hda_disk_image | string | QEMU hda disk image path | |
hda_disk_image_md5sum | ['string', 'null'] | QEMU hda disk image checksum | |
hda_disk_interface | string | QEMU hda interface | |
hdb_disk_image | string | QEMU hdb disk image path | |
hdb_disk_image_md5sum | ['string', 'null'] | QEMU hdb disk image checksum | |
hdb_disk_interface | string | QEMU hdb interface | |
hdc_disk_image | string | QEMU hdc disk image path | |
hdc_disk_image_md5sum | ['string', 'null'] | QEMU hdc disk image checksum | |
hdc_disk_interface | string | QEMU hdc interface | |
hdd_disk_image | string | QEMU hdd disk image path | |
hdd_disk_image_md5sum | ['string', 'null'] | QEMU hdd disk image checksum | |
hdd_disk_interface | string | QEMU hdd interface | |
initrd | string | QEMU initrd path | |
initrd_md5sum | ['string', 'null'] | QEMU initrd path | |
kernel_command_line | ['string', 'null'] | QEMU kernel command line | |
kernel_image | string | QEMU kernel image path | |
kernel_image_md5sum | ['string', 'null'] | QEMU kernel image checksum | |
legacy_networking | ['boolean', 'null'] | Use QEMU legagy networking commands (-net syntax) | |
linked_clone | boolean | either the VM is a linked clone or not | |
mac_address | ['string', 'null'] | QEMU MAC address | |
name | ✔ | string | QEMU VM instance name |
options | ['string', 'null'] | Additional QEMU options | |
platform | enum | Possible values: aarch64, alpha, arm, cris, i386, lm32, m68k, microblaze, microblazeel, mips, mips64, mips64el, mipsel, moxie, or32, ppc, ppc64, ppcemb, s390x, sh4, sh4eb, sparc, sparc64, tricore, unicore32, x86_64, xtensa, xtensaeb, null | |
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 | |
usage | string | How to use the qemu VM | |
vm_id | QEMU VM identifier |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
acpi_shutdown | ✔ | boolean | ACPI shutdown support |
adapter_type | ✔ | string | QEMU adapter type |
adapters | ✔ | integer | number of adapters |
boot_priority | ✔ | enum | Possible values: c, d |
cdrom_image | ✔ | string | QEMU cdrom image path |
cdrom_image_md5sum | ✔ | ['string', 'null'] | QEMU cdrom image checksum |
console | ✔ | integer | console TCP port |
console_type | ✔ | enum | Possible values: telnet, vnc |
cpu_throttling | ✔ | integer | Percentage of CPU allowed for QEMU |
cpus | ✔ | ['integer', 'null'] | number of vCPUs |
hda_disk_image | ✔ | string | QEMU hda disk image path |
hda_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hda disk image checksum |
hda_disk_interface | ✔ | string | QEMU hda interface |
hdb_disk_image | ✔ | string | QEMU hdb disk image path |
hdb_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hdb disk image checksum |
hdb_disk_interface | ✔ | string | QEMU hdb interface |
hdc_disk_image | ✔ | string | QEMU hdc disk image path |
hdc_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hdc disk image checksum |
hdc_disk_interface | ✔ | string | QEMU hdc interface |
hdd_disk_image | ✔ | string | QEMU hdd disk image path |
hdd_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hdd disk image checksum |
hdd_disk_interface | ✔ | string | QEMU hdd interface |
initrd | ✔ | string | QEMU initrd path |
initrd_md5sum | ✔ | ['string', 'null'] | QEMU initrd path |
kernel_command_line | ✔ | string | QEMU kernel command line |
kernel_image | ✔ | string | QEMU kernel image path |
kernel_image_md5sum | ✔ | ['string', 'null'] | QEMU kernel image checksum |
legacy_networking | ✔ | boolean | Use QEMU legagy networking commands (-net syntax) |
mac_address | ✔ | string | QEMU MAC address |
name | ✔ | string | QEMU VM instance name |
options | ✔ | string | Additional QEMU options |
platform | ✔ | enum | Possible values: aarch64, alpha, arm, cris, i386, lm32, m68k, microblaze, microblazeel, mips, mips64, mips64el, mipsel, moxie, or32, ppc, ppc64, ppcemb, s390x, sh4, sh4eb, sparc, sparc64, tricore, unicore32, x86_64, xtensa, xtensaeb |
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 |
usage | ✔ | string | How to use the qemu VM |
vm_directory | ✔ | string | |
vm_id | ✔ | string | QEMU VM uuid |
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms' -d '{"hda_disk_image": "linux.img", "name": "PC TEST 1", "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmph3pfurip/qemu-system-x86_64", "ram": 1024}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms HTTP/1.1
{
"hda_disk_image": "linux.img",
"name": "PC TEST 1",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmph3pfurip/qemu-system-x86_64",
"ram": 1024
}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 1363
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms
{
"acpi_shutdown": false,
"adapter_type": "e1000",
"adapters": 1,
"boot_priority": "c",
"cdrom_image": "",
"cdrom_image_md5sum": null,
"console": 2001,
"console_type": "telnet",
"cpu_throttling": 0,
"cpus": 1,
"hda_disk_image": "linux.img",
"hda_disk_image_md5sum": null,
"hda_disk_interface": "ide",
"hdb_disk_image": "",
"hdb_disk_image_md5sum": null,
"hdb_disk_interface": "ide",
"hdc_disk_image": "",
"hdc_disk_image_md5sum": null,
"hdc_disk_interface": "ide",
"hdd_disk_image": "",
"hdd_disk_image_md5sum": null,
"hdd_disk_interface": "ide",
"initrd": "",
"initrd_md5sum": null,
"kernel_command_line": "",
"kernel_image": "",
"kernel_image_md5sum": null,
"legacy_networking": false,
"mac_address": "00:00:ab:50:58:00",
"name": "PC TEST 1",
"options": "",
"platform": "x86_64",
"process_priority": "low",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmph3pfurip/qemu-system-x86_64",
"ram": 1024,
"usage": "",
"vm_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpqqnauky9/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/qemu/b949f2e2-d338-4b51-aea9-270196ed5058",
"vm_id": "b949f2e2-d338-4b51-aea9-270196ed5058"
}
/v1/projects/{project_id}/qemu/vms/{vm_id}¶
Contents
GET /v1/projects/{project_id}/qemu/vms/{vm_id}¶
Get a Qemu VM 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 |
---|---|---|---|
acpi_shutdown | ✔ | boolean | ACPI shutdown support |
adapter_type | ✔ | string | QEMU adapter type |
adapters | ✔ | integer | number of adapters |
boot_priority | ✔ | enum | Possible values: c, d |
cdrom_image | ✔ | string | QEMU cdrom image path |
cdrom_image_md5sum | ✔ | ['string', 'null'] | QEMU cdrom image checksum |
console | ✔ | integer | console TCP port |
console_type | ✔ | enum | Possible values: telnet, vnc |
cpu_throttling | ✔ | integer | Percentage of CPU allowed for QEMU |
cpus | ✔ | ['integer', 'null'] | number of vCPUs |
hda_disk_image | ✔ | string | QEMU hda disk image path |
hda_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hda disk image checksum |
hda_disk_interface | ✔ | string | QEMU hda interface |
hdb_disk_image | ✔ | string | QEMU hdb disk image path |
hdb_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hdb disk image checksum |
hdb_disk_interface | ✔ | string | QEMU hdb interface |
hdc_disk_image | ✔ | string | QEMU hdc disk image path |
hdc_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hdc disk image checksum |
hdc_disk_interface | ✔ | string | QEMU hdc interface |
hdd_disk_image | ✔ | string | QEMU hdd disk image path |
hdd_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hdd disk image checksum |
hdd_disk_interface | ✔ | string | QEMU hdd interface |
initrd | ✔ | string | QEMU initrd path |
initrd_md5sum | ✔ | ['string', 'null'] | QEMU initrd path |
kernel_command_line | ✔ | string | QEMU kernel command line |
kernel_image | ✔ | string | QEMU kernel image path |
kernel_image_md5sum | ✔ | ['string', 'null'] | QEMU kernel image checksum |
legacy_networking | ✔ | boolean | Use QEMU legagy networking commands (-net syntax) |
mac_address | ✔ | string | QEMU MAC address |
name | ✔ | string | QEMU VM instance name |
options | ✔ | string | Additional QEMU options |
platform | ✔ | enum | Possible values: aarch64, alpha, arm, cris, i386, lm32, m68k, microblaze, microblazeel, mips, mips64, mips64el, mipsel, moxie, or32, ppc, ppc64, ppcemb, s390x, sh4, sh4eb, sparc, sparc64, tricore, unicore32, x86_64, xtensa, xtensaeb |
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 |
usage | ✔ | string | How to use the qemu VM |
vm_directory | ✔ | string | |
vm_id | ✔ | string | QEMU VM uuid |
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/84777300-eef4-4a3a-9135-d7009bdb0722'
GET /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/84777300-eef4-4a3a-9135-d7009bdb0722 HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 1353
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}
{
"acpi_shutdown": false,
"adapter_type": "e1000",
"adapters": 1,
"boot_priority": "c",
"cdrom_image": "",
"cdrom_image_md5sum": null,
"console": 2001,
"console_type": "telnet",
"cpu_throttling": 0,
"cpus": 1,
"hda_disk_image": "",
"hda_disk_image_md5sum": null,
"hda_disk_interface": "ide",
"hdb_disk_image": "",
"hdb_disk_image_md5sum": null,
"hdb_disk_interface": "ide",
"hdc_disk_image": "",
"hdc_disk_image_md5sum": null,
"hdc_disk_interface": "ide",
"hdd_disk_image": "",
"hdd_disk_image_md5sum": null,
"hdd_disk_interface": "ide",
"initrd": "",
"initrd_md5sum": null,
"kernel_command_line": "",
"kernel_image": "",
"kernel_image_md5sum": null,
"legacy_networking": false,
"mac_address": "00:00:ab:07:22:00",
"name": "PC TEST 1",
"options": "",
"platform": "x86_64",
"process_priority": "low",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmph3pfurip/qemu-system-x86_64",
"ram": 256,
"usage": "",
"vm_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpqqnauky9/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/qemu/84777300-eef4-4a3a-9135-d7009bdb0722",
"vm_id": "84777300-eef4-4a3a-9135-d7009bdb0722"
}
PUT /v1/projects/{project_id}/qemu/vms/{vm_id}¶
Update a Qemu VM 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 |
---|---|---|---|
acpi_shutdown | ['boolean', 'null'] | ACPI shutdown support | |
adapter_type | ['string', 'null'] | QEMU adapter type | |
adapters | ['integer', 'null'] | number of adapters | |
boot_priority | enum | Possible values: c, d | |
cdrom_image | string | QEMU cdrom image path | |
cdrom_image_md5sum | ['string', 'null'] | QEMU cdrom image checksum | |
console | ['integer', 'null'] | console TCP port | |
console_type | enum | Possible values: telnet, vnc | |
cpu_throttling | ['integer', 'null'] | Percentage of CPU allowed for QEMU | |
cpus | ['integer', 'null'] | number of vCPUs | |
hda_disk_image | string | QEMU hda disk image path | |
hda_disk_image_md5sum | ['string', 'null'] | QEMU hda disk image checksum | |
hda_disk_interface | string | QEMU hda interface | |
hdb_disk_image | string | QEMU hdb disk image path | |
hdb_disk_image_md5sum | ['string', 'null'] | QEMU hdb disk image checksum | |
hdb_disk_interface | string | QEMU hdb interface | |
hdc_disk_image | string | QEMU hdc disk image path | |
hdc_disk_image_md5sum | ['string', 'null'] | QEMU hdc disk image checksum | |
hdc_disk_interface | string | QEMU hdc interface | |
hdd_disk_image | string | QEMU hdd disk image path | |
hdd_disk_image_md5sum | ['string', 'null'] | QEMU hdd disk image checksum | |
hdd_disk_interface | string | QEMU hdd interface | |
initrd | string | QEMU initrd path | |
initrd_md5sum | ['string', 'null'] | QEMU initrd path | |
kernel_command_line | ['string', 'null'] | QEMU kernel command line | |
kernel_image | string | QEMU kernel image path | |
kernel_image_md5sum | ['string', 'null'] | QEMU kernel image checksum | |
legacy_networking | ['boolean', 'null'] | Use QEMU legagy networking commands (-net syntax) | |
mac_address | ['string', 'null'] | QEMU MAC address | |
name | ['string', 'null'] | QEMU VM instance name | |
options | ['string', 'null'] | Additional QEMU options | |
platform | enum | Possible values: aarch64, alpha, arm, cris, i386, lm32, m68k, microblaze, microblazeel, mips, mips64, mips64el, mipsel, moxie, or32, ppc, ppc64, ppcemb, s390x, sh4, sh4eb, sparc, sparc64, tricore, unicore32, x86_64, xtensa, xtensaeb, null | |
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 | |
usage | string | How to use the qemu VM |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
acpi_shutdown | ✔ | boolean | ACPI shutdown support |
adapter_type | ✔ | string | QEMU adapter type |
adapters | ✔ | integer | number of adapters |
boot_priority | ✔ | enum | Possible values: c, d |
cdrom_image | ✔ | string | QEMU cdrom image path |
cdrom_image_md5sum | ✔ | ['string', 'null'] | QEMU cdrom image checksum |
console | ✔ | integer | console TCP port |
console_type | ✔ | enum | Possible values: telnet, vnc |
cpu_throttling | ✔ | integer | Percentage of CPU allowed for QEMU |
cpus | ✔ | ['integer', 'null'] | number of vCPUs |
hda_disk_image | ✔ | string | QEMU hda disk image path |
hda_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hda disk image checksum |
hda_disk_interface | ✔ | string | QEMU hda interface |
hdb_disk_image | ✔ | string | QEMU hdb disk image path |
hdb_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hdb disk image checksum |
hdb_disk_interface | ✔ | string | QEMU hdb interface |
hdc_disk_image | ✔ | string | QEMU hdc disk image path |
hdc_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hdc disk image checksum |
hdc_disk_interface | ✔ | string | QEMU hdc interface |
hdd_disk_image | ✔ | string | QEMU hdd disk image path |
hdd_disk_image_md5sum | ✔ | ['string', 'null'] | QEMU hdd disk image checksum |
hdd_disk_interface | ✔ | string | QEMU hdd interface |
initrd | ✔ | string | QEMU initrd path |
initrd_md5sum | ✔ | ['string', 'null'] | QEMU initrd path |
kernel_command_line | ✔ | string | QEMU kernel command line |
kernel_image | ✔ | string | QEMU kernel image path |
kernel_image_md5sum | ✔ | ['string', 'null'] | QEMU kernel image checksum |
legacy_networking | ✔ | boolean | Use QEMU legagy networking commands (-net syntax) |
mac_address | ✔ | string | QEMU MAC address |
name | ✔ | string | QEMU VM instance name |
options | ✔ | string | Additional QEMU options |
platform | ✔ | enum | Possible values: aarch64, alpha, arm, cris, i386, lm32, m68k, microblaze, microblazeel, mips, mips64, mips64el, mipsel, moxie, or32, ppc, ppc64, ppcemb, s390x, sh4, sh4eb, sparc, sparc64, tricore, unicore32, x86_64, xtensa, xtensaeb |
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 |
usage | ✔ | string | How to use the qemu VM |
vm_directory | ✔ | string | |
vm_id | ✔ | string | QEMU VM uuid |
Sample session¶
curl -i -X PUT 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/578b6391-e461-4f17-86f6-dd556d2f4dde' -d '{"console": 2002, "hdb_disk_image": "linux.img", "name": "test", "ram": 1024}'
PUT /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/578b6391-e461-4f17-86f6-dd556d2f4dde HTTP/1.1
{
"console": 2002,
"hdb_disk_image": "linux.img",
"name": "test",
"ram": 1024
}
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 1358
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}
{
"acpi_shutdown": false,
"adapter_type": "e1000",
"adapters": 1,
"boot_priority": "c",
"cdrom_image": "",
"cdrom_image_md5sum": null,
"console": 2002,
"console_type": "telnet",
"cpu_throttling": 0,
"cpus": 1,
"hda_disk_image": "",
"hda_disk_image_md5sum": null,
"hda_disk_interface": "ide",
"hdb_disk_image": "linux.img",
"hdb_disk_image_md5sum": null,
"hdb_disk_interface": "ide",
"hdc_disk_image": "",
"hdc_disk_image_md5sum": null,
"hdc_disk_interface": "ide",
"hdd_disk_image": "",
"hdd_disk_image_md5sum": null,
"hdd_disk_interface": "ide",
"initrd": "",
"initrd_md5sum": null,
"kernel_command_line": "",
"kernel_image": "",
"kernel_image_md5sum": null,
"legacy_networking": false,
"mac_address": "00:00:ab:4d:de:00",
"name": "test",
"options": "",
"platform": "x86_64",
"process_priority": "low",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmph3pfurip/qemu-system-x86_64",
"ram": 1024,
"usage": "",
"vm_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpqqnauky9/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/qemu/578b6391-e461-4f17-86f6-dd556d2f4dde",
"vm_id": "578b6391-e461-4f17-86f6-dd556d2f4dde"
}
DELETE /v1/projects/{project_id}/qemu/vms/{vm_id}¶
Delete a Qemu VM 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/1b1a72b7-97ea-4598-8c02-2edc285f7987'
DELETE /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/1b1a72b7-97ea-4598-8c02-2edc285f7987 HTTP/1.1
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}
/v1/projects/{project_id}/qemu/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Contents
- /v1/projects/{project_id}/qemu/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio
POST /v1/projects/{project_id}/qemu/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Add a NIO to a Qemu VM instance
Parameters¶
- adapter_number: Network adapter where the nio is located
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 201: NIO created
- 404: Instance doesn’t exist
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/82435d91-3cb5-4a44-abff-34a4ae46b24f/adapters/1/ports/0/nio' -d '{"ethernet_device": "eth0", "type": "nio_generic_ethernet"}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/82435d91-3cb5-4a44-abff-34a4ae46b24f/adapters/1/ports/0/nio HTTP/1.1
{
"ethernet_device": "eth0",
"type": "nio_generic_ethernet"
}
HTTP/1.1 409
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 89
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
{
"message": "NIO of type nio_generic_ethernet is not supported",
"status": 409
}
DELETE /v1/projects/{project_id}/qemu/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Remove a NIO from a Qemu VM instance
Parameters¶
- adapter_number: Network adapter where the nio is located
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: NIO deleted
Sample session¶
curl -i -X DELETE 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/b5c23125-ea22-4008-a89e-72565ae9f746/adapters/1/ports/0/nio'
DELETE /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/b5c23125-ea22-4008-a89e-72565ae9f746/adapters/1/ports/0/nio HTTP/1.1
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
/v1/projects/{project_id}/qemu/vms/{vm_id}/reload¶
Contents
POST /v1/projects/{project_id}/qemu/vms/{vm_id}/reload¶
Reload a Qemu VM 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 reloaded
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/3275bdce-9b75-445f-8168-0103cd524182/reload' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/3275bdce-9b75-445f-8168-0103cd524182/reload HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}/reload
/v1/projects/{project_id}/qemu/vms/{vm_id}/resume¶
Contents
POST /v1/projects/{project_id}/qemu/vms/{vm_id}/resume¶
Resume a Qemu VM 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 resumed
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/2d03502f-6b3f-4551-b924-b74fd5d6cdf5/resume' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/2d03502f-6b3f-4551-b924-b74fd5d6cdf5/resume HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}/resume
/v1/projects/{project_id}/qemu/vms/{vm_id}/start¶
Contents
POST /v1/projects/{project_id}/qemu/vms/{vm_id}/start¶
Start a Qemu VM 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 started
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/04afa03a-3d9b-4aa7-945f-8f3077b6790e/start' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/04afa03a-3d9b-4aa7-945f-8f3077b6790e/start HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}/start
/v1/projects/{project_id}/qemu/vms/{vm_id}/stop¶
Contents
POST /v1/projects/{project_id}/qemu/vms/{vm_id}/stop¶
Stop a Qemu VM 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 stopped
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/f5bfbadc-9a09-4090-a624-89be68858746/stop' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/f5bfbadc-9a09-4090-a624-89be68858746/stop HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}/stop
/v1/projects/{project_id}/qemu/vms/{vm_id}/suspend¶
Contents
POST /v1/projects/{project_id}/qemu/vms/{vm_id}/suspend¶
Suspend a Qemu VM 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 suspended
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/bb00b1e0-f19d-4ce8-b99a-82c1518fa33e/suspend' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/vms/bb00b1e0-f19d-4ce8-b99a-82c1518fa33e/suspend HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}/suspend
/v1/qemu/binaries¶
GET /v1/qemu/binaries¶
Get a list of available Qemu binaries
Response status codes¶
- 200: Success
- 400: Invalid request
- 404: Instance doesn’t exist
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/qemu/binaries' -d '{"archs": ["i386"]}'
GET /v1/qemu/binaries HTTP/1.1
{
"archs": [
"i386"
]
}
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 212
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/qemu/binaries
[
{
"path": "/tmp/x86_64",
"version": "2.2.0"
},
{
"path": "/tmp/alpha",
"version": "2.1.0"
},
{
"path": "/tmp/i386",
"version": "2.1.0"
}
]
/v1/qemu/capabilities¶
Contents
GET /v1/qemu/capabilities¶
Get a list of Qemu capabilities on this server
Response status codes¶
- 200: Success
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/qemu/capabilities'
GET /v1/qemu/capabilities HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 39
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/qemu/capabilities
{
"kvm": [
"x86_64"
]
}
/v1/qemu/img¶
POST /v1/qemu/img¶
Create a Qemu image
Response status codes¶
- 201: Image created
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
adapter_type | enum | Possible values: ide, lsilogic, buslogic, legacyESX | |
cluster_size | integer | ||
format | ✔ | enum | Possible values: qcow2, qcow, vpc, vdi, vmdk, raw |
lazy_refcounts | enum | Possible values: on, off | |
path | ✔ | string | Absolute or relative path of the image |
preallocation | enum | Possible values: off, metadata, falloc, full | |
qemu_img | ✔ | string | Path to the qemu-img binary |
refcount_bits | integer | ||
size | ✔ | integer | Image size in M |
static | enum | Possible values: on, off | |
subformat | enum | Possible values: dynamic, fixed, streamOptimized, twoGbMaxExtentSparse, twoGbMaxExtentFlat, monolithicSparse, monolithicFlat | |
zeroed_grain | enum | Possible values: on, off |
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/qemu/img' -d '{"cluster_size": 64, "format": "qcow2", "lazy_refcounts": "off", "path": "/tmp/hda.qcow2", "preallocation": "metadata", "qemu_img": "/tmp/qemu-img", "refcount_bits": 12, "size": 100}'
POST /v1/qemu/img HTTP/1.1
{
"cluster_size": 64,
"format": "qcow2",
"lazy_refcounts": "off",
"path": "/tmp/hda.qcow2",
"preallocation": "metadata",
"qemu_img": "/tmp/qemu-img",
"refcount_bits": 12,
"size": 100
}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/qemu/img
/v1/qemu/img-binaries¶
GET /v1/qemu/img-binaries¶
Get a list of available Qemu-img binaries
Response status codes¶
- 200: Success
- 400: Invalid request
- 404: Instance doesn’t exist
/v1/qemu/vms¶
GET /v1/qemu/vms¶
Retrieve the list of Qemu images
Response status codes¶
- 200: List of Qemu images retrieved
Server¶
/v1/server/shutdown¶
POST /v1/server/shutdown¶
Shutdown the local server
Response status codes¶
- 201: Server is shutting down
- 403: Server shutdown refused
Version¶
/v1/version¶
Contents
GET /v1/version¶
Retrieve the server version number
Response status codes¶
- 200: OK
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
local | boolean | Either this is a local server | |
version | ✔ | string | Version number human readable |
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/version'
GET /v1/version HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 50
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/version
{
"local": true,
"version": "1.4.0dev13"
}
POST /v1/version¶
Check if version is the same as the server
Response status codes¶
- 200: Same version
- 409: Invalid version
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
local | boolean | Either this is a local server | |
version | ✔ | string | Version number human readable |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
local | boolean | Either this is a local server | |
version | ✔ | string | Version number human readable |
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/version' -d '{"version": "1.4.0dev13"}'
POST /v1/version HTTP/1.1
{
"version": "1.4.0dev13"
}
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 31
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/version
{
"version": "1.4.0dev13"
}
Virtualbox¶
/v1/projects/{project_id}/virtualbox/vms¶
Contents
POST /v1/projects/{project_id}/virtualbox/vms¶
Create a new VirtualBox VM instance
Parameters¶
- project_id: UUID for the project
Response status codes¶
- 400: Invalid request
- 201: Instance created
- 409: Conflict
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
acpi_shutdown | boolean | ACPI shutdown | |
adapter_type | string | VirtualBox adapter type | |
adapters | integer | number of adapters | |
console | integer | console TCP port | |
enable_remote_console | boolean | enable the remote console | |
headless | boolean | headless mode | |
linked_clone | ✔ | boolean | either the VM is a linked clone or not |
name | ✔ | string | VirtualBox VM instance name |
ram | integer | Amount of RAM | |
use_any_adapter | boolean | allow GNS3 to use any VirtualBox adapter | |
vm_id | VirtualBox VM instance identifier | ||
vmname | ✔ | string | VirtualBox VM name (in VirtualBox itself) |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
acpi_shutdown | boolean | ACPI shutdown | |
adapter_type | string | VirtualBox adapter type | |
adapters | integer | number of adapters | |
console | integer | console TCP port | |
enable_remote_console | boolean | enable the remote console | |
headless | boolean | headless mode | |
name | ✔ | string | VirtualBox VM instance name |
project_id | ✔ | string | Project UUID |
ram | integer | Amount of RAM | |
use_any_adapter | boolean | allow GNS3 to use any VirtualBox adapter | |
vm_directory | ✔ | ['string', 'null'] | |
vm_id | ✔ | string | VirtualBox VM instance UUID |
vmname | string | VirtualBox VM name (in VirtualBox itself) |
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms' -d '{"linked_clone": false, "name": "VM1", "vmname": "VM1"}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms HTTP/1.1
{
"linked_clone": false,
"name": "VM1",
"vmname": "VM1"
}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 409
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms
{
"acpi_shutdown": false,
"adapter_type": "Intel PRO/1000 MT Desktop (82540EM)",
"adapters": 0,
"console": 2001,
"enable_remote_console": false,
"headless": false,
"name": "VM1",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"ram": 0,
"use_any_adapter": false,
"vm_directory": null,
"vm_id": "39cc5964-d0be-487b-9f0c-8fbea600e452",
"vmname": "VM1"
}
/v1/projects/{project_id}/virtualbox/vms/{vm_id}¶
Contents
GET /v1/projects/{project_id}/virtualbox/vms/{vm_id}¶
Get a VirtualBox VM 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 |
---|---|---|---|
acpi_shutdown | boolean | ACPI shutdown | |
adapter_type | string | VirtualBox adapter type | |
adapters | integer | number of adapters | |
console | integer | console TCP port | |
enable_remote_console | boolean | enable the remote console | |
headless | boolean | headless mode | |
name | ✔ | string | VirtualBox VM instance name |
project_id | ✔ | string | Project UUID |
ram | integer | Amount of RAM | |
use_any_adapter | boolean | allow GNS3 to use any VirtualBox adapter | |
vm_directory | ✔ | ['string', 'null'] | |
vm_id | ✔ | string | VirtualBox VM instance UUID |
vmname | string | VirtualBox VM name (in VirtualBox itself) |
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/63b9b470-5a07-4cfe-b9d5-ae5d5518b988'
GET /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/63b9b470-5a07-4cfe-b9d5-ae5d5518b988 HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 415
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}
{
"acpi_shutdown": false,
"adapter_type": "Intel PRO/1000 MT Desktop (82540EM)",
"adapters": 0,
"console": 2002,
"enable_remote_console": false,
"headless": false,
"name": "VMTEST",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"ram": 0,
"use_any_adapter": false,
"vm_directory": null,
"vm_id": "63b9b470-5a07-4cfe-b9d5-ae5d5518b988",
"vmname": "VMTEST"
}
PUT /v1/projects/{project_id}/virtualbox/vms/{vm_id}¶
Update a VirtualBox VM 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 |
---|---|---|---|
acpi_shutdown | boolean | ACPI shutdown | |
adapter_type | string | VirtualBox adapter type | |
adapters | integer | number of adapters | |
console | integer | console TCP port | |
enable_remote_console | boolean | enable the remote console | |
headless | boolean | headless mode | |
name | string | VirtualBox VM instance name | |
ram | integer | Amount of RAM | |
use_any_adapter | boolean | allow GNS3 to use any VirtualBox adapter | |
vmname | string | VirtualBox VM name (in VirtualBox itself) |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
acpi_shutdown | boolean | ACPI shutdown | |
adapter_type | string | VirtualBox adapter type | |
adapters | integer | number of adapters | |
console | integer | console TCP port | |
enable_remote_console | boolean | enable the remote console | |
headless | boolean | headless mode | |
name | ✔ | string | VirtualBox VM instance name |
project_id | ✔ | string | Project UUID |
ram | integer | Amount of RAM | |
use_any_adapter | boolean | allow GNS3 to use any VirtualBox adapter | |
vm_directory | ✔ | ['string', 'null'] | |
vm_id | ✔ | string | VirtualBox VM instance UUID |
vmname | string | VirtualBox VM name (in VirtualBox itself) |
Sample session¶
curl -i -X PUT 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/aa45d68c-c68e-4296-9550-641b522a73c2' -d '{"console": 2011, "name": "test"}'
PUT /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/aa45d68c-c68e-4296-9550-641b522a73c2 HTTP/1.1
{
"console": 2011,
"name": "test"
}
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 413
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}
{
"acpi_shutdown": false,
"adapter_type": "Intel PRO/1000 MT Desktop (82540EM)",
"adapters": 0,
"console": 2011,
"enable_remote_console": false,
"headless": false,
"name": "test",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"ram": 0,
"use_any_adapter": false,
"vm_directory": null,
"vm_id": "aa45d68c-c68e-4296-9550-641b522a73c2",
"vmname": "VMTEST"
}
DELETE /v1/projects/{project_id}/virtualbox/vms/{vm_id}¶
Delete a VirtualBox VM 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
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Contents
- /v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio
POST /v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Add a NIO to a VirtualBox VM instance
Parameters¶
- adapter_number: Adapter where the nio should be added
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 201: NIO created
- 404: Instance doesn’t exist
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/556aba72-c19a-4fc3-a350-9454791687f4/adapters/0/ports/0/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/556aba72-c19a-4fc3-a350-9454791687f4/adapters/0/ports/0/nio HTTP/1.1
{
"lport": 4242,
"rhost": "127.0.0.1",
"rport": 4343,
"type": "nio_udp"
}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 89
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
{
"lport": 4242,
"rhost": "127.0.0.1",
"rport": 4343,
"type": "nio_udp"
}
DELETE /v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Remove a NIO from a VirtualBox VM instance
Parameters¶
- adapter_number: Adapter from where the nio should be removed
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: NIO deleted
Sample session¶
curl -i -X DELETE 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/3f79083e-3da8-433e-9e9b-fe72a602ab4e/adapters/0/ports/0/nio'
DELETE /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/3f79083e-3da8-433e-9e9b-fe72a602ab4e/adapters/0/ports/0/nio HTTP/1.1
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/start_capture¶
Contents
POST /v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/start_capture¶
Start a packet capture on a VirtualBox VM instance
Parameters¶
- adapter_number: Adapter to start a packet capture
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 200: Capture started
- 400: Invalid request
- 404: Instance doesn’t exist
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/stop_capture¶
Contents
POST /v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/stop_capture¶
Stop a packet capture on a VirtualBox VM instance
Parameters¶
- adapter_number: Adapter to stop a packet capture
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Capture stopped
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/reload¶
Contents
POST /v1/projects/{project_id}/virtualbox/vms/{vm_id}/reload¶
Reload a VirtualBox VM 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 reloaded
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/1a517572-9b86-441a-8347-1d28b01d9a41/reload' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/1a517572-9b86-441a-8347-1d28b01d9a41/reload HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}/reload
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/resume¶
Contents
POST /v1/projects/{project_id}/virtualbox/vms/{vm_id}/resume¶
Resume a suspended VirtualBox VM 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 resumed
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/7f5648e4-0ce8-49b3-b470-f2b821a5fe3e/resume' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/7f5648e4-0ce8-49b3-b470-f2b821a5fe3e/resume HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}/resume
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/start¶
Contents
POST /v1/projects/{project_id}/virtualbox/vms/{vm_id}/start¶
Start a VirtualBox VM 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 started
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/ee1fef8f-cbe1-4590-8c47-fbd12f7f6beb/start' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/ee1fef8f-cbe1-4590-8c47-fbd12f7f6beb/start HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}/start
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/stop¶
Contents
POST /v1/projects/{project_id}/virtualbox/vms/{vm_id}/stop¶
Stop a VirtualBox VM 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 stopped
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/5e8543c3-45a7-4668-824f-01eaeb848898/stop' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/5e8543c3-45a7-4668-824f-01eaeb848898/stop HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}/stop
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/suspend¶
Contents
POST /v1/projects/{project_id}/virtualbox/vms/{vm_id}/suspend¶
Suspend a VirtualBox VM 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 suspended
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/95f620da-c0e5-4404-81fc-10f3e18786cb/suspend' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/vms/95f620da-c0e5-4404-81fc-10f3e18786cb/suspend HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}/suspend
Vmware¶
/v1/projects/{project_id}/vmware/vms¶
Contents
POST /v1/projects/{project_id}/vmware/vms¶
Create a new VMware VM instance
Parameters¶
- project_id: UUID for the project
Response status codes¶
- 400: Invalid request
- 201: Instance created
- 409: Conflict
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
acpi_shutdown | boolean | ACPI shutdown | |
adapter_type | string | VMware adapter type | |
adapters | integer | number of adapters | |
console | integer | console TCP port | |
enable_remote_console | boolean | enable the remote console | |
headless | boolean | headless mode | |
linked_clone | ✔ | boolean | either the VM is a linked clone or not |
name | ✔ | string | VMware VM instance name |
use_any_adapter | boolean | allow GNS3 to use any VMware adapter | |
use_ubridge | boolean | use uBridge for network connections | |
vm_id | string | VMware VM instance identifier | |
vmx_path | ✔ | string | path to the vmx file |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
acpi_shutdown | boolean | ACPI shutdown | |
adapter_type | string | VMware adapter type | |
adapters | integer | number of adapters | |
console | integer | console TCP port | |
enable_remote_console | boolean | enable the remote console | |
headless | boolean | headless mode | |
name | ✔ | string | VMware VM instance name |
project_id | ✔ | string | Project UUID |
use_any_adapter | boolean | allow GNS3 to use any VMware adapter | |
use_ubridge | boolean | use uBridge for network connections | |
vm_directory | ['string', 'null'] | ||
vm_id | ✔ | string | VMware VM instance UUID |
vmx_path | string | path to the vmx file |
/v1/projects/{project_id}/vmware/vms/{vm_id}¶
GET /v1/projects/{project_id}/vmware/vms/{vm_id}¶
Get a VMware VM 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 |
---|---|---|---|
acpi_shutdown | boolean | ACPI shutdown | |
adapter_type | string | VMware adapter type | |
adapters | integer | number of adapters | |
console | integer | console TCP port | |
enable_remote_console | boolean | enable the remote console | |
headless | boolean | headless mode | |
name | ✔ | string | VMware VM instance name |
project_id | ✔ | string | Project UUID |
use_any_adapter | boolean | allow GNS3 to use any VMware adapter | |
use_ubridge | boolean | use uBridge for network connections | |
vm_directory | ['string', 'null'] | ||
vm_id | ✔ | string | VMware VM instance UUID |
vmx_path | string | path to the vmx file |
PUT /v1/projects/{project_id}/vmware/vms/{vm_id}¶
Update a VMware VM 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 |
---|---|---|---|
acpi_shutdown | boolean | ACPI shutdown | |
adapter_type | string | VMware adapter type | |
adapters | integer | number of adapters | |
console | integer | console TCP port | |
enable_remote_console | boolean | enable the remote console | |
headless | boolean | headless mode | |
name | string | VMware VM instance name | |
use_any_adapter | boolean | allow GNS3 to use any VMware adapter | |
use_ubridge | boolean | use uBridge for network connections | |
vmx_path | string | path to the vmx file |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
acpi_shutdown | boolean | ACPI shutdown | |
adapter_type | string | VMware adapter type | |
adapters | integer | number of adapters | |
console | integer | console TCP port | |
enable_remote_console | boolean | enable the remote console | |
headless | boolean | headless mode | |
name | ✔ | string | VMware VM instance name |
project_id | ✔ | string | Project UUID |
use_any_adapter | boolean | allow GNS3 to use any VMware adapter | |
use_ubridge | boolean | use uBridge for network connections | |
vm_directory | ['string', 'null'] | ||
vm_id | ✔ | string | VMware VM instance UUID |
vmx_path | string | path to the vmx file |
DELETE /v1/projects/{project_id}/vmware/vms/{vm_id}¶
Delete a VMware VM 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
/v1/projects/{project_id}/vmware/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Contents
POST /v1/projects/{project_id}/vmware/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Add a NIO to a VMware VM instance
Parameters¶
- adapter_number: Adapter where the nio should be added
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 201: NIO created
- 404: Instance doesn’t exist
DELETE /v1/projects/{project_id}/vmware/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Remove a NIO from a VMware VM instance
Parameters¶
- adapter_number: Adapter from where the nio should be removed
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: NIO deleted
/v1/projects/{project_id}/vmware/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/start_capture¶
Contents
POST /v1/projects/{project_id}/vmware/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/start_capture¶
Start a packet capture on a VMware VM instance
Parameters¶
- adapter_number: Adapter to start a packet capture
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 200: Capture started
- 400: Invalid request
- 404: Instance doesn’t exist
/v1/projects/{project_id}/vmware/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/stop_capture¶
Contents
POST /v1/projects/{project_id}/vmware/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/stop_capture¶
Stop a packet capture on a VMware VM instance
Parameters¶
- adapter_number: Adapter to stop a packet capture
- port_number: Port on the adapter (always 0)
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: Capture stopped
/v1/projects/{project_id}/vmware/vms/{vm_id}/interfaces/vmnet¶
Contents
POST /v1/projects/{project_id}/vmware/vms/{vm_id}/interfaces/vmnet¶
Allocate a VMware VMnet interface on the server
Parameters¶
- project_id: The UUID of the project
- vm_id: UUID for the instance
Response status codes¶
- 201: VMnet interface allocated
/v1/projects/{project_id}/vmware/vms/{vm_id}/reload¶
Contents
POST /v1/projects/{project_id}/vmware/vms/{vm_id}/reload¶
Reload a VMware VM 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 reloaded
/v1/projects/{project_id}/vmware/vms/{vm_id}/resume¶
Contents
POST /v1/projects/{project_id}/vmware/vms/{vm_id}/resume¶
Resume a suspended VMware VM 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 resumed
/v1/projects/{project_id}/vmware/vms/{vm_id}/start¶
Contents
POST /v1/projects/{project_id}/vmware/vms/{vm_id}/start¶
Start a VMware VM 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 started
/v1/projects/{project_id}/vmware/vms/{vm_id}/stop¶
Contents
POST /v1/projects/{project_id}/vmware/vms/{vm_id}/stop¶
Stop a VMware VM 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 stopped
/v1/projects/{project_id}/vmware/vms/{vm_id}/suspend¶
Contents
POST /v1/projects/{project_id}/vmware/vms/{vm_id}/suspend¶
Suspend a VMware VM 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 suspended
Vpcs¶
/v1/projects/{project_id}/vpcs/vms¶
Contents
POST /v1/projects/{project_id}/vpcs/vms¶
Create a new VPCS instance
Parameters¶
- project_id: UUID for the project
Response status codes¶
- 400: Invalid request
- 201: Instance created
- 409: Conflict
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
console | ['integer', 'null'] | console TCP port | |
name | ✔ | string | VPCS VM name |
startup_script | ['string', 'null'] | Content of the VPCS startup script | |
vm_id | VPCS VM identifier |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
console | ✔ | integer | console TCP port |
name | ✔ | string | VPCS VM name |
project_id | ✔ | string | Project UUID |
startup_script | ['string', 'null'] | Content of the VPCS startup script | |
startup_script_path | ✔ | ['string', 'null'] | Path of the VPCS startup script relative to project directory |
status | ✔ | enum | Possible values: started, stopped |
vm_directory | string | ||
vm_id | ✔ | string | VPCS VM UUID |
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms' -d '{"name": "PC TEST 1"}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms HTTP/1.1
{
"name": "PC TEST 1"
}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 422
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/vpcs/vms
{
"console": 2010,
"name": "PC TEST 1",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"startup_script": null,
"startup_script_path": null,
"status": "stopped",
"vm_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpqqnauky9/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/vpcs/d1808514-893b-4aa5-86c2-c4dea88ff895",
"vm_id": "d1808514-893b-4aa5-86c2-c4dea88ff895"
}
/v1/projects/{project_id}/vpcs/vms/{vm_id}¶
Contents
GET /v1/projects/{project_id}/vpcs/vms/{vm_id}¶
Get a VPCS 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 |
---|---|---|---|
console | ✔ | integer | console TCP port |
name | ✔ | string | VPCS VM name |
project_id | ✔ | string | Project UUID |
startup_script | ['string', 'null'] | Content of the VPCS startup script | |
startup_script_path | ✔ | ['string', 'null'] | Path of the VPCS startup script relative to project directory |
status | ✔ | enum | Possible values: started, stopped |
vm_directory | string | ||
vm_id | ✔ | string | VPCS VM UUID |
Sample session¶
curl -i -X GET 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/7e24fcc2-e38c-43e8-a7bb-fc22d7b91547'
GET /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/7e24fcc2-e38c-43e8-a7bb-fc22d7b91547 HTTP/1.1
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 422
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}
{
"console": 2010,
"name": "PC TEST 1",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"startup_script": null,
"startup_script_path": null,
"status": "stopped",
"vm_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpqqnauky9/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/vpcs/7e24fcc2-e38c-43e8-a7bb-fc22d7b91547",
"vm_id": "7e24fcc2-e38c-43e8-a7bb-fc22d7b91547"
}
PUT /v1/projects/{project_id}/vpcs/vms/{vm_id}¶
Update a VPCS 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 |
---|---|---|---|
console | ['integer', 'null'] | console TCP port | |
name | ['string', 'null'] | VPCS VM name | |
startup_script | ['string', 'null'] | Content of the VPCS startup script |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
console | ✔ | integer | console TCP port |
name | ✔ | string | VPCS VM name |
project_id | ✔ | string | Project UUID |
startup_script | ['string', 'null'] | Content of the VPCS startup script | |
startup_script_path | ✔ | ['string', 'null'] | Path of the VPCS startup script relative to project directory |
status | ✔ | enum | Possible values: started, stopped |
vm_directory | string | ||
vm_id | ✔ | string | VPCS VM UUID |
Sample session¶
curl -i -X PUT 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/608a4cd0-476c-40ba-95db-0c81effc8e9c' -d '{"console": 2012, "name": "test", "startup_script": "ip 192.168.1.1"}'
PUT /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/608a4cd0-476c-40ba-95db-0c81effc8e9c HTTP/1.1
{
"console": 2012,
"name": "test",
"startup_script": "ip 192.168.1.1"
}
HTTP/1.1 200
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 438
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}
{
"console": 2012,
"name": "test",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"startup_script": "ip 192.168.1.1",
"startup_script_path": "startup.vpc",
"status": "stopped",
"vm_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpqqnauky9/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/vpcs/608a4cd0-476c-40ba-95db-0c81effc8e9c",
"vm_id": "608a4cd0-476c-40ba-95db-0c81effc8e9c"
}
DELETE /v1/projects/{project_id}/vpcs/vms/{vm_id}¶
Delete a VPCS 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/vpcs/vms/6f9f4ab8-1b77-4eee-b0fb-e8d299b843a7'
DELETE /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/6f9f4ab8-1b77-4eee-b0fb-e8d299b843a7 HTTP/1.1
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}
/v1/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Contents
- /v1/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio
POST /v1/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Add a NIO to a VPCS instance
Parameters¶
- adapter_number: Network adapter where the nio is located
- port_number: Port where the nio should be added
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 201: NIO created
- 404: Instance doesn’t exist
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/fbf2e4d7-d60e-4e03-95bc-1bd53b74689a/adapters/0/ports/0/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/fbf2e4d7-d60e-4e03-95bc-1bd53b74689a/adapters/0/ports/0/nio HTTP/1.1
{
"lport": 4242,
"rhost": "127.0.0.1",
"rport": 4343,
"type": "nio_udp"
}
HTTP/1.1 201
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 89
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
{
"lport": 4242,
"rhost": "127.0.0.1",
"rport": 4343,
"type": "nio_udp"
}
DELETE /v1/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:d+}/ports/{port_number:d+}/nio¶
Remove a NIO from a VPCS instance
Parameters¶
- adapter_number: Network adapter where the nio is located
- port_number: Port from where the nio should be removed
- project_id: UUID for the project
- vm_id: UUID for the instance
Response status codes¶
- 400: Invalid request
- 404: Instance doesn’t exist
- 204: NIO deleted
Sample session¶
curl -i -X DELETE 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/6666f3a7-d805-4572-a35c-bc15213f0b52/adapters/0/ports/0/nio'
DELETE /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/6666f3a7-d805-4572-a35c-bc15213f0b52/adapters/0/ports/0/nio HTTP/1.1
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
/v1/projects/{project_id}/vpcs/vms/{vm_id}/reload¶
Contents
POST /v1/projects/{project_id}/vpcs/vms/{vm_id}/reload¶
Reload a VPCS 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 reloaded
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/1a1b95de-cc91-4a90-870b-5c7c8965eb5d/reload' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/1a1b95de-cc91-4a90-870b-5c7c8965eb5d/reload HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}/reload
/v1/projects/{project_id}/vpcs/vms/{vm_id}/start¶
Contents
POST /v1/projects/{project_id}/vpcs/vms/{vm_id}/start¶
Start a VPCS 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 started
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/184c6dcc-a8fd-4cc9-b333-86cc24f2e98e/start' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/184c6dcc-a8fd-4cc9-b333-86cc24f2e98e/start HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}/start
/v1/projects/{project_id}/vpcs/vms/{vm_id}/stop¶
Contents
POST /v1/projects/{project_id}/vpcs/vms/{vm_id}/stop¶
Stop a VPCS 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 stopped
Sample session¶
curl -i -X POST 'http://localhost:8000/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/bc34aac0-6c5e-4b91-b2ea-47b76d4b26f1/stop' -d '{}'
POST /v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/bc34aac0-6c5e-4b91-b2ea-47b76d4b26f1/stop HTTP/1.1
{}
HTTP/1.1 204
ACCESS-CONTROL-ALLOW-ORIGIN: *
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/1.4.0dev13
X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}/stop