mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-29 02:08:10 +00:00
Documentation.
This commit is contained in:
parent
59c82e26df
commit
119bebee25
@ -5,9 +5,9 @@ DELETE /virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio HTTP/1.1
|
||||
|
||||
|
||||
HTTP/1.1 204
|
||||
CONNECTION: keep-alive
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 0
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio
|
||||
|
||||
|
@ -5,9 +5,9 @@ DELETE /vpcs/{uuid}/ports/{port_number:\d+}/nio HTTP/1.1
|
||||
|
||||
|
||||
HTTP/1.1 204
|
||||
CONNECTION: keep-alive
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 0
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /vpcs/{uuid}/ports/{port_number:\d+}/nio
|
||||
|
||||
|
@ -5,56 +5,32 @@ GET /interfaces HTTP/1.1
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 652
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 298
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /interfaces
|
||||
|
||||
[
|
||||
{
|
||||
"id": "lo0",
|
||||
"name": "lo0"
|
||||
"id": "lo",
|
||||
"name": "lo"
|
||||
},
|
||||
{
|
||||
"id": "gif0",
|
||||
"name": "gif0"
|
||||
"id": "eth0",
|
||||
"name": "eth0"
|
||||
},
|
||||
{
|
||||
"id": "stf0",
|
||||
"name": "stf0"
|
||||
"id": "wlan0",
|
||||
"name": "wlan0"
|
||||
},
|
||||
{
|
||||
"id": "en0",
|
||||
"name": "en0"
|
||||
"id": "vmnet1",
|
||||
"name": "vmnet1"
|
||||
},
|
||||
{
|
||||
"id": "en1",
|
||||
"name": "en1"
|
||||
},
|
||||
{
|
||||
"id": "fw0",
|
||||
"name": "fw0"
|
||||
},
|
||||
{
|
||||
"id": "en2",
|
||||
"name": "en2"
|
||||
},
|
||||
{
|
||||
"id": "p2p0",
|
||||
"name": "p2p0"
|
||||
},
|
||||
{
|
||||
"id": "bridge0",
|
||||
"name": "bridge0"
|
||||
},
|
||||
{
|
||||
"id": "vboxnet0",
|
||||
"name": "vboxnet0"
|
||||
},
|
||||
{
|
||||
"id": "vboxnet1",
|
||||
"name": "vboxnet1"
|
||||
"id": "vmnet8",
|
||||
"name": "vmnet8"
|
||||
}
|
||||
]
|
||||
|
@ -5,11 +5,11 @@ GET /version HTTP/1.1
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 29
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /version
|
||||
|
||||
{
|
||||
|
@ -5,11 +5,11 @@ GET /virtualbox/{uuid} HTTP/1.1
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 348
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 346
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /virtualbox/{uuid}
|
||||
|
||||
{
|
||||
@ -20,7 +20,7 @@ X-ROUTE: /virtualbox/{uuid}
|
||||
"enable_remote_console": false,
|
||||
"headless": false,
|
||||
"name": "VMTEST",
|
||||
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"uuid": "c6b74706-54b6-405d-8aea-9c48a94987e8",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"uuid": "f246f72b-9f79-4a60-a8fb-0b2375d29d28",
|
||||
"vmname": "VMTEST"
|
||||
}
|
||||
|
@ -5,18 +5,18 @@ GET /vpcs/{uuid} HTTP/1.1
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 213
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 211
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /vpcs/{uuid}
|
||||
|
||||
{
|
||||
"console": 2003,
|
||||
"name": "PC TEST 1",
|
||||
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"script_file": null,
|
||||
"startup_script": null,
|
||||
"uuid": "aceec3c0-f02d-44ee-88a6-85c3120c22ca"
|
||||
"uuid": "0300d8a7-e971-4402-bd85-8c12384d308d"
|
||||
}
|
||||
|
@ -5,11 +5,11 @@ POST /ports/udp HTTP/1.1
|
||||
|
||||
|
||||
HTTP/1.1 201
|
||||
CONNECTION: keep-alive
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 25
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /ports/udp
|
||||
|
||||
{
|
||||
|
@ -7,11 +7,11 @@ POST /version HTTP/1.1
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 29
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /version
|
||||
|
||||
{
|
||||
|
@ -1,20 +1,20 @@
|
||||
curl -i -X POST 'http://localhost:8000/virtualbox' -d '{"linked_clone": false, "name": "VM1", "project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80", "vmname": "VM1"}'
|
||||
curl -i -X POST 'http://localhost:8000/virtualbox' -d '{"linked_clone": false, "name": "VM1", "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", "vmname": "VM1"}'
|
||||
|
||||
POST /virtualbox HTTP/1.1
|
||||
{
|
||||
"linked_clone": false,
|
||||
"name": "VM1",
|
||||
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"vmname": "VM1"
|
||||
}
|
||||
|
||||
|
||||
HTTP/1.1 201
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 342
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 340
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /virtualbox
|
||||
|
||||
{
|
||||
@ -25,7 +25,7 @@ X-ROUTE: /virtualbox
|
||||
"enable_remote_console": false,
|
||||
"headless": false,
|
||||
"name": "VM1",
|
||||
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"uuid": "7ba9ddf4-0a6a-48a0-8483-3450a9f305df",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"uuid": "210fbbba-4025-4286-81dc-1f07cc494cc9",
|
||||
"vmname": "VM1"
|
||||
}
|
||||
|
@ -10,11 +10,11 @@ POST /virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio HTTP/1.1
|
||||
|
||||
|
||||
HTTP/1.1 201
|
||||
CONNECTION: keep-alive
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 89
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio
|
||||
|
||||
{
|
||||
|
@ -1,25 +1,25 @@
|
||||
curl -i -X POST 'http://localhost:8000/vpcs' -d '{"name": "PC TEST 1", "project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80"}'
|
||||
curl -i -X POST 'http://localhost:8000/vpcs' -d '{"name": "PC TEST 1", "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80"}'
|
||||
|
||||
POST /vpcs HTTP/1.1
|
||||
{
|
||||
"name": "PC TEST 1",
|
||||
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80"
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80"
|
||||
}
|
||||
|
||||
|
||||
HTTP/1.1 201
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 213
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 211
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /vpcs
|
||||
|
||||
{
|
||||
"console": 2001,
|
||||
"name": "PC TEST 1",
|
||||
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"script_file": null,
|
||||
"startup_script": null,
|
||||
"uuid": "896e7bbd-936c-4a6f-9268-c89f8eb91f5e"
|
||||
"uuid": "92ff89ed-aed2-487c-b893-5559ca258d0f"
|
||||
}
|
||||
|
@ -10,11 +10,11 @@ POST /vpcs/{uuid}/ports/{port_number:\d+}/nio HTTP/1.1
|
||||
|
||||
|
||||
HTTP/1.1 201
|
||||
CONNECTION: keep-alive
|
||||
CONNECTION: close
|
||||
CONTENT-LENGTH: 89
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
SERVER: Python/3.4 aiohttp/0.13.1
|
||||
X-ROUTE: /vpcs/{uuid}/ports/{port_number:\d+}/nio
|
||||
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ Input
|
||||
<tr><td>headless</td> <td> </td> <td>boolean</td> <td>headless mode</td> </tr>
|
||||
<tr><td>linked_clone</td> <td>✔</td> <td>boolean</td> <td>either the VM is a linked clone or not</td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>VirtualBox VM instance name</td> </tr>
|
||||
<tr><td>project_uuid</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>uuid</td> <td> </td> <td>string</td> <td>VirtualBox VM instance UUID</td> </tr>
|
||||
<tr><td>vbox_id</td> <td> </td> <td>integer</td> <td>VirtualBox VM instance ID (for project created before GNS3 1.3)</td> </tr>
|
||||
<tr><td>vmname</td> <td>✔</td> <td>string</td> <td>VirtualBox VM name (in VirtualBox itself)</td> </tr>
|
||||
@ -46,7 +46,7 @@ Output
|
||||
<tr><td>enable_remote_console</td> <td> </td> <td>boolean</td> <td>enable the remote console</td> </tr>
|
||||
<tr><td>headless</td> <td> </td> <td>boolean</td> <td>headless mode</td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>VirtualBox VM instance name</td> </tr>
|
||||
<tr><td>project_uuid</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>uuid</td> <td>✔</td> <td>string</td> <td>VirtualBox VM instance UUID</td> </tr>
|
||||
<tr><td>vmname</td> <td> </td> <td>string</td> <td>VirtualBox VM name (in VirtualBox itself)</td> </tr>
|
||||
</table>
|
||||
|
@ -29,7 +29,7 @@ Output
|
||||
<tr><td>enable_remote_console</td> <td> </td> <td>boolean</td> <td>enable the remote console</td> </tr>
|
||||
<tr><td>headless</td> <td> </td> <td>boolean</td> <td>headless mode</td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>VirtualBox VM instance name</td> </tr>
|
||||
<tr><td>project_uuid</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>uuid</td> <td>✔</td> <td>string</td> <td>VirtualBox VM instance UUID</td> </tr>
|
||||
<tr><td>vmname</td> <td> </td> <td>string</td> <td>VirtualBox VM name (in VirtualBox itself)</td> </tr>
|
||||
</table>
|
||||
@ -84,7 +84,7 @@ Output
|
||||
<tr><td>enable_remote_console</td> <td> </td> <td>boolean</td> <td>enable the remote console</td> </tr>
|
||||
<tr><td>headless</td> <td> </td> <td>boolean</td> <td>headless mode</td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>VirtualBox VM instance name</td> </tr>
|
||||
<tr><td>project_uuid</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>uuid</td> <td>✔</td> <td>string</td> <td>VirtualBox VM instance UUID</td> </tr>
|
||||
<tr><td>vmname</td> <td> </td> <td>string</td> <td>VirtualBox VM name (in VirtualBox itself)</td> </tr>
|
||||
</table>
|
||||
|
@ -9,8 +9,8 @@ Add a NIO to a VirtualBox VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_id**: Adapter where the nio should be added
|
||||
- **uuid**: Instance UUID
|
||||
- **adapter_id**: Adapter where the nio should be added
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
@ -31,8 +31,8 @@ Remove a NIO from a VirtualBox VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_id**: Adapter from where the nio should be removed
|
||||
- **uuid**: Instance UUID
|
||||
- **adapter_id**: Adapter from where the nio should be removed
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
|
@ -9,8 +9,8 @@ Start a packet capture on a VirtualBox VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_id**: Adapter to start a packet capture
|
||||
- **uuid**: Instance UUID
|
||||
- **adapter_id**: Adapter to start a packet capture
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
|
@ -9,8 +9,8 @@ Stop a packet capture on a VirtualBox VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_id**: Adapter to stop a packet capture
|
||||
- **uuid**: Instance UUID
|
||||
- **adapter_id**: Adapter to stop a packet capture
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
|
@ -21,7 +21,7 @@ Input
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>console</td> <td> </td> <td>['integer', 'null']</td> <td>console TCP port</td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>VPCS device name</td> </tr>
|
||||
<tr><td>project_uuid</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>startup_script</td> <td> </td> <td>['string', 'null']</td> <td>Content of the VPCS startup script</td> </tr>
|
||||
<tr><td>uuid</td> <td> </td> <td>string</td> <td>VPCS device UUID</td> </tr>
|
||||
<tr><td>vpcs_id</td> <td> </td> <td>integer</td> <td>VPCS device instance ID (for project created before GNS3 1.3)</td> </tr>
|
||||
@ -35,7 +35,7 @@ Output
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>console</td> <td>✔</td> <td>integer</td> <td>console TCP port</td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>VPCS device name</td> </tr>
|
||||
<tr><td>project_uuid</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>script_file</td> <td> </td> <td>['string', 'null']</td> <td>VPCS startup script</td> </tr>
|
||||
<tr><td>startup_script</td> <td> </td> <td>['string', 'null']</td> <td>Content of the VPCS startup script</td> </tr>
|
||||
<tr><td>uuid</td> <td>✔</td> <td>string</td> <td>VPCS device UUID</td> </tr>
|
||||
|
@ -24,7 +24,7 @@ Output
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>console</td> <td>✔</td> <td>integer</td> <td>console TCP port</td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>VPCS device name</td> </tr>
|
||||
<tr><td>project_uuid</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>script_file</td> <td> </td> <td>['string', 'null']</td> <td>VPCS startup script</td> </tr>
|
||||
<tr><td>startup_script</td> <td> </td> <td>['string', 'null']</td> <td>Content of the VPCS startup script</td> </tr>
|
||||
<tr><td>uuid</td> <td>✔</td> <td>string</td> <td>VPCS device UUID</td> </tr>
|
||||
@ -70,7 +70,7 @@ Output
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>console</td> <td>✔</td> <td>integer</td> <td>console TCP port</td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>VPCS device name</td> </tr>
|
||||
<tr><td>project_uuid</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>script_file</td> <td> </td> <td>['string', 'null']</td> <td>VPCS startup script</td> </tr>
|
||||
<tr><td>startup_script</td> <td> </td> <td>['string', 'null']</td> <td>Content of the VPCS startup script</td> </tr>
|
||||
<tr><td>uuid</td> <td>✔</td> <td>string</td> <td>VPCS device UUID</td> </tr>
|
||||
|
@ -9,8 +9,8 @@ Add a NIO to a VPCS instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **port_number**: Port where the nio should be added
|
||||
- **uuid**: Instance UUID
|
||||
- **port_number**: Port where the nio should be added
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
@ -31,8 +31,8 @@ Remove a NIO from a VPCS instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **port_number**: Port from where the nio should be removed
|
||||
- **uuid**: Instance UUID
|
||||
- **port_number**: Port from where the nio should be removed
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
|
@ -59,7 +59,7 @@ class VirtualBoxHandler:
|
||||
|
||||
vbox_manager = VirtualBox.instance()
|
||||
vm = yield from vbox_manager.create_vm(request.json.pop("name"),
|
||||
request.json.pop("project_uuid"),
|
||||
request.json.pop("project_id"),
|
||||
request.json.get("uuid"),
|
||||
request.json.pop("vmname"),
|
||||
request.json.pop("linked_clone"),
|
||||
|
Loading…
Reference in New Issue
Block a user