Add a curl sample sessions

pull/100/head
Julien Duponchelle 9 years ago
parent ae7bf828cd
commit ebd72d1149

@ -13,8 +13,8 @@ SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /v1/projects/{project_id}
{
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpjlh4s0j0",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpjlh4s0j0/00010203-0405-0607-0809-0a0b0c0d0e0f",
"project_id": "00010203-0405-0607-0809-0a0b0c0d0e0f",
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpqekqsxgq",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpqekqsxgq/00010203-0405-0607-0809-0a0b0c0d0e02",
"project_id": "00010203-0405-0607-0809-0a0b0c0d0e02",
"temporary": false
}

@ -19,9 +19,9 @@ X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}
"l1_keepalives": false,
"name": "PC TEST 1",
"nvram": 128,
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3621/test_iou_get0/iou.bin",
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3782/test_iou_get0/iou.bin",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"ram": 256,
"serial_adapters": 2,
"vm_id": "f75ff9e7-e658-45f7-9021-1651cfed1194"
"vm_id": "b9022212-4b9e-48fd-b910-85f0d896f951"
}

@ -28,7 +28,7 @@ X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}
"options": "",
"process_priority": "low",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpu7smjb0q/qemu_x42",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmprhap9vc_/qemu_x42",
"ram": 256,
"vm_id": "b41caecc-86fc-4986-a0b2-36892ac8baba"
"vm_id": "5eee27c5-c590-4ddf-aa1f-783e15a3c41a"
}

@ -21,6 +21,6 @@ X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}
"name": "VMTEST",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"use_any_adapter": false,
"vm_id": "bb20d4fa-f233-400d-af07-2fbdcb337022",
"vm_id": "4d4c9e18-0bad-4345-9338-17b98f2f6680",
"vmname": "VMTEST"
}

@ -6,7 +6,7 @@ GET /projects/{project_id}/vpcs/vms/{vm_id} HTTP/1.1
HTTP/1.1 200
CONNECTION: keep-alive
CONTENT-LENGTH: 187
CONTENT-LENGTH: 220
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
@ -17,5 +17,6 @@ X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}
"name": "PC TEST 1",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"startup_script": null,
"vm_id": "1b0843ea-4fcf-4d2a-94e8-bc3b7a92be88"
"startup_script_path": null,
"vm_id": "ca159ab0-42d5-4c9a-bfb0-c2290ac90556"
}

@ -4,7 +4,7 @@ POST /projects HTTP/1.1
{}
HTTP/1.1 200
HTTP/1.1 201
CONNECTION: keep-alive
CONTENT-LENGTH: 277
CONTENT-TYPE: application/json
@ -13,8 +13,8 @@ SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /v1/projects
{
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpanmwxfqf",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpanmwxfqf/f0f4987c-b1d3-432f-a354-1179d1c727f9",
"project_id": "f0f4987c-b1d3-432f-a354-1179d1c727f9",
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpgrmlhkz5",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpgrmlhkz5/8a563c49-902c-4ee8-8a3c-d188e5832741",
"project_id": "8a563c49-902c-4ee8-8a3c-d188e5832741",
"temporary": false
}

@ -1,4 +1,4 @@
curl -i -X POST 'http://localhost:8000/projects/{project_id}/iou/vms' -d '{"ethernet_adapters": 0, "initial_config_content": "hostname test", "l1_keepalives": true, "name": "PC TEST 1", "nvram": 512, "path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3621/test_iou_create_with_params0/iou.bin", "ram": 1024, "serial_adapters": 4}'
curl -i -X POST 'http://localhost:8000/projects/{project_id}/iou/vms' -d '{"ethernet_adapters": 0, "initial_config_content": "hostname test", "l1_keepalives": true, "name": "PC TEST 1", "nvram": 512, "path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3782/test_iou_create_with_params0/iou.bin", "ram": 1024, "serial_adapters": 4}'
POST /projects/{project_id}/iou/vms HTTP/1.1
{
@ -7,7 +7,7 @@ POST /projects/{project_id}/iou/vms HTTP/1.1
"l1_keepalives": true,
"name": "PC TEST 1",
"nvram": 512,
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3621/test_iou_create_with_params0/iou.bin",
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3782/test_iou_create_with_params0/iou.bin",
"ram": 1024,
"serial_adapters": 4
}
@ -28,9 +28,9 @@ X-ROUTE: /v1/projects/{project_id}/iou/vms
"l1_keepalives": true,
"name": "PC TEST 1",
"nvram": 512,
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3621/test_iou_create_with_params0/iou.bin",
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3782/test_iou_create_with_params0/iou.bin",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"ram": 1024,
"serial_adapters": 4,
"vm_id": "20e66cd4-52ef-4ad2-a44e-16bce06fd6f2"
"vm_id": "d6832edf-97ad-45a2-b588-c64d5c3f5dec"
}

