This is the description of the Dedicated Network Equipment API.
The base url of this API is https://api.leaseweb.com
.
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.
List your Dedicated Network Equipment. This api call supports pagination. Use
the limit
and offset
query string parameters to paginate through all your
dedicated network equipment.
Every network equipment
object in the json response lists a few properties
of a network equipment. Use the single resource api call to get more details
for a single network equipment.
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
reference | string Example: reference=my-switch Filter the list of network equipment by reference. |
ip | string <ipv4> Example: ip=127.0.0.4 Filter the list of network equipment by ip address. |
macAddress | string([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})|([0-9... Example: macAddress=aa:bb:cc:dd:ee:ff Filter the list of network equipment by mac address. |
site | string Example: site=FRA-10 Filter the list of network equipment by site (location). |
privateRackId | string Example: privateRackId=123 Filter the list of network equipment by dedicated rack id. |
privateNetworkCapable | string Enum: "true" "false" Filter the list for private network capable network equipment |
privateNetworkEnabled | string Enum: "true" "false" Filter the list for private network enabled network equipment |
curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/networkEquipments?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&reference=SOME_STRING_VALUE&ip=SOME_STRING_VALUE&macAddress=00%3A15%3A17%3ADB%3A63%3A01&site=SOME_STRING_VALUE&privateRackId=SOME_STRING_VALUE&privateNetworkCapable=SOME_STRING_VALUE&privateNetworkEnabled=SOME_STRING_VALUE' \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 2
}, - "networkEquipments": [
- {
- "contract": {
- "customerId": "10085996",
- "deliveryStatus": "ACTIVE",
- "id": "49031391001170",
- "reference": "My Private Switch",
- "salesOrgId": "2000"
}, - "featureAvailability": {
- "automation": true,
- "ipmiReboot": false,
- "powerCycle": true,
- "privateNetwork": false,
- "remoteManagement": false
}, - "id": "12345",
- "location": {
- "rack": "YY11",
- "site": "AMS-01",
- "suite": "HALL3",
- "unit": "21"
}, - "networkInterfaces": {
- "internal": {
- "gateway": null,
- "ip": null,
- "ports": [ ]
}, - "public": {
- "gateway": "127.0.2.254",
- "ip": "127.0.2.1/24",
- "locationId": "",
- "nullRouted": false,
- "ports": [ ]
}, - "remoteManagement": {
- "gateway": null,
- "ip": null,
- "locationId": null,
- "ports": [ ]
}
}, - "type": "SWITCH"
}, - {
- "contract": {
- "customerId": "10085996",
- "deliveryStatus": "ACTIVE",
- "id": "49031513001110",
- "reference": "My Other Private Switch",
- "salesOrgId": "2000"
}, - "featureAvailability": {
- "automation": false,
- "ipmiReboot": false,
- "powerCycle": false,
- "privateNetwork": false,
- "remoteManagement": false
}, - "id": "45678",
- "location": {
- "rack": "XX00",
- "site": "AMS-01",
- "suite": "HALL3",
- "unit": "21"
}, - "networkInterfaces": {
- "internal": {
- "gateway": null,
- "ip": null,
- "ports": [ ]
}, - "public": {
- "gateway": "127.1.1.254",
- "ip": "127.1.1.68/24",
- "locationId": "",
- "nullRouted": false,
- "ports": [ ]
}, - "remoteManagement": {
- "gateway": null,
- "ip": null,
- "locationId": null,
- "ports": [ ]
}
}, - "type": "SWITCH"
}
]
}
Use this API to get information about a single network equipment.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345 \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "contract": {
- "aggregationPackId": null,
- "billingCycle": 1,
- "billingFrequency": "MONTH",
- "contractTerm": 12,
- "contractType": "NORMAL",
- "currency": "EUR",
- "customerId": "10085996",
- "deliveryStatus": "ACTIVE",
- "endsAt": null,
- "id": "49031391001170",
- "networkTraffic": {
- "connectivityType": "INTERCONNECTED",
- "datatrafficLimit": null,
- "datatrafficUnit": null,
- "trafficType": null,
- "type": null
}, - "pricePerFrequency": "0.00",
- "reference": "My Switch",
- "salesOrgId": "2000",
- "sla": "Platinum",
- "startsAt": "2017-08-01T00:00:00Z",
- "status": "ACTIVE",
- "subnets": [ ]
}, - "featureAvailability": {
- "automation": true,
- "ipmiReboot": false,
- "powerCycle": true,
- "privateNetwork": false,
- "remoteManagement": false
}, - "id": "12345",
- "location": {
- "rack": "YY11",
- "site": "AMS-01",
- "suite": "HALL3",
- "unit": "21"
}, - "name": "ABC-DE-001",
- "networkInterfaces": {
- "internal": {
- "gateway": null,
- "ip": null,
- "ports": [ ]
}, - "public": {
- "gateway": "127.0.0..254",
- "ip": "127.0.0..124/24",
- "locationId": "",
- "nullRouted": false,
- "ports": [ ]
}, - "remoteManagement": {
- "gateway": null,
- "ip": null,
- "locationId": null,
- "ports": [ ]
}
}, - "powerPorts": [
- {
- "name": "AMS-01-HALL3-YY11-PDU01",
- "port": "7"
}
], - "rack": {
- "capacity": "",
- "id": "11111"
}, - "serialNumber": "XN51FPD0QX",
- "specs": {
- "brand": "HP",
- "model": "PC 2530-48 J9781A"
}, - "type": "SWITCH"
}
Update the reference for a network equipment.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
reference required | string The reference for this network equipment |
{- "reference": "my-private-switch"
}
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "401",
- "errorMessage": "You are not authorized to view this resource."
}
List all IP Addresses associated with this network equipment. Optionally filtered.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
networkType | string Enum: "INTERNAL" "PUBLIC" "REMOTE_MANAGEMENT" Example: networkType=INTERNAL Filter the collection of ip addresses by network type |
version | string Filter the collection by ip version |
nullRouted | string Filter Ips by Nulled-Status |
ips | string Filter the collection of Ips for the comma separated list of Ips |
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/bareMetals/v2/networkEquipments/12345/ips?networkType=INTERNAL&version=SOME_STRING_VALUE&nullRouted=SOME_STRING_VALUE&ips=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "ips": [
- {
- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "floatingIp": false,
- "gateway": "12.123.123.254",
- "ip": "12.123.123.1/24",
- "mainIp": true,
- "networkType": "PUBLIC",
- "nullRouted": true,
- "reverseLookup": "domain.example.com",
- "version": 4
}, - {
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}, - "floatingIp": false,
- "gateway": "2001:db8:85a3::8a2e:370:1",
- "ip": "2001:db8:85a3::8a2e:370:7334/64",
- "mainIp": false,
- "networkType": "REMOTE_MANAGEMENT",
- "nullRouted": false,
- "reverseLookup": "domain.example.com",
- "version": 6
}
]
}
Get a single IP address associated with this network equipment.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
ip required | string Example: 127.0.0.6 The IP Address |
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/ips/127.0.0.6 \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "floatingIp": false,
- "gateway": "12.123.123.254",
- "ip": "12.123.123.1/24",
- "mainIp": true,
- "networkType": "PUBLIC",
- "nullRouted": false,
- "reverseLookup": "domain.example.com",
- "version": 4
}
Update the reverse lookup or DDoS detection profile for the ip address.
DDoS detection profiles can only be changed if the IP address is protected using Advanced DDoS protection.
For more information about DDoS detection profiles click here for our KB related article.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
ip required | string Example: 127.0.0.6 The IP Address |
detectionProfile | string Enum: "ADVANCED_DEFAULT" "ADVANCED_LOW_UDP" "ADVANCED_MED_UDP" The detection profile value |
reverseLookup | string The reverse lookup value |
{- "detectionProfile": "ADVANCED_LOW_UDP",
- "reverseLookup": "domain.example.com"
}
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "floatingIp": false,
- "gateway": "12.123.123.254",
- "ip": "12.123.123.1/24",
- "mainIp": true,
- "networkType": "PUBLIC",
- "nullRouted": false,
- "reverseLookup": "domain.example.com",
- "version": 4
}
Null the given IP address. It might take a few minutes before the change is propagated across the network.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
ip required | string Example: 127.0.0.6 The IP Address |
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/ips/127.0.0.6/null \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "floatingIp": false,
- "gateway": "12.123.123.254",
- "ip": "12.123.123.1/24",
- "mainIp": true,
- "networkType": "PUBLIC",
- "nullRouted": false,
- "reverseLookup": "domain.example.com",
- "version": 4
}
Remove an existing null route for the given IP address. It might take a few minutes before the change is propagated across the network.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
ip required | string Example: 127.0.0.6 The IP Address |
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/ips/127.0.0.6/unnull \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "floatingIp": false,
- "gateway": "12.123.123.254",
- "ip": "12.123.123.1/24",
- "mainIp": true,
- "networkType": "PUBLIC",
- "nullRouted": false,
- "reverseLookup": "domain.example.com",
- "version": 4
}
Show all null route history for any ips associated with this a network equipment.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
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/bareMetals/v2/networkEquipments/12345/nullRouteHistory?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "nullRoutes": [
- {
- "automatedUnnullingAt": "2016-08-12T07:45:33+00:00",
- "comment": "Device Null Route related to DDoS Mitigation",
- "ip": "1.1.1.1/32",
- "nullLevel": 3,
- "nulledAt": "2016-08-12T07:40:27+00:00",
- "ticketId": "282912"
}
]
}
The credentials API allows you to store usernames and passwords securely.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
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/bareMetals/v2/networkEquipments/12345/credentials?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 13
}, - "credentials": [
- {
- "type": "REMOTE_MANAGEMENT",
- "username": "admin"
}, - {
- "type": "RESCUE_MODE",
- "username": "root"
}, - {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "CONTROL_PANEL",
- "username": "user"
}, - {
- "type": "SWITCH",
- "username": "admin"
}, - {
- "type": "PDU",
- "username": "root"
}, - {
- "type": "FIREWALL",
- "username": "root"
}, - {
- "type": "LOAD_BALANCER",
- "username": "user"
}, - {
- "type": "VNC",
- "username": "admin"
}, - {
- "type": "TEMPORARY_OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "VPN_USER",
- "username": "root"
}, - {
- "type": "COMBINATION_LOCK",
- "username": "user"
}, - {
- "type": "DATABASE",
- "username": "user"
}
]
}
Password will NOT be updated on the network equipment. The ability to update credentials is for convenience only. It provides a secure way to communicate passwords with Leaseweb engineers in case support is required.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
password required | string The password for the credentials |
type required | string (credentialType) Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE" The type of the credential. |
username required | string The username for the credentials |
{- "password": "mys3cr3tp@ssw0rd",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
{- "password": "mys3cr3tp@ssw0rd",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
List all the credentials filtered by the specified type that are associated with this network equipment.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
type required | string (credentialType) Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE" The type of the credential. |
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/bareMetals/v2/networkEquipments/12345/credentials/%7Btype%7D?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 2
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "OPERATING_SYSTEM",
- "username": "user"
}
]
}
This action is purely administrative and will only remove the username and password associated with this resource from our database.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
type required | string (credentialType) Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE" The type of the credential. |
username required | string Example: root Username |
curl --request DELETE \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/credentials/%7Btype%7D/%7Busername%7D \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "401",
- "errorMessage": "You are not authorized to view this resource."
}
View the password for the given credential, identified by type
and
username
.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
type required | string (credentialType) Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE" The type of the credential. |
username required | string Example: root Username |
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/credentials/%7Btype%7D/%7Busername%7D \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "password": "mys3cr3tp@ssw0rd",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
The usernames or types cannot be changed. In order to change those remove this credentials and create a new one.
This action is purely administrative and will only update the password associated with this resource in our database.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
type required | string (credentialType) Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE" The type of the credential. |
username required | string Example: root Username |
password required | string The password for the credentials |
{- "password": "mys3cr3tp@ssw0rd"
}
{- "password": "mys3cr3tp@ssw0rd",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
Powercyle the network equipment.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerCycle \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
The network equipment can either be ON
or OFF
. Network Equipment can be
powered on or off by using the respective /powerOn
and /powerOff
API
calls. In addition network equipment can also be rebooted using the
/powerCycle
API call.
The pdu
object describes the power status from the power distribution unit
(PDU) point of view. If your network equipment is connected to multiple PDU
ports the status
property will report on
if at least one PDU port has
power.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerInfo \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "pdu": {
- "status": "on"
}
}
Power off the given network equipment.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerOff \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
Power on the given network equipment.
networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerOn \ --header 'X-Lsw-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}