Skip to content

Iso

API Methods

Method Action Description
add add ISO image Adds a new ISO image or updates an existing one by name.
delete delete ISO image Deletes an ISO image by ID.
list_iso get list of ISO images Returns a list of available ISO images.
mount_iso mount ISO image Mounts an ISO image on the specified server.
unmount_iso unmount ISO image Unmounts an ISO image from the specified server.
upload upload ISO image Uploads an ISO image via URL.
uploaded get list of uploaded ISO images Returns a list of uploaded ISO images for a client or staff member.

iso/add

Adds a new ISO image or updates an existing one by name.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: add
token string Authorization token
params[name] string Full name of the ISO image
params[short_name] string Short name of the ISO image
params[iso_name] string ISO image filename
params[private] string Client email (valid email)
params[description] string Image description
params[admin_only] integer Flag for admin-only access (0 or 1)
params[status] string Image status (default 'Pending')

Example Request

curl -s "https://api.hostkey.com/iso.php" -X POST \
--data "action=add" \
--data "token=HOSTKEY_TOKEN" \
--data "params[name]=VALUE" \
--data "params[short_name]=VALUE" \
--data "params[iso_name]=VALUE" \
--data "params[private]=VALUE"
Example of a successful response
{
"result": "OK",
"action": "add",
"module": "iso",
"data": {
"id": 123,
"name": "Ubuntu 22.04",
"short_name": "ubuntu-22.04",
"iso_name": "ubuntu-22.04.iso",
"private": "[email protected]",
"description": "Ubuntu 22.04 LTS",
"admin_only": 0,
"status": "Pending"
}
}
Failure response
{
"code": -1,
"message": "invalid argument iso_name"
}

iso/delete

Deletes an ISO image by ID.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: delete
token string Authorization token
id int ID of the ISO image to delete

Example Request

curl -s "https://api.hostkey.com/iso.php" -X POST \
--data "action=delete" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE"
Example of a successful response
{
"result": "OK",
"action": "delete",
"module": "iso",
"data": {
"id": 123,
"status": "deleted"
}
}
Failure response
{
"code": -1,
"message": "ISO not found"
}

iso/list_iso

Returns a list of available ISO images.

HTTP Method: GET

Parameters:

Parameter Required Type Description
action string Method identifier: list_iso
token string Authorization token
id int Server ID (required for clients)

Example Request

curl -s "https://api.hostkey.com/iso.php" -X GET \
--data "action=list_iso" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE"
Example of a successful response
{
"result": "OK",
"action": "list_iso",
"module": "iso",
"server_id": 456,
"iso_images": [
{
"id": 1,
"iso_name": "ubuntu-22.04.iso",
"url": "https://example.com/ubuntu-22.04.iso",
"description": "Ubuntu 22.04 LTS",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": 2,
"iso_name": "windows-11.iso",
"url": "https://example.com/windows-11.iso",
"description": "Windows 11 Pro",
"created_at": "2024-01-16T11:45:00Z"
}
]
}
Failure response
{
"code": -1,
"message": "Server id required"
}

iso/mount_iso

Mounts an ISO image on the specified server.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: mount_iso
token string Authorization token
id int Server ID
iso string ISO image name to mount

Example Request

curl -s "https://api.hostkey.com/iso.php" -X POST \
--data "action=mount_iso" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE" \
--data "iso=VALUE"
Example of a successful response
{
"result": "OK",
"action": "mount_iso",
"callback": "7bc29eb23fb1b879b21fce509597f07c"
}
Failure response
{
"code": -1,
"message": "ISO name required"
}

iso/unmount_iso

Unmounts an ISO image from the specified server.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: unmount_iso
token string Authorization token
id int Server ID

Example Request

curl -s "https://api.hostkey.com/iso.php" -X POST \
--data "action=unmount_iso" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE"
Example of a successful response
{
"result": "OK",
"action": "unmount_iso",
"callback": "7bc29eb23fb1b879b21fce509597f07c"
}
Failure response
{
"code": -1,
"message": "iso/unmount_iso: Server id required"
}

iso/upload

Uploads an ISO image via URL.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: upload
token string Authorization token
params[url] string URL for image upload (must end with .iso)
params[email] string Client email (required for staff)
params[customer_id] int Client ID (required for staff)

Example Request

curl -s "https://api.hostkey.com/iso.php" -X POST \
--data "action=upload" \
--data "token=HOSTKEY_TOKEN" \
--data "params[url]=VALUE"
Example of a successful response
{
"result": "OK",
"action": "upload",
"module": "iso",
"data": {
"id": 124,
"name": "custom-image",
"url": "https://example.com/custom-image.iso",
"size": 1073741824,
"key": "7bc29eb23fb1b879b21fce509597f07c"
}
}
Failure response
{
"code": -1,
"message": "Invalid URL"
}

iso/uploaded

Returns a list of uploaded ISO images for a client or staff member.

HTTP Method: GET

Parameters:

Parameter Required Type Description
action string Method identifier: uploaded
token string Authorization token
params[email] string Client email (required for staff)

Example Request

curl -s "https://api.hostkey.com/iso.php" -X GET \
--data "action=uploaded" \
--data "token=HOSTKEY_TOKEN"
Example of a successful response
{
"result": "OK",
"action": "uploaded",
"module": "iso",
"data": [
{
"id": 125,
"name": "debian-12.iso",
"status": "active"
}
]
}
Failure response
{
"code": -1,
"message": "Incorrect parameter params"
}

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