Virtual Machine Actions

VM Actions (Start, Stop, Restart)

  • POST /api/marketplace-resources/<resource_uuid>/actions/<action_name>/ - Perform actions on a VM (start, stop, restart).

    This endpoint allows you to perform various actions on a virtual machine, such as starting, stopping, and restarting. Replace <action_name> with the specific action you want to perform (e.g., startstoprestart). You'll need the resource_uuid of the VM, which you can obtain from the "List VMs" endpoint (3.2.2).

    Notes:

    • The available actions may vary depending on the VM offering and the hypervisor used.
    • Some actions might be asynchronous, meaning the VM state might not change immediately. You can use the "Get VM Details" endpoint (3.2.3) to check the VM's status.

    Request Example (Start VM):

    POST [https://api.wayscloud.services/api/marketplace-resources/vm_resource_uuid/actions/start/](https://www.google.com/search?q=https://api.wayscloud.services/api/marketplace-resources/vm_resource_uuid/actions/start/)
    Authorization: Token <your_api_token>

    Request Example (Stop VM):

    POST [https://api.wayscloud.services/api/marketplace-resources/vm_resource_uuid/actions/stop/](https://www.google.com/search?q=https://api.wayscloud.services/api/marketplace-resources/vm_resource_uuid/actions/stop/)
    Authorization: Token <your_api_token>

    Request Example (Restart VM):

    POST [https://api.wayscloud.services/api/marketplace-resources/vm_resource_uuid/actions/restart/](https://www.google.com/search?q=https://api.wayscloud.services/api/marketplace-resources/vm_resource_uuid/actions/restart/)
    Authorization: Token <your_api_token>

    Status Codes:

    • 202 Accepted: The action was accepted and is being processed.
    • 400 Bad Request: The requested action is not valid or supported for this VM.
    • 401 Unauthorized: The user making the request is not authorized.
    • 404 Not Found: The specified VM resource_uuid does not exist.
    • 409 Conflict: The VM cannot be acted upon due to its current state (e.g., starting a VM that is already running).