Actions

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"
  ]
}
KeyTypeDescription
namestringName for action
idnumberUnique identifier for action
enabledbooleanEnable or disable execution of action after trigger.
codenumberCode for action. See Action Code Table
paramsarrayArray of strings. Corresponds to action code. See Action Code Table
 

List All Actions

GET     /api/actions               Grab list of all actions

Example 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 Action

Request

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 action

Follows 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 action

Request

Follows Authentication Scheme

{} // no request parameters

Example 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

CodeNameParameter 1Parameter 2Parameter 3Description
11Switch OutletOutlet IDState to switch to--State to switch to. either "ON" or "OFF"
12Reboot OutletOutlet ID----
15Email RecipientEmail Address----Must have SMTP settings configured.
16Switch Outlet GroupGroup IDState to switch to--State to switch to. Either "ON" or "OFF"
17Powercycle Outlet GroupGroup ID----
18SNMPv2 Trap NotificationTrap Manager HostTrap Community String--
19SNMPv3 Trap NotificationTrap Manager Host----
20HTTP Post RequestURL/IP AddressOptional Power Stats--Using URL requires proper DNS Configuration. Stat Options: "none", "inlets", "sensors", "outlets", and "circuits"
22Switch Output RelayOutput Relay NameState to switch to--Only available on PDUs with Output Relay
23Reboot Output RelayOutput Relay Name----Only available on PDUs with Output Relay
24Switch Off Other PDU OutletIP of Other PDUOutlet ID or IndexPersonal Access Token from Other PDUPerforms action on "Other" PDU on the same network
25Switch On Other PDU OutletIP of Other PDUOutlet ID or IndexPersonal Access Token from Other PDUPerforms action on "Other" PDU on the same network
26Switch Off Other PDU Outlet GroupIP of Other PDUGroup ID or IndexPersonal Access Token from Other PDUPerforms action on "Other" PDU on the same network
27Switch On Other PDU Outlet GroupIP of Other PDUGroup ID or IndexPersonal Access Token from Other PDUPerforms action on "Other" PDU on the same network
28Reboot Other PDU OutletIP of Other PDUOutlet ID or IndexPersonal Access Token from Other PDUPerforms action on "Other" PDU on the same network
29Reboot Other PDU Outlet GroupIP of Other PDUGroup ID or IndexPersonal Access Token from Other PDUPerforms action on "Other" PDU on the same network
30Switch Secondary Network Interface----Requires USB-to-Ethernet Accessory to enable Secondary NIC
31Reset kWh Meter----Only available on PDUs with Energy Metering.
32Smart IO Hub Relay SwitchSensor Port (A or B)Output Relay Index (1-6)Output Relay State (OPEN/CLOSE)Requires SPA-0140 Smart IO Hub. Switches a output relay.