Virtual Servers API (v2)

The base URL for this API is: https://api.leaseweb.com/cloud/v2

Errors

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

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.

Virtual servers

List virtual servers

Authorizations:
query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

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'

Response samples

Content type
application/json
{
  • "virtualServers": [
    ],
  • "_metadata": {
    }
}

Inspect a virtual server

Authorizations:
path Parameters
virtualServerId
required
string
Example: 123242

Id of the virtual server

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cloud/v2/virtualServers/123242 \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "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": {
    },
  • "hardware": {
    },
  • "iso": {
    },
  • "ips": [
    ]
}

Update a virtual server

Authorizations:
path Parameters
virtualServerId
required
string
Example: 123242

Id of the virtual server

Request Body schema: application/json
reference
required
string

The reference description for the virtual server

Responses

Request samples

Content type
application/json
{
  • "reference": "My reference"
}

Response samples

Content type
application/json
{
  • "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": {
    },
  • "hardware": {
    },
  • "iso": {
    },
  • "ips": [
    ]
}

Power on

The power on call is an asynchronous call, meaning the power on will be performed as soon as possible.

Authorizations:
path Parameters
virtualServerId
required
string
Example: 123242

Id of the virtual server

Responses

Request samples