@ -16,5 +16,5 @@ SERVER: Python/3.4 GNS3/1.3.dev1
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/tmpd25gn8du/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/captures/test.pcap"
"pcap_file_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpina5gsqc/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/captures/test.pcap"
}

@ -1,10 +1,10 @@
curl -i -X POST 'http://localhost:8000/projects/{project_id}/qemu/vms' -d '{"hda_disk_image": "hda", "name": "PC TEST 1", "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpu7smjb0q/qemu_x42", "ram": 1024}'
curl -i -X POST 'http://localhost:8000/projects/{project_id}/qemu/vms' -d '{"hda_disk_image": "hda", "name": "PC TEST 1", "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmprhap9vc_/qemu_x42", "ram": 1024}'
POST /projects/{project_id}/qemu/vms HTTP/1.1
{
"hda_disk_image": "hda",
"name": "PC TEST 1",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpu7smjb0q/qemu_x42",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmprhap9vc_/qemu_x42",
"ram": 1024
}
@ -33,7 +33,7 @@ X-ROUTE: /v1/projects/{project_id}/qemu/vms
"options": "",
"process_priority": "low",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpu7smjb0q/qemu_x42",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmprhap9vc_/qemu_x42",
"ram": 1024,
"vm_id": "3176897a-996a-4020-86b8-3cd7a0031cbc"
"vm_id": "4c3596aa-e44c-4129-94e4-45dd93ef7e6b"
}

@ -25,6 +25,6 @@ X-ROUTE: /v1/projects/{project_id}/virtualbox/vms
"name": "VM1",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"use_any_adapter": false,
"vm_id": "8f384969-8478-4e8a-a6cd-c91376ccc89b",
"vm_id": "d162a4e3-f28b-48db-a9f4-1c87db4ed0d2",
"vmname": "VM1"
}

@ -8,7 +8,7 @@ POST /projects/{project_id}/vpcs/vms HTTP/1.1
HTTP/1.1 201
CONNECTION: keep-alive
CONTENT-LENGTH: 187
CONTENT-LENGTH: 220
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
@ -19,5 +19,6 @@ X-ROUTE: /v1/projects/{project_id}/vpcs/vms
"name": "PC TEST 1",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"startup_script": null,
"vm_id": "90e4cc09-4013-4e94-97ce-3ca48676de22"
"startup_script_path": null,
"vm_id": "4bec08c2-b54b-4040-90a3-2add2fd82f32"
}

@ -1,8 +1,8 @@
curl -i -X PUT 'http://localhost:8000/projects/{project_id}' -d '{"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3621/test_update_path_project_non_l0"}'
curl -i -X PUT 'http://localhost:8000/projects/{project_id}' -d '{"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3782/test_update_path_project_non_l0"}'
PUT /projects/{project_id} HTTP/1.1
{
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3621/test_update_path_project_non_l0"
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3782/test_update_path_project_non_l0"
}

@ -28,9 +28,9 @@ X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}
"l1_keepalives": true,
"name": "test",
"nvram": 2048,
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3621/test_iou_update0/iou.bin",
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3782/test_iou_update0/iou.bin",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"ram": 512,
"serial_adapters": 0,
"vm_id": "e867af73-aaf1-4770-a935-78a357ea5db3"
"vm_id": "69ad7d57-d1ec-447e-b8da-7b2f888a85e5"
}

@ -33,7 +33,7 @@ X-ROUTE: /v1/projects/{project_id}/qemu/vms/{vm_id}
"options": "",
"process_priority": "low",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpu7smjb0q/qemu_x42",
"qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmprhap9vc_/qemu_x42",
"ram": 1024,
"vm_id": "8a0d735b-d485-4a2e-bae1-be54f426fbeb"
"vm_id": "385c7895-f085-4682-b31a-a6a63930c5c4"
}

@ -24,6 +24,6 @@ X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}
"name": "test",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"use_any_adapter": false,
"vm_id": "dcf2c555-703d-47cb-9dd2-8ee6c11b9f6c",
"vm_id": "15c34b6c-63bb-48a6-b4b0-e772fdb74925",
"vmname": "VMTEST"
}

