Create an Instance
You can create an instance in a specific data center with a composite call. A composite call doesn't only configure a single instance but also defines additional devices. This is required because a Cube must include a direct-attached storage device. An instance cannot be provisioned and then mounted with a direct-attached storage volume. Composite calls are used to execute a series of REST APIrequests into a single API call. You can use the output of one request as the input for a subsequent request.
Endpoint
Use the following endpoint for Cubes: https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/servers
Request
curl -X 'POST' \
'https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/servers' \
-H 'accept: application/json'
To make authenticated requests to the API, the following fields are mandatory in the request header:
Name
Type
Description
datacenterId
string
The ID of the data center.
serverId
string
The ID of the Cube.
Response
A 202 message confirms that the instance is created.
{
"id": "15f67991-0f51-4efc-a8ad-ef1fb31a480c",
"type": "server",
"href": "<RESOURCE-URI>",
"metadata": {
"etag": "45480eb3fbfc31f1d916c1eaa4abdcc3",
"createdDate": "2015-12-04T14:34:09.809Z",
"createdBy": "[email protected]",
"createdByUserId": "[email protected]",
"lastModifiedDate": "2015-12-04T14:34:09.809Z",
"lastModifiedBy": "[email protected]",
"lastModifiedByUserId": "63cef532-26fe-4a64-a4e0-de7c8a506c90",
"state": "AVAILABLE"
},
"properties": {
"templateUuid": "15f67991-0f51-4efc-a8ad-ef1fb31a480c",
"name": "My resource",
"hostname": "myHostname",
"cores": 4,
"ram": 4096,
"availabilityZone": "AUTO",
"vmState": "RUNNING",
"bootCdrom": {
"id": "string",
"type": "resource",
"href": "<RESOURCE-URI>"
},
"bootVolume": {
"id": "string",
"type": "resource",
"href": "<RESOURCE-URI>"
},
"cpuFamily": "INTEL_ICELAKE",
"type": "CUBE",
"nicMultiQueue": true
},
"entities": {
"volumes": {
"items": [
{
"properties": {
"name": "My resource",
"type": "DAS",
"licenceType": "LINUX"
}
}
]
}
}
}
Last updated
Was this helpful?