Actions
Actions are operations that are triggered from an event. Examples include email notifications, outlet reboots, send snmp traps.
Action Object
{
"name": "Reboot Router Outlet",
"id": 3,
"enabled": true,
"code": 12,
"params": [
"4-286331153"
]
}| Key | Type | Description |
|---|---|---|
| name | string | Name for action |
| id | number | Unique identifier for action |
| enabled | boolean | Enable or disable execution of action after trigger. |
| code | number | Code for action. See Action Code Table |
| params | array | Array of strings. Corresponds to action code. See Action Code Table |
List All Actions
GET /api/actions Grab list of all actionsExample Request
curl 'http://192.168.1.100/api/events' \
--header 'Authorization: Bearer j2d36cG2ciHKDDqFc3k'Expected response is a list of Action Object
Create New Action
POST /api/actions Create a new ActionRequest
Follows Authentication Scheme
{
"name": "Reboot Router Outlet",
"code": 12,
"params": [
"4-286331153"
]
}name required
Name string up to 100 characters
code required
Action code for particular action. See Action Code Table.
params required for certain triggers
See Action Code Table. Array of strings, maximum 3 parameters.
Example Request
curl 'http://192.168.1.100/api/actions' \
--header 'Authorization: Bearer j2d36cG2ciHKDDqFc3k' \
--data '{"name":"Reboot Router Outlet","code":12,"params":["4-286331153"]}'Expected response is an Action Object
Modify Action
POST /api/actions/:action_id Modifies specific actionFollows Authentication Scheme
Same request body as Creating New Action
Example Request
curl 'http://192.168.1.100/api/actions/1' \
--header 'Authorization: Bearer j2d36cG2ciHKDDqFc3k' \
--data '{"name":"Reboot Router Outlet","code":12,"params":["5-286331153"]}'Expected response is an Action Object
Delete Action Permanently
DELETE /api/actions/:action_id Permanently remove actionRequest
Follows Authentication Scheme
{} // no request parametersExample Request
curl -X DELETE 'http://192.168.1.100/api/actions/1' \
--header 'Cookie: SPID=j2d36cG2ciHKDDqFc3k'Expected response is a 200 HTTP response for success.
Action Code Table
| Code | Name | Parameter 1 | Parameter 2 | Parameter 3 | Description | |
|---|---|---|---|---|---|---|
| 11 | Switch Outlet | Outlet ID | State to switch to | -- | State to switch to. either "ON" or "OFF" | |
| 12 | Reboot Outlet | Outlet ID | -- | -- | ||
| 15 | Email Recipient | Email Address | -- | -- | Must have SMTP settings configured. | |
| 16 | Switch Outlet Group | Group ID | State to switch to | -- | State to switch to. Either "ON" or "OFF" | |
| 17 | Powercycle Outlet Group | Group ID | -- | -- | ||
| 18 | SNMPv2 Trap Notification | Trap Manager Host | Trap Community String | -- | ||
| 19 | SNMPv3 Trap Notification | Trap Manager Host | -- | -- | ||
| 20 | HTTP Post Request | URL/IP Address | Optional Power Stats | -- | Using URL requires proper DNS Configuration. Stat Options: "none", "inlets", "sensors", "outlets", and "circuits" | |
| 22 | Switch Output Relay | Output Relay Name | State to switch to | -- | Only available on PDUs with Output Relay | |
| 23 | Reboot Output Relay | Output Relay Name | -- | -- | Only available on PDUs with Output Relay | |
| 24 | Switch Off Other PDU Outlet | IP of Other PDU | Outlet ID or Index | Personal Access Token from Other PDU | Performs action on "Other" PDU on the same network | |
| 25 | Switch On Other PDU Outlet | IP of Other PDU | Outlet ID or Index | Personal Access Token from Other PDU | Performs action on "Other" PDU on the same network | |
| 26 | Switch Off Other PDU Outlet Group | IP of Other PDU | Group ID or Index | Personal Access Token from Other PDU | Performs action on "Other" PDU on the same network | |
| 27 | Switch On Other PDU Outlet Group | IP of Other PDU | Group ID or Index | Personal Access Token from Other PDU | Performs action on "Other" PDU on the same network | |
| 28 | Reboot Other PDU Outlet | IP of Other PDU | Outlet ID or Index | Personal Access Token from Other PDU | Performs action on "Other" PDU on the same network | |
| 29 | Reboot Other PDU Outlet Group | IP of Other PDU | Group ID or Index | Personal Access Token from Other PDU | Performs action on "Other" PDU on the same network | |
| 30 | Switch Secondary Network Interface | -- | -- | Requires USB-to-Ethernet Accessory to enable Secondary NIC | ||
| 31 | Reset kWh Meter | -- | -- | Only available on PDUs with Energy Metering. | ||
| 32 | Smart IO Hub Relay Switch | Sensor Port (A or B) | Output Relay Index (1-6) | Output Relay State (OPEN/CLOSE) | Requires SPA-0140 Smart IO Hub. Switches a output relay. |