LeaseWeb API for launching and managing Public Cloud instances (v1)

The base URL for this API is: https://api.leaseweb.com/publicCloud/v1/

This API provides ways to launch and manage Public Cloud instances.

BETA
This API is in BETA. Documentation might be incorrect or incomplete. Functionality might change with the final release.>

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.

Regions

List regions

Authorizations:
query Parameters
limit
integer
Default: 20
Example: limit=20

Limit the number of results returned.

offset
integer
Default: 0
Example: offset=10

Return results starting from the given offset.

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/regions \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

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

Instance types

List instance types

Get instance types

Authorizations:
query Parameters
region
required
string
limit
integer >= 0
Default: 50
offset
integer >= 0
Default: 0

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/instanceTypes?region=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

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

Instance

Launch instance

Launch a Public Cloud instance.

Available regions can be obtained using /v1/regions.

Available Operating Systems can be obtained using /v1/operatingSystems.

Available instance types for your region and selected Operating System using: /v1/instanceTypes.

Authorizations:
Request Body schema: application/json
region
required
string

Region to launch the instance into

instanceType
required
string

Instance type

operatingSystemId
required
string

Operating System ID

marketAppId
string

Market App ID that must be installed into the instance

reference
string

An identifying name you can refer to the instance

contractType
required
string
Enum: "HOURLY" "MONTHLY"
contractTerm
required
integer
Enum: 0 1 3 6 12

Contract commitment. Used only when contract type is MONTHLY

billingFrequency
required
integer
Enum: 1 3 6 12

How often you wish to be charged. Used only when contract type is MONTHLY. '1' means every month, '3' every three months and so on.

rootDiskSize
integer

The root disk's size in GB. Must be at least 5 GB for Linux and FreeBSD instances and 50 GB for Windows instances

rootDiskStorageType
required
string
Enum: "LOCAL" "CENTRAL"

The root disk's storage type

sshKey
string

Public SSH key to be installed into the instance. Must be used only on Linux/FreeBSD instances

Responses