Skip to content

Iso

API Methods

Method Action Description
add create or update ISO Adds a new ISO image or updates an existing one by name. Requires administrator privileges.
del delete ISO Deletes an ISO image. Available to administrators and owners of private images.
delete delete ISO (alternative) Alternative method to delete an ISO image by ID.
history get history Returns the history of operations with ISO images.
list_iso get ISO list Returns a list of available ISO images. Server ID is required for clients.
mount_iso mount ISO Mounts an ISO image to the specified server. Returns a task key for tracking.
unmount_iso unmount ISO Unmounts an ISO image from the specified server. Returns a task key.
update update ISO Updates metadata of an existing ISO image.
upload upload ISO Uploads an ISO image via URL. Requires email and customer_id for staff members.
uploaded list uploaded ISOs 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. Requires administrator privileges.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: add
token string Authorization token
params[name] string Full ISO name
params[short_name] string Short ISO name
params[iso_name] string ISO file name
params[private] string Client email (valid email)
params[description] string ISO image description
params[admin_only] integer Flag for administrator-only access (0 or 1)
params[status] string ISO 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": "ubuntu22",
"iso_name": "ubuntu-22.04.iso",
"private": "[email protected]",
"description": "Ubuntu Server 22.04 LTS",
"admin_only": 0,
"status": "Pending",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
Failure response
{
"code": -1,
"message": "invalid argument iso_name"
}

iso/del

Deletes an ISO image. Available to administrators and owners of private images.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: del
token string Authorization token
params[id] int ID of the ISO image to delete
params[pending] bool Delete the record from the database immediately (without queuing)

Example Request

curl -s "https://api.hostkey.com/iso.php" -X POST \
--data "action=del" \
--data "token=HOSTKEY_TOKEN" \
--data "params[id]=VALUE"
Example of a successful response
{
"result": "OK",
"action": "del",
"module": "iso",
"data": {
"result": "ok",
"key": "7bc29eb23fb1b879b21fce509597f07c"
}
}
Failure response
{
"code": -1,
"message": "Can't find iso data for id={id}"
}

iso/delete

Alternative method to delete 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
}
}
Failure response
{
"code": -1,
"message": "ISO id required"
}

iso/history

Returns the history of operations with ISO images.

HTTP Method: POST

Parameters:

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

Example Request

curl -s "https://api.hostkey.com/iso.php" -X POST \
--data "action=history" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE"
Example of a successful response
{
"result": "OK",
"action": "history",
"module": "iso",
"data": [
{
"id": 1,
"date": "2024-01-15 10:30:00",
"description": "ISO uploaded",
"type": "upload",
"login": "[email protected]",
"message": "ISO uploaded",
"iso_name": "ubuntu-22.04.iso"
}
]
}
Failure response
{
"code": -1,
"message": "invalid argument id '-1'"
}

iso/list_iso

Returns a list of available ISO images. Server ID is required for clients.

HTTP Method: POST

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 POST \
--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": 123,
"iso_name": "ubuntu-22.04.iso",
"description": "Ubuntu Server 22.04 LTS",
"size": 2147483648,
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": 124,
"iso_name": "windows-server-2022.iso",
"description": "Windows Server 2022",
"size": 5368709120,
"created_at": "2024-01-16T09:15:00Z"
}
]
}
Failure response
{
"code": -1,
"message": "Server id required"
}

iso/mount_iso

Mounts an ISO image to the specified server. Returns a task key for tracking.

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. Returns a task key.

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/update

Updates metadata of an existing ISO image.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: update
token string Authorization token
params[id] int ID of the ISO image to update
params[description] string New description
params[iso_name] string New ISO name

Example Request

curl -s "https://api.hostkey.com/iso.php" -X POST \
--data "action=update" \
--data "token=HOSTKEY_TOKEN" \
--data "params[id]=123" \
--data "params[description]=Updated description" \
--data "params[iso_name]=ubuntu-22.04-updated.iso"
Example of a successful response
{
"result": "OK",
"action": "update",
"module": "iso",
"data": {
"id": 123,
"iso_name": "ubuntu-22.04-updated.iso",
"description": "Updated description",
"updated_at": "2024-01-15T12:00:00Z"
}
}
Failure response
{
"code": -1,
"message": "ISO not found"
}

iso/upload

Uploads an ISO image via URL. Requires email and customer_id for staff members.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: upload
token string Authorization token
params[url] string ISO image URL (https://...)
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": 125,
"name": "debian-12",
"url": "https://example.com/iso/debian-12.iso",
"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: POST

Parameters:

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

Example Request

curl -s "https://api.hostkey.com/iso.php" -X POST \
--data "action=uploaded" \
--data "token=HOSTKEY_TOKEN"
Example of a successful response
{
"result": "OK",
"action": "uploaded",
"module": "iso",
"data": [
{
"id": 123,
"name": "ubuntu-22.04.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 ×