IP Management API v2

IPs

The IP resources are IPs connected to one of your bare metal server or cloud instances. You can manage your IPs via this resource (change the reverse lookup for example).

GEThttps://api.leaseweb.com/ipMgmt/v2/ips
REQUEST EXAMPLE
curl --request GET \
  --url https://api.leaseweb.com/ipMgmt/v2/ips \
  --header 'X-LSW-Auth: 213423-2134234-234234-23424'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.leaseweb.com/ipMgmt/v2/ips",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "X-LSW-Auth: 213423-2134234-234234-23424"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

headers = { 'X-LSW-Auth': "213423-2134234-234234-23424" }

conn.request("GET", "/ipMgmt/v2/ips", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.leaseweb.com/ipMgmt/v2/ips")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["X-LSW-Auth"] = '213423-2134234-234234-23424'

response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
200 OK
{
  "ips":
  [
    {
      "ip": "192.0.2.1",
      "version": 4,
      "type": "NORMAL_IP",
      "prefixLength": 32,
      "primary": true,
      "reverseLookup": "mydomain1.example.com",
      "nullRouted": false,
      "unnullingAllowed": false,
      "equipmentId": "1234",
      "assignedContract": {
        "id": "5643634"
      },
      "subnet": {
        "id": "192.0.2.0_24",
        "networkIp": "192.0.2.0",
        "prefixLength": 24,
        "gateway": "192.0.2.254"
      }
    },
    {
      "ip": "192.0.2.2",
      "version": 4,
      "type": "NORMAL_IP",
      "prefixLength": 32,
      "primary": false,
      "reverseLookup": "mydomain2.example.com",
      "nullRouted": false,
      "unnullingAllowed": false,
      "equipmentId": "1235",
      "assignedContract": {
        "id": "4363465"
      },
      "subnet": {
        "id": "192.0.2.0_24",
        "networkIp": "192.0.2.0",
        "prefixLength": 24,
        "gateway": "192.0.2.254"
      }
    }
  ],
  "_metadata": {
    "totalCount": 2,
    "offset": 0,
    "limit": 50
  }
}

GETGet all your IPs

To retrieve a list of all of your IPs, send a GET request to /v2/ips.

The response will be a JSON object with key ips containing an array of your IPs, each of which contain the standard IP attributes:

Name Type Description
ip string IP address
version integer Protocol version (4 or 6)
type string Type of the IP (NORMAL_IP, NETWORK, BROADCAST, GATEWAY, ROUTER1, ROUTER2, IPMI)
prefixLength integer Prefix length of the IP range represented by the record. Note: this is not the same as subnet.prefixLength.
reverseLookup string Reverse lookup set for the IP
nullRouted boolean Boolean to indicate if the IP is null-routed
unnullingAllowed boolean Boolean indicating if the null route can be removed
primary boolean Boolean indicating if this is the primary IP of the assigned equipment
equipmentId string ID of the equipment using the IP
assignedContract object Object containing information about the contract connected to the IP
subnet object Object containing information about the network and gateway

The assignedContract object contains the following attributes:

Name Type Description
id string ID of the contract connected to the IP

The subnet object contains the following attributes:

Name Type Description
id string Subnet identifier consisting of network IP and prefix length separated by underscore (e.g. 192.0.2.0_24)
networkIp string Network IP of the subnet
prefixLength integer Address prefix length
gateway string The gateway IP to be used in network settings

You can use the following query parameters:

Name Type Description
subnetId string Filter by subnet
version integer Filter by protocol version (4 or 6)
type string Filter by IP type
nullRouted boolean Filter by whether or not the IP has an active null route (true or false)
primary boolean Filter by whether or not the IP is primary (true or false)
fromIp string Return only IPs greater or equal to the specified address
toIp string Return only IPs lower or equal to the specified address
ips string Return only IPs specified as a comma-separated list
equipmentIds string Return only IPs assigned to equipment items specified as a comma-separated list of IDs
assignedContractIds string Return only IPs assigned to contracts specified as a comma-separated list of IDs
sort string Comma-separated list of sort field names. Prepend the field name with '-' for descending order. E.g. sort=ip,-nullrouted. Sortable field names are ip, nullRouted, reverseLookup.
offset integer Skip the specified number records in the results
limit integer Limit the results to the specified number of records

The following query string parameters are available:

Name Example Description
limit Maximum number of results
offset Offset of the first result
subnetId 192.0.2.0_24 Filter by subnet
version 4 Filter by protocol version (4 or 6)
type NORMAL_IP Filter by IP type
nullRouted true Filter by whether or not the IP has an active null route (true or false)
primary true Filter by whether or not the IP is primary (true or false)
fromIp 192.0.2.0 Return only IPs greater or equal to the specified address
toIp 192.0.2.127 Return only IPs lower or equal to the specified address
ips 192.0.2.1,192.0.2.2 Return only IPs specified as a comma-separated list
equipmentIds 10001,10002,10003 Return only IPs assigned to equipment items specified as a comma-separated list of IDs
assignedContractIds 5643634,185698,123456 Return only IPs assigned to contracts specified as a comma-separated list of IDs
sort ip,-nullrouted Comma-separated list of sort field names. Prepend the field name with '-' for descending order. E.g. `sort=ip,-nullrouted`. Sortable field names are ip, nullRouted, reverseLookup.
GEThttps://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1
REQUEST EXAMPLE
curl --request GET \
  --url https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1 \
  --header 'X-LSW-Auth: 213423-2134234-234234-23424'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "X-LSW-Auth: 213423-2134234-234234-23424"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

headers = { 'X-LSW-Auth': "213423-2134234-234234-23424" }

conn.request("GET", "/ipMgmt/v2/ips/192.0.2.1", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["X-LSW-Auth"] = '213423-2134234-234234-23424'

response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
200 OK
{
  "ip": "192.0.2.1",
  "version": 4,
  "type": "NORMAL_IP",
  "prefixLength": 32,
  "primary": true,
  "reverseLookup": "mydomain1.example.com",
  "nullRouted": false,
  "unnullingAllowed": false,
  "equipmentId": "1234",
  "assignedContract": {
    "id": "5643634"
  },
  "subnet": {
    "id": "192.0.2.0_24",
    "networkIp": "192.0.2.0",
    "prefixLength": 24,
    "gateway": "192.0.2.254"
  }
}

GETGet a single IP

To retrieve a single IP resource, send a GET request to /v2/ips/{ipAddress}.

The response will be a JSON object with key ip containing the standard IP attributes:

Name Type Description
ip string IP address
version integer Protocol version (4 or 6)
type string Type of the IP (NORMAL_IP, NETWORK, BROADCAST, GATEWAY, ROUTER1, ROUTER2, IPMI)
prefixLength integer Prefix length of the IP range represented by the record. Note: this is not the same as subnet.prefixLength.
reverseLookup string Reverse lookup set for the IP
nullRouted boolean Boolean to indicate if the IP is null-routed
unnullingAllowed boolean Boolean indicating if the null route can be removed
primary boolean Boolean indicating if this is the primary IP of the assigned equipment
equipmentId string ID of the equipment using the IP
assignedContract object Object containing information about the contract connected to the IP
subnet object Object containing information about the network and gateway

The assignedContract object contains the following attributes:

Name Type Description
id string ID of the contract connected to the IP

The subnet object contains the following attributes:

Name Type Description
id string Subnet identifier consisting of network IP and prefix length separated by underscore (e.g. 192.0.2.0_24)
networkIp string Network IP of the subnet
prefixLength integer Address prefix length
gateway string The gateway IP to be used in network settings
PUThttps://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1
REQUEST EXAMPLE
curl --request PUT \
  --url https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1 \
  --header 'X-LSW-Auth: 213423-2134234-234234-23424' \
  --header 'content-type: application/json' \
  --data '{
  "reverseLookup": "mydomain1.example.com"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{  \"reverseLookup\": \"mydomain1.example.com\"}",
  CURLOPT_HTTPHEADER => array(
    "X-LSW-Auth: 213423-2134234-234234-23424",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

payload = "{  \"reverseLookup\": \"mydomain1.example.com\"}"

headers = {
    'X-LSW-Auth': "213423-2134234-234234-23424",
    'content-type': "application/json"
    }

conn.request("PUT", "/ipMgmt/v2/ips/192.0.2.1", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["X-LSW-Auth"] = '213423-2134234-234234-23424'
request["content-type"] = 'application/json'
request.body = "{  \"reverseLookup\": \"mydomain1.example.com\"}"

response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
200 OK
{
  "ip": "192.0.2.1",
  "version": 4,
  "type": "NORMAL_IP",
  "prefixLength": 32,
  "primary": true,
  "reverseLookup": "mydomain1.example.com",
  "nullRouted": false,
  "unnullingAllowed": false,
  "equipmentId": "1234",
  "assignedContract": {
    "id": "5643634"
  },
  "subnet": {
    "id": "192.0.2.0_24",
    "networkIp": "192.0.2.0",
    "prefixLength": 24,
    "gateway": "192.0.2.254"
  }
}

PUTUpdate reverse lookup

To update the reverse lookup, send a PUT request to /v2/ips/{ipAddress}. The request body must be a JSON object containing the following attributes:

Name Type Description
reverseLookup string The reverse lookup for the IP address
POSThttps://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/nullRoute
REQUEST EXAMPLE
curl --request POST \
  --url https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/nullRoute \
  --header 'X-LSW-Auth: 213423-2134234-234234-23424' \
  --header 'content-type: application/json' \
  --data '{
  "automatedUnnullingAt": "2015-06-25T11:13:00Z",
  "ticketId": "188612",
  "comment": "This IP is evil"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/nullRoute",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{  \"automatedUnnullingAt\": \"2015-06-25T11:13:00Z\",  \"ticketId\": \"188612\",  \"comment\": \"This IP is evil\"}",
  CURLOPT_HTTPHEADER => array(
    "X-LSW-Auth: 213423-2134234-234234-23424",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

payload = "{  \"automatedUnnullingAt\": \"2015-06-25T11:13:00Z\",  \"ticketId\": \"188612\",  \"comment\": \"This IP is evil\"}"

headers = {
    'X-LSW-Auth': "213423-2134234-234234-23424",
    'content-type': "application/json"
    }

conn.request("POST", "/ipMgmt/v2/ips/192.0.2.1/nullRoute", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/nullRoute")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["X-LSW-Auth"] = '213423-2134234-234234-23424'
request["content-type"] = 'application/json'
request.body = "{  \"automatedUnnullingAt\": \"2015-06-25T11:13:00Z\",  \"ticketId\": \"188612\",  \"comment\": \"This IP is evil\"}"

response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
201 Created
{
  "id": "4534536",
  "ip": "192.0.2.1",
  "nulledAt": "2015-06-28T12:00:00Z",
  "nulledBy": "john.doe@example.com",
  "nullLevel": 1,
  "automatedUnnullingAt": "2015-06-25T11:13:00Z",
  "unnulledAt": null,
  "unnulledBy": null,
  "ticketId": "188612",
  "comment": "This IP is evil",
  "equipmentId": "456",
  "assignedContract": {
    "id": "123456"
  }
}

POSTCreate null route

To create a null-route for an IP address, send a POST request to /v2/ips/{ipAddress}/nullRoute. The request body must be a JSON object and may contain following attributes:

Name Type Description
automatedUnnullingAt string The date and time when the null route is to be deactivated. The date and time should be specified using the format yyyy-mm-ddThh:mm:ss±hh:mm (with time zone designator) or yyyy-mm-ddThh:mm:ssZ (UTC). If this field is not present then the null route will not be automatically removed.
comment string A comment to be stored with the null route (e.g. null route reason)
ticketId string A reference to be stored with the null route

All attributes are optional.

DELETEhttps://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/nullRoute
REQUEST EXAMPLE
curl --request DELETE \
  --url https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/nullRoute \
  --header 'X-LSW-Auth: 213423-2134234-234234-23424'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/nullRoute",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "X-LSW-Auth: 213423-2134234-234234-23424"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

headers = { 'X-LSW-Auth': "213423-2134234-234234-23424" }

conn.request("DELETE", "/ipMgmt/v2/ips/192.0.2.1/nullRoute", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/nullRoute")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["X-LSW-Auth"] = '213423-2134234-234234-23424'

response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
200 OK

Null-route successfully deleted

DELETERemove null route

To remove a null-route for an IP address, send a DELETE request to /v2/ips/{ipAddress}/nullRoute.

Null Route History

This API can be used to get history information about null routes.

GEThttps://api.leaseweb.com/ipMgmt/v2/nullRoutes
REQUEST EXAMPLE
curl --request GET \
  --url https://api.leaseweb.com/ipMgmt/v2/nullRoutes \
  --header 'X-LSW-Auth: 213423-2134234-234234-23424'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.leaseweb.com/ipMgmt/v2/nullRoutes",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "X-LSW-Auth: 213423-2134234-234234-23424"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

headers = { 'X-LSW-Auth': "213423-2134234-234234-23424" }

conn.request("GET", "/ipMgmt/v2/nullRoutes", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.leaseweb.com/ipMgmt/v2/nullRoutes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["X-LSW-Auth"] = '213423-2134234-234234-23424'

response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
200 OK
{
  "nullroutes": [
    {
      "id": "4534536",
      "ip": "192.0.2.1",
      "nulledAt": "2015-06-28T12:00:00Z",
      "nulledBy": "john.doe@example.com",
      "nullLevel": 1,
      "automatedUnnullingAt": "2015-06-28T13:00:00Z",
      "unnulledAt": null,
      "unnulledBy": null,
      "ticketId": "188612",
      "comment": "This IP is evil",
      "equipmentid": "456",
      "assignedContract": {
        "id": "123456"
      }
    },
    {
      "id": "4534535",
      "ip": "192.0.2.1",
      "nulledAt": "2015-06-27T12:00:00Z",
      "nulledBy": "john.doe@example.com",
      "nullLevel": 1,
      "automatedUnnullingAt": "2015-06-27T13:00:00Z",
      "unnulledAt": "2015-06-27T13:00:05Z",
      "unnulledBy": "UnnullRunner",
      "ticketId": "188612",
      "comment": "This IP is evil",
      "equipmentId": "456",
      "assignedContract": {
        "id": "123456"
      }
    }
  ],
  "_metadata": {
    "totalCount": 2,
    "offset": 0,
    "limit": 50
  }
}

GETGet null route history

To retrieve a history of null routes for your IPs, send a GET request to /v2/nullRoutes.

The response will be a JSON object with key nullroutes containing an array of objects representing null routes, each of which contains the standard null route attributes:

Name Type Description
id string Null route ID
ip string IP address
nulledAt string Null route date in UTC in format yyyy-mm-ddThh:mm:ssZ
nulledBy string Email address of the user who created the null route or 'LeaseWeb' if null route was created by LeaseWeb
nullLevel integer Null route permission level. If greater than 1 then the null route can only be removed by LeaseWeb.
automatedUnnullingAt string The date and time when the null route is to be automatically removed
unnulledAt string The date and time when the null route has been removed. If null then the null route is still active.
unnulledBy string Email address of the user who removed the null route or 'LeaseWeb' if null route was removed by LeaseWeb
ticketId string Reference stored with the null route
comment string Comment stored with the null route
equipmentId string ID of the equipment which was assigned to the IP at the time of null route creation
assignedContract object Object describing the contract which was assigned to the IP at the time of null route creation

The assignedContract object contains the following attributes:

Name Type Description
id string ID of the contract connected to the IP

You can use the following query parameters:

Name Type Description
fromIp string Return only null routes of IPs greater or equal to the specified address
toIp string Return only null routes of IPs lower or equal to the specified address
fromDate string Return only null routes active after the specified date and time
toDate string Return only null routes active before the specified date and time
nulledBy string Filter by the email address of the user who created the null route
unnulledBy string Filter by the email address of the user who removed the null route
ticketId string Filter by the reference stored with the null route
contractId string Filter by ID of the contract assigned to the IP at the time of null route creation
equipmentId string Filter by ID of the equipment assigned to the IP at the time of null route creation
sort string Comma-separated list of sort field names. Prepend the field name with '-' for descending order. E.g. sort=ip,-nulledAt. Sortable field names are id, ip, nulledAt, nulledBy, automatedUnnullingAt, unnulledAt, unnulledBy, nullLevel, ticketId.
offset integer Skip the specified number records in the results
limit integer Limit the results to the specified number of records

The following query string parameters are available:

Name Example Description
limit Maximum number of results
offset Offset of the first result
fromIp 192.0.2.0 Return only null routes of IPs greater or equal to the specified address
toIp 192.0.2.127 Return only null routes of IPs lower or equal to the specified address
fromDate 2015-06-28T12:00:00Z Return only null routes active after the specified date and time
toDate 2015-06-28T13:00:00Z Return only null routes active before the specified date and time
nulledBy john.doe@example.com Filter by the email address of the user who created the null route
unnulledBy john.doe@example.com Filter by the email address of the user who removed the null route
ticketId 188612 Filter by the reference stored with the null route
contractId 123456 Filter by ID of the contract assigned to the IP at the time of null route creation
equipmentId 456 Filter by ID of the server assigned to the IP at the time of null route creation
sort ip,-nulledAt Comma-separated list of sort field names. Prepend the field name with '-' for descending order. E.g. `sort=ip,-nulledAt`. Sortable field names are id, ip, nulledAt, nulledBy, automatedUnnullingAt, unnulledAt, unnulledBy, nullLevel, ticketId.
GEThttps://api.leaseweb.com/ipMgmt/v2/nullRoutes/453453
REQUEST EXAMPLE
curl --request GET \
  --url https://api.leaseweb.com/ipMgmt/v2/nullRoutes/453453 \
  --header 'X-LSW-Auth: 213423-2134234-234234-23424'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.leaseweb.com/ipMgmt/v2/nullRoutes/453453",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "X-LSW-Auth: 213423-2134234-234234-23424"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

headers = { 'X-LSW-Auth': "213423-2134234-234234-23424" }

conn.request("GET", "/ipMgmt/v2/nullRoutes/453453", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.leaseweb.com/ipMgmt/v2/nullRoutes/453453")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["X-LSW-Auth"] = '213423-2134234-234234-23424'

response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
200 OK
{
  "id": "4534536",
  "ip": "192.0.2.1",
  "nulledAt": "2015-06-28T12:00:00Z",
  "nulledBy": "john.doe@example.com",
  "nullLevel": 1,
  "automatedUnnullingAt": "2015-06-25T11:13:00Z",
  "unnulledAt": null,
  "unnulledBy": null,
  "ticketId": "188612",
  "comment": "This IP is evil",
  "equipmentId": "456",
  "assignedContract": {
    "id": "123456"
  }
}

GETGet a specific null route history item

To retrieve a null route history item by ID, send a GET request to /v2/nullRoutes/{id}, replacing {id} with the id attribute of the null route.

The response will be a JSON object which contains the standard null route attributes:

Name Type Description
id string Null route ID
ip string IP address
nulledAt string Null route date in UTC in format yyyy-mm-ddThh:mm:ssZ
nulledBy string Email address of the user who created the null route or 'LeaseWeb' if null route was created by LeaseWeb
nullLevel integer Null route permission level. If greater than 1 then the null route can only be removed by LeaseWeb.
automatedUnnullingAt string The date and time when the null route is to be automatically removed
unnulledAt string The date and time when the null route has been removed. If null then the null route is still active.
unnulledBy string Email address of the user who removed the null route or 'LeaseWeb' if null route was removed by LeaseWeb
ticketId string Reference stored with the null route
comment string Comment stored with the null route
equipmentId string ID of the equipment which was assigned to the IP at the time of null route creation
assignedContract object Object describing the contract which was assigned to the IP at the time of null route creation

The assignedContract object contains the following attributes:

Name Type Description
id string ID of the contract connected to the IP
PUThttps://api.leaseweb.com/ipMgmt/v2/nullRoutes/453453
REQUEST EXAMPLE
curl --request PUT \
  --url https://api.leaseweb.com/ipMgmt/v2/nullRoutes/453453 \
  --header 'X-LSW-Auth: 213423-2134234-234234-23424' \
  --header 'content-type: application/json' \
  --data '{
  "automatedUnnullingAt": "2015-06-25T11:13:00Z",
  "ticketId": "188612",
  "comment": "This IP is evil"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.leaseweb.com/ipMgmt/v2/nullRoutes/453453",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{  \"automatedUnnullingAt\": \"2015-06-25T11:13:00Z\",  \"ticketId\": \"188612\",  \"comment\": \"This IP is evil\"}",
  CURLOPT_HTTPHEADER => array(
    "X-LSW-Auth: 213423-2134234-234234-23424",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

payload = "{  \"automatedUnnullingAt\": \"2015-06-25T11:13:00Z\",  \"ticketId\": \"188612\",  \"comment\": \"This IP is evil\"}"

headers = {
    'X-LSW-Auth': "213423-2134234-234234-23424",
    'content-type': "application/json"
    }

conn.request("PUT", "/ipMgmt/v2/nullRoutes/453453", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.leaseweb.com/ipMgmt/v2/nullRoutes/453453")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["X-LSW-Auth"] = '213423-2134234-234234-23424'
request["content-type"] = 'application/json'
request.body = "{  \"automatedUnnullingAt\": \"2015-06-25T11:13:00Z\",  \"ticketId\": \"188612\",  \"comment\": \"This IP is evil\"}"

response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
200 OK
{
  "id": "4534536",
  "ip": "192.0.2.1",
  "nulledAt": "2015-06-28T12:00:00Z",
  "nulledBy": "john.doe@example.com",
  "nullLevel": 1,
  "automatedUnnullingAt": "2015-06-25T11:13:00Z",
  "unnulledAt": null,
  "unnulledBy": null,
  "ticketId": "188612",
  "comment": "This IP is evil",
  "equipmentId": "456",
  "assignedContract": {
    "id": "123456"
  }
}

PUTUpdate a null route

To modify an active null route, send a PUT request to /v2/nullRoutes/{id}, replacing {id} with the id attribute of the null route. The request body must be a JSON object and may contain the following attributes:

Name Type Description
automatedUnnullingAt string The date and time when the null route is to be deactivated. The date and time should be specified using the format yyyy-mm-ddThh:mm:ss±hh:mm (with time zone designator) or yyyy-mm-ddThh:mm:ssZ (UTC). If this field is set to null then the null route will not be automatically removed.
comment string A comment to be stored with the null route (e.g. null route reason)
ticketId string A reference to be stored with the null route

All attributes are optional. Only the attributes which are present in the JSON object will be modified. Other null route attributes will remain unchanged.