The base URL for this API is: https://api.leaseweb.com/ipMgmt/v2/
The API uses standard HTTP status codes to indicate the success or failure of the API call. The response will be JSON. Most APIs use the following format:
{
"errorCode": "APP00800",
"errorMessage": "The connection with the DB cannot be established.",
"correlationId": "550e8400-e29b-41d4-a716-446655440000",
"userMessage": "Cannot handle your request at the moment. Please try again later.",
"reference": "https://developer.leaseweb.com/errors/APP00800"
}
Authentication for the APIs is required. To authenticate your call, you will need to sent your API key as X-LSW-Auth
header.
You can generate API keys in the Customer Portal.
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
subnetId | string Filter by subnet |
version | integer Enum: 4 6 Filter by protocol version |
type | string Enum: "NORMAL_IP" "NETWORK" "BROADCAST" "GATEWAY" "ROUTER1" "ROUTER2" "IPMI" 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. |
reverseLookup | string Example: reverseLookup=mydomain1.example.com Filter by reverse lookup. |
curl --request GET \ --url 'https://api.leaseweb.com/ipMgmt/v2/ips?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&subnetId=SOME_STRING_VALUE&version=SOME_INTEGER_VALUE&type=SOME_STRING_VALUE&nullRouted=SOME_BOOLEAN_VALUE&primary=SOME_BOOLEAN_VALUE&fromIp=SOME_STRING_VALUE&toIp=SOME_STRING_VALUE&ips=SOME_STRING_VALUE&equipmentIds=SOME_STRING_VALUE&assignedContractIds=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&reverseLookup=SOME_STRING_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "totalCount": 2,
- "offset": 0,
- "limit": 50
}, - "ips": [
- {
- "ip": "192.0.2.1",
- "version": 4,
- "type": "NORMAL_IP",
- "prefixLength": 32,
- "primary": true,
- "reverseLookup": "mydomain1.example.com",
- "nullRouted": false,
- "nullLevel": null,
- "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,
- "nullLevel": null,
- "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"
}
}
]
}
ip required | string Example: 192.0.2.1 IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6). PrefixLength is mandatory for IP range, for example, the IPv6 address range with prefixLength = 112 |
curl --request GET \ --url https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "ip": "192.0.2.1",
- "version": 4,
- "type": "NORMAL_IP",
- "prefixLength": 32,
- "primary": true,
- "reverseLookup": "mydomain1.example.com",
- "nullRouted": false,
- "nullLevel": null,
- "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"
}
}
Use this operation to set reverse lookup for IPv4 IP addresses.
ip required | string <ipv4> IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 |
reverseLookup required | string |
{- "reverseLookup": "mydomain1.example.com"
}
{- "ip": "192.0.2.1",
- "version": 4,
- "type": "NORMAL_IP",
- "prefixLength": 32,
- "primary": true,
- "reverseLookup": "mydomain1.example.com",
- "nullRouted": false,
- "nullLevel": null,
- "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"
}
}
Get reverse lookup values set for IPs in the specified range
ip required | string Example: 192.0.2.1 IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6). PrefixLength is mandatory for IP range, for example, the IPv6 address range with prefixLength = 112 |
ip | string Filter the list by IP address |
reverseLookup | string Example: reverseLookup=mydomain1.example.com Filter by reverse lookup. |
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
curl --request GET \ --url 'https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/reverseLookup?ip=SOME_STRING_VALUE&reverseLookup=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "totalCount": 3,
- "offset": 0,
- "limit": 2
}, - "reverseLookups": [
- {
- "ip": "2001:db8::0",
- "reverseLookup": "name1.example.com"
}, - {
- "ip": "2001:db8::1",
- "reverseLookup": "name2.example.com"
}
]
}
This endpoint allows to set or unset reverse lookup for multiple IPv6 IPs in a specific IP range. To remove reverse lookup for an IP address set it to null
or ""
.
Reverse lookup values of IPs not listed in the request body will not be affected.
You can set up to 20 records in a single request.
ip required | string Example: 192.0.2.1 IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6). PrefixLength is mandatory for IP range, for example, the IPv6 address range with prefixLength = 112 |
required | Array of objects (reverseLookup) |
{- "reverseLookups": [
- {
- "ip": "2001:db8::0",
- "reverseLookup": "name1.example.com"
}, - {
- "ip": "2001:db8::1",
- "reverseLookup": "name2.example.com"
}
]
}
{- "reverseLookups": [
- {
- "ip": "2001:db8::0",
- "reverseLookup": "name1.example.com"
}, - {
- "ip": "2001:db8::1",
- "reverseLookup": "name2.example.com"
}
]
}
ip required | string Example: 192.0.2.1 IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6). PrefixLength is mandatory for IP range, for example, the IPv6 address range with prefixLength = 112 |
automatedUnnullingAt | string <date-time> 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 |
{- "automatedUnnullingAt": "2015-06-25T11:13:00Z",
- "comment": "This IP is evil",
- "ticketId": "188612"
}
{- "assignedContract": {
- "id": "123456"
}, - "automatedUnnullingAt": "2015-06-25T11:13:00Z",
- "comment": "This IP is evil",
- "equipmentId": "456",
- "id": "4534536",
- "ip": "192.0.2.1",
- "nullLevel": 1,
- "nulledAt": "2015-06-28T12:00:00Z",
- "nulledBy": "john.doe@example.com",
- "ticketId": "188612",
- "unnulledAt": null,
- "unnulledBy": null
}
ip required | string Example: 192.0.2.1 IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6). PrefixLength is mandatory for IP range, for example, the IPv6 address range with prefixLength = 112 |
curl --request DELETE \ --url https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/nullRoute \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "401",
- "errorMessage": "You are not authorized to view this resource."
}
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
fromIp | string Return only IPs greater or equal to the specified address |
toIp | string Return only IPs lower or equal to the specified address |
fromDate | string <date> Return only null routes active after the specified date and time |
toDate | string <date> 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 server 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. |
curl --request GET \ --url 'https://api.leaseweb.com/ipMgmt/v2/nullRoutes?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&fromIp=SOME_STRING_VALUE&toIp=SOME_STRING_VALUE&fromDate=SOME_STRING_VALUE&toDate=SOME_STRING_VALUE&nulledBy=SOME_STRING_VALUE&unnulledBy=SOME_STRING_VALUE&ticketId=SOME_STRING_VALUE&contractId=SOME_STRING_VALUE&equipmentId=SOME_STRING_VALUE&sort=SOME_STRING_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "totalCount": 2,
- "offset": 0,
- "limit": 50
}, - "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"
}
}
]
}
id required | string Example: 23234 Null route ID |
curl --request GET \ --url https://api.leaseweb.com/ipMgmt/v2/nullRoutes/%7Bid%7D \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "assignedContract": {
- "id": "123456"
}, - "automatedUnnullingAt": "2015-06-25T11:13:00Z",
- "comment": "This IP is evil",
- "equipmentId": "456",
- "id": "4534536",
- "ip": "192.0.2.1",
- "nullLevel": 1,
- "nulledAt": "2015-06-28T12:00:00Z",
- "nulledBy": "john.doe@example.com",
- "ticketId": "188612",
- "unnulledAt": null,
- "unnulledBy": null
}
id required | string Example: 23234 Null route ID |
automatedUnnullingAt | string <date-time> 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 |
{- "automatedUnnullingAt": "2015-06-25T11:13:00Z",
- "comment": "This IP is evil",
- "ticketId": "188612"
}
{- "assignedContract": {
- "id": "123456"
}, - "automatedUnnullingAt": "2015-06-25T11:13:00Z",
- "comment": "This IP is evil",
- "equipmentId": "456",
- "id": "4534536",
- "ip": "192.0.2.1",
- "nullLevel": 1,
- "nulledAt": "2015-06-28T12:00:00Z",
- "nulledBy": "john.doe@example.com",
- "ticketId": "188612",
- "unnulledAt": null,
- "unnulledBy": null
}