@ -10,7 +10,7 @@ PUT /projects/{project_id}/vpcs/vms/{vm_id} HTTP/1.1
HTTP/1.1 200
CONNECTION: keep-alive
CONTENT-LENGTH: 194
CONTENT-LENGTH: 236
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
@ -21,5 +21,6 @@ X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}
"name": "test",
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"startup_script": "ip 192.168.1.1",
"vm_id": "f27aa7da-e267-483a-adc6-2587e1377e8c"
"startup_script_path": "startup.vpc",
"vm_id": "a239c325-d437-4209-a583-9eee28905802"
}

@ -9,8 +9,8 @@ Get a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************
@ -75,8 +75,8 @@ Update a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************
@ -191,8 +191,8 @@ Delete a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,10 +9,10 @@ Add a NIO to a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Adapter where the nio should be added
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port on the adapter
- **adapter_number**: Adapter where the nio should be added
Response status codes
**********************
@ -27,10 +27,10 @@ Remove a NIO from a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Adapter from where the nio should be removed
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port on the adapter
- **adapter_number**: Adapter from where the nio should be removed
Response status codes
**********************

@ -9,10 +9,10 @@ Start a packet capture on a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Adapter to start a packet capture
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port on the adapter
- **adapter_number**: Adapter to start a packet capture
Response status codes
**********************

@ -9,10 +9,10 @@ Stop a packet capture on a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Adapter to stop a packet capture
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port on the adapter (always 0)
- **adapter_number**: Adapter to stop a packet capture
Response status codes
**********************

