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 resouce 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. |
ip | string Example: ip=127.0.0.4 Filter the list of network equipment by ip address. |
macAddress | string 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&ip=SOME_STRING_VALUE&macAddress=SOME_STRING_VALUE&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 |