AWS compatible Public Cloud API (v1)

License: Apache 2.0

This is the AWS compatible Public Cloud API Reference. It provides descriptions, API request parameters, and the XML response for each of the API actions that Leaseweb supports.

The purpose of the AWS compatible Public Cloud API is to make the migration easy for the users to switch from the AWS EC2 to the Leaseweb Public Cloud APIs.

NOTE: Since AWS EC2 and Public Cloud APIs are not 100% matched, Leaseweb hard-coded some request/response attributes, which you can see in schema definition.

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

BETA

Errors

AWS compatible APIs have two types of error codes:

Client errors: These errors are usually caused by something the client did, such as specifying an incorrect or invalid parameter in the request, or using an action or resource on behalf of a user that doesn't have permission to use the action or resource. These errors are accompanied by a 400-series HTTP response code.

Server errors: These errors are usually caused by an AWS compatible APIs server-side issue. These errors are accompanied by a 500-series HTTP response code.

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Errors>
        <Error>
            <Code>ERROR CODE 1</Code>
            <Message>ERROR MESSAGE 1</Message>
        </Error>
        <Error>
            <Code>ERROR CODE 2</Code>
            <Message>ERROR MESSAGE 2</Message>
        </Error>
    </Errors>
    <RequestID>REQUEST ID</RequestID>
</Response>

DescribeInstances

Describes the specified instances or all instances.

If you specify instance IDs, the output includes information for only the specified instances.

If you specify filters, the output includes information for only those instances that meet the filter criteria.

If you do not specify instance IDs or filters, the output includes information for all instances, which can affect performance. We recommend that you use pagination to ensure that the operation returns quickly and successfully.

If you specify an instance ID that is not valid, an error is returned. If you specify an instance that you do not own, it is not included in the output.

AWS CLI example

aws ec2 describe-instances --filters "Name=<FILTER_NAME>,Values=<FILTER_VALUE>" --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL>
Authorizations:
Authorization
query Parameters
Filter.N.instance-id
string
Example: Filter.N.instance-id=29145c92-4a68-4c63-aaeb-f2212d85a74a

The ID of the instance.

Filter.N.ip-address
string
Example: Filter.N.ip-address=123.456.7.8

The public IPv4 address of the instance.

Filter.N.tag:reference
string
Example: Filter.N.tag:reference=reference

The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key reference and the value TeamA, specify tag:reference for the filter name and TeamA for the filter value.

Filter.N.instance-state-name
string
Enum: "pending" "running" "shutting-down" "terminated" "stopping" "stopped"
Example: Filter.N.instance-state-name=pending

The state of the instance.

Filter.N.instance-type
string
Example: Filter.N.instance-type=t2.micro

The type of instance. The documentation has a complete list.

Filter.N.availability-zone
string
Example: Filter.N.availability-zone=eu-west-1

The Availability Zone of the instance.

MaxResults
integer
Example: MaxResults=10

The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output.

