The base URL for this API is: https://api.leaseweb.com/floatingIps/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" : "http://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.
A Floating IP range is bound to a particular site or metro.
If you have services in multiple data centers and want to use the Floating IP feature in each of those locations you will need to order a range per site or metro.
limit | integer Default: 10 Limit the number of results returned |
offset | integer Default: 0 Return results starting from the given offset |
type | string Enum: "SITE" "METRO" Filter ranges by range type |
location | string Filter ranges by range location |
Authentication is required.
curl --request GET \ --url 'https://api.leaseweb.com/floatingIps/v2/ranges?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&type=SOME_STRING_VALUE&location=SOME_STRING_VALUE' \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "ranges": [
- {
- "id": "88.17.0.0_17",
- "range": "88.17.0.0/17",
- "customerId": "10001234",
- "salesOrgId": "2000",
- "location": "AMS-01",
- "type": "SITE"
}, - {
- "id": "85.17.0.0_17",
- "range": "85.17.0.0/17",
- "customerId": "10001234",
- "salesOrgId": "2000",
- "location": "AMS-01",
- "type": "SITE"
}, - {
- "id": "86.17.0.0_17",
- "range": "86.17.0.0/17",
- "customerId": "10001234",
- "salesOrgId": "2000",
- "location": "AMS",
- "type": "METRO"
}
], - "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 3
}
}
A Floating IP range is identified by is network IP and the prefix length, separated by a underscore; for example 10.0.0.0_29
.
Be aware that every IP address of a Floating IP range is usable and routable. A Floating IP range does not have a network IP, broadcast IP or gateway IP.
So for every IP in the range you can create a Floating IP Definition.
rangeId required | string Example: 10.0.0.0_29 ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore) |
Authentication is required.
curl --request GET \ --url https://api.leaseweb.com/floatingIps/v2/ranges/10.0.0.0_29 \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "id": "88.17.0.0_17",
- "range": "88.17.0.0/17",
- "customerId": "10001234",
- "salesOrgId": "2000",
- "location": "AMS-01",
- "type": "SITE"
}
A Floating IP definition describes a mapping between one or more Floating IPs (a.k.a Floating IP) to an anchor IP. Traffic destined for all the Floating IPs will be rerouted to the anchor IP.
The anchor IP is an ip address that belongs to a service you have with Leaseweb. At this moment only dedicated servers, private racks and colocations are supported.
rangeId required | string Example: 10.0.0.0_29 ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore) |
limit | integer Default: 10 Limit the number of results returned |
offset | integer Default: 0 Return results starting from the given offset |
location | string Filter range definations by range location |
type | string Enum: "SITE" "METRO" Filter range definations by range type |
Authentication is required.
curl --request GET \ --url 'https://api.leaseweb.com/floatingIps/v2/ranges/10.0.0.0_29/floatingIpDefinitions?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&location=SOME_STRING_VALUE&type=SOME_STRING_VALUE' \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "floatingIpDefinitions": [
- {
- "id": "88.17.34.108_32",
- "rangeId": "88.17.0.0_17",
- "location": "AMS-01",
- "type": "SITE",
- "customerId": "10001234",
- "salesOrgId": "2000",
- "floatingIp": "88.17.34.108/32",
- "anchorIp": "95.10.126.1",
- "status": "ACTIVE",
- "createdAt": "2019-03-13T09:10:02+0000",
- "updatedAt": "2019-03-13T09:10:02+0000"
}, - {
- "id": "88.17.34.109_32",
- "rangeId": "88.17.0.0_17",
- "location": "AMS-01",
- "type": "SITE",
- "customerId": "10001234",
- "salesOrgId": "2000",
- "floatingIp": "88.17.34.109/32",
- "anchorIp": "95.10.126.12",
- "status": "ACTIVE",
- "createdAt": "2019-03-13T09:10:02+0000",
- "updatedAt": "2019-03-13T09:10:02+0000"
}, - {
- "id": "88.17.34.110_32",
- "rangeId": "88.17.0.0_17",
- "location": "AMS",
- "type": "METRO",
- "customerId": "10001234",
- "salesOrgId": "2000",
- "floatingIp": "88.17.34.110/32",
- "anchorIp": "95.10.126.11",
- "status": "ACTIVE",
- "createdAt": "2019-03-13T09:10:02+0000",
- "updatedAt": "2019-03-13T09:10:02+0000"
}
], - "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 3
}
}
When a Floating IP definition is created, the Floating IP address is then made to route all traffic to the anchor IP address, Hence all services on the server become reachable via the Floating IP. This works in the background by maintaining BGP sessions in each site which announce the Floating IP routes through the border routers.
Floating IP addresses which do not have an anchor IP address have no route, and are thus effectively nullrouted.
On the server, Floating IPs should be setup like any other additional IP address. However, the same Floating IP will have to be setup on all servers that you want to be able to route it to.
Note: Currently, Floating IPs does not work on VPS or Cloud servers.
rangeId required | string Example: 10.0.0.0_29 ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore) |
floatingIp | string The Floating IP address |
anchorIp | string The Anchor IP address |
The errorDetails
value is an object describing why validation failed.
Authentication is required.
{- "floatingIp": "88.17.0.5/32",
- "anchorIp": "95.10.126.1"
}
{- "id": "88.17.34.108_32",
- "rangeId": "88.17.0.0_17",
- "location": "AMS-01",
- "type": "SITE",
- "customerId": "10001234",
- "salesOrgId": "2000",
- "floatingIp": "88.17.34.108/32",
- "anchorIp": "95.10.126.1",
- "status": "ACTIVE",
- "createdAt": "2019-03-13T09:10:02+0000",
- "updatedAt": "2019-03-13T09:10:02+0000"
}
rangeId required | string Example: 10.0.0.0_29 ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore) |
floatingIpDefinitionId required | string ID of a Floating IP Definition, consisting of network IP and prefix length (separated by an underscore) |
Authentication is required.
curl --request GET \ --url https://api.leaseweb.com/floatingIps/v2/ranges/10.0.0.0_29/floatingIpDefinitions/%7BfloatingIpDefinitionId%7D \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "id": "88.17.34.108_32",
- "rangeId": "88.17.0.0_17",
- "location": "AMS-01",
- "type": "SITE",
- "customerId": "10001234",
- "salesOrgId": "2000",
- "floatingIp": "88.17.34.108/32",
- "anchorIp": "95.10.126.1",
- "status": "ACTIVE",
- "createdAt": "2019-03-13T09:10:02+0000",
- "updatedAt": "2019-03-13T09:10:02+0000"
}
Imagine you have 2 dedicated servers in AMS-01, in different racks. And you have a Floating IP definition for Floating IP 10.0.0.0_32. You have configured the ip address 10.0.0.0/32 on both dedicated servers.
If the anchor IP in the Floating IP definition is poining to your first server,
all traffic goes to that server. With this PUT
request you can change the
Anchor IP address to point to, for example, your second server. Within a
matter of seconds all the traffic destined for the Floating IP will now end up
at the new Anchor IP. In the above example, your second server.
rangeId required | string Example: 10.0.0.0_29 ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore) |
floatingIpDefinitionId required | string ID of a Floating IP Definition, consisting of network IP and prefix length (separated by an underscore) |
anchorIp | string The Anchor IP address |
The errorDetails
value is an object describing why validation failed.
Authentication is required.
{- "anchorIp": "95.10.126.1"
}
{- "id": "88.17.34.108_32",
- "rangeId": "88.17.0.0_17",
- "location": "AMS-01",
- "type": "SITE",
- "customerId": "10001234",
- "salesOrgId": "2000",
- "floatingIp": "88.17.34.108/32",
- "anchorIp": "95.10.126.1",
- "status": "ACTIVE",
- "createdAt": "2019-03-13T09:10:02+0000",
- "updatedAt": "2019-03-13T09:10:02+0000"
}
rangeId required | string Example: 10.0.0.0_29 ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore) |
floatingIpDefinitionId required | string ID of a Floating IP Definition, consisting of network IP and prefix length (separated by an underscore) |
Authentication is required.
curl --request DELETE \ --url https://api.leaseweb.com/floatingIps/v2/ranges/10.0.0.0_29/floatingIpDefinitions/%7BfloatingIpDefinitionId%7D \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'