The base URL for this API is: https://api.leaseweb.com/cloud/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.
limit | integer Default: 10 Limit the number of results returned |
offset | integer Default: 0 Return results starting from the given offset |
curl --request GET \ --url 'https://api.leaseweb.com/cloud/v2/virtualServers?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "virtualServers": [
- {
- "id": "222903",
- "reference": "Web server",
- "customerId": "1301178860",
- "dataCenter": "AMS-01",
- "cloudServerId": null,
- "state": "STOPPED",
- "firewallState": "DISABLED",
- "template": "Ubuntu 14.04 64 40 20140707T1340",
- "serviceOffering": "S",
- "sla": "Bronze",
- "contract": {
- "id": "30000778",
- "startsAt": "2016-02-01T00:00:00+0200",
- "endsAt": "2017-01-31T00:00:00+0200",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 4.7,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 1
}, - "memory": {
- "unit": "MB",
- "amount": 1024
}, - "storage": {
- "unit": "GB",
- "amount": 40
}
}, - "iso": null,
- "ips": [
- {
- "ip": "10.11.116.130",
- "version": 4,
- "type": "PUBLIC"
}
]
}, - {
- "id": "301708",
- "reference": null,
- "customerId": "1301178860",
- "dataCenter": "AMS-01",
- "cloudServerId": null,
- "state": "STOPPED",
- "firewallState": "ENABLED",
- "template": "CentOS 7.0 64 60 20140711T1039",
- "serviceOffering": "M",
- "sla": "Bronze",
- "contract": {
- "id": "30000779",
- "startsAt": "2016-02-01T00:00:00+0200",
- "endsAt": "2017-01-31T00:00:00+0200",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 4.7,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 2
}, - "memory": {
- "unit": "MB",
- "amount": 2048
}, - "storage": {
- "unit": "GB",
- "amount": 60
}
}, - "iso": {
- "id": "9eadbe14-69be-4dee-8f56-5ebb23bb3c33",
- "name": "Knoppix",
- "displayName": "Knoppix"
}, - "ips": [
- {
- "ip": "10.11.116.132",
- "version": 4,
- "type": "PUBLIC"
}
]
}
], - "_metadata": {
- "totalCount": 2,
- "offset": 0,
- "limit": 10
}
}
virtualServerId required | string Example: 123242 Id of the virtual server |
curl --request GET \ --url https://api.leaseweb.com/cloud/v2/virtualServers/123242 \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "id": "222903",
- "reference": "Web server",
- "customerId": "1301178860",
- "dataCenter": "AMS-01",
- "cloudServerId": null,
- "state": "STOPPED",
- "firewallState": "DISABLED",
- "template": "Ubuntu 14.04 64 40 20140707T1340",
- "serviceOffering": "S",
- "sla": "Bronze",
- "contract": {
- "id": "30000778",
- "startsAt": "2016-02-01T00:00:00+0200",
- "endsAt": "2017-01-31T00:00:00+0200",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 4.7,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 1
}, - "memory": {
- "unit": "MB",
- "amount": 1024
}, - "storage": {
- "unit": "GB",
- "amount": 40
}
}, - "iso": {
- "id": "9eadbe14-69be-4dee-8f56-5ebb23bb3c33",
- "name": "Knoppix",
- "displayName": "Knoppix"
}, - "ips": [
- {
- "ip": "10.11.116.130",
- "version": 4,
- "type": "PUBLIC"
}
]
}
virtualServerId required | string Example: 123242 Id of the virtual server |
reference required | string The reference description for the virtual server |
{- "reference": "My reference"
}
{- "id": "222903",
- "reference": "Web server",
- "customerId": "1301178860",
- "dataCenter": "AMS-01",
- "cloudServerId": null,
- "state": "STOPPED",
- "firewallState": "DISABLED",
- "template": "Ubuntu 14.04 64 40 20140707T1340",
- "serviceOffering": "S",
- "sla": "Bronze",
- "contract": {
- "id": "30000778",
- "startsAt": "2016-02-01T00:00:00+0200",
- "endsAt": "2017-01-31T00:00:00+0200",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 4.7,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 1
}, - "memory": {
- "unit": "MB",
- "amount": 1024
}, - "storage": {
- "unit": "GB",
- "amount": 40
}
}, - "iso": {
- "id": "9eadbe14-69be-4dee-8f56-5ebb23bb3c33",
- "name": "Knoppix",
- "displayName": "Knoppix"
}, - "ips": [
- {
- "ip": "10.11.116.130",
- "version": 4,
- "type": "PUBLIC"
}
]
}