REST - VxLAN networks

Listing networks

Query

GET /v2/vxlans

Returns an array with a list of existing VxLAN networks.

Response

{
    "success": true,
    "vxlans": [
    {
        "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 (string) - UUID of the VxLAN network
  • $network_label (string) - name of the VxLAN network
  • $network_cost (float) - cost of the VxLAN network per hour
  • $owner_id (string) - UUID of the owner of the VxLAN network
  • $owner_name (string) - name of the owner of the VxLAN network
  • $zone_id (string) - UUID of the location where the VxLAN network is located
  • $zone_id (string) - name of the location where the VxLAN network is located
  • $vm_id (string) - UUID of the virtual machine to which the VxLAN network is connected
  • $vm_label (string) - name of the virtual machine to which the VxLAN network is connected
  • $vm_owner_id (string) - UUID of the owner of the virtual machine to which the VxLAN network is connected


Creating VxLAN network

Query

PUT /v2/vxlans

Query content

{
   "zone_id": "$network_zone_id",
   "label": "$network_label"
}

Parameters description

  • $network_zone_id (string) - UUID of the location where the VxLAN network is to be located
  • $network_label (string) - name of the VxLAN network

Response

{
  "success": true,
  "vlan": [
    {
      "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 (string) - UUID of the VxLAN network
  • $network_label (string) - name of the VxLAN network
  • $network_cost (float) - cost of the VxLAN network per hour
  • $owner_id (string) - UUID of the owner of the VxLAN network
  • $owner_name (string) - name of the owner of the VxLAN network
  • $zone_id (string) - UUID of the location where the VxLAN network is located
  • $zone_id (string) - name of the location where the VxLAN network is located
  • $vm_id (string) - UUID of the virtual machine to which the VxLAN network is connected
  • $vm_label (string) - name of the virtual machine to which the VxLAN network is connected
  • $vm_owner_id (string) - UUID of the owner of the virtual machine to which the VxLAN network is connected


Connecting VxLAN network to a virtual server

Query

POST /v2/vxlans/$NETWORK_ID/attach  

Connects VxLAN network $NETWORK_ID to the specified virtual server.

Query Content

{
   "virtual_machine_id": "$virtual_machine_id"
}

Parameters Description

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

Query

{
  "success":true
}


Disconnecting VxLAN network from a virtual server

Query

POST /v2/vxlans/$NETWORK_ID/detach

Disconnects VxLAN network $NETWORK_ID from the specified virtual server.

Query Content

{
   "virtual_machine_id": "$virtual_machine_id"
}

Parameters Description

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

Response

{  
  "success":true
}


Deleting VxLAN network

Query

DELETE /v2/vxlans/$NETWORK_ID

Deletes VxLAN network $NETWORK_ID.

Response

{  
  "success":true
}