This section provides details on how to manage your virtual machines (VMs) through the WAYSCloud API.
Create VM (via Order)
-
POST /api/marketplace-orders/
- Create a new virtual machine by placing an order.To create a VM, you need to place an order specifying the desired offering, plan, and VM configuration attributes. This is an asynchronous operation. The response will include an
order_uuid
, which you can use to track the order status. Once the order is fulfilled, the VM will be created.Request Example:
POST [https://api.wayscloud.services/api/marketplace-orders/](https://api.wayscloud.services/api/marketplace-orders/)
Authorization: Token <your_api_token>
Content-Type: application/json
{
"project": "<project_uuid>",
"offering": "<offering_uuid>",
"plan": "<plan_uuid>",
"attributes": {
"name": "my-vm",
"image": "<image_uuid>",
"flavor": "<flavor_uuid>", // If not part of the offering
"ssh_public_key": "<your_ssh_public_key>",
"networks": [
{
"subnet": "<subnet_uuid>",
"floating_ip": "auto" // Or "none", or a specific "<floating_ip_uuid>"
}
]
}
}Request Parameters:
Parameter Description Required project
The UUID of the project where the VM will be created. Yes offering
The UUID of the VM offering (template). Yes plan
The UUID of the plan for the offering. Yes attributes
VM configuration attributes. Yes attributes.name
The name of the VM. Yes attributes.image
The UUID of the image to use for the VM. Yes attributes.flavor
The UUID of the flavor (size) of the VM (if not specified in the offering). No attributes.ssh_public_key
Your SSH public key for accessing the VM. Yes attributes.networks
An array of network configurations. Yes attributes.networks.subnet
The UUID of the subnet to connect the VM to. Yes attributes.networks.floating_ip
"auto" to automatically assign a floating IP, "none" to not assign one, or the UUID of a specific floating IP to assign. Yes Response Example:
{
"uuid": "order_uuid_value",
"project": "project_uuid_value",
"offering": "offering_uuid_value",
"plan": "plan_uuid_value",
"created": "2025-03-15T11:00:00Z",
"state": "Creating",
//... other fields...
}Status Codes:
- 201 Created: The order was successfully created.
- 400 Bad Request: The request body contained invalid data or a required parameter was missing.
- 401 Unauthorized: The user making the request is not authorized.
Notes:
- You can use the
order_uuid
from the response to track the order status using the "Get Order" endpoint (GET /api/marketplace-orders/<order_uuid>/
). - The
state
field in the response will indicate the status of the order (e.g., "Creating," "Success," "Erred"). - Once the order is successfully completed, the VM will be created, and you can manage it using other VM management endpoints.