@ -9,8 +9,8 @@ Reload a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Resume a suspended Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Start a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Stop a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Suspend a Dynamips VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -1,8 +0,0 @@
Iou
---------------------
.. toctree::
:glob:
:maxdepth: 2
iou/*

@ -1,62 +0,0 @@
/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
*******
.. raw:: html
<table>
<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>ethernet_adapters</td> <td> </td> <td>integer</td> <td>How many ethernet adapters are connected to the IOU</td> </tr>
<tr><td>initial_config_content</td> <td> </td> <td>['string', 'null']</td> <td>Initial configuration of the IOU</td> </tr>
<tr><td>l1_keepalives</td> <td> </td> <td>['boolean', 'null']</td> <td>Always up ethernet interface</td> </tr>
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>IOU VM name</td> </tr>
<tr><td>nvram</td> <td> </td> <td>['integer', 'null']</td> <td>Allocated NVRAM KB</td> </tr>
<tr><td>path</td> <td>&#10004;</td> <td>string</td> <td>Path of iou binary</td> </tr>
<tr><td>ram</td> <td> </td> <td>['integer', 'null']</td> <td>Allocated RAM MB</td> </tr>
<tr><td>serial_adapters</td> <td> </td> <td>integer</td> <td>How many serial adapters are connected to the IOU</td> </tr>
<tr><td>vm_id</td> <td> </td> <td></td> <td>IOU VM identifier</td> </tr>
</table>
Output
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>console</td> <td>&#10004;</td> <td>integer</td> <td>console TCP port</td> </tr>
<tr><td>ethernet_adapters</td> <td>&#10004;</td> <td>integer</td> <td>How many ethernet adapters are connected to the IOU</td> </tr>
<tr><td>initial_config</td> <td>&#10004;</td> <td>['string', 'null']</td> <td>Path of the initial config content relative to project directory</td> </tr>
<tr><td>l1_keepalives</td> <td>&#10004;</td> <td>boolean</td> <td>Always up ethernet interface</td> </tr>
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>IOU VM name</td> </tr>
<tr><td>nvram</td> <td>&#10004;</td> <td>integer</td> <td>Allocated NVRAM KB</td> </tr>
<tr><td>path</td> <td>&#10004;</td> <td>string</td> <td>Path of iou binary</td> </tr>
<tr><td>project_id</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
<tr><td>ram</td> <td>&#10004;</td> <td>integer</td> <td>Allocated RAM MB</td> </tr>
<tr><td>serial_adapters</td> <td>&#10004;</td> <td>integer</td> <td>How many serial adapters are connected to the IOU</td> </tr>
<tr><td>vm_id</td> <td>&#10004;</td> <td>string</td> <td>IOU VM UUID</td> </tr>
</table>
Sample session
***************
.. literalinclude:: ../../examples/post_projectsprojectidiouvms.txt

@ -1,126 +0,0 @@
/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
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>console</td> <td>&#10004;</td> <td>integer</td> <td>console TCP port</td> </tr>
<tr><td>ethernet_adapters</td> <td>&#10004;</td> <td>integer</td> <td>How many ethernet adapters are connected to the IOU</td> </tr>
<tr><td>initial_config</td> <td>&#10004;</td> <td>['string', 'null']</td> <td>Path of the initial config content relative to project directory</td> </tr>
<tr><td>l1_keepalives</td> <td>&#10004;</td> <td>boolean</td> <td>Always up ethernet interface</td> </tr>
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>IOU VM name</td> </tr>
<tr><td>nvram</td> <td>&#10004;</td> <td>integer</td> <td>Allocated NVRAM KB</td> </tr>
<tr><td>path</td> <td>&#10004;</td> <td>string</td> <td>Path of iou binary</td> </tr>
<tr><td>project_id</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
<tr><td>ram</td> <td>&#10004;</td> <td>integer</td> <td>Allocated RAM MB</td> </tr>
<tr><td>serial_adapters</td> <td>&#10004;</td> <td>integer</td> <td>How many serial adapters are connected to the IOU</td> </tr>
<tr><td>vm_id</td> <td>&#10004;</td> <td>string</td> <td>IOU VM UUID</td> </tr>
</table>
Sample session
***************
.. literalinclude:: ../../examples/get_projectsprojectidiouvmsvmid.txt
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
*******
.. raw:: html
<table>
<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>ethernet_adapters</td> <td> </td> <td>['integer', 'null']</td> <td>How many ethernet adapters are connected to the IOU</td> </tr>
<tr><td>initial_config_content</td> <td> </td> <td>['string', 'null']</td> <td>Initial configuration of the IOU</td> </tr>
<tr><td>l1_keepalives</td> <td> </td> <td>['boolean', 'null']</td> <td>Always up ethernet interface</td> </tr>
<tr><td>name</td> <td> </td> <td>['string', 'null']</td> <td>IOU VM name</td> </tr>
<tr><td>nvram</td> <td> </td> <td>['integer', 'null']</td> <td>Allocated NVRAM KB</td> </tr>
<tr><td>path</td> <td> </td> <td>['string', 'null']</td> <td>Path of iou binary</td> </tr>
<tr><td>ram</td> <td> </td> <td>['integer', 'null']</td> <td>Allocated RAM MB</td> </tr>
<tr><td>serial_adapters</td> <td> </td> <td>['integer', 'null']</td> <td>How many serial adapters are connected to the IOU</td> </tr>
</table>
Output
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>console</td> <td>&#10004;</td> <td>integer</td> <td>console TCP port</td> </tr>
<tr><td>ethernet_adapters</td> <td>&#10004;</td> <td>integer</td> <td>How many ethernet adapters are connected to the IOU</td> </tr>
<tr><td>initial_config</td> <td>&#10004;</td> <td>['string', 'null']</td> <td>Path of the initial config content relative to project directory</td> </tr>
<tr><td>l1_keepalives</td> <td>&#10004;</td> <td>boolean</td> <td>Always up ethernet interface</td> </tr>
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>IOU VM name</td> </tr>
<tr><td>nvram</td> <td>&#10004;</td> <td>integer</td> <td>Allocated NVRAM KB</td> </tr>
<tr><td>path</td> <td>&#10004;</td> <td>string</td> <td>Path of iou binary</td> </tr>
<tr><td>project_id</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
<tr><td>ram</td> <td>&#10004;</td> <td>integer</td> <td>Allocated RAM MB</td> </tr>
<tr><td>serial_adapters</td> <td>&#10004;</td> <td>integer</td> <td>How many serial adapters are connected to the IOU</td> </tr>
<tr><td>vm_id</td> <td>&#10004;</td> <td>string</td> <td>IOU VM UUID</td> </tr>
</table>
Sample session
***************
.. literalinclude:: ../../examples/put_projectsprojectidiouvmsvmid.txt
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
***************
.. literalinclude:: ../../examples/delete_projectsprojectidiouvmsvmid.txt

@ -1,52 +0,0 @@
/v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
----------------------------------------------------------------------------------------------------------------------
.. contents::
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
**********
- **project_id**: UUID for the project
- **adapter_number**: Network adapter where the nio is located
- **vm_id**: UUID for the instance
- **port_number**: Port where the nio should be added
Response status codes
**********************
- **400**: Invalid request
- **201**: NIO created
- **404**: Instance doesn't exist
Sample session
***************
.. literalinclude:: ../../examples/post_projectsprojectidiouvmsvmidadaptersadapternumberdportsportnumberdnio.txt
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
**********
- **project_id**: UUID for the project
- **adapter_number**: Network adapter where the nio is located
- **vm_id**: UUID for the instance
- **port_number**: Port from where the nio should be removed
Response status codes
**********************
- **400**: Invalid request
- **404**: Instance doesn't exist
- **204**: NIO deleted
Sample session
***************
.. literalinclude:: ../../examples/delete_projectsprojectidiouvmsvmidadaptersadapternumberdportsportnumberdnio.txt

@ -1,38 +0,0 @@
/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
**********
- **project_id**: UUID for the project
- **adapter_number**: Adapter to start a packet capture
- **vm_id**: UUID for the instance
- **port_number**: Port on the adapter
Response status codes
**********************
- **200**: Capture started
- **400**: Invalid request
- **404**: Instance doesn't exist
Input
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>capture_file_name</td> <td>&#10004;</td> <td>string</td> <td>Capture file name</td> </tr>
<tr><td>data_link_type</td> <td>&#10004;</td> <td>string</td> <td>PCAP data link type</td> </tr>
</table>
Sample session
***************
.. literalinclude:: ../../examples/post_projectsprojectidiouvmsvmidadaptersadapternumberdportsportnumberdstartcapture.txt

@ -1,28 +0,0 @@
/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
**********
- **project_id**: UUID for the project
- **adapter_number**: Adapter to stop a packet capture
- **vm_id**: UUID for the instance
- **port_number**: Port on the adapter (always 0)
Response status codes
**********************
- **400**: Invalid request
- **404**: Instance doesn't exist
- **204**: Capture stopped
Sample session
***************
.. literalinclude:: ../../examples/post_projectsprojectidiouvmsvmidadaptersadapternumberdportsportnumberdstopcapture.txt

@ -1,30 +0,0 @@
/v1/projects/{project_id}/iou/vms/{vm_id}/initial_config
----------------------------------------------------------------------------------------------------------------------
.. contents::
GET /v1/projects/**{project_id}**/iou/vms/**{vm_id}**/initial_config
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Retrieve the initial config content
Response status codes
**********************
- **200**: Initial config retrieved
- **400**: Invalid request
- **404**: Instance doesn't exist
Output
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>content</td> <td>&#10004;</td> <td>['string', 'null']</td> <td>Content of the initial configuration file</td> </tr>
</table>
Sample session
***************
.. literalinclude:: ../../examples/get_projectsprojectidiouvmsvmidinitialconfig.txt

