/virtualbox/{uuid}/ports/{port_id:d+}/nio — GNS3 1.3.dev1 documentation

### Navigation

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

# /virtualbox/{uuid}/ports/{port_id:d+}/nio

Contents

- /virtualbox/{uuid}/ports/{port_id:d+}/nio
  - POST /virtualbox/{uuid}/ports/{port_id:d+}/nio
    - Parameters
    - Response status codes
    - Sample session
  - DELETE /virtualbox/{uuid}/ports/{port_id:d+}/nio
    - Parameters
    - Response status codes
    - Sample session

## POST /virtualbox/{uuid}/ports/{port_id:d+}/nio

Add a NIO to a VirtualBox VM instance

### Parameters

- uuid: Instance UUID
- port_id: ID of the port where the nio should be added

### Response status codes

- 400: Invalid instance UUID
- 201: NIO created
- 404: Instance doesn’t exist

### Sample session

    curl -i -X POST 'http://localhost:8000/virtualbox/{uuid}/ports/{port_id:\d+}/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}'

    POST /virtualbox/{uuid}/ports/{port_id:\d+}/nio HTTP/1.1
    {
        "lport": 4242,
        "rhost": "127.0.0.1",
        "rport": 4343,
        "type": "nio_udp"
    }

    HTTP/1.1 201
    CONNECTION: keep-alive
    CONTENT-LENGTH: 89
    CONTENT-TYPE: application/json
    DATE: Thu, 08 Jan 2015 16:09:15 GMT
    SERVER: Python/3.4 GNS3/1.3.dev1
    X-ROUTE: /virtualbox/{uuid}/ports/{port_id:\d+}/nio

    {
        "lport": 4242,
        "rhost": "127.0.0.1",
        "rport": 4343,
        "type": "nio_udp"
    }

## DELETE /virtualbox/{uuid}/ports/{port_id:d+}/nio

Remove a NIO from a VirtualBox VM instance

### Parameters

- uuid: Instance UUID
- port_id: ID of the port from where the nio should be removed

### Response status codes

- 400: Invalid instance UUID
- 404: Instance doesn’t exist
- 204: NIO deleted

### Sample session

    curl -i -X DELETE 'http://localhost:8000/virtualbox/{uuid}/ports/{port_id:\d+}/nio'

    DELETE /virtualbox/{uuid}/ports/{port_id:\d+}/nio HTTP/1.1

    HTTP/1.1 204
    CONNECTION: keep-alive
    CONTENT-LENGTH: 0
    DATE: Thu, 08 Jan 2015 16:09:15 GMT
    SERVER: Python/3.4 GNS3/1.3.dev1
    X-ROUTE: /virtualbox/{uuid}/ports/{port_id:\d+}/nio

### Navigation

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