REST - VLAN networks

Listing networks

Query

GET /v2/vlans

Returns an array with a list of existing VLAN networks.

Response

{
    "success": true,
    "vlans": [
    {
        "id": "$network_id",
        "label": "$network_label",
        "cost_per_hour": $network_cost,
        "owner": {
            "id": "$owner_id",
            "name": "$owner_name"
        },
        "zone": {
            "id": "$zone_id",
            "name": "$zone_name"
        },
        "task": [],
        "virtual_machines": [
            {
                "id": "$vm_id",
                "label": "$vm_label",
                "owner_id": "$vm_owner_id"
            }
        ]
    }, {...}
}

Returned information

  • $network_id (int) - ID of the VLAN network
  • $network_label (string) - name of the VLAN network
  • $network_cost (float) - cost of the VLAN network per hour
  • $owner_id (string) - UUID of the VLAN network owner
  • $owner_name (string) - name of the VLAN network owner
  • $zone_id (string) - UUID of the location where the VLAN network is located
  • $zone_id (string) - name of the location where the VLAN network is located
  • $vm_id (string) - UUID of the virtual machine to which the VLAN network is connected
  • $vm_label (string) - name of the virtual machine to which the VLAN network is connected
  • $vm_owner_id (string) - UUID of the owner of the virtual machine to which the VLAN network is connected


Connecting a VLAN network to a virtual server

Query

POST /v2/vlans/$NETWORK_ID/attach  

Connects the VLAN network $NETWORK_ID to the specified virtual server.

Query content

{
   "virtual_machine_id": "$virtual_machine_id"
}

Parameter description

  • $virtual_machine_id (string) - UUID of the server to which we want to connect the VLAN network

Response

{
  "success":true
}


Disconnecting a VLAN network from a virtual server

Query

POST /v2/vlans/$NETWORK_ID/detach

Disconnects the VLAN network $NETWORK_ID from the specified virtual server.

Query content

{
   "virtual_machine_id": "$virtual_machine_id"
}

Parameter description

  • $virtual_machine_id (string) - UUID of the server from which we want to disconnect the VLAN network

Response

{  
  "success":true
}