NextToken
integer
Example: NextToken=1

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?Filter.N.instance-id=SOME_STRING_VALUE&Filter.N.ip-address=SOME_STRING_VALUE&Filter.N.tag%3Areference=SOME_STRING_VALUE&Filter.N.instance-state-name=SOME_STRING_VALUE&Filter.N.instance-type=SOME_STRING_VALUE&Filter.N.availability-zone=SOME_STRING_VALUE&MaxResults=SOME_INTEGER_VALUE&NextToken=SOME_INTEGER_VALUE&Action=DescribeInstances' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <DescribeInstancesResponse xmlns='http://ec2.amazonaws.com/doc/2016-11-15/'>
 	<nextToken>1</nextToken>
 	<requestId>f7f55139-53d4-4b5f-bd7f-dbeddee039c0</requestId>
 	<reservationSet>
 		<item>
 			<reservationId></reservationId>
 			<ownerId>10072540</ownerId>
 			<instancesSet>
 				<item>
 					<instanceId>10a6163b-03c6-4303-a274-c96fa2217503</instanceId>
 					<imageId>UBUNTU_22_04_64BIT</imageId>
 					<instanceState>
 						<code>16</code>
 						<name>RUNNING</name>
 					</instanceState>
 					<amiLaunchIndex>-1</amiLaunchIndex>
 					<instanceType>lsw.m3.large</instanceType>
 					<launchTime>2024-05-07T12:02:49+0000</launchTime>
 					<placement>
 						<availabilityZone>eu-west-3</availabilityZone>
 						<groupName></groupName>
 						<tenancy></tenancy>
 					</placement>
 					<subnetId></subnetId>
 					<vpcId></vpcId>
 					<privateIpAddress></privateIpAddress>
 					<ipAddress>85.17.17.88</ipAddress>
 					<architecture>x86_64</architecture>
 					<rootDeviceType></rootDeviceType>
 					<virtualizationType></virtualizationType>
 					<tagSet>
 						<item>
 							<key>reference</key>
 							<value>test ono 3</value>
 						</item>
 					</tagSet>
 					<cpuOptions>
 						<coreCount>2</coreCount>
 						<threadsPerCore>-1</threadsPerCore>
 					</cpuOptions>
 					<networkInterfaceSet>
 						<item>
 							<networkInterfaceId></networkInterfaceId>
 							<subnetId></subnetId>
 							<vpcId></vpcId>
 							<description></description>
 							<ownerId></ownerId>
 							<status></status>
 							<macAddress></macAddress>
 							<privateIpAddress></privateIpAddress>
 							<privateDnsName></privateDnsName>
 							<sourceDestCheck></sourceDestCheck>
 							<groupSet>
 								<item>
 									<groupId></groupId>
 									<groupName></groupName>
 								</item>
 							</groupSet>
 							<attachment>
 								<attachmentId></attachmentId>
 								<deviceIndex>-1</deviceIndex>
 								<status></status>
 								<attachTime>2000-01-01T00:00:00+0000</attachTime>
 								<deleteOnTermination></deleteOnTermination>
 							</attachment>
 							<association>
 								<publicIp>85.17.17.88</publicIp>
 								<publicDnsName></publicDnsName>
 								<ipOwnerId></ipOwnerId>
 							</association>
 							<privateIpAddressesSet>
 								<item>
 									<privateIpAddress></privateIpAddress>
 									<privateDnsName></privateDnsName>
 									<primary></primary>
 									<association>
 										<publicIp></publicIp>
 										<publicDnsName></publicDnsName>
 										<ipOwnerId></ipOwnerId>
 									</association>
 								</item>
 							</privateIpAddressesSet>
 							<ipv6AddressesSet>
 								<item>
 										<ipv6Address>85.17.17.88</ipv6Address>
 									</item>
 							</ipv6AddressesSet>
 						</item>
 					</networkInterfaceSet>
 				</item>
 			</instancesSet>
 		</item>
 	</reservationSet>
 </DescribeInstancesResponse>
 

RunInstances

Launches an instance using an image for which you have permissions.

AWS CLI example

aws ec2 run-instances --image-id <IMAGE_ID> --placement AvailabilityZone=<REGION> --instance-type <INSTANCE_TYPE> --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL>
Authorizations:
Authorization
query Parameters
InstanceType
required
string
Example: InstanceType=lsw.t2.micro

The instance type.

ImageId
required
string
Example: ImageId=UBUNTU_22_04_64BIT

The name of the image. An image is required to launch an instance and must be specified here. The documentation has a complete list.

Placement
required
string
Example: Placement=eu-west-1

