Skip to content

pdu.php

PDU management module for retrieving power usage statistics and firmware information via SNMP.

API Methods

Method Action Description
bind bind Performs a bind operation. No business parameters are processed in this action.
check_overload trigger overload check task Triggers a background Jenkins job to check for PDU overloads and logs the task.
get get PDU usage data Returns a list of SNMP-based power usage reports for a specific PDU, including total and historical load data.
load_version get firmware version Retrieves the current firmware version of the PDU via SNMP using its IP address.

pdu/get

Returns a list of SNMP-based power usage reports for a specific PDU, including total and historical load data.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: get
id ✅ integer PDU ID for which to retrieve power usage data.

Request example

curl -s "https://invapi.hostkey.com/pdu.php" -X POST \
--data "action=get" \
--data "id=VALUE"
Success response example
{
"result": "OK",
"data": [
{
"name": "Power Usage 1",
"id": 101,
"total": 250.5,
"5min": 248.2,
"2h": 251.0,
"24h": 249.5
},
{
"name": "Power Usage 2",
"id": 102,
"error": "SNMP timeout"
}
]
}
Error examples
{
"code": -1,
"message": "$module: id is required"
}

pdu/load_version

Retrieves the current firmware version of the PDU via SNMP using its IP address.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: load_version
id ✅ integer The ID of the equipment to retrieve firmware version from.
ip ❌ string IP address of the device for firmware version retrieval.

Request example

curl -s "https://invapi.hostkey.com/pdu.php" -X POST \
--data "action=load_version" \
--data "id=123" \
--data "ip=192.168.1.1"
Success response example
{
"result": "OK",
"id": 123,
"callback": "7bc29eb23fb1b879b21fce509597f07c"
}
Error examples
{
"code": -1,
"message": "$module/load_version: equipment 123 has invalid IP address - 192.168.1.invalid"
}

pdu/check_overload

Triggers a background Jenkins job to check for PDU overloads and logs the task.

HTTP method: POST

Parameters:

action ✅ string Method identifier: check_overload

Request example

curl -s "https://invapi.hostkey.com/pdu.php" -X POST \
--data "action=check_overload"
Success response example
{
"result": "OK",
"module": "pdu",
"action": "check_overload"
}
Error examples
[]

pdu/bind

Performs a bind operation. No business parameters are processed in this action.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: bind

Request example

curl -s "https://invapi.hostkey.com/pdu.php" -X POST \
--data "action=bind"
Success response example
{
"result": "OK",
"action": "bind",
"data": {}
}
Error examples
{
"code": -1,
"message": "Error description"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×