@ -1,26 +0,0 @@
/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
***************
.. literalinclude:: ../../examples/post_projectsprojectidiouvmsvmidreload.txt

@ -1,26 +0,0 @@
/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
Sample session
***************
.. literalinclude:: ../../examples/post_projectsprojectidiouvmsvmidstart.txt

@ -1,26 +0,0 @@
/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
***************
.. literalinclude:: ../../examples/post_projectsprojectidiouvmsvmidstop.txt

@ -9,7 +9,8 @@ Create a new project on the server
Response status codes
**********************
- **200**: OK
- **201**: Project created
- **409**: Project already created
Input
*******

@ -9,8 +9,8 @@ Get a Qemu.instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************
@ -57,8 +57,8 @@ Update a Qemu.instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************
@ -130,8 +130,8 @@ Delete a Qemu.instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,10 +9,10 @@ Add a NIO to a Qemu.instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Network adapter where the nio is located
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port where the nio should be added
- **adapter_number**: Network adapter where the nio is located
Response status codes
**********************
@ -33,10 +33,10 @@ Remove a NIO from a Qemu.instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Network adapter where the nio is located
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port from where the nio should be removed
- **adapter_number**: Network adapter where the nio is located
Response status codes
**********************

@ -9,8 +9,8 @@ Reload a Qemu.instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Resume a Qemu.instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Start a Qemu.instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Stop a Qemu.instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Suspend a Qemu.instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Get a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************
@ -49,8 +49,8 @@ Update a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************
@ -106,8 +106,8 @@ Delete a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,10 +9,10 @@ Add a NIO to a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Adapter where the nio should be added
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port on the adapter (always 0)
- **adapter_number**: Adapter where the nio should be added
Response status codes
**********************
@ -33,10 +33,10 @@ Remove a NIO from a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Adapter from where the nio should be removed
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port on the adapter (always)
- **adapter_number**: Adapter from where the nio should be removed
Response status codes
**********************

