Aller au contenu

eq_callback.php

Module for processing asynchronous responses from workers to manage hardware (EQ) and virtual machines. It processes task statuses (deploy, reinstall, backup, network), updates billing, and sends notifications to customers.

API Methods

Method Action Description
check check task status Checks the execution status of an asynchronous job by key. Returns current state, context, and debug information.
reinstall reinstall server Starts the operating system reinstallation process on the server. If the deploy_options=reinstall parameter is specified in the request, a full cleanup of tags and configuration is performed upon completion.

eq_callback/check

Checks the execution status of an asynchronous job by key. Returns current state, context, and debug information.

HTTP Method: POST

Parameters:

Parameter Required Type Description
key string 32-character alphanumeric task key (async key)
action string Action for callback processing
status string Current execution status
stage string Task execution stage (default: done)
id integer Related entity ID

Example Request

curl -s "https://invapi.hostkey.com/eq_callback" -X POST \
--data "key=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
Example of a successful response
{
"result": "OK",
"action": "check",
"scope": {
"id": 12345,
"location": "NL"
},
"context": {
"action": "deploy",
"id": 12345,
"ip": "1.2.3.4"
},
"debug": "some debug info",
"key": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
Failure response

``` { "code": -1, "message": "AsyncKey a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 not found" }

```

eq_callback/reinstall

Starts the operating system reinstallation process on the server. If the deploy_options=reinstall parameter is specified in the request, a full cleanup of tags and configuration is performed upon completion.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: reinstall
key string 32-character asynchronous task key
status string Execution status (e.g., deploy_done)
params[id] integer Server ID
params[location] string Execution location
params[ticket] string Kayako ticket ID
params[os_name] string Installed OS name
params[soft_name] string Installed software name
params[ip] string Server IP address
params[root_pass] string Root password
params[deploy_options] string Deploy options (e.g., reinstall)

Example Request

curl -s "https://invapi.hostkey.com/eq_callback" -X POST \
--data "action=reinstall" \
--data "key=7bc29eb23fb1b879b21fce509597f07c" \
--data "status=deploy_done" \
--data "params[id]=12345" \
--data "params[deploy_options]=reinstall"
Example of a successful response
{
"result": "OK",
"action": "reinstall",
"callback": "7bc29eb23fb1b879b21fce509597f07c"
}
Failure response

``` { "code": -1, "message": "Reinstallation execution error or invalid status" }