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
- Callback APIs
- The Event object
- Events and corresponding resource statuses
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:
-
Navigate to the VM deployment page in Hyperstack by clicking Virtual Machines in the sidebar and then selecting Deploy New Virtual Machine.
-
Configure your VM as desired, and then click on Configure Additional Settings.
-
In the Callback URL section, enter the URL where you want event notifications to be sent.
-
Deploy the VM.
Attach a callback URL to an existing VM
To attach a callback URL to an existing virtual machine, follow these steps:
-
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.
-
On the VM's details page, go to the Callbacks tab and click Add a New Callback URL.
-
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 Name | URL | Description |
---|---|---|
Attach callback to virtual machine | POST /core/virtual-machines/{id}/attach-callback | Creates a callback URL for a specified volume. |
Update virtual machine callback | PUT /core/virtual-machines/{id}/update-callback | Updates the callback URL for a specified volume. |
Delete virtual machine callback | DELETE /core/virtual-machines/{id}/delete-callback | Deletes a callback URL attached to a volume. |
Volume callback APIs
Endpoint Name | URL | Description |
---|---|---|
Attach callback to volume | POST /core/volumes/{id}/attach-callback | Creates a callback URL for a specified volume. |
Update volume callback | PUT /core/volumes/{id}/update-callback | Updates the callback URL for a specified volume. |
Delete volume callback | DELETE /core/volumes/{id}/delete-callback | Deletes 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
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.
{
"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:
Operation | Status |
---|---|
createVM | CREATING , BUILD , ACTIVE , ERROR |
deleteVM | DELETING , DELETED , ERROR |
createSecurityRule | PENDING , SUCCESS , ERROR |
deleteSecurityRule | DELETING , DELETED , ERROR |
startVM | STARTING , ACTIVE , ERROR |
stopVM | STOPPING , SHUTOFF , ERROR |
hardRebootVM | HARD_REBOOT , ACTIVE , ERROR |
attachPublicIP | ATTACHING , ATTACHED , ERROR |
detachPublicIP | DETACHING , NO PUBLIC IP , ERROR |
getVNCAccessURL | SUCCESS , ERROR |
Events for volumes
Here are the supported operations related to volumes, along with the corresponding statuses returned for each operation:
Operation name | Status |
---|---|
createVolumes | CREATING , AVAILABLE , ERROR |
deleteVolumes | PENDING_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:
Operation | Status |
---|---|
attachVolumes | ATTACHING , ATTACHED , ERROR |
detachVolumes | DETACHING , DETACHED , ERROR |