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

### Navigation

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

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

Contents

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

## 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
vm_id | ✔ | string | VPCS VM UUID

### Sample session

    curl -i -X GET 'http://localhost:8000/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/6f3c227f-86f5-4f54-bc4b-74597744b904'

    GET /projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/6f3c227f-86f5-4f54-bc4b-74597744b904 HTTP/1.1

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

    {
        "console": 2009,
        "name": "PC TEST 1",
        "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
        "startup_script": null,
        "startup_script_path": null,
        "vm_id": "6f3c227f-86f5-4f54-bc4b-74597744b904"
    }

## 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
vm_id | ✔ | string | VPCS VM UUID

### Sample session

    curl -i -X PUT 'http://localhost:8000/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/39951883-cbfb-4aff-9cbc-06895749e571' -d '{"console": 2011, "name": "test", "startup_script": "ip 192.168.1.1"}'

    PUT /projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/39951883-cbfb-4aff-9cbc-06895749e571 HTTP/1.1
    {
        "console": 2011,
        "name": "test",
        "startup_script": "ip 192.168.1.1"
    }

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

    {
        "console": 2011,
        "name": "test",
        "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
        "startup_script": "ip 192.168.1.1",
        "startup_script_path": "startup.vpc",
        "vm_id": "39951883-cbfb-4aff-9cbc-06895749e571"
    }

## 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/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/879f1789-bde0-4e64-ac68-f61a9b114347'

    DELETE /projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/vms/879f1789-bde0-4e64-ac68-f61a9b114347 HTTP/1.1

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

### Navigation

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