The placement for the instance.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?InstanceType=SOME_STRING_VALUE&ImageId=SOME_STRING_VALUE&Placement=SOME_STRING_VALUE&Action=RunInstances' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <RunInstancesResponse xmlns='http: //ec2.amazonaws.com/doc/2016-11-15/'>
 	<groupSet/>
 	<instancesSet>
 		<item>
 			<instanceId>10a6163b-03c6-4303-a274-c96fa2217503</instanceId>
 			<imageId>UBUNTU_22_04_64BIT</imageId>
 			<instanceState>
 				<code>0</code>
 				<name>CREATING</name>
 			</instanceState>
 			<amiLaunchIndex>-1</amiLaunchIndex>
 			<instanceType>lsw.m3.large</instanceType>
 			<launchTime>2024-05-07T12: 02: 49+0000</launchTime>
 			<placement>
 				<availabilityZone>eu-west-3</availabilityZone>
 				<groupName></groupName>
 				<tenancy></tenancy>
 			</placement>
 			<subnetId></subnetId>
 			<vpcId></vpcId>
 			<privateIpAddress></privateIpAddress>
 			<ipAddress>85.17.17.88</ipAddress>
 			<architecture>x86_64</architecture>
 			<rootDeviceType></rootDeviceType>
 			<virtualizationType></virtualizationType>
 			<tagSet>
 				<item>
 					<key>reference</key>
 					<value></value>
 				</item>
 			</tagSet>
 			<cpuOptions>
 				<coreCount>2</coreCount>
 				<threadsPerCore>-1</threadsPerCore>
 			</cpuOptions>
 			<networkInterfaceSet>
 				<item>
 					<networkInterfaceId></networkInterfaceId>
 					<subnetId></subnetId>
 					<vpcId></vpcId>
 					<description></description>
 					<ownerId></ownerId>
 					<status></status>
 					<macAddress></macAddress>
 					<privateIpAddress></privateIpAddress>
 					<privateDnsName></privateDnsName>
 					<sourceDestCheck></sourceDestCheck>
 					<groupSet>
 						<item>
 							<groupId></groupId>
 							<groupName></groupName>
 						</item>
 					</groupSet>
 					<attachment>
 						<attachmentId></attachmentId>
 						<deviceIndex>-1</deviceIndex>
 						<status></status>
 						<attachTime>2000-01-01T00: 00: 00+0000</attachTime>
 						<deleteOnTermination></deleteOnTermination>
 					</attachment>
 					<association>
 						<publicIp>85.17.17.88</publicIp>
 						<publicDnsName></publicDnsName>
 						<ipOwnerId></ipOwnerId>
 					</association>
 					<privateIpAddressesSet>
 						<item>
 							<privateIpAddress></privateIpAddress>
 							<privateDnsName></privateDnsName>
 							<primary></primary>
 							<association>
 								<publicIp></publicIp>
 								<publicDnsName></publicDnsName>
 								<ipOwnerId></ipOwnerId>
 							</association>
 						</item>
 					</privateIpAddressesSet>
 					<ipv6AddressesSet>
 						<item/>
 					</ipv6AddressesSet>
 				</item>
 			</networkInterfaceSet>
 		</item>
 	</instancesSet>
 	<ownerId>10072540</ownerId>
 	<requesterId></requesterId>
 	<requestId></requestId>
 	<reservationId></reservationId>
 </RunInstancesResponse>
 

StartInstances

Starts a Public Cloud instance that you've previously stopped.

AWS CLI example

aws ec2 start-instances --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL> --instance-ids <INSTANCE_ID>
Authorizations:
Authorization
query Parameters
InstanceId.1
required
string
Example: InstanceId.1=29145c92-4a68-4c63-aaeb-f2212d85a74a

The instance id.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?InstanceId.1=SOME_STRING_VALUE&Action=StartInstances' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <StartInstancesResponse xmlns='http: //ec2.amazonaws.com/doc/2016-11-15/'>
 	<instancesSet>
 		<item>
 			<instanceId>10a6163b-03c6-4303-a274-c96fa2217503</instanceId>
 		</item>
 	</instancesSet>
 	<requestId>10a6163b-03c6-4303-a274</requestId>
 </StartInstancesResponse>
 

StopInstances

Stops a Public Cloud instance that you've previously started.

AWS CLI example

aws ec2 stop-instances --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL> --instance-ids <INSTANCE_ID>
Authorizations:
Authorization
query Parameters
InstanceId.1
required
string
Example: InstanceId.1=29145c92-4a68-4c63-aaeb-f2212d85a74a

The instance id.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?InstanceId.1=SOME_STRING_VALUE&Action=StopInstances' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <StopInstancesResponse xmlns='http: //ec2.amazonaws.com/doc/2016-11-15/'>
 	<instancesSet>
 		<item>
 			<instanceId>10a6163b-03c6-4303-a274-c96fa2217503</instanceId>
 		</item>
 	</instancesSet>
 	<requestId>10a6163b-03c6-4303-a274</requestId>
 </StopInstancesResponse>