Skip to content

eq_callback.php

Module for processing asynchronous responses from workers for equipment (EQ) and virtual machine management. Handles task statuses (deploy, reinstall, backup, network), updates billing, and sends notifications to clients.

API Methods

Method Action Description
check check status of an asynchronous task Checks the current status of a task by key and returns the execution context if the task is completed or at an intermediate stage.
reinstall handle server reinstallation response Callback handler from the worker after the reinstallation operation is completed. Updates the server status, clears temporary tags, sends an email to the client with access credentials, and updates billing.

eq_callback/check

Checks the current status of a task by key and returns the execution context if the task is completed or at an intermediate stage.

HTTP Method: GET

Parameters:

Parameter Required Type Description
action string Method identifier: check
key string Unique identifier of the asynchronous task (32 characters, a-z0-9).

Example Request

curl -s "https://api.hostkey.com/eq_callback.php" -X GET \
--data "action=check" \
--data "key=VALUE"
Example of a successful response
{
"result": "OK",
"action": "check",
"scope": {
"id": 12345,
"location": "NL",
"preset": "vps-s-1"
},
"context": {
"action": "deploy",
"id": 12345,
"ip": "192.168.1.10",
"ip_ipmi": "192.168.1.1",
"interface_id": 5678,
"port": "eth0",
"User": "root",
"password": "censored"
},
"debug": "Task completed successfully",
"key": "7bc29eb23fb1b879b21fce509597f07c"
}
Failure response
{
"code": -1,
"message": "AsyncKey not found",
"key": "7bc29eb23fb1b879b21fce509597f07c"
}

eq_callback/reinstall

Callback handler from the worker after the reinstallation operation is completed. Updates the server status, clears temporary tags, sends an email to the client with access credentials, and updates billing.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: reinstall
key string Unique identifier of the asynchronous task (32 characters, a-z0-9).
status string JSON string or text status from the worker (e.g., 'deploy_done', 'Error').
stage string Task execution stage (default is 'done').
id int Server ID (if not passed in the status).

Example Request

curl -s "https://api.hostkey.com/eq_callback.php" -X POST \
--data "action=reinstall" \
--data "key=VALUE" \
--data "status=VALUE"
Example of a successful response
{
"result": "OK",
"action": "reinstall",
"callback": "7bc29eb23fb1b879b21fce509597f07c"
}
Failure response
{
"code": -1,
"message": "Key not found",
"action": "eq_callback",
"key": "7bc29eb23fb1b879b21fce509597f07c"
}

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×