Skip to main content

Callback URLs

Callback URLs can be attached to your virtual machines and volumes, providing you with notifications when actions are performed on the resource.

In this article


Callback URLs in Hyperstack

Attach a callback URL during VM deployment

To attach a callback URL to your virtual machine in Hyperstack, follow these steps:

  1. Navigate to the VM deployment page in Hyperstack by clicking Virtual Machines in the sidebar and then selecting Deploy New Virtual Machine.

  2. Configure your VM as desired, and then click on Configure Additional Settings.

  3. In the Callback URL section, enter the URL where you want event notifications to be sent.

    Callback UI

  4. Deploy the VM.

Attach a callback URL to an existing VM

To attach a callback URL to an existing virtual machine, follow these steps:

  1. In Hyperstack, navigate to the My Virtual Machines page. Select the VM to which you want to attach a callback URL by clicking on its name.

  2. On the VM's details page, go to the Callbacks tab and click Add a New Callback URL.

  3. Enter the URL where you want event notifications to be sent, then click Update to save your changes.


Callback APIs

Virtual machine callback APIs

Endpoint NameURLDescription
Attach callback to virtual machine /core/virtual-machines/{id}/attach-callbackCreates a callback URL for a specified volume.
Update virtual machine callbackPUT /core/virtual-machines/{id}/update-callbackUpdates the callback URL for a specified volume.
Delete virtual machine callbackDELETE /core/virtual-machines/{id}/delete-callbackDeletes a callback URL attached to a volume.

Volume callback APIs

Endpoint NameURLDescription
Attach callback to volume /core/volumes/{id}/attach-callbackCreates a callback URL for a specified volume.
Update volume callbackPUT /core/volumes/{id}/update-callbackUpdates the callback URL for a specified volume.
Delete volume callbackDELETE /core/volumes/{id}/delete-callbackDeletes a callback URL attached to a volume.


The Event object

When an action occurs to a virtual machine or volume, here's an example of the event object that gets sent to the specified callback URL:


Attributes of the Event object


resource object

An object containing details about the resource associated with the event.

Show child attributes
id string

Unique identifier for the resource, e.g., "id-of-the-resource."


name string

Name of the resource, e.g., "resource-name."


type string

Type or category of the resource.
Possible values: instance and volume.


operation object

An object containing details about the operation performed.

Show child attributes
name string

Name of the operation performed. For example, "createVM".
Possible values: See supported operations for virtual machines, and volumes.


status string

Status of the operation, e.g., "status."


user_payload object

An object containing user-specific data related to the event.


data object

An object containing additional data related to the event.

Example event object
{
"resource": {
"id": "id-of-the-resource",
"name": "resource-name",
"type": "resource-type"
},
"operation": {
"name": "operation-name"
"status": "status"
},
"user_payload": {
// ...
},
"data": {
// ...
}
}


Events and corresponding resource statuses

Events for virtual machines

Below is a list of supported operations related to virtual machines, along with the corresponding statuses returned for each operation:

OperationStatus
createVMCREATING, BUILD, ACTIVE, ERROR
deleteVMDELETING, DELETED, ERROR
createSecurityRulePENDING, SUCCESS, ERROR
deleteSecurityRuleDELETING, DELETED, ERROR
startVMSTARTING, ACTIVE, ERROR
stopVMSTOPPING, SHUTOFF, ERROR
hardRebootVMHARD_REBOOT, ACTIVE, ERROR
attachPublicIPATTACHING, ATTACHED, ERROR
detachPublicIPDETACHING, NO PUBLIC IP, ERROR
getVNCAccessURLSUCCESS, ERROR

Events for volumes

Here are the supported operations related to volumes, along with the corresponding statuses returned for each operation:

Operation nameStatus
createVolumesCREATING, AVAILABLE, ERROR
deleteVolumesPENDING_DELETE, DELETED, ERROR

Events for volume attachments

Because volume attachments impact both virtual machines and volumes, events are dispatched to the callback URLs of both resources. Here's an overview of operations and their respective response statuses related to volumes:

OperationStatus
attachVolumesATTACHING, ATTACHED, ERROR
detachVolumesDETACHING, DETACHED, ERROR

Back to top