REST - IP addresses

Listing IP Addresses

Request

GET /v2/ipv4-addresses/

Returns an array with a list of existing IP addresses.

Response

{
    "success": true,
    "ipv4_addresses": [
        {
            "id": "$ip_id",
            "ipv4_address": "$ip_address",
            "cost_per_hour": "$cost_per_hour",
            "owner": {
                "id": "$owner_id",
                "name": "$owner_name"
            },
            "zone": {
                "id": "$zone_id",
                "name": "$zone_name"
            },
            "virtual_machine": {
                "id": "$vm_id",
                "label": "$vm_name"
            },
            "attach_time": "$ip_date",
            "dhcp": $ip_dhcp
        }
  ]
}   

Returned information

  • $ip_id (string) - UUID of the IP address
  • $ip_address (string) - IP address
  • $cost_per_hour (float) - cost of the IP address per hour
  • $owner_id (string) - UUID of the IP address owner
  • $owner_name (string) - name of the IP address owner
  • $zone_id (string) - UUID of the zone where the IP address is located
  • $zone_name (string) - name of the zone where the IP address is located
  • $vm_id (string) - UUID of the virtual server to which the IP address is connected
  • $vm_name (string) - name of the virtual server to which the IP address is connected
  • $ip_date (string) - date and time of IP address connection
  • $ip_dhcp (bool) - information whether the IP address is obtained from DHCP


Retrieving information about IP addresses

Request

GET GET /v2/ipv4-addresses/$IP_ID

Returns information about the IP address with the specified $IP_ID.

Response

{
    "success": true,
    "ipv4_address": {
        "id": "$ip_id",
        "ipv4_address": "$ip_address",
        "cost_per_hour": "$cost_per_hour",
        "owner": {
            "id": "$owner_id",
            "name": "$owner_name"
        },
        "zone": {
            "id": "$zone_id",
            "name": "$zone_name"
        },
        "virtual_machine": {
            "id": "$vm_id",
            "label": "$vm_name"
        },
        "attach_time": "$ip_date",
        "dhcp": $ip_dhcp
    }
}   

Returned information

  • $ip_id (string) - UUID of the IP address
  • $ip_address (string) - IP address
  • $cost_per_hour (float) - cost of the IP address per hour
  • $owner_id (string) - UUID of the IP address owner
  • $owner_name (string) - name of the IP address owner
  • $zone_id (string) - UUID of the zone where the IP address is located
  • $zone_name (string) - name of the zone where the IP address is located
  • $vm_id (string) - UUID of the virtual server to which the IP address is connected
  • $vm_name (string) - name of the virtual server to which the IP address is connected
  • $ip_date (string) - date and time of IP address connection
  • $ip_dhcp (bool) - information whether the IP address is obtained from DHCP or not


Adding IP Address

Request

PUT /v2/ipv4-addresses

Request content

{
  "zone_id": "$zone_id"
}

Parameter description

  • $zone_id (string) - UUID of the zone where the IP address should be located

Response

{
    "success": true,
    "ipv4_address": {
        "id": "$ip_id",
        "ipv4_address": "$ip_address",
        "cost_per_hour": "$cost_per_hour",
        "owner": {
            "id": "$owner_id",
            "name": "$owner_name"
        },
        "zone": {
            "id": "$zone_id",
            "name": "$zone_name"
        },
        "virtual_machine": {
            "id": "$vm_id",
            "label": "$vm_name"
        },
        "attach_time": "$ip_date",
        "dhcp": $ip_dhcp
    }
}   

Returned information

  • $ip_id (string) - UUID of the IP address
  • $ip_address (string) - IP address
  • $cost_per_hour (float) - cost of the IP address per hour
  • $owner_id (string) - UUID of the IP address owner
  • $owner_name (string) - name of the IP address owner
  • $zone_id (string) - UUID of the zone where the IP address is located
  • $zone_name (string) - name of the zone where the IP address is located
  • $vm_id (string) - UUID of the virtual server to which the IP address is connected
  • $vm_name (string) - name of the virtual server to which the IP address is connected
  • $ip_date (string) - date and time of IP address connection
  • $ip_dhcp (bool) - information whether the IP address is obtained from DHCP or not


Retrieving information about IP address

Request

POST /v2/ipv4-addresses/$IP_ID/attach

Connecting the IP address with ID $IP_ID, to the virtual server.

Request content

{
   "virtual_machine_id": "$vm_id"
}

Parameter description

  • $vm_id (string) - UUID of the virtual server

Response

{  
  "success":true
}


Disconnecting IP address from virtual server

Request

POST /v2/ipv4-addresses/$IP_ID/detach

Adds a task to disconnect the IP address with $IP_ID from the virtual server. The IP address must be connected to a virtual server for the operation to succeed.

Response

{  
  "success":true
}


Deleting IP address

Request

DELETE /v2/ipv4-addresses/$IP_ID

Adds a task to delete the IP address with $IP_ID. If the IP address is connected to a virtual server, it will automatically be disconnected from it.

Response

{  
  "success":true
}