@ -9,10 +9,10 @@ Start a packet capture on a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Adapter to start a packet capture
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port on the adapter (always 0)
- **adapter_number**: Adapter to start a packet capture
Response status codes
**********************

@ -9,10 +9,10 @@ Stop a packet capture on a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Adapter to stop a packet capture
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port on the adapter (always 0)
- **adapter_number**: Adapter to stop a packet capture
Response status codes
**********************

@ -9,8 +9,8 @@ Reload a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Resume a suspended VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Start a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Stop a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Suspend a VirtualBox VM instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -39,6 +39,7 @@ Output
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>VPCS VM name</td> </tr>
<tr><td>project_id</td> <td>&#10004;</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>startup_script_path</td> <td>&#10004;</td> <td>['string', 'null']</td> <td>Path of the VPCS startup script relative to project directory</td> </tr>
<tr><td>vm_id</td> <td>&#10004;</td> <td>string</td> <td>VPCS VM UUID</td> </tr>
</table>

@ -9,8 +9,8 @@ Get a VPCS instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************
@ -28,6 +28,7 @@ Output
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>VPCS VM name</td> </tr>
<tr><td>project_id</td> <td>&#10004;</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>startup_script_path</td> <td>&#10004;</td> <td>['string', 'null']</td> <td>Path of the VPCS startup script relative to project directory</td> </tr>
<tr><td>vm_id</td> <td>&#10004;</td> <td>string</td> <td>VPCS VM UUID</td> </tr>
</table>
@ -44,8 +45,8 @@ Update a VPCS instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************
@ -75,6 +76,7 @@ Output
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>VPCS VM name</td> </tr>
<tr><td>project_id</td> <td>&#10004;</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>startup_script_path</td> <td>&#10004;</td> <td>['string', 'null']</td> <td>Path of the VPCS startup script relative to project directory</td> </tr>
<tr><td>vm_id</td> <td>&#10004;</td> <td>string</td> <td>VPCS VM UUID</td> </tr>
</table>
@ -91,8 +93,8 @@ Delete a VPCS instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,10 +9,10 @@ Add a NIO to a VPCS instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Network adapter where the nio is located
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port where the nio should be added
- **adapter_number**: Network adapter where the nio is located
Response status codes
**********************
@ -33,10 +33,10 @@ Remove a NIO from a VPCS instance
Parameters
**********
- **project_id**: UUID for the project
- **adapter_number**: Network adapter where the nio is located
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
- **port_number**: Port from where the nio should be removed
- **adapter_number**: Network adapter where the nio is located
Response status codes
**********************

@ -9,8 +9,8 @@ Reload a VPCS instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Start a VPCS instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -9,8 +9,8 @@ Stop a VPCS instance
Parameters
**********
- **project_id**: UUID for the project
- **vm_id**: UUID for the instance
- **project_id**: UUID for the project
Response status codes
**********************

@ -16,6 +16,162 @@ JSON like that
"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:
.. code-block:: shell-session
# curl "http://localhost:8000/v1/version"
{
"version": "1.3.dev1"
}
The next step is to create a project.
.. code-block:: shell-session
# curl -X POST "http://localhost:8000/v1/projects" -d "{}"
{
"project_id": "42f9feee-3217-4104-981e-85d5f0a806ec",
"temporary": false
}
With this project id we can now create two VPCS VM.
.. code-block:: shell-session
# curl -X POST "http://localhost:8000/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:8000/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.
.. code-block:: shell-session
# curl -X POST "http://localhost:8000/v1/ports/udp" -d '{}'
{
"udp_port": 10000
}
# curl -X POST "http://localhost:8000/v1/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.
.. code-block:: shell-session
# curl -X POST "http://localhost:8000/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:8000/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
.. code-block:: shell-session
# curl -X POST "http://localhost:8000/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms/24d2e16b-fbef-4259-ae34-7bc21a41ee28/start" -d "{}"
# curl -X POST "http://localhost:8000/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.
.. code-block:: shell-session
# 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
============

Loading…
Cancel
Save