Power Alert Device Manger (v20)

REST API User’s Guide

 

Introduction

Beginning with version 20.0.0, PowerAlert Device Manager (PADM) supports a Representational State Transfer (REST) Application Programming Interface (API). This specification document defines the REST APIs, including the Uniform Resource Identifier (URI), method, parameters, request body and response body. These specifications are intended to provide all required details to call the PowerAlert REST APIs and to build scripts around these calls.

Supported REST API Version

 

PowerAlert Release

Rest API Version

20.0

1.0.0

 

The API version should be entered in the 'Accept-Version' header, as shown in the image below. If the version is not entered, the server returns the latest supported version. Third party systems that consume the PowerAlert API should provide the expected version in this header.

 

Client Request

GET https://{poweralert_endpoint}/api/devices   
Authorization: Bearer {access_token}
Content-Type: application/vnd.api+json
Accept-Version: 1.0.0

 

Guidelines

Authentication and Authorization

·       Authentication and Authorization of the PowerAlert API is based on the OAuth2.0 standard and uses a JSON Web Token (JWT)

·       A successful authentication request returns a valid access token

·       In all cases, a valid access token is required to interact with the PowerAlert API

·       Refer to the Authentication Model section of this document for additional details

Validation and Constraints

As shown below, an API response for a GET request has “meta” and “data” parts. The “meta” part consists of validation and constraints; the “data” part contains a response attribute in the form of key value pairs. Validation provides information about the data attribute (e.g. minimum and maximum), whereas constraints indicate whether a data attribute is required and can be edited or deleted. Refer to Appendix B for a detailed explanation of metadata.

 

{
        "meta": {
                 "id": "6a85a9a9-7f7a-4538-941c-c33dbacb3077",
                 "constraints": {
                         "max_items": 0,
                         "min_items": 0,
                         "editable_attributes": [
                                 "name",
                                 "location",
                         ],
                         "required_attributes": [],
                         "delete_allowed": true
                 },
                 "validation": [
                         {
                                 "attribute": "name",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 1,
                                 "max_length": 64,
                                 "pattern": "",
                                 "enum": [],
                                 "type": "string"
                         },
                         {
                                 "attribute": "location",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 1,
                                 "max_length": 80,
                                 "pattern": "",
                                 "enum": [],
                                 "type": "string"
                         }
                 ]
        },
        "data": {
                 "type": "devices",
                 "id": "1",
                 "attributes": {
                         "name": "device-123",
                         "manufacturer": "TRIPP LITE",
                         "location": "chicago"
                 }
        }
}

Validations and constraints may be omitted by turning the validation flag to false. e.g:  /api/email-contacts?validation=false

Required Attributes

Required attributes are needed when adding objects (POST requests). A list of required attributes for a specific endpoint are listed in the “meta” section of the GET response. In the example below, the “meta” section of the  GET /api/ localusers response lists the required attributes (shown in bold).

{
    "meta": {
        "id": "f760f23e-175d-4704-b81d-e37e5e34566b",
        "constraints": {
        
            "editable_attributes": [
               
            ],
            "required_attributes": [
                "name",
                "password",
                "role",
                "session_timeout_enabled",
                "idle_timeout_enabled"
            ],
            "delete_allowed": true
        },
        "validation": [
               ..]
        ...
       }
}            

Each update (PATCH) request supports partial updates in which case all the fields are not required. Only the values specified in the request body are updated; missing fields are omitted, retaining their values.

Content Type

Clients must send all requests with the following header:

Content-Type: application/vnd.api+json

The server responses also include this header.

API Unique Identifier

A unique identifier is required to create, read, update and/or delete an individual item. This identifier can either be ID or name. If using name as the identifier, then he following custom HTTP header is required to access data by name.

 

By: name

 

 

Authentication Model

Authentication Endpoint

PowerAlert uses the OAuth 2.0 token-based authentication model. Under this model, a user calls POST /api/outh/token to request an access token. A token is returned if the credential (user name and password) in the POST request is valid. The token appears in the headers of each subsequent request and determines if the user is authorized to perform the operation. The access token must be included in the HTTP header of subsequent requests.  For details see section Authentication (Login & Logout).

 

 

Authentication Request

POST https://{poweralert_endpoint}//api/oauth/token
Content-Type: application/vnd.api+json
Accept-Version: 1.0.0
{
    "username":"localadmin",
    "password":"localadmin",
    "grant_type": "password"
}               

 

Authentication Response

 

On receiving a valid request, the server returns an access token and refresh token with a “successful” HTTP Error Code response:

 

Status: 200 OK

 

Refer to Appendix A for information on HTTP Error Codes.

{
    "access_token": "eyJ0eXoiVElNRUZPUk1BVF9ITU1TU1RUIiwiaWRsZV90aW1lb3V0Ijo2MCwic2Vzc2lvbl90aW1lb3V0IjozNlsibG9nX2ZpbGVzOnIiLCJzc2xfdXBsb2FkOnJ3Iiwic3NsX2Rvd25sb2FkOnIiLCJhcGk6cnciLCJlYnBfdXBsb2FkOnJ3Il19fQ.8fKhR3Rkk5AlVS3i4QosTlqXlx5TdX5uD9FN7w1p-9k",
    "msg": "Logged in as localadmin",
    "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjMxNTY4OTksIm5iZiI6MTYyMzE1Njg5OSwianRpIjoiNjY2NzBmMWQtYzg2Ny00YzA4LWE1ZTQtMTQ1YjI2MjY1ZDExIiwiZXhwIjoxNjIzMTc4NDk5LCJpZGVudGl0eSI6ImxvY2FsYWRtaW4iLCJ0eXP3dHyMyqo41ur0NvZ9QveWNxu4Q"
}                      

 

Accessing Other APIs

 

To interact with PowerAlert API, a valid access token generated from a successful authentication response must be entered in the HTTP header. In the example below -- getting device information from PowerAlert – the token is entered in place of {access_token}. The IP address or host name is entered in place of {poweralert_endpoint}.

 

GET https://{poweralert_endpoint}/api/devices/1 
Authorization: Bearer {access_token}
Content-Type: application/vnd.api+json
Accept-Version: 1.0.0

 

Refresh Token

 

The refresh token helps to acquire a new access token when the existing one expires. Use the /api/oauth/refresh endpoint to refresh the access token. For the API to work, the refresh token must be included in the Authorization header.

 

Refresh Token Request:

POST https://{poweralert_endpoint}/api/oauth/refresh 
Authorization: Bearer {refresh_token}
Content-Type: application/vnd.api+json
Accept-Version: 1.0.0

 

Refresh Token Response:

Status: 200 OK
{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXlRJTUVGT1JNQVRfREVGQVVMVCIsImlkbGVfdGltZW91dCI6NjAsInNlc3Npb25fdGltZW91dCI6MzYwLCJwcml2aWxlZ2VzIjpbImxvZ19maWxlczpyIiwic3NsX3dyJdfX0.tuhFpE7XD4uZqsEUn1pL9wQB5Ne0bIJYYXv5nTHNIy4"
}

 

Logging Out

 

To Log Out, issue a logout API request to invalidate the existing access token.

 

Logout Request:

 

POST https://{poweralert_endpoint}/api/oauth/token/logout 
Authorization: Bearer {refresh_token}
Content-Type: application/vnd.api+json
Accept-Version: 1.0.0

 

Logout Response:

 

Status: 200 OK
{"msg":"Refresh token has been revoked"}

 

Examples

A number of basic examples are provided in this section; refer to the following link for additional examples.

https://documenter.getpostman.com/view/447714/TzeUn8vX

 

The following two variables are used throughout the examples:

·       {{DevEndpointHttps}} – This represents the HTTP(S) endpoint of a device, for example: http://10.22.0.98

·       {{access_token}} – This access token is required for interacting with the PowerAlert API Refer to the Authentication Model section of this document for details on obtaining this access token.

 

Device Properties

This section provides API examples on how to retireve and update attributes of a PowerAlert device and any peripherals connected to it.  Some attributes, such as “Device Name”, “Location”, “Installation Data” and “Asset Identifier” can be edited using device update service (PATCH /api/device/id).

 

Retrieving Device Properties

 

The example below retrieves all properties of the PowerAlert device and any connected peripherals. Specify the port if it different from the default values of 80 for HTTP or 443 for HTTPS.

 

Device Properties Request:

 

curl --location -g --request GET '{{DevEndpointHttps}}/api/devices' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--data-raw ''     
 

Device Properties Response:

 

Status: 200 OK

 

{
        "meta": {
               "id": "a0dd05e8-729e-4a20-907d-ef4994731226",
               "constraints": {
                       "max_items": 0,
                       "min_items": 0,
                       "editable_attributes": [
                               ...
                               
                       ],
                       "required_attributes": [],
                       "delete_allowed": true
               },
               "validation": [{
                  ..
               }
               ]
        },
        "data": [{
                       "type": "devices",
                       "id": "1",
                       "attributes": {
                               "device_id": 1,
                               "name": "Device0391",
                               "manufacturer": "TRIPP LITE",
                               "model": "SMART1500RM2U",
                               "serial_number": "2850DY0SM820600391",
                               "protocol": "3015",
                               "location": "Chicago",
                               "port_mode": "DEVICE_COMM_RS232",
                               "port_name": "/dev/ttyS2",
                               "region": "Mid West",
                               "install_date": "2021-05-17",
                               "deactivate_date": ""
                         ...
                       }
               },
               {
                       "type": "devices",
                       "id": "2",
                       "attributes": {
                               "device_id": 2,
                               "name": "Sensor0473",
                               "manufacturer": "TRIPP LITE",
                               "model": "E2MTHDI ",
                               "serial_number": "2833AV0AC89FC00473",
                               "protocol": "9300",
                               "location": "",
                               "port_mode": "DEVICE_COMM_RS232",
                               "port_name": "/dev/serial/by-id/usb-TRIPP_LITE_TRIPP_LITE_E2MTHDI_2833AV0AC89FC00473-if00",
                               "region": "",
                               "install_date": "2021-05-17",
                               "deactivate_date": "2021-05-21"
                         ....
                       }
               }
        ]
}

 

·       This example shows only a portion of the response; the device has many more attributes.

·       Use device id or name “/api/devices/{id}” to retrieve the attributes of one device.

·       Use the following HTTP header to retrieve attributes by device name

 

By: name

 

Retrieving a Device’s Properties by ID:

 

curl --location -g --request GET '{{DevEndpointHttps}}/api/devices/{DeviceId}' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--data-raw ''  

 

Retrieving a Device’s Properties by name:

 

curl --location -g --request GET '{{DevEndpointHttps}}/api/devices/{DeviceName}' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--header 'By: name' \
--data-raw ''  
 

 

 

Updating Editable Device Properties

 

Note that device ID or device name is required to edit attributes.

 

Device Update Request by ID:

 

curl --location -g --request PATCH '{{DevEndpointHttps}}/api/devices/{deviceId}' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--data-raw '{
               "data": {
                       "type": "devices",
                       "attributes": {
                       "id": "1",
                       "name": "Device0391",
                       "location": "Chicago",
                       "manufacturer": "TRIPP LITE",
                       "installDate": "2021-05-18",
                       "region": "USA",
                       "configured_device_id": 123,
                       "configured_asset_tag": "tripplitelight-0123456",
                       "install_date": "2021-05-18"
                       }
               }
         }'

·       The following attributes are editable: name, location, manufacturer, location, region, configured_device_id and configured_asset_tag.

·       Similar to GET, the device ID must be specified when requesting updates. Alternatively the device name can be used along with the following Http cusom header.

By: name

 

Device Update Request by name:

 

curl --location -g --request PATCH '{{DevEndpointHttps}}/api/devices/Device0391' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--header 'By: name' \
--data-raw '{
               "data": {
                       "type": "devices",
                       "attributes": {
                       "id": "1",
                       "name": "Device0391",
                       "location": "Chicago",
                       "manufacturer": "TRIPP LITE",
                       "installDate": "2021-05-18",
                       "region": "USA",
                       "configured_device_id": 123,
                       "configured_asset_tag": "tripplitelight-0123456",
                       "install_date": "2021-05-18"
                       }
               }
         }'

 

Device Update Response:

 

Status: 200 OK

 

{
        "meta": {
               "id": "c143e284-a1b3-4d64-ad72-64092e3dfac8"
        },
        "data": {
               "type": "devices",
               "id": "1",
               "attributes": {
                       "response": 0
               }
        }
}

 

Device Metrics       

This section provides API examples for retrieving devices metrics (variables), including:

·       Runtime Remaining

·       Battery Voltage

·       Battery Capacity

·       Input and Output Voltage / Current

·       Input and Output Frequency

·       Output Utilization

·       Temperature

 

Metrics can be retrieved as a full set or by individual variable

 

Retrieving All Device Metrics

 

Device Metrics Request:

 

curl --location -g --request GET '{{DevEndpointHttps}}/api/variables' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \    
--data-raw ''
 

 

Device Metrics (Variables) Response:

{
        "meta": {
               "id": "a0dd05e8-729e-4a20-907d-ef4994731226",
               "constraints": {
                       "max_items": 0,
                       "min_items": 0,
                       "editable_attributes": [
                               ...            
                       ],
                       "required_attributes": [],
                       "delete_allowed": true
               },
               "validation": [{
                  ..
               }
               ]
        },
        "data": [{
                       "type": "variables",
                       "id": "1",
                       "attributes": {
                               "key": 872415338,
                               "device_id": 1,
                               "device_name": "Device0391",
                               "device_type": "DEVICE_TYPE_UPS",
                               "label": "Runtime Remaining (Min)",
                               "value": "474",
                               "min_value": 0,
                               "max_value": 1440,
                               "suffix": "Minutes",
                               "group": "VARGROUP_BATTERY",
                               "purpose": "VARPURPOSE_STATUS",
                               "data_type": "VARTYPE_INTEGER",
                               "state": "DEVICE_STATE_NORMAL",
                               "display_label": "Runtime Remaining",
                               "raw_value": "474",    
                               ....
                       }
               },
               {
                       "type": "variables",
                       "id": "2",
                       "attributes": {
                               "key": 872415360,
                               "device_id": 1,
                               "device_name": "Device0391",
                               "device_type": "DEVICE_TYPE_UPS",
                               "label": "Battery Capacity",
                               "value": "100",
                               "min_value": 0,
                               "max_value": 100,
                               "suffix": "%",
                               "group": "VARGROUP_BATTERY",
                               "purpose": "VARPURPOSE_STATUS",
                               "data_type": "VARTYPE_INTEGER",
                               "state": "DEVICE_STATE_NORMAL",
                               "display_label": "Battery Capacity",
                               "raw_value": "100",
                         ....
                       }
               },
               ...             
        ]
}

 

·       This example shows only a portion of the response; the device has many more variables.

·       This response shows all variables for the PowerAlert device and connected peripherals – Each variable has a device ID, type and details

·       Attribute “label” is the variable name, “value” is the value of the variable and “suffix” is the unit of measure.

 

Retrieving Individual Device Metrics

 

Request Using ID:

curl --location -g --request GET '{{DevEndpointHttps}}/api/variables/{variableId}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--data-raw ''
 

Where {variableId} is the device metric ID or variable ID

 

Retrieve a variable using its ID:

https://10.22.0.58/api/variables/7

 

 A variable can also be retrieved using its name in which case the following values must be included in the HTTP header.

·       “By : name”

·       “deviceId : {id}” or “deviceName: {name}” – Where id is the unique ID of the device and name is the name of the device 

 

Request Using Name:

 

curl --location -g --request GET '{{DevEndpointHttps}}/api/variables/{variableName}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'By: name' \
--header 'deviceName: Device0391' \
--header 'Accept-Version: 1.0.0' \
--data-raw ''

 

Where {variableName} is device metric name or variable name

 

Example: https://10.22.0.98/api/variables/Runtime Remaining (Min)

 

Response:

 

Status: 200 OK

 

{
        "meta": {
               "id": "a0dd05e8-729e-4a20-907d-ef4994731226",
               "constraints": {
                       "max_items": 0,
                       "min_items": 0,
                       "editable_attributes": [
                               ...            
                       ],
                       "required_attributes": [],
                       "delete_allowed": true
               },
               "validation": [{
                  ..
               }
               ]
        },
        "data": {
               "type": "variables",
               "id": "1",
               "attributes": {
                       "key": 872415338,
                       "device_id": 1,
                       "device_name": "Device0391",
                       "device_type": "DEVICE_TYPE_UPS",
                       "label": "Runtime Remaining (Min)",
                       "value": "474",
                       "min_value": 0,
                       "max_value": 1440,
                       "suffix": "Minutes",
                       "group": "VARGROUP_BATTERY",
                       "purpose": "VARPURPOSE_STATUS",
                       "data_type": "VARTYPE_INTEGER",
                       "state": "DEVICE_STATE_NORMAL",
                       "display_label": "Runtime Remaining",
                       "raw_value": "474",    
                         ....
               }
        }
}

API Reference

All PowerAlert REST APIs leverage HTTP Status Codes to indicate errors and successful responses. Refer to Appendix A for details.

Actions

Action APIs enable configuration of action parameters applicable to the device and connected peripherals. Below are examples of configurable action parameters, followed by the supported enumerations (enums):

·       Delay – the number of seconds the action will wait to execute after being triggered

·       Target Device – the device undergoing the action

·       Interval – the number of seconds between successive executions of the action

·       Count – the number of times the action will be executed

·       Contacts – one or more notification/trap/set recipients

·       Action Type – the type of action; each has an enumeration value

·       Trigger Event – the trigger for the action, occurring either when the event is set (On Set) or cleared (On Clear). These events contains additional attributes pertaining to the event (device, load, etc). 

 

source_type:

EVENT_SOURCE_TYPE_DEVICE
EVENT_SOURCE_TYPE_AUTOPROBE
EVENT_SOURCE_TYPE_SYSTEM

 

action_type:

ACTIONTYPE_REBOOT_WEBLX

ACTIONTYPE_TURN_OFF_DEVICE

ACTIONTYPE_TURN_ON_DEVICE

ACTIONTYPE_SENSOR

ACTIONTYPE_EMAIL

ACTIONTYPE_SNMP_SET_OID

ACTIONTYPE_SNMP_TRAP

ACTIONTYPE_SMS

ACTIONTYPE_LOAD

ACTIONTYPE_LOAD_GROUP

ACTIONTYPE_RAMP

ACTIONTYPE_SHED

ACTIONTYPE_EXEC_SCRIPT

ACTIONTYPE_SHUTDOWN_OS

ACTIONTYPE_REBOOT_OS

ACTIONTYPE_REMOTE_SHUTDOWN

ACTIONTYPE_RESTART_DEVICE

 

 

GET All Actions

This API returns a summary of all available actions.

 

Title

GET All Actions                                                                                                

URL

/api/actions

Method

GET

Success Response

Code: 200
Content: {

    "meta": {

        "id": "837e874a-507e-4061-b6f9-f6835e977e9e",

        "constraints": {

                   ..

        },

        "validation": [

          

        ]

    },

    "data": [

        {

            "type": "actions",

            "id": "1",

            "attributes": {

                "name": "Default Email Notification", //String ValueAction Name

                "action_type": "ACTIONTYPE_EMAIL", //ActionType ENUM

                "key": 1281,// <Intger value>

                "delay": 30, //Delay integer value

                "interval": 0,// Integer Value

                "count": 1, // Integer Value

                "enabled": true,

                "redundant": false,

                "set_events": 25, // Integer Value

                "clear_events": 25 // Integer Value           }

        }

  ]

}

Sample Call

curl –i -H "Accept: application/vnd.api+json" 

http://localhost:3001/api/actions

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete Action

This API deletes an action, based on action ID or action name

 

Title

Delete Action                                                                                               

URL

/api/actions/:actionId

OR

To delete using name: /api/actions/:actionName 

"by:name" http header is required to delete by name

Method

DELETE

Success Response

Code: 200
Content: {

    "meta": {

        "id": "b3039324-3961-4188-b6b1-649daf7794fb"

    },

    "data": {

        "type": "actions",

        "id": 0,

        "attributes": {

            "response": 0

        }

    }

}

Sample Call

curl –I -H "Accept: application/vnd.api+json" –X "DELETE”

http://localhost:3001/api/actions/7

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete Multiple Actions

This API deletes multiple actions based on the action IDs provided in the body

 

Title

Delete Multiple Actions

URL

/api/actions

Method

DELETE

Data Params

{

       "data": [{

             "type": "actions",

             "id": "9" //Integer Action ID

       }, {

             "type": "actions",

             "id": "10"

       }]

}

Success Response

Code: 200
Content: {

    "meta": {

        "id": "bf1c99d8-d8c4-4fbf-8cb7-eb9facdde7c3" //Request Id

    },

    "data": [

        {

            "type": "actions",

            "id": "9" //Integer action Id

        },

        {

            "type": "actions",

            "id": "10"

        }

    ]

}

Version 

"Accept-Version: 1.0.0"

                       

 

GET Supported Actions

This API provides the Boolean value for each of the action types, indicating support for on_set, on_clear and mutually_exclusive. If mutually_exclusive is set to true, either on_set or on_clear can be supported, but not both.

 

Title

GET Supported Actions

URL

/api/actions/supported

Method

GET

Success Response

Code: 200
Content: {

       "meta": {

             "id": "1d20d459-83a4-4168-8aa9-debfbcc6e6a5"

       },

       "data": {

             "type": "actions-supported",

             "id": "ActionsSupported",

             "attributes": {

                    "email_supported": {

                          "supported_on_set": true, //Boolean

                          "supported_on_clear": true, //Boolean

                          "mutually_exclusive": false //Boolean

                    },

                    "sms_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": false

                    },

                    "snmp_trap_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": false

                    },

                    "snmp_set_oid_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": true

                    },

                    "reboot_webcardlx_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": false,

                          "mutually_exclusive": false

                    },

                    "turn_off_device_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391"

                          }]

                    },

                    "turn_on_device_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1, //Integer

                                 "name": "Device0391" //String

                          }]

                    },

                    "reboot_os_supported": {

                          "supported_on_set": false,

                           "supported_on_clear": false,

                          "mutually_exclusive": false

                    },

                    "sensor_supported": {

                          "supported_on_set": false,

                          "supported_on_clear": false,

                          "mutually_exclusive": false,

                          "devices": []

                    },

                    "ramp_supported": {

                          "supported_on_set": false,

                          "supported_on_clear": true,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391"

                          }]

                    },

                    "shed_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": false,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391"

                          }]

                    },

                    "load_action_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": true,

                           //Load identifier for deviev

                          "load_identity_per_device": [{

                                 "device": {

                                       "id": 1, //Integer device Id

                                       "name": "Device0391"

                                 },

                                 "loads": [{

                                              "id": "1", //Integer load id

                                              "name": "Load number 1",//String load number

                                              "load_number": 1 //Integer

                                       },

                                       {

                                              "id": "2",

                                              "name": "Load 2",

                                              "load_number": 2

                                       }

                                 ]

                          }]

                    },

                    "load_group_action_supported": {

                          "supported_on_set": false,

                          "supported_on_clear": false,

                          "mutually_exclusive": true,

                           "load_group_identity_per_device": []

                    },

                    "remote_shutdown_supported": {

                          "supported_on_set": false,

                          "supported_on_clear": false,

                          "mutually_exclusive": false

                    },

                    "mute_alarm_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": false,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391"

                          }]

                    },

                    "initiate_self_test_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": false,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391"

                          }]

                    },

                    "restart_device_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": false,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391",// String device name

                                 "parameters": {

                                       "Cmd Turn On Device (Delayed) Data": "Seconds"

                                 }

                          }]

                    }

             }

       }

}

Version 

"Accept-Version: 1.0.0"

 

 

Email Action

 

The Email Action endpoint provides a Create, Read, Update, Delete (CRUD) API for email actions.  Email Action has attributes ‘email_contact’ and ‘send_to_all’. If attribute ‘send_to_all’ is set to true, the email will be sent to all email contacts. If set to false, the ‘email_contact’ field must contain one or more valid email contact IDs.

 

GET Email Action

 

Title

GET Email action                                                                                                

URL

/api/email_actions

Method

GET

URL Params

Get Email Action

/api/email_actions/:actionId - By id (default)

or

/api/email_actions/:actionName

Note: No HTTP header required to get email action by id

http header "by: name" required to get email action by name

Success Response

Code: 200
Content
{

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

        "type": "email_actions",

        "id": "11",

        "attributes": {

            "name": "email_action",

            "key": 0,

            "delay": 0,

            "enabled": true,

            "trigger_events": [

                {

                    "id": "5",

                    "key": 0,

                    "name": "",

                    //ENUM EventSourceTYpe

                    "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                    "source_id": 1, //Integer is

                    "source_name": "Device0391",

                    "action_id": "11",//Integer action id

                    "action_name": "",

                    "fire_on_set": false,

                    "fire_on_clear": true

                }

            ],

            "interval": 0,

            "count": 1,

            "send_to_all": true,

            "email_contact": []

        }

    }

}

Sample Call

curl –i -H "Accept: application/vnd.api+json" 
http://localhost:3001/api/email_actions/11

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create Email Action

 

Title

Create Email Action

URL

/api/email_actions

Method

POST

Data Params

{

       "data": {

             "type": "email_actions",

             "attributes": {

                    "name": "Email Action",

                    "interval": 0,

                    "delay": 0,

                    "count": 1,

                    "enabled": true,

                    "key": 0,

                    "send_to_all": true,

                    "trigger_events": [{

                          "id": "5",

                          "name": "Overload",

                          "fire_on_set": true,

                          "fire_on_clear": false,

                          "action_name": "Email Action",

                           //ENUM EventSourceType

                          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                          "source_id": 1,

                          "source_name": "Device0391",

                          "key": 0

                    }]

             }

       }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "email_actions",

             "id": "8", //Integer – Action ID

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Email Action

 

Title

Update Email Action

URL

/api/email_actions

Method

PATCH

URL Params

PATCH Email Action

/api/email_actions/:actionId - By id (default)

or

/api/email_actions/:actionName

Note: No HTTP header required to get email action by id

http header "by: name" required to update email action by name

Data Params

{

       "data": {

             "type": "email_actions",

             "attributes": {

                    "name": "Email Action2",//String Value

                    "interval": 0, //Intger Value

                    "delay": 0, //Intger Value

                    "count": 1, //Intger Value

                    "enabled": true,

                    "key": 0, //Intger Value

                    "send_to_all": true,

                    "trigger_events": [{

                          "id": "5", //Intger Value

                          "name": "Overload",//String Value

                          "fire_on_set": true,

                          "fire_on_clear": false,

                          "action_name": "Email Action",

                          "source_type": "EVENT_SOURCE_TYPE_DEVICE",//Enum Event Source

                          "source_id": 1, //Intger Value

                          "source_name": "Device0391", //String Value

                          "key": 0 //Intger Value

                    }]

             }

       }

}

Success Response

Code: 200
Content: {

       "meta": {

              "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "email_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

The payload for update is similar to create. Alternatively update api allow to add and remove list of email contacts, set and clear events. Example:

 

    "remove_set_events" : [

          {

            "name" : "seteventname2",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename2"

          }

        ],

        "add_email_contact" : [

          {

            "name" : "contact1"

          },

          {

            "name" : "contact2"

          }

        ],

        "add_clear_events" : [

          {

            "name" : "cleareventname1",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename1"

          }

        ],

        "add_set_events" : [

          {

            "name" : "seteventname1",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename1"

          }

        ],

        "remove_email_contact" : [

          {

            "name" : "contact3"

          },

          {

            "name" : "contact4"

          }

        ],

        "remove_clear_events" : [

          {

            "name" : "cleareventname2",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename1"

          }

...

 

Initiate Self-Test Action

 

The Initiate Self-Test Action endpoint provides a CRUD API for Initiate Self-Test actions. It requires a target device identity in the form of ‘device_name’ or ‘device_id’.

 

GET Initiate Self-Test Action

 

Title

GET Initiate Self-Test Action

URL

/api/initiate_self_test_actions

Method

GET

URL Params

Get Initiate Self-Test Actions

/api/initiate_self_test_actions/:actionId

- By id (default)

or

/api/initiate_self_test_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

        "type": "email_actions",

        "id": "11",

        "attributes": {

         "name": "anInitiateSelfTestActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events": [         {

            "id": "1",

            "key": 0,

            "name": "",

            //ENUM EventSourceType

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_id": 1,

            "source_name": "",

            "action_id": "20",

            "action_name": "",

            "fire_on_set": true,

            "fire_on_clear": true

         }],

         "device_identity":          {

            "device_id": 1,

            "device_name": ""

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create an Initiate Self-Test Action

 

Title

Create Initiate Self-Test Action

URL

/api/initiate_self_test_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0, //Integer delay

      "device_id" : 1, //Integer device id

      "key" : 1, //Integer key

      "name" : "anInitiateSelfTestActionName"

    },

    "type" : "initiate_self_test_actions"

  }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "initiate_self_test_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update an Initiate Self-Test Action

 

Title

Update Initiate Self-Test Action

URL

/api/initiate_self_test_actions

Method

PATCH

URL Params

PATCH Initate Self Test

api/initiate_self_test_actions/:actionId – by default (id)

or

/api/initiate_self_test_actions/:actionName

Note: No HTTP header required to update email action by id

http header "by: name" required to update email action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceType

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "anInitiateSelfTestActionName"

    },

    "type" : "initiate_self_test_actions"

  }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "initiate_self_test_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

The payload for update is similar to create. Alternatively update api allow to add and remove list, set and clear events. Example:

 

     "remove_set_events" : [

          {

            "name" : "seteventname2",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename2"

          }

        ],

        "add_clear_events" : [

          {

            "name" : "cleareventname1",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename1"

          }

        ],

        "add_set_events" : [

          {

            "name" : "seteventname1",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename1"

          }

        ...

 

 

Load Control Action

 

The Load Control Action endpoint provides a CRUD API for Load Control actions. It requires device ID, load identifier (load ID or name and load number) and load action. This API uses the following enums:

 

load_actions:

LOAD_ACTION_IDLE

LOAD_ACTION_OFF

LOAD_ACTION_ON

LOAD_ACTION_CYCLE

 

GET Load Control Action  

 

Title

GET Load Control Action

URL

/api/load_control_actions

Method

GET

URL Params

Get Load Control Actions

/api/load_control_actions/:actionId

- By id (default)

or

/api/load_control_actions/actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

      "type": "load_control_actions",

      "id": "7",

      "attributes":       {

         "name": "aLoadControlActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events":          [

                        {

               "id": "1",

               "key": 0,

               "name": "",

               //ENUM EventSourceType

               "source_type": "EVENT_SOURCE_TYPE_DEVICE",

               "source_id": 1,

               "source_name": "",

               "action_id": "7",

               "action_name": "",

               "fire_on_set": true,

               "fire_on_clear": true

            }

         ],

         "load_identifier":          [

                        {

               "id": "1",

               "name": "",

               "load_number": 0

            }

         ],

         "device_identity":          {

            "device_id": 1,

            "device_name": ""

         },

         "load_action": "LOAD_ACTION_ON" //ENUM LoadAction

      }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Load Control Action

 

Title

Create Load Control Action

URL

/api/load_control_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceType

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aLoadControlActionName",

      "load_identifier": [

        {

            "id": 1,

            "name": "",

            "load_number": 1        

        }

      ],

      "load_action": "LOAD_ACTION_ON" //ENUM LoadAction

    },

    "type" : "load_control_actions"

  }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "load_control_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Load Control Action

 

Title

Update Load Control Action

URL

/api/load_control_actions

Method

PATCH

URL Params

PATCH Load Control Action

api/load_control_actions/actionId – by default (id)

or

/api/load_control_actions/:actionName

Note: No HTTP header required to update action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceType

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aLoadControlActionName",

      "load_identifier": [

        {

            "id": 1,

            "name": "",

            "load_number": 1        

        }

      ],

 

      "load_action": "LOAD_ACTION_ON" //ENUM LoadAction

      

    },

    "type": "load_control_actions"

   }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "load_control_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Load Group Control Action

 

The Load Group Control Action endpoint provides a CRUD API for Load Group Control actions, requiring device ID, load group identifier (load group id or name) and load action. It uses the following enums:

 

load_action:
LOAD_ACTION_IDLE
LOAD_ACTION_OFF
LOAD_ACTION_ON
LOAD_ACTION_CYCLE

 

 

GET Load Group Control Action  

 

Title

GET Load Group Control Action

URL

/api/load_group_control_actions

Method

GET

URL Params

Get Load Group Actions

/api/load_group_control_actions/:actionId

- By id (default)

or

/api/load_group_control_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

      "type": "load_control_actions",

      "id": "7",

      "attributes":       {

         "name": "aLoadControlActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events":          [

                        {

               "id": "1",

               "key": 0,

               "name": "",

               "source_type": "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceType

               "source_id": 1,

               "source_name": "",

               "action_id": "7",

               "action_name": "",

               "fire_on_set": true,

               "fire_on_clear": true

            }

         ],

         "load_group_identifier":[

               {

               "id": "1", //load group id

               "name": ""

            }

         ],

         "device_identity":          {

            "device_id": 1,

            "device_name": ""

         },

         "load_action": "LOAD_ACTION_ON" //ENUM LoadAction

      }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Load Group Control Action

 

Title

Create Load Group Action

URL

/api/load_group_control_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1, // Integer device id

      "key" : 1,

      "name" : "aLoadGroupControlActionName",

      " load_group_identifier [

        {

            "id": 1, //Integer Load group ID

            "name": ""        

        }

      ],

      "load_action": "LOAD_ACTION_ON" //ENUM LoadAction

    },

    "type" : "load_group_control_actions"

  }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "load_group_control_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Update Load Group Control Action

 

Title

Update Load Group Control Action

URL

/api/load_group_control_actions

Method

PATCH

URL Params

PATCH Load Group Control Action

api/load_group_control_actions /actionId – by default (id)

or

/api/load_group_control_actions /:actionName

Note: No HTTP header required to get load group action by id

http header "by: name" required to update load group action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1", //Integer event id

          "source_id" : 1, //Integer source id

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE", //Enum – Load Group id

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aLoadControlActionName",

      "load_group_identifier": [

        {

            "id": 1, //Integer Load group id

            "name": "" //Optional String Load group name

        }

      ],

      "load_action": "LOAD_ACTION_ON"    

    },

    "type": "load_group_control_actions"

   }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "load_group_control_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Mute Alarm Action

 

The Mute Alarm Action endpoint provides a CRUD API for Mute Alarm actions. It requires ‘device_id’ or ‘device_name’ and delay value.

 

 

GET Mute Alarm Action  

 

Title

GET Mute Alarm Action

URL

/api/mute_alarm_actions

Method

GET

URL Params

/api/mute_alarm_actions/:actionId - By id (default)

or

/api/mute_alarm_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

      "type": "mute_alarm_actions",

      "id": "7",

      "attributes":       {

         "name": "aLoadControlActionName",

         "key": 0,

         "delay": 2,

         "enabled": true,

         "trigger_events":          [

                        {

               "id": "1",

               "key": 0,

               "name": "",

               "source_type": "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceType

               "source_id": 1,

               "source_name": "",

               "action_id": "7",

               "action_name": "",

               "fire_on_set": true,

               "fire_on_clear": true

            }

         ],

         "device_identity":          {

            "device_id": 1,

            "device_name": "" //String device name

         }

      }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Mute Alarm Action

 

Title

Create Mute Alarm Action

URL

/api/mute_alarm_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceTyps

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aMuteAlarmAction"

    },

    "type" : "mute_alarm_actions"

  }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "mute_alarm_actions",

             "id": "8",

              "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Update Mute Alarm Action

 

Title

Update Mute Alarm Action

URL

/api/mute_alarm_actions

Method

PATCH

URL Params

api/mute_alarm_actions /actionId – by default (id)

or

/api/mute_alarm_actions /:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aMuteActionName”,

    },

    "type": "mute_alarm_actions"

   }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "mute_alarm_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Ramp Action

 

The Ramp Action endpoint provides a CRUD API for Ramp actions. It requires ‘device_id’ or ‘device_name’.

 

GET Ramp Action  

 

Title

GET Ramp Action

URL

/api/ramp_actions

Method

GET

URL Params

/api/ramp_actions/:actionId- By id (default)

or

/api/ ramp_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

   "data":    {

      "type": "ramp_actions",

      "id": "14",

      "attributes":       {

         "name": "aRampActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events": [         {

            "id": "1",

            "key": 0,

            "name": "",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_id": 1,

            "source_name": "",

            "action_id": "14",

            "action_name": "",

            "fire_on_set": true,

            "fire_on_clear": true

         }],

         "device_identity":          {

            "device_id": 1,

            "device_name": ""

         }

      }

   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Create Ramp Action

 

Title

Create Ramp Action

URL

/api/ramp_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aRampActionName"

    },

    "type" : "ramp_actions"

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/ramp_actions"

  },

  "data" : {

    "type" : "ramp_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Update Ramp Action

 

Title

Update Ramp Action

URL

/api/ramp_actions

Method

PATCH

URL Params

/api/ramp_actions/:actionId

or

/api/ramp_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aRampActionName"

    },

    "type" : "ramp_actions"

  }

}

Success Response

Code: 200
Content:

{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/ramp_actions"

  },

  "data" : {

    "type" : "ramp_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Reboot OS Action

 

The Reboot Action endpoint provides a CRUD API for Reboot OS actions. This API is supported only for PowerAlert Office/Home/Medical.

 

GET Reboot OS Action  

 

Title

GET Reboot OS Action

URL

/api/reboot_os_actions

Method

GET

URL Params

/api/reboot_os_actions /:actionId

or

/api/reboot_os_actions /:actionName

Note: No HTTP header required to get reboot os action by id

http header "by: name" required to get action by name

Success Response

   "data":    {
      "type": "reboot_os_actions",
      "id": "12",
      "attributes":       {
         "name": "<String>",
         "key": <Integer>,
         "delay": <Integer>,
         "enabled": <Boolean>,
         "redundant": <Boolean>,
         "trigger_events":[

                        {

               "id": "1",

               "key": 0,

               "name": "",

               "source_type": "EVENT_SOURCE_TYPE_DEVICE",

               "source_id": 1,

               "source_name": "",

               "action_id": "7",

               "action_name": "",

               "fire_on_set": true,

               "fire_on_clear": true

            }

         ],

      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

Create Reboot OS Action

 

Title

Create Reboot OS Action

URL

/api/reboot_os_actions

Method

POST

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
        {
          "id" : "<String ID>",
          "source_id" : "<Integer>",
          "fire_on_clear" : "<Boolean>",
          "source_type" : "<Enum source type>",
          "fire_on_set" : "<Boolean>"
        }
      ],
      "name": "<String>"
      "delay": <Integer>,
      "enabled": <Boolean>,
      "redundant": <Boolean>

    },
    "type" : "reboot_os_actions"
  }
}

Success Response

Code: 201
{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/reboot_os_actions"
  },
  "data" : {
    "type" : "reboot_os_actions",
    "id" : "7",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

Update Reboot OS Action

 

Title

Update Reboot OS Action

URL

/api/reboot_os_actions

Method

PATCH

URL Params

/api/reboot_os_actions /:actionId

or

/api/reboot_os_actions /:actionName

Note: No HTTP header required to get ramp action by id

http header "by: name" required to update reboot os action by name

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
      ],     

      "name": "<String>"
      "delay": <Integer>,
      "enabled": <Boolean>,
      "redundant": <Boolean>,

      "add_set_events" : [
       {
         "name" : "<String>",
         "source_type": "<Enum : Source Type>",
         "source_name" : "<Source Name>"
       },

 

      "remove_set_events" : [
       {
         "name" : "<String>",
         "source_type": "<Enum : Source Type>",
         "source_name" : "<Source Name>"
       }    

     }
  }
}

Success Response

Code: 200
Content:

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/reboot_os_actions"
  },
  "data" : {
    "type" : "reboot_os_actions",
    "id" : "5",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

Reboot Web LX Action

The Reboot Web LX Action endpoint provides a CRUD API for Rebooting LX actions.

 

GET Reboot Web LX Action  

 

Title

GET Reboot Web LX Action

URL

/api/reboot_web_lx_actions

Method

GET

URL Params

/api/reboot_web_lx_actions/:actionId

or

/api/reboot_web_lx_actions/:actionName

Note: No HTTP header required to get reboot web lx action by id

http header "by: name" required to get action by name

Success Response

  {

   "data":    {

      "type": "reboot_web_lx_actions",

      "id": "12",

      "attributes":       {

         "name": "aRebootWebLxActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events": [         {

            "id": "1",

            "key": 0,

            "name": "",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_id": 1,

            "source_name": "",

            "action_id": "12",

            "action_name": "",

            "fire_on_set": true,

            "fire_on_clear": true

         }]

      }

   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Reboot Web LX Action  

 

Title

Create Reboot Web LX Action

URL

/api/reboot_web_lx_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "key" : 1,

      "name" : "aRebootWebLxActionName"

    },

    "type" : "reboot_web_lx_actions"

  }

}

Success Response

Code: 201
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/reboot_web_lx_actions"

  },

  "data" : {

    "type" : "reboot_web_lx_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Reboot Web LX Action  

 

Title

Update Reboot Web LX Action

URL

api/reboot_web_lx_actions

Method

PATH

URL Params

api/reboot_web_lx_actions/:actionId

or

/api/reboot_web_lx_actions/:actionName

Note: No HTTP header required to get ramp action by id

http header "by: name" required to update reboot os action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "key" : 1,

      "name" : "aRebootWebLxActionName"

    },

    "type" : "reboot_web_lx_actions"

  }

}

Success Response

Code: 200
Content:

{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/reboot_web_lx_actions"

  },

  "data" : {

    "type" : "reboot_web_lx_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Script Actions

 

The Script Action endpoint provides a CRUD API for Script actions. This API is supported only for PowerAlert Office/Home/Medical.

 

GET Script Action  

 

Title

GET Script Action

URL

/api/script_actions

Method

GET

URL Params

/api/script_actions/:actionId

or

/api/script_actions/:actionName

Note: No HTTP header required to get reboot web lx action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

   "data":    {
      "type": "script_actions",
      "id": "12",
      "attributes":       {
         "name": "scriptactions",
         "key": 0,
         "delay": 0,
         "enabled": true,
         "script": 0,
         "redundant": true,
         "trigger_events": [         {
          
         }]
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

 

Create Script Action  

 

Title

Create Script Action

URL

/api/script_actions

Method

POST

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
        {
          "id" : "1",
          "source_id" : 1,
          "fire_on_clear" : true,
          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",
          "fire_on_set" : true
        }
      ],
      "enabled" : true,
      "delay" : 0,
      "key" : 1,
      "name" : "scriptactionsName",
      "script": "test_script2",
      "redundant": true
    },
    "type" : "script_actions"
  }
}

Success Response

Code: 201
{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/script_actions"
  },
  "data" : {
    "type" : "script_actions",
    "id" : "7",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

Update Script Action  

 

Title

Update Script Action

URL

/api/script_actions

Method

PATH

URL Params

/api/script_actions/:actionId

or

/api/script_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
      ],
      "enabled" : <Boolean>,
      "delay" : 0,
      "key" : 1,
      "name" : "aScriptActionName",
      "script" : "test_script3",
      "name" : "aScriptActionName"
    },
    "redundant" : true
  }
}

Success Response

Code: 200
Content:

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/script_actions"
  },
  "data" : {
    "type" : "script_actions",
    "id" : "5",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

Sensor Actions

 

The Sensor Action endpoint provides a CRUD API for Sensor actions. It uses the following enums:

 

contact:
CONTACTS_SENSOR_CONTACT_1
CONTACTS_SENSOR_CONTACT_2

contact_state:
CONTACTSTATE_SENSOR_STATE_OPEN
CONTACTSTATE_SENSOR_STATE_CLOSED

 

GET Sensor Action  

 

Title

GET Sensor Action

URL

/api/sensor_actions

Method

GET

URL Params

/api/sensor_actions/:actionId

or

/api/sensor_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

  "data":    {
       "type": "sensor_actions",
       "id": "9",
       "attributes":       {
          "name": "aSensorActionName",
          "key": 0,
          "delay": 0,
          "enabled": true,
          "trigger_events": [         {
             "id": "1",
             "key": 0,
             "name": "",

             "source_type": "EVENT_SOURCE_TYPE_DEVICE", //Event Source Type Enum
             "source_id": 1,
             "source_name": "",
             "action_id": "9",
             "action_name": "",
             "fire_on_set": true,
             "fire_on_clear": true
          }],
          "device_identity":          {
             "device_id": 1,
             "device_name": ""
          },
          "contact": "CONTACTS_SENSOR_CONTACT_1", //contact Enum
          "contact_state": "CONTACTSTATE_SENSOR_STATE_OPEN" //contact_state Enum
       }
    }
 }

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Sensor Action  

 

Title

Create Sensor Action

URL

/api/sensor_actions

Method

POST

Data Params

{
    "data": {
        "type": "sensor_actions",
        "attributes": {
            "name": "aSensorActionName",
            "key": 1,
            "delay": 0,
            "enabled": true,
            "device_id": 2,
            "contact": "CONTACTS_SENSOR_CONTACT_1",
            "contact_state": "CONTACTSTATE_SENSOR_STATE_OPEN",
            "trigger_events": [
                { "id": "1",
                  "source_type": "EVENT_SOURCE_TYPE_DEVICE",
                  "source_id": 1,

"source_name": "",
                  "fire_on_set": true,
                  "fire_on_clear": true 
                }
            ]
        }
    }
}

Success Response

Code: 201
{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : 
"/api/sensor_actions"
  },
  "data" : {
    "type" : "
sensor_actions",
    "id" : "7",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Sensor Action  

 

Title

Update Sensor Action

URL

/api/sensor_actions

Method

PATH

URL Params

/api/sensor_actions/:actionId

or

/api/sensor_actions/:actionName

Note: No HTTP header required to get sensor action by id

http header "by: name" required to update action by name

Data Params

{   "data": {
    "type": "sensor_actions",
    "attributes": {
        "name": "aSensorActionName",
        "key": 1,
        "delay": 0,
        "enabled": true,
        "device_id": 2,
        "contact": "CONTACTS_SENSOR_CONTACT_1",
        "contact_state": "CONTACTSTATE_SENSOR_STATE_OPEN",
        "trigger_events": [
            { "id": "1",
              "source_type": "EVENT_SOURCE_TYPE_DEVICE",
              "source_id": 1,

"source_name": "",
              "fire_on_set": true,
              "fire_on_clear": true 
            }
        ]
    }
}
}

Success Response

Code: 200
Content:

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" "/api/sensor_actions"
  },
  "data" : {
    "type" : "sensor_actions",
    "id" : "5",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Shed Actions

 

The Shed Action endpoint provides a CRUD API for Shed actions.

 

GET Shed Action  

 

Title

Get Shed Action

URL

/api/shed_actions

Method

GET

URL Params

/api/shed_actions/:actionId

or

/api/shed_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

"data":    {

      "type": "shed_actions",

      "id": "14",

      "attributes":       {

         "name": "aShedActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events": [         {

            "id": "1",

            "key": 0,

            "name": "",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_id": 1,

            "source_name": "",

            "action_id": "14",

            "action_name": "",

            "fire_on_set": true,

            "fire_on_clear": true

         }],

         "device_identity":          {

            "device_id": 1,

            "device_name": ""

         }

      }

   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create Shed Action  

 

Title

Create Shed Action

URL

/api/shed_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aShedActionName"

    },

    "type" : "shed_actions"

  }

}

Success Response

Code: 201

{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/shed_actions"

  },

  "data" : {

    "type" : "shed_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update Shed Action  

 

Title

Update Shed Action

URL

/api/shed_actions

Method

PATCH

URL Params

/api/shed_actions/:actionId

or

/api/shed_actions/:actionName

Note: No HTTP header required to get sensor action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aShedActionName"

    },

    "type" : "shed_actions"

  }

}

Success Response

Code: 200
Content:

{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/shed_actions"

  },

  "data" : {

    "type" : "shed_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Shutdown Actions

 

The Shutdown Action endpoint provides a CRUD API for Shutdown actions.

 

 

GET Shutdown Action  

 

Title

GET Shutdown Action

URL

/api/shutdown_actions

Method

GET

URL Params

/api/shutdown_actions/:actionId

or

/api/shutdown_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

"data":    {
      "type": "shutdown_actions",
      "id": "12",
      "attributes":       {
         "name": "<Sting: action name>",
         "key": "<Integer>",
         "shutdown_os": "<Boolean>",

         "shutdown_os_delay": "<Boolean>",
         "shutdown_device": "<Boolean>",
         "enabled": "<Boolean>",
         "shutdown_device_delay": "<Boolean>",
         "redundant": "<Boolean>",
         "trigger_events": [         {
          
         }]
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

 

Create Shutdown Action  

 

Title

Create Shutdown Action

URL

/api/shutdown_actions

Method

POST

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
        {
          "id" : "1",
          "source_id" : 1,
          "fire_on_clear" : true,
          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",
          "fire_on_set" : true
        }
      ],

      "enabled" : "<Boolean>",
      "shutdown_os_delay" : <Integer>,
      "shutdown_os" : <Boolean>,
      "name" : "<String>",
      "shutdown_device_delay": "<Integer>",
      "shutdown_device": "<Boolean>",
      "redundant": "<Boolean>"
    },
    "type" : "shutdown_actions"
  }
}

Success Response

Code: 201
{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/shutdown_actions"
  },
  "data" : {
    "type" : "shutdown_actions",
    "id" : "7",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

 

Update Shutdown Action  

 

Title

Update Shutdown Action

URL

/api/shutdown_actions

Method

PATCH

URL Params

/api/shutdown_actions/:actionId

or

/api/shutdown_actions/:actionName

Note: No HTTP header required to get sensor action by id

http header "by: name" required to update action by name

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
      ],

 

      "enabled" : "<Boolean>",
      "shutdown_os_delay" : <Integer>,
      "shutdown_os" : <Boolean>,
      "name" : "<String>",
      "shutdown_device_delay": "<Integer>",
      "shutdown_device": "<Boolean>",
      "redundant": "<Boolean>"    }
  }
}

Success Response

Code: 200
Content:

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/shutdown_actions"
  },
  "data" : {
    "type" : "shutdown_actions",
    "id" : "5",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

Shutdown Home Action

 

The Shutdown Home Action endpoint provides a CRUD API for Shutdown actions. This API is supported only for PowerAlert Office/Home/Medical. It uses the following enums:

 

type:
SHUTDOWN_HOME_NONE
SHUTDOWN_HOME_ON_BATTERY
SHUTDOWN_HOME_POWER_REMAINING
SHUTDOWN_HOME_RUNTIME_REMAINING
SHUTDOWN_HOME_BATTERY_LOW

 

 

GET Shutdown Home Action

                                                                             

Title

GET Shutdown Home Action

URL

/api/shutdown_home_actions

Method

GET

Success Response

{
   "meta":    {
     
   },
   "data":    {
      "type": "shutdown_home_actions",
    
      "attributes":       {
         "shutdown_supported": "<Boolean>",
         "on_battery_supported": "<Boolean>",
         "battery_power_remaining_supported": "<Boolean>",

         "battery_time_remaining_supported": "<Boolean>",
         "battery_low_supported": "<Boolean>",
         "enabled": "<Boolean>",
         "shutdown_device_delay": "<Boolean>",
         "type": "<ENUM Shutdown type>",
         "on_battery_delay": "<Integer>",
         "percent_battery_remaining":"<Integer>",
         "minutes_battery_remaining": "<Integer>"

      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

Update Shutdown Home Action  

 

Title

Update Shutdown Action

URL

/api/shutdown_actions

Method

PATCH

Data Params

{
  "data" : {
    "attributes" : 

     "type": "<ENUM Shutdown type>",
     "on_battery_delay": "<Integer>",
     "percent_battery_remaining":"<Integer>",
     "minutes_battery_remaining": "<Integer>"
  }
}

Success Response

Code: 200

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/shutdown_actions"
  },
  "data" : {
    "type" : "shutdown_actions",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

Shutdown Method 

 

The Shutdown Method endpoint provides a GET and Update API for the Shutdown method. This API is supported only for PowerAlert Office/Home/Medical. It uses the following enums:

 

shutdown_method:
SHUTDOWN_METHOD_SHUTDOWN
SHUTDOWN_METHOD_HIBERNATE

 

 

GET Shutdown Home Method  

 

Title

GET Shutdown Method

URL

/api/shutdown_method

Method

GET

Success Response

{
   "meta":    {
     
   },
   "data":    {
      "type": "shutdown_method",
      "attributes":       {
         "shutdown_method": "<ENUM Shutdown Method>"

      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

 

Update Shutdown Home Method  

 

Title

Update Shutdown Method

URL

/api/shutdown_method

Method

PATCH

Data Params

{
  "data" : {

         "type": "shutdown_method"
    "attributes" :{

      "type": "shutdown_method",
      "attributes":{
         "shutdown_method": "<ENUM Shutdown Method>"

      }
   }

}

Success Response

Code: 200

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/shutdown_method"
  },
  "data" : {
    "type" : "shutdown_method",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

 

SMS Action

 

The SMS Action endpoint provides a CRUD API for SMS actions.  SMS Action has attributes ‘sms_contact’ and ‘send_to_all’. If ‘send_to_all’ is set to true, sms will be sent to all sms contacts. If set to false, the ‘sms_contact’ field must contain one or more valid sms contact IDs.

 

GET SMS Action

 

Title

GET SMS Action

URL

/api/sms_actions

Method

GET

URL Params

Get SMS Action

/api/sms_actions/:actionId - By id (default)

or

/api/sms_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

        "type" : "sms_actions",

        "id" : "1",

        "attributes": {

            "name": "smsaction",

            "key": 0,

            "delay": 30,

            "enabled": true,

            "trigger_events": [

                {

                    "id": "5",

                    "key": 0,

                    "name": "",

                     //ENUM EventSourceTYpe

                    "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                    "source_id": 1,

                    "source_name": "Device0391",

                    "action_id": "11",

                    "action_name": "",

                    "fire_on_set": false,

                    "fire_on_clear": true

                }

            ],

            "interval": 0,

            "sms_contacts" : []

            "send_to_all": true,

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create SMS Action

 

Title

Create SMS Action

URL

/api/sms_actions

Method

POST

Data Params

{

  "data" : {

    "type" : "sms_actions",

    "attributes" : {

      "sms_contact" : [

        {

          "id" : 1

        },

        {

          "id" : 2

        }

      ],

      "enabled" : true,

      "send_to_all" : false,

      "trigger_events" : [

        {

          "fire_on_clear" : true,

          "action_name" : "",

          "id" : "1",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "key" : 40,

          "source_id" : 1,

          "fire_on_set" : true,

          "name" : "eventName"

        }

      ],

      "count" : 1,

      "delay" : 0,

      "key" : 1,

      "name" : "anSmsActionName",

      "interval" : 0

    }

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/sms_actions"

  },

  "data" : {

    "type" : "sms_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update SMS Action

 

Title

Update SMS Action

URL

/api/sms_actions

Method

PATCH

URL Params

PATCH SMS Action

/api/sms_actions/:actionId - By id (default)

or

/api/sms_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "type" : "sms_actions",

    "attributes" : {

      "sms_contact" : [

        {

          "id" : 1

        },

        {

          "id" : 2

        }

      ],

      "enabled" : true,

      "send_to_all" : false,

      "trigger_events" : [

        {

          "fire_on_clear" : true,

          "action_name" : "",

          "id" : "1",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "source_name" : "",

          "key" : 0,

          "source_id" : 1,

          "action_id" : 0,

          "name" : "eventName",

          "fire_on_set" : true

        }

      ],

      "count" : 1,

      "delay" : 0,

      "key" : 1,

      "name" : "anSmsActionName",

      "interval" : 0

    }

  }

}

Success Response

Code: 200
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/sms_actions"

  },

  "data" : {

    "type" : "sms_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

SNMP SET OID Action

 

The SNMP SET OID Action endpoint provides a CRUD API for SNMP OID actions.  SNMP OID Action has attributes ‘snmp_contact’ and ‘send_to_all’. If ‘send_to_all’ is set to true, SNMP notifications will be sent to all SNMP contacts. If set to false, the ‘snmp_contact’ field must contain one or more valid SNMP contact IDs. It uses the following of enum:

 

data_type:

OID_DATA_TYPE_INTEGER
OID_DATA_TYPE_U_INTEGER32
OID_DATA_TYPE_OCTET_STRING

 

 

GET SNMP SET OID Action

 

Title

Get SNMP SET OID Action

URL

/api/snmp_set_oid_actions

Method

GET

URL Params

/api/snmp_set_oid_actions/:actionId

or

/api/snmp_set_oid_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data":    {

      "type": "snmp_set_oid_actions",

      "id": "10",

      "attributes":       {

         "name": "anSnmpSetOidActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events": [         {

            "id": "1",

            "key": 0,

            "name": "",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_id": 1,

            "source_name": "",

            "action_id": "10",

            "action_name": "",

            "fire_on_set": true,

            "fire_on_clear": true

         }],

         "interval": 0,

         "count": 1,

         "send_to_all": false,

         "snmp_contact":          [

                        {

               "id": "1",

               "name": null

            },

                        {

               "id": "2",

               "name": null

            }

         ],

         "oid": "anoidvalue",

         "value": "avalue",

         "data_type": "DATA_TYPE_STRING"

      }

   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create SNMP SET OID Action

 

Title

Create SNMP SET OID Action

URL

/api/snmp_set_oid_actions

Method

POST

Data Params

{

    "data": {

        "type": "snmp_set_oid_actions",

        "attributes": {

            "name": "anSnmpSetOidActionName",

            "key": 1,

            "delay": 0,

            "interval": 0,

            "count": 1,

            "enabled": true,

            "oid": "anoidvalue",

            "value": "avalue",

            "data_type": "DATA_TYPE_STRING",

            "send_to_all": false,

            "snmp_contact": [

                {"id": 1},

                {"id": 2}

            ],

            "trigger_events": [

                { "id": "1",

                  "name": "eventName",

                  "key": 40,

                  "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                  "source_id": 1,

                  "action_name": "",

                  "fire_on_set": true,

                  "fire_on_clear": true

                }

            ]

        }

    }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/snmp_set_oid_actions"

  },

  "data" : {

    "type" : "snmp_set_oid_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update an SNMP SET OID Action

 

Title

Update SNMP SET OID Action

URL

/api/snmp_set_oid_actions

Method

PATCH

URL Params

PATCH SNMP SET OID Action

/api/snmp_set_oid_actions/:actionId

or

/api/snmp_set_oid_actions/:actionName

 

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

    "data": {

        "type": "snmp_set_oid_actions",

        "attributes": {

            "name": "anSnmpSetOidActionName",

            "key": 1,

            "delay": 0,

            "interval": 0,

            "count": 1,

            "enabled": true,

            "oid": "anoidvalue",

            "value": "avalue",

            "data_type": "DATA_TYPE_STRING",

            "send_to_all": false,

            "snmp_contact": [

                {"id": 1},

                {"id": 2}

            ],

            "trigger_events": [

                { "id": "1",

                  "name": "eventName",

                  "key": 40,

                  "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                  "source_id": 1,

                  "action_name": "",

                  "fire_on_set": true,

                  "fire_on_clear": true

                }

            ]

        }

    }

}

Success Response

Code: 200
Content
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/snmp_set_oid_actions"

  },

  "data" : {

    "type" : "snmp_set_oid_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

SNMP Trap Action

 

The SNMP Trap Action endpoint provides a CRUD API for SNMP Trap actions.  SNMP Trap Action has attributes ‘snmp_contact’ and ‘send_to_all’. If ‘send_to_all’ is set to true, SNMP traps will be sent to all SNMP contacts. If set to false, the ‘snmp_contact’ field must contain one or more valid SNMP contact IDs or names.

 

GET an SNMP Trap Action

 

Title

GET SNMP Trap Action

URL

/api/trap_actions

Method

GET

URL Params

/api/trap_actions/:actionId

or

/api/trap_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

"data" : {

    "type" : "trap_actions",

    "id" : "5",

    "attributes" : {

      "enabled" : true,

      "send_to_all" : false,

      "snmp_contacts" : [

        {

          "id" : "1",

          "name" : "testname1"

        },

        {

          "id" : "2",

          "name" : "testname2"

        }

      ],

      "count" : 1,

      "delay" : 0,

      "trigger_events" : [

        {

          "fire_on_clear" : true,

          "action_name" : "",

          "id" : "1",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "source_name" : "",

          "key" : 0,

          "source_id" : 1,

          "action_id" : "5",

          "name" : "",

          "fire_on_set" : true

        }

      ],

      "key" : 0,

      "name" : "aTrapActionName2",

      "interval" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create SNMP Trap Action

 

Title

Create SNMP Trap Action

URL

/api/trap_actions

Method

POST

Data Params

{

  "data" : {

    "type" : "trap_actions",

    "attributes" : {

      "enabled" : true,

      "send_to_all" : false,

      "snmp_contacts" : [

        {

          "id" : 1

        },

        {

          "id" : 2

        }

      ],

      "count" : 1,

      "delay" : 0,

      "trigger_events" : [

        {

          "fire_on_clear" : true,

          "action_name" : "",

          "id" : "1",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "key" : 40,

          "source_id" : 1,

          "fire_on_set" : true,

          "name" : "eventName"

        }

      ],

      "key" : 1,

      "name" : "aTrapActionName2",

      "interval" : 0

    }

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/trap_actions"

  },

  "data" : {

    "type" : "trap_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update SNMP Trap Action

 

Title

Update SNMP Trap Action

URL

/api/trap_actions

Method

PATCH

URL Params

/api/trap_actions/:actionId

or

/api/trap_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "type" : "trap_actions",

    "attributes" : {

      "enabled" : true,

      "send_to_all" : false,

      "snmp_contacts" : [

        {

          "id" : 1,

          "name" : "testname1"

        },

        {

          "id" : 2,

          "name" : "testname2"

        }

      ],

      "count" : 1,

      "delay" : 0,

      "trigger_events" : [

        {

          "fire_on_clear" : true,

          "action_name" : "",

          "id" : "1",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "key" : 40,

          "source_id" : 1,

          "fire_on_set" : true,

          "name" : "eventName"

        }

      ],

      "key" : 1,

      "name" : "aTrapActionName2",

      "interval" : 0

    }

  }

}

Success Response

Code: 200
Content
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/trap_actions"

  },

  "data" : {

    "type" : "trap_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Turn Off Device Action

 

The Turn Off Device Action endpoint provides a CRUD API for Turn Off Device actions.  It requires a target device identity in the form of ‘device_name’ or ‘device_id’.

 

GET Turn off Device Action

 

Title

GET Turn Off Device Action

URL

/api/turn_off_device_actions

Method

GET

URL Params

/api/turn_off_device_actions/:actionId

or

/api/turn_off_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

{

"data" : {

    "type" : "turn_off_device_actions",

    "id" : "5",

    "attributes" : {

      "device_identity" : {

        "device_name" : "",

        "device_id" : 0

      },

      "trigger_events" : [

        {

          "fire_on_clear" : false,

          "action_name" : "",

          "id" : "5",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "source_name" : "",

          "key" : 0,

          "source_id" : 1,

          "action_id" : "5",

          "name" : "",

          "fire_on_set" : true

        },

        {

          "fire_on_clear" : false,

          "action_name" : "",

          "id" : "9",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "source_name" : "",

          "key" : 0,

          "source_id" : 1,

          "action_id" : "5",

          "name" : "",

          "fire_on_set" : true

        }

      ],

      "key" : 1284,

      "delay" : 120,

      "name" : "Default Device Shutdown",

      "enabled" : true

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create Turn Off Device Action

 

Title

Create Turn Off Device Action

URL

/api/turn_off_device_actions

Method

POST

Data Params

{

  "data" : {

    "type" : "turn_off_device_actions",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "key" : 1,

      "delay" : 0,

      "name" : "aTurnOffDeviceActionName",

      "enabled" : true,

      "device_id" : 1

    }

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/turn_off_device_actions"

  },

  "data" : {

    "type" : "turn_off_device_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Turn Off Device Action

 

Title

Update Turn Off Device Action

URL

/api/turn_off_device_actions

Method

PATCH

URL Params

/api/turn_off_device_actions/:actionId

or

/api/turn_off_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "type" : "turn_off_device_actions",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 1,

      "name" : "aTurnOffDeviceActionName",

      "device_id" : "1"

    }

  }

}

Success Response

Code: 200
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/turn_off_device_actions"

  },

  "data" : {

    "type" : "turn_off_device_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Turn On Device Action

 

The Turn On Device Action endpoint provides a CRUD API for Turn On Device actions.  It requires a device identity attribute in the form of ‘device_id’ or ‘device_name’.

 

GET Turn On Device Action

 

Title

GET Turn On Device Action

URL

/api/turn_on_device_actions

Method

GET

URL Params

/api/turn_on_device_actions/:actionId

or

/api/turn_on_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

{

"data": {

        "type": "turn_on_device_actions",

        "id": "5",

        "attributes": {

            "device_identity": {

                "device_name": "",

                "device_id": 0

            },

            "trigger_events": [

                {

                    "fire_on_clear": false,

                    "action_name": "",

                    "id": "5",

                    "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                    "source_name": "",

                    "key": 0,

                    "source_id": 1,

                    "action_id": "5",

                    "name": "",

                    "fire_on_set": true

                },

                {

                    "fire_on_clear": false,

                    "action_name": "",

                    "id": "9",

                    "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                    "source_name": "",

                    "key": 0,

                    "source_id": 1,

                    "action_id": "5",

                    "name": "",

                    "fire_on_set": true

                }

            ],

            "key": 1284,

            "delay": 120,

            "name": "Default Turn On Device",

            "enabled": true

        }

    }

}}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Turn On Device Action

 

Title

Create Turn On Device Action

URL

/api/turn_on_device_actions

Method

POST

Data Params

{

  "data" : {

    "type" : "turn_on_device_actions",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "key" : 1,

      "delay" : 0,

      "name" : "aTurnOnDeviceActionName",

      "enabled" : true,

      "device_id" : 1

    }

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/turn_on_device_actions"

  },

  "data" : {

    "type" : "turn_on_device_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update Turn On Device Action

 

Title

Update Turn On Device Action

URL

/api/turn_on_device_actions

Method

PATCH

URL Params

/api/turn_on_device_actions/:actionId

or

/api/turn_on_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "type" : "turn_on_device_actions",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 1,

      "name" : "aTurnOnDeviceActionName",

      "device_id" : "1"

    }

  }

}

Success Response

Code: 200
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/turn_on_device_actions"

  },

  "data" : {

    "type" : "turn_on_device_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Restart Device Action

 

The Restart Device Action endpoint provides a CRUD API for Restart Device actions.  It requires a device identity attribute in the form of ‘device_id’ or ‘device_name’. Shutdown and restart delays (in seconds) can be entered.

 

GET Restart Device Action

 

Title

GET Restart Device Action

URL

/api/restart_device_actions

Method

GET

URL Params

/api/restart_device_actions/:actionId

or

/api/restart_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

         {

       "meta": {

             "id": "6d28a089-21cf-4149-aba4-77fc58e0e2c2",

             "constraints": {

             },

             "validation": [

             ],

             "path": "/api/restart_device_actions/6"

       },

       "data": {

             "type": "restart_device_actions",

             "id": "6",

             "attributes": {

                    "name": "aTurnOnDeviceActionName",

                    "key": 0,

                    "delay": 1,

                    "enabled": true,

                    "trigger_events": [{

                          "id": "1",

                          "key": 0,

                          "name": "",

                          "source_type": "EVENT_SOURCE_TYPE_AUTOPROBE",

                          "source_id": 1,

                          "source_name": "Watchdog Ping",

                          "action_id": "6",

                          "action_name": "",

                          "fire_on_set": true,

                          "fire_on_clear": true

                    }],

                    "device_identity": {

                          "device_id": 1,

                          "device_name": "Device0391"

                    },

                    "shutdown_delay": 1,

                    "restart_delay": 2

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Restart Device Action

 

Title

Create Restart Device Action

URL

/api/restart_device_actions

Method

POST

Data Params

{

  "data" : {

    "type" : "restart_device_actions ",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "key" : 1,

      "delay" : 0,

      "name" : "restartDevice",

      "enabled" : true,

      "device_id" : 1,

      "shutdown_delay": 1,

      "restart_delay": 2

    }

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/turn_on_device_actions"

  },

  "data" : {

    "type" : "turn_on_device_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Restart Device Action

 

Title

Update Restart Device Action

URL

/api/restart_device_actions

Method

PATCH

URL Params

/api/restart_device_actions/:actionId

or

/api/restart_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "type" : "restart_device_actions",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 1,

      "name" : "RestartDeviceName",

      "device_id" : "1",

      "shutdown_delay": 1,

      "restart_delay": 2

 

    }

  }

}

Success Response

Code: 200
Content:
{

  {
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "\/api\/restart_device_actions"
  },
  "data" : {
    "type" : "restart_device_actions",
    "id" : "5",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Alarms

The Alarm API enables display of alerts for the device and any connected peripherals (e.g. sensors). An alarm is active if it has not been acknowledged, nor cleared. An alarm is cleared when the condition that triggered the alarm is no longer in effect. An alarm can be acknowledged in one of two ways: automatically (using event service) or manually. Alarm API enables manual acknowledgement of single or multiple alarms. The alarm data can also be sorted by Date/Time in descending or ascending order. It uses the following enums:

 

event_source_type:

 EVENT_SOURCE_TYPE_DEVICE

 EVENT_SOURCE_TYPE_AUTOPROBE

 EVENT_SOURCE_TYPE_SYSTEM

 

severity:

 EVENT_SEVERITY_EMERGENCY

 EVENT_SEVERITY_ALERT

 EVENT_SEVERITY_CRITICAL

 EVENT_SEVERITY_ERROR

 EVENT_SEVERITY_WARNING

 EVENT_SEVERITY_NOTICE

 EVENT_SEVERITY_INFORMATIONAL

 EVENT_SEVERITY_DEBUG

 

high_severity:

 ALARM_SEVERITY_LEVEL_NONE

 ALARM_SEVERITY_LEVEL_CRITICAL

 ALARM_SEVERITY_LEVEL_WARNING

 ALARM_SEVERITY_LEVEL_INFORMATIONAL

 

GET All Alarms

 

Title

GET All Alarms

URL

/api/alarms

Method

GET

URL Params

Filtering

·       'filter' query parameter is used for filtering:

       Field Equals to Value:

/api/alarms?filter=[{"name":"<field name>","op":"eq","val":<field value>}]

Example

filter=[{"name": "acknowledged","op": "eq","val": false}]

 

·       Checking for multiple value:

/api/alarms?filter=[{"name":"<field name>","op":"_in","val":[<field value1>,..., <field value N>] }]

Example: filter=[{"name": "severity","op": "in_","val": ["EVENT_SEVERITY_ERROR","EVENT_SEVERITY_WARNING","EVENT_SEVERITY_CRITICAL"]}

 

·       Timestamp Range:

/api/alarms?filter=[{"name":"occurred_time","op":"ge","val": "YYYY-MM-DDTHH:mm:ss-00:00"}, {"name":"occurred_time","op":"le","val": "YYYY-MM-DDTHH:mm:ss-00:00"}] 

Example filter=[{"name": "occurred_time","op": "range","val": ["2019-06-06T15:38:54-05:00","2019-06-09T15:38:54-05:00"]}]

·       Timestamp from Date Time:

/api/alarms?filter=[{"name":"occurred_time","op":"ge","val":"YYYY-MM-DDTHH:mm:ss-00:00"}]

Example: filter=[{"name": "occurred_time","op": "ge","val": "2019-05-06T15:38:54-05:00"}]

·       Timestamp till Date Time:

/api/alarms?filter=[{"name":"occurred_time","op":"le","val": "YYYY-MM-DDTHH:mm:ss-00:00"}]

Example: filter=[{"name": "occurred_time","op": "le","val": "2019-05-06T15:38:54-05:00"}]

 

Sorting

·       'sort' query parameter is used for sorting:

/api/alarms?sort=<fieldname>

·       Descendant Sort:

/api/alarms?sort=-<fieldname>

Example : sort in descendant order based on alarm occurred time

/api/alarms?sort=-occurred_time

·       Multiple Sort:

/api/alarms?sort=<fieldname1>, <fieldname2>

·       Multiple + Descendant Sort:

/api/alarms?sort=<fieldname1>, -<fieldname2>

 

Pagination

/api/alarms?page[size]=<page size>&page[number]=<page number>

 

Default:

page size = 30

page number = 1

 

Examples:

·       ID Range Filter

/api/alarms?id[from]=<from id>&id[tp]=<to id>

Example /api/alarms?id[from]=1&id[to]=10

·       Combination Example

http://127.0.0.1:3001/api/alarms?filter=[{"name": "severity","op": "in_","val": ["EVENT_SEVERITY_ERROR","EVENT_SEVERITY_WARNING","EVENT_SEVERITY_CRITICAL"]},{"name":"source_name","op":"in_","val":["Sensor0014","Device0001"]}]&sort=-occurred_time&page[size]=5&page[number]=1

·       Get all cleared alarms

http://127.0.0.1:3001/api/alarms?page[size]=5&page[number]=1&filter=[{"name": "cleared","op": "eq","val": true}]

·       Get all acknowledged alarms

http://127.0.0.1:3001/api/alarms?page[number]=1&filter=[{"name": "acknowledged","op": "eq","val": true}]

Success Response

Code: 200 

Content: 

{
    "meta": {
        "id": "<request id>",
        "constraints": {
            "max_items": < integer : total number of alarms record>,
            "min_items": 0,
            "editable_attributes": [],
            "required_attributes": [],
            "delete_allowed": true
        },
        "validation": [{
                "attribute": "event_key",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "integer"
            },
            {
                "attribute": "event_source_type",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [
                    "EVENT_SOURCE_TYPE_DEVICE",
                    "EVENT_SOURCE_TYPE_AUTOPROBE",
                    "EVENT_SOURCE_TYPE_SYSTEM"
                ],
                "type": "enum"
            },
            {
                "attribute": "source_name",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "string"
            },
            {
                "attribute": "severity",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [
                    "EVENT_SEVERITY_EMERGENCY",
                    "EVENT_SEVERITY_ALERT",
                    "EVENT_SEVERITY_CRITICAL",
                    "EVENT_SEVERITY_ERROR",
                    "EVENT_SEVERITY_WARNING",
                    "EVENT_SEVERITY_NOTICE",
                    "EVENT_SEVERITY_INFORMATIONAL",
                    "EVENT_SEVERITY_DEBUG"
                ],
                "type": "enum"
            },
            {
                "attribute": "detail",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "string"
            },
            {
                "attribute": "occurred_time",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "datetime"
            },
            {
                "attribute": "cleared_time",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "datetime"
            },
            {
                "attribute": "cleared",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "boolean"
            },
            {
                "attribute": "acknowledged",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "boolean"
            },
            {
                "attribute": "acknowledged_time",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "datetime"
            },
            {
                "attribute": "localize",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "boolean"
            }
        ],
        "count": <integer : total number of alarm count or record>,
        "path": "/api/alarms"
    },
    "links": {
        "self": "http://<serverip>/api/alarms?page%5Bsize%5D=30&page%5Bnumber%5D=1"
    },
    "data": [{
        "type": "alarms",
        "id": <alarm id>,
        "attributes": {
            "event_source_type": "Enum EVENT SOURCE TYPE",
            "source_name": "<String>",
            "severity": "ENUM EVENT SEVERITY",
            "detail": "<String>",
            "occured_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "cleared_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "acknowledged_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "acknowledged": <boolean>,
            "cleared": <boolean>,
            "localize": <boolean>
        }
    }]
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET One Alarm

 

Title

GET One Alarm

URL

/api/alarms/:id

Method

GET

Success Response

Code: 200 

Content:

{

    "meta": {

        "id": "request id",

        "constraints": {},

        "validation": [

            {

                "attribute": "event_key",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "event_source_type",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_SOURCE_TYPE_DEVICE",

                    "EVENT_SOURCE_TYPE_AUTOPROBE",

                    "EVENT_SOURCE_TYPE_SYSTEM"

                ],

                "type": "enum"

            },

            {

                "attribute": "source_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "severity",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_SEVERITY_EMERGENCY",

                    "EVENT_SEVERITY_ALERT",

                    "EVENT_SEVERITY_CRITICAL",

                    "EVENT_SEVERITY_ERROR",

                    "EVENT_SEVERITY_WARNING",

                    "EVENT_SEVERITY_NOTICE",

                    "EVENT_SEVERITY_INFORMATIONAL",

                    "EVENT_SEVERITY_DEBUG"

                ],

                "type": "enum"

            },

            {

                "attribute": "detail",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "occurred_time",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "datetime"

            },

            {

                "attribute": "cleared_time",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "datetime"

            },

            {

                "attribute": "cleared",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "acknowledged",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "acknowledged_time",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "datetime"

            },

            {

                "attribute": "localize",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            }

        ],

        "path": "/api/alarms/5"

    },

    "data": {

        "type": "alarms",
        "id": <alarm id>,
        "attributes": {
            "event_source_type": "Enum EVENT SOURCE TYPE",
            "source_name": "<String>",
            "severity": "ENUM EVENT SEVERITY",
            "detail": "<String>",
            "occurred_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "cleared_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "acknowledged_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "acknowledged": <boolean>,
            "cleared": <boolean>,
            "localize": <boolean>

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Acknowledge Alarms

 

Title

Acknowledge Alarms

URL

/api/alarms/acknowledge

Method

PATCH

URL Params

Data Params

{
  "data": [
    { "type": "alarms", "id": "<string, alarms id>" },
    { "type": "alarms", "id": "<string, alarms id>" }
  ]
}

Success Response

Code: 200
Content: {  
   "meta":{  
      "id":
"<request id>"
   },
   "data":{  
      "data":[  
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         },
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         },
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         }
      ]
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Acknowledge All Alarms

 

Title

Acknowledge All Alarms

URL

/api/alarms/acknowledge/all

Method

PATCH

Success Response

Code: 200
Content: {  
   "meta":{  
      "id":
"<request id>"
   },
   "data":{  
      "data":[  
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         },
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         },
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         }
      ]
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Return empty array if there is no alarm to acknowledge

 

GET Alarm Summary

 

Title

GET Alarm Summary

URL

/api/alarms/acknowledge/all

Method

GET

Success Response

Code: 200
Content:

{

    "meta": {

        "id": "ceac87cb-5753-426b-a665-647551f02b2e",

        "constraints": {},

        "validation": [

            {

                "attribute": "critical_alarm_count",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "warning_alarm_count",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "informational_alarm_count",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "total_alarm_count",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "high_severity",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "ALARM_SEVERITY_LEVEL_NONE",

                    "ALARM_SEVERITY_LEVEL_CRITICAL",

                    "ALARM_SEVERITY_LEVEL_WARNING",

                    "ALARM_SEVERITY_LEVEL_INFORMATIONAL"

                ],

                "type": "enum"

            }

        ],

        "path": "/api/alarms/summary"

    },

    "data": {

        "type": "alarms",

        "attributes": {

            "critical_alarm_count": <int>

            "warning_alarm_count": <int>,

            "informational_alarm_count": <int>,

            "total_alarm_count": <int>,

            "high_severity": "Enum ALARM SEVERITY"

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Return empty array if there is no alarm to acknowledge

 

Authentication (Login & Logout)

PowerAlert uses an OAuth 2.0 token-based authentication model. Under this model, a user calls POST /api/outh/token to request access token. An access token is returned if the credential passed in the POST request is valid. An access token passed in the headers of each subsequent request and used to determine if the user is authorized to perform the operation. Token request (login), refresh token and logout are separate API each of them explained in detail below.

 

Login (Token) Request

An authentication token is required to interact with PowerAlert APIs. Once obtained, this token must appear in the HTTP header of any subsequent requent. 

HEADERS

Authorization Bearer {access_token}

 

 

Title

Login

URL

/api/oauth/token

Method

POST

Data Params

{

    "username":"localadmin",

    "password":"localadmin",

    "grant_type": "password"

}

Success Response

Code: 200
Content:

 

{

    "access_token": "<string>",

    "msg": "Logged in as localadmin",

    "refresh_token": "<String>"

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Return empty array if there is no alarm to acknowledge

 

Refresh Token

 

Title

Refresh Token

URL

/api/oauth/token/refresh

Method

POST

URL Params

HTTP Header required:

Authorization: Bearer {refresh_token}

Where refresh_token comes from login request

Success Response

Code: 200
Content:

 

{

    "access_token": "<string>",

    "msg": "Logged in as localadmin",

    "refresh_token": "<String>"

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Return empty array if there is no alarm to acknowledge

 

 

Logout (Invalidate Access Token)

 

Title

Logout  

URL

/api/oauth/token/logout

Method

POST

URL Params

HTTP Header required:

Authorization: Bearer {refresh_token}

Where refresh_token comes from login request

Success Response

Code: 200
Content:

{}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Return empty array if there is no alarm to acknowledge

 

 

Alert Contact

The Alert Contact API enables creation, editing and deletion of alert notification recipients. Three types of alert contact can be created: Email, SMS and SNMP. For testing each type of alert contact, use the following enums:

 

last_test_status:

TEST_STATUS_UNSPECIFIED

TEST_STATUS_NONE

TEST_STATUS_SUCCESS   are these the right enums for Alert Contaxt?

TEST_STATUS_FAIL

 

 

Email Contact

 

The Email Contact API enables creating, editing, deleting and testing email notification recipients.

 

 

GET All Email Contacts

 

Title

GET All Email Contacts

URL

/api/email_contacts

Method

GET

URL Params

Data Params

Success Response

Code: 200 
Content: {  
   "meta": {
    "id": "<string>",
    "constraints": {
    "max_items": 64,
    "min_items": 0,
    "editable_attributes": [
    "name",
    "email",
    "status"
    ],
    "required_attributes": [
    "name",
    "email",
    "status"
    ],
    "delete_allowed": true
   },
    "validation": [
    {
    "attribute": "name",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 1,
    "max_length": 64,
    "pattern": "",
    "enum": [],
    "type": "string"
    },
    {
    "attribute": "email",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 1,
    "max_length": 128,
    "pattern": "[^@]+@[^@]+\\.[^@]+",
    "enum": [],
    "type": "email"
    },
    {
    "attribute": "status",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [],
    "type": "boolean"
    },
    {
    "attribute": "last_test_status",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [
    "TEST_STATUS_NONE",
    "TEST_STATUS_SUCCESS",
    "TEST_STATUS_FAIL"
    ],
    "type": "enum"
    },
    {
    "attribute": "last_test_message",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 64,
    "pattern": "",
    "enum": [],
    "type": "string"
    },
    {
    "attribute": "last_test_timestamp",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [],
     "type": "datetime"
    }
    ]
   },
   "data":[  
      {  
         "type":"email_contacts",
         "id":"<string>",
         "attributes":{  
            "name":"<string>",
            "email":"<string>",
            "status":<boolean>
         }
      },
      {  
         "type":"email_contacts",
         "id":"<string>",
         "attributes":{  
            "name":"<string>",
            "email":"<string>",
            "status":<boolean>,
            "last_test_message": "<string>",
            "last_test_status": "<enum, TestStatus>",
            "last_test_timestamp": "<timestamp>"
         }
      }
   ]
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET One Email Contact

 

Title

Get One Email Contact

URL

/api/email_contacts/:contactId or

/api/email_contacts/:contactName

Method

GET

URL Params

/api/email_contacts/:contactId or

/api/email_contacts/:contactName

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Success Response

Code: 200 
Content: 
{  
  "meta": {
    "id": "<id>",
    "constraints": {
    "max_items": 64,
    "min_items": 0,
    "editable_attributes": [
    "name",
    "email",
    "status"
    ],
    "required_attributes": [
    "name",
    "email",
    "status"
    ],
    "delete_allowed": true
   },
    "validation": [
    {
    "attribute": "name",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 1,
    "max_length": 64,
    "pattern": "",
    "enum": [],
    "type": "string"
    },
    {
    "attribute": "email",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 1,
    "max_length": 128,
    "pattern": "[^@]+@[^@]+\\.[^@]+",
    "enum": [],
    "type": "email"
    },
    {
    "attribute": "status",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [],
    "type": "boolean"
    },
    {
    "attribute": "last_test_status",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [
    "TEST_STATUS_NONE",
    "TEST_STATUS_SUCCESS",
    "TEST_STATUS_FAIL"
    ],
    "type": "enum"
    },
    {
    "attribute": "last_test_message",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 64,
    "pattern": "",
    "enum": [],
    "type": "string"
    },
    {
    "attribute": "last_test_timestamp",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [],
     "type": "datetime"
    }
    ]
   },
   "data":{  
      "type":"email_contacts",
      "id":"<string>",
      "attributes":{  
         "name":"<string>",
         "email":"<string>",
         "status":"<boolean>",
         "last_test_message": "<string>",
         "last_test_status": "<enum, TestStatus>",
         "last_test_timestamp": "<timestamp>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Create Email Contact

 

Title

Create Email Contact

URL

/api/email_contacts

Method

POST

Data Params

{
 "data": {
 "type": "email_contacts",
 "attributes": {
 "name": "<string>",
 "email": "<string>",
 "status": "<boolean>",
 "last_test_message": "<string>",
 "last_test_status": "<enum, TestStatus>",
 "last_test_timestamp": "<timestamp>"

 }
 }
}

Success Response

Code: 201 
Content:
{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "email_contacts",
 "id": "<string>",
 "attributes": {
 "name": "<string>",
 "email": "<string>",
 "status": "<boolean>",
 "last_test_message": "<string>",
 "last_test_status": "<enum, TestStatus>",
 "last_test_timestamp": "<timestamp>"

 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Delete Email Contact

 

Title

Delete Email Contact

URL

/api/email_contacts/:contactId or

/api/email_contacts/:contactName

Method

PATCH

URL Params

/api/email_contacts/:contactId or

/api/email_contacts/:contactName

Note: No HTTP header required to delete by id

http header "by: name" required to delete by name

Success Response

Code: 200 
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"email_contacts",
      "id":"<string, deleted contact id>",
      "attributes":{  
         "response":0
      }
   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Test Email Contact

 

Title

Test Email Contact

URL

/api/email_contacts/test

Method

POST

Data Params

{
 "data": {
 "type": "email_contacts",
 "id": "<string, optional for testing by id>",
 "attributes": {
 "email": "<string>",
 "name": <string, optional for testing by name>
 }
 }
}

Success Response

Code: 200 
Content:
{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "email_contacts",
 "id": "<string>",
 "attributes": {
 "last_test_message": "<string>",
 "last_test_timestamp": "<timestamp>",
 "status": "<enum, TestStatus>"
 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

SMS Contact

 

The SMS Contact API enables creating, editing, deleting and testing SMS notification recipients.

 

 

GET All SMS Contacts

 

Title

GET All SMS Contacts

URL

/api/sms_contacts

Method

GET

Success Response

Code: 200 
Content:
{
 "meta": {
 "id": "<id>",
 "constraints": {
 "max_items": 64,
 "min_items": 0,
 "editable_attributes": [
 "name",
 "phone",
 "status"
 ],
 "required_attributes": [
 "name",
 "phone",
 "status"
 ],
 "delete_allowed": true
 },
 "validation": [
 {
 "attribute": "name",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 1,
 "max_length": 64,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "phone",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 6,
 "max_length": 32,
 "pattern": "^[\\d\\(\\)\\+\\-]+$",
 "enum": [
 
 ],
 "type": "phone"
 },
 {
 "attribute": "provider",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 "alltel",
 "att",
 "boost_mobile",
 "consumer_cellular",
 "cricket",
 "c_spire",
 "google_fi",
 "metro_pcs",
 "page_plus",
 "republic_wireless",
 "sprint",
 "ting",
 "tmobile",
 "tracfone",
 "us_cellular",
 "verizon",
 "virgin_mobile",
 "xfinity_mobile",
 "custom"
 ],
 "type": "enum"
 },
 {
 "attribute": "custom_email",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 128,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "status",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 
 ],
 "type": "boolean"
 },
 {
 "attribute": "last_test_status",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 "TEST_STATUS_NOT_TESTED",
 "TEST_STATUS_SUCCESS",
 "TEST_STATUS_FAIL"
 ],
 "type": "enum"
 },
 {
 "attribute": "last_test_message",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 64,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "last_test_timestamp",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 
 ],
 "type": "datetime"
 }
 ]
 },
 "data": [
 {
 "type": "sms_contacts",
 "id": "<string>",
 "attributes": {
 "uid": "<string>",
 "name": "<string>",
 "phone": "<string>",
 "status": <boolean>,
 "provider": "<string>",
 "custom_email": "<string>",
 "last_test_status": <enum, TestStatus>,
 "last_test_message": "<string>",
 "last_test_timestamp": <number>
 }
 }
 ]
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET One SMS Contact

 

Title

GET One SMS Contact

URL

/api/sms_contacts/:contactId or

/api/sms_contacts/:contactName

Method

GET

URL Params

/api/sms_contacts/:contactId or

/api/sms_contacts/:contactName

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Success Response

Code: 200 
Content:
{
 "meta": {
 "id": "<string>",
 "constraints": {
 "max_items": 64,
 "min_items": 0,
 "editable_attributes": [
 "name",
 "phone",
 "status"
 ],
 "required_attributes": [
 "name",
 "phone",
 "status"
 ],
 "delete_allowed": true
 },
 "validation": [
 {
 "attribute": "name",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 1,
 "max_length": 64,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "phone",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 6,
 "max_length": 32,
 "pattern": "^[\\d\\(\\)\\+\\-]+$",
 "enum": [
 
 ],
 "type": "phone"
 },
 {
 "attribute": "provider",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 "alltel",
 "att",
 "boost_mobile",
 "consumer_cellular",
 "cricket",
 "c_spire",
 "google_fi",
 "metro_pcs",
 "page_plus",
 "republic_wireless",
 "sprint",
 "ting",
 "tmobile",
 "tracfone",
 "us_cellular",
 "verizon",
 "virgin_mobile",
 "xfinity_mobile",
 "custom"
 ],
 "type": "enum"
 },
 {
 "attribute": "custom_email",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 128,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "status",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 
 ],
 "type": "boolean"
 },
 {
 "attribute": "last_test_status",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 "TEST_STATUS_NOT_TESTED",
 "TEST_STATUS_SUCCESS",
 "TEST_STATUS_FAIL"
 ],
 "type": "enum"
 },
 {
 "attribute": "last_test_message",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 64,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "last_test_timestamp",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 
 ],
 "type": "datetime"
 }
 ]
 },
 "data": {
 "type": "sms_contacts",
 "id": "<string>",
 "attributes": {
 "uid": "<string>",
 "name": "<string>",
 "phone": "<string>",
 "provider": "<string>",
 "custom_email": "<string>",
 "status": <boolean>,
 "last_test_status": "<enum, TestStatus>",
 "last_test_message": "<string>",
 "last_test_timestamp": "<timestamp>"
 },
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Create SMS Contact

 

Title

Create SMS Contact

URL

/api/sms_contacts

Method

POST

Data Params

{
 "data": {
 "type": "sms_contacts",
 "attributes": {
 "name": "<string>",
 "phone": "<string>",
 "status": "<boolean>",
 "provider": "<string>",
 "custom_email": "<string>",
 "last_test_status": "<enum, TestStatus>",
 "last_test_message": "<string>",
 "last_test_timestamp": "<timestamp>"
 }
 }
}

Success Response

Code: 201 
Content:

{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_contacts",
 "id": "<string>",
 "attributes": {
 "uid": "<string>",
 "name": "<string>",
 "phone": "<string>",
 "status": "<boolean>",
 "provider": "<string>",
 "custom_email": "<string>",
 "last_test_message": "<string>",
 "last_test_status": "<enum, TestStatus>",
 "last_test_timestamp": "<timestamp>"
 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Delete SMS Contact

 

Title

Delete SMS Contact

URL

/api/email_contacts/:contactId or

/api/email_contacts/:contactName

Method

DELETE

URL Params

/api/sms_contacts/:contactId or

/api/sms_contacts/:contactName

Note: No HTTP header required to delete by id

http header "by: name" required to delete by name

Success Response

Code: 200 
Content:

{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_contacts",
 "id": "<string>",
 "attributes": {
 "response": 0
 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update SMS Contact

 

Title

Update SMS Contact

URL

/api/sms_contacts/:contactId or

/api/sms_contacts/:contactName

Method

PATCH

URL Params

/api/sms_contacts/:contactId or

/api/sms_contacts/:contactName

Note: No HTTP header required to update by id

http header "by: name" required to update by name

Data Params

{
 "data": {
 "type": "sms_contacts",
 "attributes": {
 "name": "<string>",
 "phone": "<string>",
 "status": "<boolean>",
 "provider": "<string>",
 "custom_email": "<string>",
 "last_test_status": "<enum, TestStatus>",
 "last_test_message": "<string>",
 "last_test_timestamp": "<timestamp>"
 }
 }
}

Success Response

Code: 200
Content:
{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_contacts",
 "id": "<string>",
 "attributes": {
 "response": 0
 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET All SMS Providers

 

Title

GET All SMS Providers

URL

/api/sms_providers

Method

GET

Success Response

Code: 200 
Content:  
{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_providers",
 "attributes": {
   "<key>": "<carrier>",
   "<key>": "<carrier>"
   ...
   }
 }
}

Example:

{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_providers",
 "attributes": {
   "alltel": "Alltel",
   "att": "AT&T",
   "boost_mobile": "Boost Mobile",
   "c_spire": "C-Spire",
   "consumer_cellular": "Consumer Cellular",
   "cricket": "Cricket",
   "custom": "Other",
   "google_fi": "Google Fi",
   "metro_pcs": "Metro PCS",
   "page_plus": "Page Plus",
   "republic_wireless": "Republic Wireless",
   "sprint": "Sprint",
   "ting": "Ting",
   "tmobile": "T-Mobile",
   "tracfone": "Tracfone",
   "us_cellular": "U.S. Cellular",
   "verizon": "Verizon",
   "virgin_mobile": "Virgin Mobile",
   "xfinity_mobile": "XFinity Mobile"
   }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Test SMS Contact

 

Title

Test SMS Contact

URL

/api/sms_contacts/test

Method

POST

Data Params

{
 "data": {
 "type": "sms_contacts",
 "id": "<string, optional for testing by id>",
 "attributes": {
 "name": "<string, optional for testing by name>",
 "phone": "<string>",
 "provider": "<string>",
 "status": <boolean>
 }
 }
}

Success Response

Code: 200
Content:
{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_contacts",
 "attributes": {
 "last_test_message": "<string>",
 "last_test_timestamp": "<timestamp>",
 "status": "<enum, TestStatus>"
 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

SNMP Contact

 

The SNMP Contact API enables creating, editing, deleting and testing SNMP notification recipients. It uses the following enums:

 

snmp_version:

SNMP_PROTOCOL_V1

SNMP_PROTOCOL_V2

SNMP_PROTOCOL_V3

 

notification_type:

NOTIFICATION_TYPE_TRAP

NOTIFICATION_TYPE_INFORM

 

last_test_status:

TEST_STATUS_SUCCESS

TEST_STATUS_FAIL

TEST_STATUS_NONE

 

privacy_mode:

SNMPV3_AUTH_NO_AUTH_NO_PRIV

SNMPV3_AUTH_AUTH_NOPRIV

SNMPV3_AUTH_AUTH_PRIV

 

auth_proto:

SNMPV3_AUTH_PROTO_MD5

SNMPV3_AUTH_PROTO_SHA

 

priv_proto:

SNMPV3_PRIV_PROTO_DES

SNMPV3_PRIV_PROTO_AES

 

 

GET All SNMP Contacts

 

Title

GET All SNMP Contacts

URL

/api/snmp_contacts?snmpVersion=:snmpVersion

Method

GET

URL Params

Optional:

snmpVersion=<enum, snmp version>

example: snmpVersion=SNMP_PROTOCOL_V1

If empty, all snmp users, of all versions are returned

Success Response

Code: 200 
Content:

{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "status",
            "ip_address",
            "trap_port",
            "set_port",
            "snmp_version",
            "notification_type",
            "trap_enabled",
            "set_enabled",
            "community",
            "user_name",
            "privacy_mode",
            "auth_proto",
            "authentication_pass_phrase",
            "priv_proto",
            "privacy_pass_phrase",
            "engine_id",

 "test_result_trap",

 "test_result_set"

         ],
         "required_attributes":[  
            "name",
            "ip_address",
            "trap_port",
            "set_port",
            "community",
            "user_name",
            "authentication_pass_phrase",
            "privacy_pass_phrase"
         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"ip_address",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"ip"
         },
         {  
            "attribute":"trap_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"set_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"snmp_version",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "SNMP_PROTOCOL_V1",
               "SNMP_PROTOCOL_V2",
               "SNMP_PROTOCOL_V3"
            ],
            "type":"enum"
         },
         {  
            "attribute":"notification_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "NOTIFICATION_TYPE_TRAP",
               "NOTIFICATION_TYPE_INFORM"
            ],
            "type":"enum"
         },
         {  
            "attribute":"trap_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"set_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"last_test_status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "TEST_STATUS_NONE",
               "TEST_STATUS_SUCCESS",
               "TEST_STATUS_FAIL"
            ],
            "type":"enum"
         },
         {  
            "attribute":"last_test_message",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"last_test_timestamp",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"datetime"
         },
         {  
            "attribute":"community",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"user_name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"privacy_mode",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "SNMPV3_AUTH_NO_AUTH_NO_PRIV",
               "SNMPV3_AUTH_AUTH_NOPRIV",
               "SNMPV3_AUTH_AUTH_PRIV"
            ],
            "type":"enum"
         },
         {  
            "attribute":"auth_proto",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "SNMPV3_AUTH_PROTO_MD5",
               "SNMPV3_AUTH_PROTO_SHA"
            ],
            "type":"enum"
         },
         {  
            "attribute":"authentication_pass_phrase",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"priv_proto",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "SNMPV3_PRIV_PROTO_DES",
               "SNMPV3_PRIV_PROTO_AES"
            ],
            "type":"enum"
         },
         {  
            "attribute":"privacy_pass_phrase",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"engine_id",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":5,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":[  

// v1/v2c contact:
      {  
         "type":"snmp_contacts",
         "id":"<string>",
         "attributes":{  
            "uid":"<string>",
            "name":"<string>",
            "status":"<boolean>",
            "ip_address":"<string>",
            "trap_port":"<uint32>",
            "set_port":"<uint32>",
            "snmp_version":"<enum, snmp version>",
            "trap_enabled":"<true/false>",
            "set_enabled":"<true/false>",         
            "notification_type":"<enum, notification type>",
            "last_test_trap_status":"<enum, test status>",
            "last_test_trap_message":"<string>",

            "last_test_trap_timestamp":"<number in seconds>",
            "last_test_set_status": "<enum, test status>",
            "last_test_set_message": "<string>",
            "last_test_set_timestamp": "<number in seconds>",

            "community":""
         }
      },

// v3 contact
      {  
         "type":"snmp_contacts",
         "id":"<string>",
         "attributes":{  
            "uid":"<string>",
            "name":"<string>",
            "status":"<boolean>",
            "ip_address":"<string>",
            "trap_port":"<uint32>",
            "set_port":"<uint32>",
            "snmp_version":"<enum, snmp version>",
            "trap_enabled":"<true/false>",
            "set_enabled":"<true/false>",           
            "notification_type":"<enum, notification type>",         

            "last_test_trap_status":"<enum, test status>",
            "last_test_trap_message":"<string>",
            "last_test_trap_timestamp":"<number in seconds>",
            "last_test_set_status": "<enum, test status>",
            "last_test_set_message": "<string>",
            "last_test_set_timestamp": "<number in seconds>",

            "user_name":"<string>",
            "authentication_pass_phrase":"<string>",
            "privacy_pass_phrase":"<string>",
            "engine_id":"<string>",
            "privacy_mode":"<enum, privacy mode>",
            "auth_proto":"<enum, auth proto>",
            "priv_proto":"<enum, priv proto>"
         }
      }
   ]
}

Sample Call

curl -i

-H "Accept: application/vnd.api+json"

http://localhost:3001/api/snmp_contacts?snmpVersion=v1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is used for SNMP v1, v2c, and v3 variants.

 

GET One SNMP Contact

 

Title

GET One SNMP Contact

URL

/api/snmp_contacts/:contactId or

/api/snmp_contacts/:contactName

Method

GET

URL Params

/api/snmp_contacts/:contactId or

/api/snmp_contacts/:contactName

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Success Response

Code: 200 
Content:

{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "status",
            "ip_address",
            "trap_port",
            "set_port",
            "snmp_version",
            "notification_type",
            "trap_enabled",
            "set_enabled",
            "community",

            "test_result_trap",

            "test_result_set"
         ],
         "required_attributes":[  
            "name",
            "ip_address",
            "trap_port",
            "set_port",
            "community"
         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"ip_address",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"ip"
         },
         {  
            "attribute":"trap_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"set_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"snmp_version",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "SNMP_PROTOCOL_V1",
               "SNMP_PROTOCOL_V2",
               "SNMP_PROTOCOL_V3"
            ],
            "type":"enum"
         },
         {  
            "attribute":"notification_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "NOTIFICATION_TYPE_TRAP",
               "NOTIFICATION_TYPE_INFORM"
            ],
            "type":"enum"
         },
         {  
            "attribute":"trap_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"set_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"last_test_status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "TEST_STATUS_NONE",
               "TEST_STATUS_SUCCESS",
               "TEST_STATUS_FAIL"
            ],
            "type":"enum"
         },
         {  
            "attribute":"last_test_message",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"last_test_timestamp",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"datetime"
         },
         {  
            "attribute":"community",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":{  
      "type":"snmp_contacts",
      "id":"<string>",
      "attributes":{  
         "uid":"<string>",
         "name":"<string>",
         "status":"<boolean>",
         "ip_address":"<string>",
         "trap_port":"<uint32>",
         "set_port":"<uint32>",
         "snmp_version":"<enum, snmp version>",
         "trap_enabled":"<boolean>",
         "set_enabled":"<boolean>",        
         "notification_type":"<enum, notification type>",      
         "community":"",

         "last_test_trap_status": "<enum test status>",
         "last_test_trap_message": "<string>",
         "last_test_trap_timestamp": "<number in seconds>",
         "last_test_set_status": "<enum test status>",
         "last_test_set_message": "<string>",
         "last_test_set_timestamp": "<number in seconds>"

      }
   }
}

Sample Call

curl -i

-H "Accept: application/vnd.api+json"

http://localhost:3001/api/snmp_contacts/123

http://localhost:3001/api/snmp_contacts/somecontactname

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Create SNMP contact

 

Title

Create SNMP Contact

URL

/api/snmp_contacts

Method

POST

Data Params

 {  
   "data":{  
      "type":"snmp_contacts",
      "attributes":{  
         "name":"<string>",
         "status":"<boolean>",
         "ip_address":"<string>",
         "trap_port":"<uint32>",
         "set_port":"<uint32>",
         "snmp_version":"<enum, snmp version>",
         "trap_enabled":"<boolean>",
         "set_enabled":"<boolean>",        
         "notification_type":"<enum, notification type>",

         "last_test_trap_status": "<enum test status>",
         "last_test_trap_message": "<string>",
         "last_test_trap_timestamp": "<number in seconds>",
         "last_test_set_status": "<enum test status>",
         "last_test_set_message": "<string>",
         "last_test_set_timestamp": "<number in seconds>"      

// for v1/v2c only:
         "community":"<string>",

// for v3 only:
         "user_name":"<string>",
         "authentication_pass_phrase":"<string>",
         "privacy_pass_phrase":"<string>",
         "engine_id":"<string>",
         "privacy_mode":"<enum, privacy mode>",
         "auth_proto":"<enum, auth proto>",
         "priv_proto":"<enum, priv proto>"
      }
   }
}

Success Response

Code: 201 
Content:

{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmp_contacts",
      "id":"<string, snmp contact id>",
      "attributes":{  
         "uid":"<string, snmp contact id>",
         "name":"<string>",
         "status":"<boolean>",
         "ip_address":"<string>",
         "trap_port":"<uint32>",
         "set_port":"<uint32>",
         "snmp_version":"<enum, snmp version>",
         "trap_enabled":"<boolean>",
         "set_enabled":"<boolean>",         
         "notification_type":"<enum, notification type>",

         "last_test_trap_status": "<enum test status>",
         "last_test_trap_message": "<string>",
         "last_test_trap_timestamp": "<number in seconds>",
         "last_test_set_status": "<enum test status>",
         "last_test_set_message": "<string>",
         "last_test_set_timestamp": "<number in seconds>"       

// for v1/v2c only:
         "community":"<string>",

// for v3 only:
         "user_name":"<string>",
         "authentication_pass_phrase":"<string>",
         "privacy_pass_phrase":"<string>",
         "engine_id":"<string>",
         "privacy_mode":"<enum, privacy mode>",
         "auth_proto":"<enum, auth proto>",
         "priv_proto":"<enum, priv proto>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is used for SNMP v1, v2c, and v3 variants.

 

 

 

Delete SNMP Contact

 

Title

Delete SNMP Contact

URL

/api/snmp_contacts/:contactId  or

/api/snmp_contacts/:contactName

Method

DELETE

URL Params

/api/snmp_contacts/:contactId  or

/api/snmp_contacts/:contactName

Note: No HTTP header required to delete by id

http header "by: name" required to delete by name

Success Response

Code: 200 
Content:

{  
   "data":{  
      "type":"snmp_contacts",
      "id":"<deleted contact id>",
      "attributes":{  
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update SNMP Contact

 

Title

Update SNMP Contact

URL

/api/snmp_contacts/:contactId or

/api/snmp_contacts/:contactName

Method

PATCH

URL Params

/api/snmp_contacts/:contactId or

/api/snmp_contacts/:contactName

Note: No HTTP header required to update by id

http header "by: name" required to update by name

Data Params

 {  
   "data":{  
      "type":"snmp_contacts",
      "attributes":{  
         "name":"<string>",
         "status":"<boolean>",
         "ip_address":"<string>",
         "trap_port":"<uint32>",
         "set_port":"<uint32>",
         "snmp_version":"<enum, snmp version>",
         "trap_enabled":"<boolean>",
         "set_enabled":"<boolean>",         
         "notification_type":"<enum, notification type>",

         "last_test_trap_status": "<enum test status>",
         "last_test_trap_message": "<string>",
         "last_test_trap_timestamp": "<number in seconds>",
         "last_test_set_status": "<enum test status>",
         "last_test_set_message": "<string>",
         "last_test_set_timestamp": "<number in seconds>"         

// for v1/v2c only:
         "community":"<string>",

// for v3 only:
         "user_name":"<string>",
         "authentication_pass_phrase":"<string>",
         "privacy_pass_phrase":"<string>",
         "engine_id":"<string>",
         "privacy_mode":"<enum, privacy mode>",
         "auth_proto":"<enum, auth proto>",
         "priv_proto":"<enum, priv proto>"
      }
   }
}

 

Success Response

Code: 200
Content:
{  
   "data":{  
      "type":"snmp_contacts",
      "id":"<string, updated contact id>",
      "attributes":{  
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Test SNMP Contact

 

Title

Test SNMP Contact

URL

/api/snmp_contacts/traptest

Method

POST

Data Params

{  
   "data":{  

      "type":"snmp_contacts_traptest",

 "id": "<contact id>"
      "attributes":{          
         "contact":{

            "<snmp contact>"        

      }

 }
   }
}

see notes below for details on contact attribute

Success Response

Code: 201 
Content:

{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmp_contacts",
      "id":"<contact id>",
      "attributes":{         
      "status": "<enum TestStatus>",

      "message": "<string>",

      "timestamp": "<number>"
      
}
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Test SNMP Contact (Set Port Test)

 

Title

Test SNMP Contact

URL

/api/snmp_contacts/settest

Method

POST

Data Params

{  
   "data":{  

      "type":"snmp_contacts",

       "id": "<contact id>"
      "attributes":{          
         "contact":"<snmp contact>" ,

          "oid": "<oid string>",

          "oid_data_type": <one of: "

          "oid_value": "<string>"       
      }
   }
}

see notes below for details on contact attribute

Success Response

Code: 201 
Content:

{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmp_contacts",
      "id":"<contact id>",
      "attributes":{         
         "status": "<enum TestStatus>",

         "message": "<string>",

         "timestamp": "<number>" 
      
}
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

·       In Data Params, id field in data is required for an existing snmp contact only. id field is in the response only for an existing snmp contact as well

·       Also in Data Params, the <snmp contact> field is as it is defined in the 'Update one SNMP Contact' section above as shown in "data": {
"attributes": {<snmp contact> }
}

·       This Trap Port Test section is relevant for SNMP v1, v2, and v3

 

AutoProbes

The AutoProbes API enables management of AutoProbes, which automatically execute a prescribed action when the device loses network communication with specified target device.  This API is used for creating, editing and deleting AutoProbes. It uses the following enums:

 

probe_type:

AUTOPROBE_TYPE_NTP

AUTOPROBE_TYPE_PING

AUTOPROBE_TYPE_SNMP

 

probe_status:

AUTOPROBE_STATUS_UNSPECIFIED

AUTOPROBE_STATUS_UNKNOWN

AUTOPROBE_STATUS_OK

AUTOPROBE_STATUS_FAILED

AUTOPROBE_STATUS_FAILED_INIT

    

snmp_version:

SNMP_PROTOCOL_V1

SNMP_PROTOCOL_V2

SNMP_PROTOCOL_V

    

auth_proto:

SNMPV3_AUTH_PROTO_MD5

SNMPV3_AUTH_PROTO_SHA

    

priv_proto:

SNMPV3_PRIV_PROTO_DES

SNMPV3_PRIV_PROTO_AES

 

privacy_mode:

SNMPV3_AUTH_NO_AUTH_NO_PRIV

SNMPV3_AUTH_AUTH_NOPRIV

SNMPV3_AUTH_AUTH_PRIV

 

 

GET All AutoProbe Settings

 

Title

GET All AutoProbe Settings

URL

/api/autoprobe

Method

GET

URL Params

additive filters supported by status, probe_type, probe_status

 

GET all AutoProbe Entries by probe_type

/api/autoprobe?filter[probe_type]=AUTOPROBE_TYPE_SNMP

 

GET all AutoProbe Entries by status

/api/autoprobe?filter[status]=true

 

GET all AutoProbe Entries by probe_status

/api/autoprobe?filter[probe_status]=AUTOPROBE_STATUS_FAILED_INIT

 

GET all AutoProbe Entries by status, probe_type, probe_status

/api/autoprobe?filter[status]=true&filter[probe_type]

=AUTOPROBE_TYPE_SNMP&filter[probe_status]=AUTOPROBE_STATUS_FAILED_INIT

Success Response

Code: 200 

Content: {

    "meta": {

        "id": "c5e3d122-f41b-4caf-b520-56316ae4c199",

        "constraints": {}

        "validation": [],

        "count": 64,

        "path": "/api/autoprobe"

    },

    "data": [{

        "type": "autoprobe",

        "id": "3",

        "attributes": {

            "name": "<string>",

            "status": <boolean>,

            "description": "<string?",

            "probe_type": "<Enum>",

            "retries": <int>

            "interval": <int>

            "primary_address": "<String>",

            "primary_port": <int>,

            "secondary_address": "<string>",

            "secondary_port": <int>,

            "probe_status": "<Enum>",

            "snmp_security": {

                "snmp_version": "<Enum>",

                "community": "<String>",

                "user_name": "<String>",

                "privacy_mode": "<Enum>",

                "auth_proto": "<Enum>",

                "authentication_pass_phrase": "<String>",

                "priv_proto": "<Enum>",

                "privacy_pass_phrase": "<String>",

                "primary_oid": "<String>",

                "secondary_oid": "<String>"

            }

        }

    }}

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET One AutoProbe Setting

 

Title

GET One AutoProbe Setting

URL

/api/autoprobe/:id

OR

/api/autoprobe/:name

 

Note: NO HTTP header required to get autoprobe by ID

Method

GET

URL Params

/api/autoprobe/:id

OR

/api/autoprobe/:name

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Required:

id=[integer] 
example: id=12

name=[string]

example: 'autoprobe1'

Success Response

Code: 200 
Content: 

{

    "meta": {

        "id": "c5e3d122-f41b-4caf-b520-56316ae4c199",

        "constraints": {}

        "validation": [],

        "count": 64,

        "path": "/api/autoprobe"

    },

    "data": {

        "type": "autoprobe",

        "id": "3",

        "attributes": {

            "name": "<string>",

            "status": <boolean>,

            "description": "<string?",

            "probe_type": "<Enum>",

            "retries": <int>

            "interval": <int>

            "primary_address": "<String>",

            "primary_port": <int>,

            "secondary_address": "<string>",

            "secondary_port": <int>,

            "probe_status": "<Enum>",

            "snmp_security": {

                "snmp_version": "<Enum>",

                "community": "<String>",

                "user_name": "<String>",

                "privacy_mode": "<Enum>",

                "auth_proto": "<Enum>",

                "authentication_pass_phrase": "<String>",

                "priv_proto": "<Enum>",

                "privacy_pass_phrase": "<String>",

                "primary_oid": "<String>",

                "secondary_oid": "<String>"

            }

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET All AutoProbe Status

 

Title

GET All AutoProbe Status

URL

/api/autoprobe_status

Method

GET

Success Response

Code: 200

Content:

{

    "meta": {

        "id": "7de6d2f4-f8f5-4165-bbdb-54d659b29793",

        "path": "/api/autoprobe_status"

    },

    "data": [{

            "type": "autoprobe",

            "id": "1",

            "attributes": {

                "name": "watchdog_ping",

                "probe_status": "AUTOPROBE_STATUS_UNKNOWN"

            }

        },

        {

            "type": "autoprobe",

            "id": "2",

            "attributes": {

                "name": "watchdog_ntp",

                "probe_status": "AUTOPROBE_STATUS_UNKNOWN"

            }

        },

        {

            "type": "autoprobe",

            "id": "3",

            "attributes": {

                "name": "autoprobe_name1",

                "probe_status": "AUTOPROBE_STATUS_FAILED_INIT"

            }

        },

        {

            "type": "autoprobe",

            "id": "4",

            "attributes": {

                "name": "autoprobe_name2",

                "probe_status": "AUTOPROBE_STATUS_FAILED_INIT"

            }

        }

    ]

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET One AutoProbe Status

 

Title

GET One AutoProbe Status

URL

/api/autoprobe_status/:id

OR

/api/autoprobe_status/:name

Note: NO HTTP header required to get autoprobe status by ID

Method

GET

URL Params

/api/autoprobe_status/:id

OR

/api/autoprobe_status/:name

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Required:

id=[integer] 
example: id=12

name=[string]

example: 'autoprobe1'

Success Response

Code: 200 
Content: 

{

    "meta": {

        "id": "51b85c59-64ac-4d73-9e9b-7083a9f0b9b0",

        "path": "/api/autoprobe_status/watchdog_ping"

    },

    "data": {

        "type": "autoprobe",

        "id": "1",

        "attributes": {

            "name": "watchdog_ping",

            "probe_status": "AUTOPROBE_STATUS_UNKNOWN"

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create AutoProbe Settings

 

Title

Create AutoProbe Settings

URL

/api/autoprobe

Method

POST

Data Params

 {

       "data": {

           "type": "autoprobe",

           "attributes": {

//---- For Ping/NTP/Snmpv1/2/3

               "name": "autoprobe_name099",

               "status": true,

               "description": "autoprobe_description",

               "probe_type": "AUTOPROBE_TYPE_SNMP",

               "retries": 3,

               "interval": 10,

               "primary_address": "10.10.10.10",

               "secondary_address": "20.20.20.20",

//---- Only for /NTP/Snmpv1/2/3

"primary_port": 2020,

               "secondary_port": 4040,

//---- Only for Snmpv1/2/3

               "snmp_security": {

                   "snmp_version": "SNMP_PROTOCOL_V3",

                   "community": "autoprobe_community",

                   "user_name": "autoprobe_user_name",

                   "privacy_mode": "SNMPV3_AUTH_AUTH_PRIV",

                "auth_proto" : "SNMPV3_AUTH_PROTO_MD5",

                   "authentication_pass_phrase": "autoprobe_auth_pass_phrase",

                   "priv_proto": "SNMPV3_PRIV_PROTO_AES",

                   "privacy_pass_phrase": "autoprobe_pass_phrase",

                   "primary_oid": "autoprobe_primary_oid",

                   "secondary_oid": "autoprobe_secondary_oid"

               }

           }

       }

   }

Success Response

Code: 200 
Content:

{

    "meta": {

        "id": "ea66350c-d95e-45c4-92fb-d8381e9eeb8c",

        "path": "/api/autoprobe"

    },

    "data": {

        "type": "autoprobe",

        "id": "6",

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update AutoProbe Settings

 

Title

Update AutoProbe Settings

URL

/api/autoprobe/:id

OR

/api/autoprobe/:name

Method

PATCH

URL Params

/api/autoprobe/:id

OR

/api/autoprobe/:name

Note: No HTTP header required to update by id

http header "By: name" required to update by name

Required:

id=[integer] 
example: id=12

name=[String] - example name=autoprobe1

Data Params

{

       "data": {

           "type": "autoprobe",

           "attributes": {

//---- For Ping/NTP/Snmpv1/2/3

               "name": "autoprobe_name3",

               "status": true,

               "description": "autoprobe_description",

               "probe_type": "AUTOPROBE_TYPE_SNMP",

               "retries": 3,

               "interval": 10,

               "primary_address": "10.10.10.10",

               "secondary_address": "20.20.20.20",

//---- Only for NTP/Snmpv1/2/3

      "primary_port": 2020,

               "secondary_port": 4040,

//---- Only for Snmpv1/2/3

               "snmp_security": {

                   "snmp_version": "SNMP_PROTOCOL_V3",

                   "community": "autoprobe_community",

                   "user_name": "autoprobe_user_name",

                   "privacy_mode": "SNMPV3_AUTH_AUTH_PRIV",

                   "auth_proto": "SNMPV3_AUTH_PROTO_MD5",

                   "authentication_pass_phrase": "autoprobe_auth_pass_phrase",

                   "priv_proto": "SNMPV3_PRIV_PROTO_AES",

                   "privacy_pass_phrase": "autoprobe_pass_phrase",

                   "primary_oid": "autoprobe_primary_oid",

                   "secondary_oid": "autoprobe_secondary_oid"

               }

           }

       }

   }

Success Response

Code: 200 
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"autoprobe",
      "id":"<string, id>",
      "attributes":{  
         "response":0
      }
   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

Delete AutoProbe Settings

 

Title

Delete AutoProbe Settings

URL

/api/autoprobe/:id

OR

/api/autoprobe/:name

Method

DELETE

URL Params

/api/autoprobe/:id

OR

/api/autoprobe/:name

Note: No HTTP header required to delete by id

http header "By: name" required to delete by name

Required:

id=[integer] 

example: id=12

OR

name=[String]

example: name=autoprobe1

Success Response

Code: 200 
Content:

   

  "meta":{ 
      "id":"<request id>"
   },
   "data":{       "type":"autoprobe",
      "id":"<integer>",
      "attributes":{ 
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Device Control

The Device Control API enables control of the device in the form of Turn On, Turn Off and Reboot. This applies only to devices that supports these functions.

 

 

Turn On Device

 

Title

Turn On Device

URL

/api/controls_turnon_device/execute

Method

PATCH

Data Params

{

    "data": {

        "type": "controls_turnon_device",

        "attributes": {

        "device_id": "< int device ID >", // OR "device_name": "<sting name of device>

        "turn_on_delay": "< int time in sec >"

        }

    }

}

Success Response

Code: 201 
Content:

{

    "meta": {

        "id": "bbf554c7-38e6-42c5-81f5-3256388dbc67"

    },

    "data": {

        "type": "controls_turnon_device",

        "id": 0,

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Turn Off Device

 

Title

Turn Off Device

URL

/api/controls_turnoff_device/execute

Method

PATCH

Data Params

{

    "data": {

        "type": "controls_turnoff_device",

        "attributes": {

            "device_id": "< int device ID >", // OR "device_name": "<sting name of device>

            "turn_off_delay": "< int time in sec >"

        }

    }

}

Success Response

Code: 200

{

    "meta": {

        "id": "bbf554c7-38e6-42c5-81f5-3256388dbc67"

    },

    "data": {

        "type": "controls_turnoff_device",

        "id": 0,

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Reboot Device

 

Title

Reboot Device

URL

/api/controls_reboot_device/execute

Method

PATCH

Data Params

{

    "data": {

        "type": "controls_reboot_device",

        "attributes": {

            "device_id": "< int device ID >", // OR "device_name": "<sting name of device>

            "turn_off_delay": "< int time in sec >",

            "turn_on_delay": "< int time in sec >"

        }

    }

}

Success Response

Code: 200

{

    "meta": {

        "id": "bbf554c7-38e6-42c5-81f5-3256388dbc67"

    },

    "data": {

        "type": "controls_turnoff_device",

        "id": 0,

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

Device Properties

The Device Properties API displays properties of the device and all connected peripherals, as well as allowing updates of device attributes. It uses the following enums:

 

device_state:

DEVICE_STATE_NORMAL

DEVICE_STATE_CRITICAL

DEVICE_STATE_WARNING

DEVICE_STATE_INFORMATION

DEVICE_STATE_STATUS

DEVICE_STATE_OFFLINE

 

device_type:

DEVICE_TYPE_UNKNOWN

DEVICE_TYPE_UPS

DEVICE_TYPE_PDU

DEVICE_TYPE_ENVIROSENSE

DEVICE_TYPE_AC

DEVICE_TYPE_KVM

DEVICE_TYPE_ASSETTRACKER

DEVICE_TYPE_ATS

DEVICE_TYPE_SWITCH

 

port_mode:

DEVICE_COMM_UNKNOWN         

DEVICE_COMM_RS232

DEVICE_COMM_HID

DEVICE_COMM_USB

DEVICE_COMM_SIMULATED

 

 

init_state:

DEVICE_INIT_STATE_INACTIVE

DEVICE_INIT_STATE_INITIALIZING

DEVICE_INIT_STATE_INITIALIZED

 

device_battery_synchronization_state:

DEVICE_BATTERY_SYNCHRONIZATION_STATE_NONE

DEVICE_BATTERY_SYNCHRONIZATION_STATE_READING

DEVICE_BATTERY_SYNCHRONIZATION_STATE_WRITING

DEVICE_BATTERY_SYNCHRONIZATION_STATE_VERIFYING

 

 

GET All Devices

 

Title

GET All Devices

URL

/api/devices

Method

GET

Success Response

Code: 200 
Content:
{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "location",
            "region",
            "role",
            "keyword",
            "importance",
            "install_date"
         ],
         "required_attributes":[  

         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"device_id",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"manufacturer",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":80,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"model",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":80,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"protocol",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":40,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"location",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":128,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"region",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":128,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"role",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"keyword",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"importance",
            "maximum":100,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"install_date",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"date"
         },
         {  
            "attribute":"deactivate_date",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"date"
         },
         {  
            "attribute":"secs_on_battery",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"alarm_status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "DEVICE_STATE_NORMAL",
               "DEVICE_STATE_CRITICAL",
               "DEVICE_STATE_WARNING",
               "DEVICE_STATE_INFORMATION",
               "DEVICE_STATE_STATUS",
               "DEVICE_STATE_OFFLINE"
            ],
            "type":"enum"
         },
         {  
            "attribute":"port_mode",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "COM_UNKNOWN",
               "COM_SERIAL",
               "COM_HID",
               "COM_USB",
               "COM_SIMULATED"
            ],
            "type":"enum"
         },
         {  
            "attribute":"device_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "DEVICE_TYPE_UNKNOWN",
               "DEVICE_TYPE_UPS",
               "DEVICE_TYPE_PDU",
               "DEVICE_TYPE_ENVIROSENSE",
               "DEVICE_TYPE_AC",
               "DEVICE_TYPE_KVM",
               "DEVICE_TYPE_ASSETTRACKER",
               "DEVICE_TYPE_ATS",
               "DEVICE_TYPE_SWITCH"
            ],
            "type":"enum"
         },
         {  
            "attribute":"sync_inprogress",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"active",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"num_inputs",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_outputs",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_phases",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_outlets",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_outlet_groups",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_circuits",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_breakers",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_heatsinks",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"energy_wise_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"ramp_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"shed_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_current_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_power_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_voltage_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"controllable_mainload_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"controllable_loads_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_groups_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         }
      ]
   },
   "data":[  
      {  
         "type":"devices",
         "id":"<string>",
         "attributes":{  
            "device_id":"<uint32>",
            "name":"<string>",
            "manufacturer":"<string>",
            "model":"<string>",
            "protocol":"<string>",
            "location":"<string>",
            "region":"<string>",
            "role":"<string>",
            "keyword":"<string>",
            "importance":"<uint32>",
            "install_date":"<date, in format of YYYY-MM-DD>",
            "deactivate_date":"<date, in format of YYYY-MM-DD>",
            "secs_on_battery":"<uint32>",
            "device_type":"<enum, Device Type>",
            "sync_inprogess":"<boolean>",
            "alarm_status":"<enum, Device State>",
            "active":"<boolean>",
            "num_inputs":"<uint32>",
            "num_outputs":"<uint32>",
            "num_phases":"<uint32>",
            "num_outlets":"<uint32>",
            "num_outlet_groups":"<uint32>",
            "num_circuits":"<uint32>",
            "num_breakers":"<uint32>",
            "num_heatsinks":"<uint32>",
            "energy_wise_supported":"<boolean>",
            "ramp_supported":"<boolean>",
            "shed_supported":"<boolean>",
            "load_current_supported":"<boolean>",
            "load_power_supported":"<boolean>",
            "load_voltage_supported":"<boolean>",
            "controllable_mainload_supported":"<boolean>",
            "controllable_loads_supported":"<boolean>",
            "load_groups_supported":"<boolean>"
            "init_state": "<ENUM - DeviceInitializeState>",
            "configured_device_id": <init>,
            "configured_asset_tag": "<string>",
            "led_ready": <boolean>,
            "load_receptacle_supported": <boolean>,
            "configured_device_id_minimum": <int>,
            "configured_device_id_maximum": <int>,
            "device_battery_synchronization_state": <ENUM - DeviceBatterySynchronizationState>,
            "device_factory_reset_supported" : <boolean>,
            "ramp_shed_config_in_progress": <boolean>
         
}
      },
      {  
         "type":"devices",
         "id":"<string>",
         "attributes":{  
            "device_id":"<uint32>",
            "name":"<string>",
            "manufacturer":"<string>",
            "model":"<string>",
            "protocol":"<string>",
            "location":"<string>",
            "region":"<string>",
            "role":"<string>",
            "keyword":"<string>",
            "importance":"<uint32>",
            "install_date":"<date, in format of YYYY-MM-DD>",
            "deactivate_date":"<date, in format of YYYY-MM-DD>",
            "secs_on_battery":"<uint32>",
            "device_type":"<enum, Device Type>",
            "sync_inprogess":"<boolean>",
            "alarm_status":"<enum, Device State>",
            "active":"<boolean>",
            "num_inputs":"<uint32>",
            "num_outputs":"<uint32>",
            "num_phases":"<uint32>",
            "num_outlets":"<uint32>",
            "num_outlet_groups":"<uint32>",
            "num_circuits":"<uint32>",
            "num_breakers":"<uint32>",
            "num_heatsinks":"<uint32>",
            "energy_wise_supported":"<boolean>",
            "ramp_supported":"<boolean>",
            "shed_supported":"<boolean>",
            "load_current_supported":"<boolean>",
            "load_power_supported":"<boolean>",
            "load_voltage_supported":"<boolean>",
            "controllable_mainload_supported":"<boolean>",
            "controllable_loads_supported":"<boolean>",
            "load_groups_supported":"<boolean>"
            "ramp_shed_in_progress": <boolean>,
            "init_state": "<ENUM - DeviceInitializeState>",
            "configured_device_id": <init>,
            "configured_asset_tag": "<string>",
            "led_ready": <boolean>,
            "load_receptacle_supported": <boolean>,
            "configured_device_id_minimum": <int>,
            "configured_device_id_maximum": <int>,
            "device_battery_synchronization_state": <ENUM - DeviceBatterySynchronizationState>,
            "device_factory_reset_supported" : <boolean>,
            "ramp_shed_config_in_progress": <boolean>

         
}
      }
   ]
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" 
http://localhost:3001/api/devices

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET Basic Device Information

This API gets basic information about the device and all connected peripherals. It returns only device id, name, type and state.

 

Title

GET Basic Device Information

URL

/api/devices_info

Method

GET

Data Params

{

    "data": {

        "type": "controls_turnoff_device",

        "attributes": {

            "device_id": "< int device ID >", // OR "device_name": "<sting name of device>

            "turn_off_delay": "< int time in sec >"

        }

    }

}

Success Response

Code: 200 
Content:
{
 "meta": {
    "id": "<request id>"
 },
 "data": [
   {
    "type": "devices_info",
    "id": "<string>",
    "attributes": {
    "device_id": "<uint32>",
    "name": "<string>",
    "device_type": "<enum, Device Type>",
    "active": "<boolean>",
    "init_state": "<enum, Device Initialize State>"
   }
 },
 {
    "type": "devices_info",
    "id": "<string>",
    "attributes": {
    "device_id": "<uint32>",
    "name": "<string>",
    "device_type": "<enum, Device Type>",
    "active": "<boolean>",
    "init_state": "<enum, Device Initialize State>"
 }
 }
 ]
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET Basic Device Information by ID or Name

 

Title

GET Basic Device Information by ID/Name

URL

/api/devices/:deviceId OR

/api/devices/:deviceName

Method

GET

URL Params

/api/devices/:deviceId (default)

/api/devices/:deviceName

Note: No HTTP header required to update by id

http header "by: name" required to update by name

Success Response

Code: 200 
Content:
{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "location",
            "region",
            "role",
            "keyword",
            "importance",
            "install_date"
         ],
         "required_attributes":[  

         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"device_id",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"manufacturer",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":80,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"model",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":80,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"protocol",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":40,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"location",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":128,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"region",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":128,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"role",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"keyword",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"importance",
            "maximum":100,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"install_date",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"date"
         },
         {  
            "attribute":"deactivate_date",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"date"
         },
         {  
            "attribute":"secs_on_battery",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"alarm_status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "Normal",
               "Critical",
               "Warning",
               "Information",
               "Status",
               "Offline"
            ],
            "type":"enum"
         },
         {  
            "attribute":"device_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "Unknown",
               "UPS",
               "PDU",
               "Envirosense",
               "AC",
               "KVM",
               "AssetTracker",
               "ATS",
               "Switch"
            ],
            "type":"enum"
         },
         {  
            "attribute":"sync_inprogress",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"active",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"num_inputs",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_outputs",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_phases",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_outlets",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_outlet_groups",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_circuits",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_breakers",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_heatsinks",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"energy_wise_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"ramp_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"shed_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_current_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_power_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_voltage_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"controllable_mainload_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"controllable_loads_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_groups_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         }
      ]
   },
   "data":{  
      "type":"devices",
      "id":"<string>",
      "attributes":{  
         "device_id":"<uint32>",
         "name":"<string>",
         "manufacturer":"<string>",
         "model":"<string>",
         "protocol":"<string>",
         "location":"<string>",
         "region":"<string>",
         "role":"<string>",
         "keyword":"<string>",
         "importance":"<uint32>",
         "install_date":"<date, in format of YYYY-MM-DD>",
         "deactivate_date":"<date, in format of YYYY-MM-DD>",
         "secs_on_battery":"<uint32>",
         "device_type":"<enum, Device Type>",
         "sync_inprogess":"<boolean>",
         "alarm_status":"<enum, Device State>",
         "active":"<boolean>",
         "num_inputs":"<uint32>",
         "num_outputs":"<uint32>",
         "num_phases":"<uint32>",
         "num_outlets":"<uint32>",
         "num_outlet_groups":"<uint32>",
         "num_circuits":"<uint32>",
         "num_breakers":"<uint32>",
         "num_heatsinks":"<uint32>",
         "energy_wise_supported":"<boolean>",
         "ramp_supported":"<boolean>",
         "shed_supported":"<boolean>",
         "load_current_supported":"<boolean>",
         "load_power_supported":"<boolean>",
         "load_voltage_supported":"<boolean>",
         "controllable_mainload_supported":"<boolean>",
         "controllable_loads_supported":"<boolean>",
         "load_groups_supported":"<boolean>",
         "init_state": "<ENUM - DeviceInitializeState>",
         "configured_device_id": <init>,
         "configured_asset_tag": "<string>",
         "led_ready": <boolean>,
         "load_receptacle_supported": <boolean>,
         "configured_device_id_minimum": <int>,
         "configured_device_id_maximum": <int>,
         "device_battery_synchronization_state": <ENUM - DeviceBatterySynchronizationState>,
         "device_factory_reset_supported" : <boolean>

      
}
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Device Properties

 

Title

Update Device Properties

URL

/api/devices/:deviceId or

/api/devices/:deviceName

Method

PATCH

URL Params

/api/devices/:deviceId (default)

OR

/api/devices/:deviceName

 

Note: No HTTP header required to update by id

http header "by: name" required to update by name

Data Params

Code: 200 

Content:

{  
   "data":{  
      "type":"devices",
      "attributes":{  
         "name":"<string>",
         "location":"<string>",
         "role":"<string>",
         "importance":<uint32>,
         "date_installed":"<string, date in format of: YYYY-MM-DD>",
         "importance":<uint32>,
         "date_installed":"<string, date in format of: YYYY-MM-DD>"
      }
   }
}

Success Response

Code: 201 
Content:

{  
   "data":{  
      "type":"devices",
      "id":<uint32>,
      "attributes":{  
         "response":0
      }
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" 
http://localhost:3001/api/devices/123

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Delete Inactive Device

 

 

Title

Delete Inactive Device

URL

/api/devices/:deviceId

OR

/api/devices/:deviceName

Method

DELETE

URL Params

/api/devices/:deviceId (default)

OR

/api/devices/:deviceName

 

Note: No HTTP header required to update by id

http header "by: name" required to update by name

Success Response

CODE 200
{  
   "data":{  
      "type":"devices",
      "id":<uint32>,
      "attributes":{  
         "response":0
      }
   }
}

Sample Call

curl –i -H "Accept: application/vnd.api+json" 
http://localhost:3001/api/devices/123

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Device Metrics

The Device Metrics API enables retrieval of device metrics, including those of any connected peripherals. It uses the following enums:

 

data_type:

VARTYPE_NONE

VARTYPE_INTEGER

VARTYPE_FLOAT

VARTYPE_STRING

VARTYPE_DATE

VARTYPE_ENUMSTRING

VARTYPE_BYTE

VARTYPE_ENUMINTEGER

 

group:

VARGROUP_ALL

VARGROUP_NONE

VARGROUP_SYSTEM

VARGROUP_DEVICE

VARGROUP_CONTACT

VARGROUP_WATCHDOG

VARGROUP_LOAD

VARGROUP_BATTERY

VARGROUP_INPUT

VARGROUP_OUTPUT

VARGROUP_BYPASS

VARGROUP_ENVIRONMENT

 

purpose:

VARPURPOSE_NONE

VARPURPOSE_STATUS

VARPURPOSE_PERSONAL

VARPURPOSE_EQUIPMENT

VARPURPOSE_THRESHOLD

VARPURPOSE_BEHAVIOR

 

supports:

VARSUPPORTS_READONLY

VARSUPPORTS_UPDATE

VARSUPPORTS_CONTROLEXECUTION

 

state:

DEVICE_STATE_CRITICAL

DEVICE_STATE_INFORMATION

DEVICE_STATE_NORMAL

DEVICE_STATE_WARNING

 

 

GET All Variables

This API enables retrieval of all device variables and those of connected peripherals.

 

Title

GET All Variables

URL

/api/variables

Method

GET

URL Params

Additive filters supported by device_id, device_name, group, purpose, parents, keywords

GET all variable by device_Id

/api/variables?filter[device_id]=1

GET all variables by device_name

/api/variables?filter[device_name]=Device0001

GET all variables by purpose

/api/variables?filter[purpose]=VARPURPOSE_EQUIPMENT

GET all variables by group

/api/variables?filter[purpose]=VARGROUP_DEVICE

GET all variables by deviceId or deviceName and group

/api/variables?filter[device_id]=1& filter[purpose]=VARGROUP_DEVICE

/api/variables?filter[device_name]=Device0001& filter[purpose]=VARGROUP_DEVICE

GET all variables by deviceId or deviceName and purpose

/api/variables?filter[device_id]=1&filter[purpose]=VARGROUP_DEVICE

/api/variables?filter[device_name]=Device0001&filter[purpose]=VARGROUP_DEVICE

GET all variables by keywords

/api/variables?filter[device_id]=1?filter[keywords]=keyword1&filter[keywords]=keyword2&filter[keywords]=keyword3

GET all variables by parent id without descendants - for variable id 140

/api/variables?filter[device_id]=1?filter[parent_id]=140

GET all variables by parent with descendants - for variable id 140

/api/variables?filter[device_id]=1?filter[parent_id]=140&filter[all_descendants]=true

GET all variables that has control_key value

/api/variables?filter[has_control_key]=true

GET all variables that has nondisplay text

/api/variables?filter[include_nondisplay_text]=true

 

device_id : <integer>

device_name: <string>

purpose: enum<purpose> - purpose allowed values are given above

group: enum <purpose> - group allowed values are given about

Success Response

Code: 200 

Content:

{

    "meta": {

        "id": "<request id>",

        "constraints": {},

        "validation": [

            {

                "attribute": "key",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "device_id",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "device_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "device_type",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "DEVICE_TYPE_UNKNOWN",

                    "DEVICE_TYPE_UPS",

                    "DEVICE_TYPE_PDU",

                    "DEVICE_TYPE_ENVIROSENSE",

                    "DEVICE_TYPE_AC",

                    "DEVICE_TYPE_KVM",

                    "DEVICE_TYPE_ASSETTRACKER",

                    "DEVICE_TYPE_ATS",

                    "DEVICE_TYPE_SWITCH"

                ],

                "type": "enum"

            },

            {

                "attribute": "label",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "display_label",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "value",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "raw_value",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "min_value",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "float"

            },

            {

                "attribute": "max_value",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "float"

            },

            {

                "attribute": "suffix",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "group",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "VARGROUP_ALL",

                    "VARGROUP_NONE",

                    "VARGROUP_SYSTEM",

                    "VARGROUP_DEVICE",

                    "VARGROUP_CONTACT",

                    "VARGROUP_WATCHDOG",

                    "VARGROUP_LOAD",

                    "VARGROUP_BATTERY",

                    "VARGROUP_INPUT",

                    "VARGROUP_OUTPUT",

                    "VARGROUP_BYPASS",

                    "VARGROUP_ENVIRONMENT",

                    "VARGROUP_COOLING"

                ],

                "type": "enum"

            },

            {

                "attribute": "purpose",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "VARPURPOSE_NONE",

                    "VARPURPOSE_STATUS",

                    "VARPURPOSE_PERSONAL",

                    "VARPURPOSE_EQUIPMENT",

                    "VARPURPOSE_THRESHOLD",

                    "VARPURPOSE_BEHAVIOR"

                ],

                "type": "enum"

            },

            {

                "attribute": "data_type",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "VARTYPE_NONE",

                    "VARTYPE_INTEGER",

                    "VARTYPE_FLOAT",

                    "VARTYPE_STRING",

                    "VARTYPE_DATE",

                    "VARTYPE_ENUMSTRING",

                    "VARTYPE_BYTE",

                    "VARTYPE_ENUMINTEGER"

                ],

                "type": "enum"

            },

            {

                "attribute": "state",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "DEVICE_STATE_CRITICAL",

                    "DEVICE_STATE_INFORMATION",

                    "DEVICE_STATE_NORMAL",

                    "DEVICE_STATE_WARNING"

                ],

                "type": "enum"

            },

            {

                "attribute": "line_num",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "supports",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "VARSUPPORTS_READONLY",

                    "VARSUPPORTS_UPDATE",

                    "VARSUPPORTS_CONTROLEXECUTION"

                ],

                "type": "enum"

            },

            {

                "attribute": "editable",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "advanced_editable",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "control_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "control_key",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "expandable",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "parent_id",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "enum_values",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "object"

            },

            {

                "attribute": "keywords",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            }

        ],

        "path": "/api/variables/140"

    },

    "data":[ {

        "type": "variables",

        "id": "<String Id>",

        "attributes": {

            "key": <unit32>,

            "device_id": <unit32>,

            "device_name": <string>,

            "device_type": "<Enum Device Type",

            "label": "<strings>",

            "value": "<string>",

            "min_value": <float>,

            "max_value": <float>,

            "suffix": "<string>",

            "group": "<Enum Group>",

            "purpose": "<Enum Purpose>",

            "data_type": "<Enum Device Type>",

            "state": "<Enum state>",

            "display_label": "<string>",

            "raw_value": "<string>",

            "supports": "<Enum Support>",

            "control_name": "<string>",

            "control_key": "<unit32>",

            "expandable": "<boolean>",

            "parent_id": <"unit32>",

            "advanced_editable": <"boolean>,

            "line_num": "<float>",

            "editable": <Boolean>,

            "enum_values": <Enum Array []>,

            "keywords": "< Array of strings>",

            "cli_keywords": [],
            "display_text": true,
            "display_graph": false,
            "display_gauge": false,
            "widget_styles": <array of Strings>
            "graph_set": "<String>",
            "precision": <int>,
            "child_variables": [{id : <string>, name :<string>],
            "numeric": <Boolean>,
            "password": <Boolean>

        }

    }]

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET One Variable

 

Title

GET One Variable

URL

/api/variables/:variableId

OR

/api/variables/:variableName

OR

/api/variables/:variableKey

 

Note: NO HTTP header required to get variables by ID

Method

GET

URL Params

/api/variables/:variableId (Id) – Default

OR

/api/variables/:variableName

OR

/api/variables/:variableKey

 

Note: NO HTTP header required to get variables by ID

For variableName the following HTTP Header is Required:

By: 'name'

deviceId : 'device_id'

Where device_id is id for device

Example if Id of device is 1 then deviceId :'1'

 

For variableKey the following HTTP Header is Required:

By: 'key'

deviceId : 'device_id'

Where device_id is id for device

Example if Id of device is 1 then deviceId :'1'

 

Required:

variableId=[integer] 
example: id=12

variableName=[string] deviceId=[integer]

example: variableName=variablename2

Success Response

Code: 200 

Content:

{

    "meta": {

        "id": "<request id>",

        "constraints": {},

        "validation": [

            {

                "attribute": "key",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "device_id",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "device_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "device_type",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "DEVICE_TYPE_UNKNOWN",

                    "DEVICE_TYPE_UPS",

                    "DEVICE_TYPE_PDU",

                    "DEVICE_TYPE_ENVIROSENSE",

                    "DEVICE_TYPE_AC",

                    "DEVICE_TYPE_KVM",

                    "DEVICE_TYPE_ASSETTRACKER",

                    "DEVICE_TYPE_ATS",

                    "DEVICE_TYPE_SWITCH"

                ],

                "type": "enum"

            },

            {

                "attribute": "label",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "display_label",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "value",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "raw_value",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "min_value",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "float"

            },

            {

                "attribute": "max_value",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "float"

            },

            {

                "attribute": "suffix",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "group",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "VARGROUP_ALL",

                    "VARGROUP_NONE",

                    "VARGROUP_SYSTEM",

                    "VARGROUP_DEVICE",

                    "VARGROUP_CONTACT",

                    "VARGROUP_WATCHDOG",

                    "VARGROUP_LOAD",

                    "VARGROUP_BATTERY",

                    "VARGROUP_INPUT",

                    "VARGROUP_OUTPUT",

                    "VARGROUP_BYPASS",

                    "VARGROUP_ENVIRONMENT",

                    "VARGROUP_COOLING"

                ],

                "type": "enum"

            },

            {

                "attribute": "purpose",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "VARPURPOSE_NONE",

                    "VARPURPOSE_STATUS",

                    "VARPURPOSE_PERSONAL",

                    "VARPURPOSE_EQUIPMENT",

                    "VARPURPOSE_THRESHOLD",

                    "VARPURPOSE_BEHAVIOR"

                ],

                "type": "enum"

            },

            {

                "attribute": "data_type",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "VARTYPE_NONE",

                    "VARTYPE_INTEGER",

                    "VARTYPE_FLOAT",

                    "VARTYPE_STRING",

                    "VARTYPE_DATE",

                    "VARTYPE_ENUMSTRING",

                    "VARTYPE_BYTE",

                    "VARTYPE_ENUMINTEGER"

                ],

                "type": "enum"

            },

            {

                "attribute": "state",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "DEVICE_STATE_CRITICAL",

                    "DEVICE_STATE_INFORMATION",

                    "DEVICE_STATE_NORMAL",

                    "DEVICE_STATE_WARNING"

                ],

                "type": "enum"

            },

            {

                "attribute": "line_num",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "supports",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "VARSUPPORTS_READONLY",

                    "VARSUPPORTS_UPDATE",

                    "VARSUPPORTS_CONTROLEXECUTION"

                ],

                "type": "enum"

            },

            {

                "attribute": "editable",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "advanced_editable",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "control_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "control_key",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "expandable",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "parent_id",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "enum_values",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "object"

            },

            {

                "attribute": "keywords",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            }

        ],

        "path": "/api/variables/140"

    },

    "data":[ {

        "type": "variables",

        "id": "<String Id>",

        "attributes": {

            "key": <unit32>,

            "device_id": <unit32>,

            "device_name": <string>,

            "device_type": "<Enum Device Type",

            "label": "<strings>",

            "value": "<string>",

            "min_value": <float>,

            "max_value": <float>,

            "suffix": "<string>",

            "group": "<Enum Group>",

            "purpose": "<Enum Purpose>",

            "data_type": "<Enum Device Type>",

            "state": "<Enum state>",

            "display_label": "<string>",

            "raw_value": "<string>",

            "supports": "<Enum Support>",

            "control_name": "<string>",

            "control_key": "<unit32>",

            "expandable": "<boolean>",

            "parent_id": <"unit32>",

            "advanced_editable": <"boolean>,

            "line_num": "<float>",

            "editable": <Boolean>,

            "enum_values": <Enum Array []>,

            "keywords": "< Array of strings>",

            "cli_keywords": [<Array of Strings>],
            "display_text": true,
            "display_graph": false,
            "display_gauge": false,
             "widget_styles": <array of Strings>
             "graph_set": "<String>",
             "precision": <int>,
             "child_variables": [{id : <string>, name :<string>],

             "numeric": <Boolean>,
             "password": <Boolean>

        }

    }]

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update Variable

 

Title

Update Variable

URL

/api/variables/:variableId

Method

PATCH

URL Params

Required:

 

variableId=[integer] 
example: id=12

Data Params

{  
   "data":{  
      "type":"variables",
      "attributes":{  
         "new_value":<string>
         "tolerance": <float>        
      }
   }
}

Success Response

Code: 200 

Content:

{

    "meta": {

        "id": "<String request ID>",

        "path": "/api/variables/<identifier>"

    },

    "data": {

        "type": "variables",

        "id": "<String variable identifier>",

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

For enum fields, appropriate enum value needs to be provided

·       User can update new_value or tolerance or both in single request

 

Update Variable

 

Title

Update Variable

URL

/api/variables/:variableName

Method

PATCH

URL Params

Required HTTP Header:

"By" : 'name'

Required:

variableName=[string] 
example: Temperature Sensor

Data Params

{  
   "data":{  
      "type":"variables",
      "attributes":{  
         "new_value":<string>,

         "tolerance": <float>,

         "device_name":<string>

      }
   }
}

Success Response

Code: 200 

Content:

{

    "meta": {

        "id": "<String request ID>",

        "path": "/api/variables/<identifier>"

    },

    "data": {

        "type": "variables",

        "id": "<String variable identifier>",

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

For enum fields, appropriate enum value needs to be provided

Make sure to provide device_name or device_id in the PATCH payload to update variable

·       User can update new_value or tolerance or both in single request

 

 

Events

The Events API displays the status and configuration all events applicable to the device and connected peripherals. It also enables configuration of Auto-Acknowledgement and Logging for all events. It uses the following enums:

 

event_source_type:

EVENT_SOURCE_TYPE_DEVICE

EVENT_SOURCE_TYPE_AUTOPROBE

EVENT_SOURCE_TYPE_SYSTEM

 

 

event_type:

EVENT_TYPE_STATEFUL

EVENT_TYPE_STATELESS_SETTING

EVENT_TYPE_STATELESS_CLEARING

EVENT_TYPE_STATELESS

           

severity:

EVENT_SEVERITY_EMERGENCY     

EVENT_SEVERITY_ALERT

EVENT_SEVERITY_CRITICAL

EVENT_SEVERITY_ERROR

EVENT_SEVERITY_WARNING

EVENT_SEVERITY_NOTICE

EVENT_SEVERITY_INFORMATIONAL

EVENT_SEVERITY_DEBUG

           

event_source_type:

EVENT_SOURCE_TYPE_DEVICE

EVENT_SOURCE_TYPE_AUTOPROBE

EVENT_SOURCE_TYPE_SYSTEM

 

 

GET All Events

 

Title

GET All Events

URL

/api/events

Method

GET

Filters

additive filters supported for attributes -source_idseverity,device_name, event_source_typecategoryenabled

 

GET all Events by source_id

/api/events?filter[source_id]=1

GET all Events by source_name

/api/events?filter[source_name]=1Device0001

GET all Events by Severity

/api/events?filter[severity]=EVENT_SEVERITY_INFORMATIONAL

GET all events by source_type

/api/events?filter[event_source_type]=EVENT_SOURCE_TYPE_DEVICE

GET all events by category

/api/events?filter[category]=EVENT_CATEGORY_VALUE

GET all events by enabled=true

/api/event?filter[enabled]=true

GET all events by set_label

/api/event?filter[set_label]=Loads Not All On

GET all events by clear_label

/api/event?filter[clear_label]=All Loads On

 

Additive filters example:

/api/events?filter[source_id]=1&filter[severity]=EVENT_SEVERITY_INFORMATIONAL

&filter[event_source

 

URL Params

source_id: <integer>

source_name: <string>

severity: <enum event severity>

event_type: <enum event type>

event_source_type: <enum event source type>

category: <enum event category>

enabled: <boolean>

set_label: <String>

clear_label: <String>

Success Response

Code: 200

Content:

{

    "meta": {

        "id":"<request id>",

        "constraints": {},

        "validation": [

            {

                "attribute": "event_key",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "set_label",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "clear_label",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "source_id",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "source_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "event_source_type",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_SOURCE_TYPE_DEVICE",

                    "EVENT_SOURCE_TYPE_AUTOPROBE",

                    "EVENT_SOURCE_TYPE_SYSTEM"

                ],

                "type": "enum"

            },

            {

                "attribute": "event_category",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_CATEGORY_PROBE",

                    "EVENT_CATEGORY_SETTINGS",

                    "EVENT_CATEGORY_CONTROL",

                    "EVENT_CATEGORY_EVENT",

                    "EVENT_CATEGORY_LOAD",

                    "EVENT_CATEGORY_LOAD_GROUP",

                    "EVENT_CATEGORY_MAIN_LOAD",

                    "EVENT_CATEGORY_MISCELLANEOUS",

                    "EVENT_CATEGORY_THRESHOLD",

                    "EVENT_CATEGORY_VALUE",

                    "EVENT_CATEGORY_DIAGNOSTICS",

                    "EVENT_CATEGORY_ENERGY_WISE",

                    "EVENT_CATEGORY_MAINTENANCE",

                    "EVENT_CATEGORY_USER_MANAGEMENT"

                ],

                "type": "enum"

            },

            {

                "attribute": "event_type",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_TYPE_STATEFUL",

                    "EVENT_TYPE_STATELESS_SETTING",

                    "EVENT_TYPE_STATELESS_CLEARING",

                    "EVENT_TYPE_STATELESS"

                ],

                "type": "enum"

            },

            {

                "attribute": "oid_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "enabled",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "auto_acknowledge",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "logging",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "syslog_msg_id",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "severity",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_SEVERITY_EMERGENCY",

                    "EVENT_SEVERITY_ALERT",

                    "EVENT_SEVERITY_CRITICAL",

                    "EVENT_SEVERITY_ERROR",

                    "EVENT_SEVERITY_WARNING",

                    "EVENT_SEVERITY_NOTICE",

                    "EVENT_SEVERITY_INFORMATIONAL",

                    "EVENT_SEVERITY_DEBUG"

                ],

                "type": "enum"

            },

            {

                "attribute": "hysteresis",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "float"

            },

            {

                "attribute": "localize_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "can_edit_rule",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "can_delete",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            }

        ],

        "path": "/api/events"

    },

    "data": [

        {

            "type": "events",

            "id": "1",

            "attributes": {

                "event_key":<unit32>,

                "set_label": "<String>",

                "clear_label": "<String>",

                "source_id": <unit32>,

                "source_name": <String>,

                "event_source_type": <enum Event Source Type>,

                "event_category": <enum Event Category>,

                "event_type": <enum Event Type>,

                "oid_name": <String>,

                "enabled": <boolean>,

                "auto_acknowledge": <boolean>,

                "logging": <boolean>,

                "syslog_msg_id": <int>,

                "severity": "<Enum Severity>",

                "hysteresis": <flot>,

                "localize_name": boolean,

                "can_edit_rule": boolean,

                "can_delete": boolean,

        "action_flags": [
        {
          "action_uid": "1",
          "action_name": "Default Email Notification",
          "action_type": "ACTIONTYPE_EMAIL",
          "key": 1281,
          "delay": 30,
          "interval": 0,
          "count": 1,
          "enabled": true,
          "fire_on_set": true,
          "fire_on_clear": true
        }

      ]

            }

        }

    ]

}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" 
http://localhost:3001/api/events

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET One Event

 

Title

GET One Event

URL

/api/events/:eventId

OR

/api/events/:eventName

OR

/api/events/:eventKey

Method

GET

URL Params

/api/events/:eventId

OR

/api/events/:eventName

OR

/api/events/:eventKey

Note: No HTTP header required to get by id

 

If URL uses :eventName, then

 

Required HTTP Header:

By: 'name'

sourceType: <Source Type Enum>  - Example sourceType: EVENT_SOURCE_TYPE_DEVICE

sourceName: 'source Name'    - If the source is a device device name should be provided - Example sourceName:Device0391

 

if URL uses :eventKey, then

Required HTTP Header:

By: 'key'

sourceType: <Source Type Enum>  - Example sourceType: EVENT_SOURCE_TYPE_DEVICE

sourceName: 'source Name'    - If the source is a device device name should be provided - Example sourceName:Device0391

Success Response

Code: 200

Content:

{

    "meta": {

        "id":"<request id>",

        "constraints": {},

        "validation": [

            {

                "attribute": "event_key",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "set_label",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "clear_label",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "source_id",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "source_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "event_source_type",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_SOURCE_TYPE_DEVICE",

                    "EVENT_SOURCE_TYPE_AUTOPROBE",

                    "EVENT_SOURCE_TYPE_SYSTEM"

                ],

                "type": "enum"

            },

            {

                "attribute": "event_category",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_CATEGORY_PROBE",

                    "EVENT_CATEGORY_SETTINGS",

                    "EVENT_CATEGORY_CONTROL",

                    "EVENT_CATEGORY_EVENT",

                    "EVENT_CATEGORY_LOAD",

                    "EVENT_CATEGORY_LOAD_GROUP",

                    "EVENT_CATEGORY_MAIN_LOAD",

                    "EVENT_CATEGORY_MISCELLANEOUS",

                    "EVENT_CATEGORY_THRESHOLD",

                    "EVENT_CATEGORY_VALUE",

                    "EVENT_CATEGORY_DIAGNOSTICS",

                    "EVENT_CATEGORY_ENERGY_WISE",

                    "EVENT_CATEGORY_MAINTENANCE",

                    "EVENT_CATEGORY_USER_MANAGEMENT"

                ],

                "type": "enum"

            },

            {

                "attribute": "event_type",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_TYPE_STATEFUL",

                    "EVENT_TYPE_STATELESS_SETTING",

                    "EVENT_TYPE_STATELESS_CLEARING",

                    "EVENT_TYPE_STATELESS"

                ],

                "type": "enum"

            },

            {

                "attribute": "oid_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "enabled",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "auto_acknowledge",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "logging",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "syslog_msg_id",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "severity",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_SEVERITY_EMERGENCY",

                    "EVENT_SEVERITY_ALERT",

                    "EVENT_SEVERITY_CRITICAL",

                    "EVENT_SEVERITY_ERROR",

                    "EVENT_SEVERITY_WARNING",

                    "EVENT_SEVERITY_NOTICE",

                    "EVENT_SEVERITY_INFORMATIONAL",

                    "EVENT_SEVERITY_DEBUG"

                ],

                "type": "enum"

            },

            {

                "attribute": "hysteresis",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "float"

            },

            {

                "attribute": "localize_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "can_edit_rule",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "can_delete",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            }

        ],

        "path": "/api/events"

    },

    "data": {

            "type": "events",

            "id": "1",

            "attributes": {

                "event_key":<unit32>,

                "set_label": "<String>",

                "clear_label": "<String>",

                "source_id": <unit32>,

                "source_name": <String>,

                "event_source_type": <enum Event Source Type>,

                "event_category": <enum Event Category>,

                "event_type": <enum Event Type>,

                "oid_name": <String>,

                "enabled": <boolean>,

                "auto_acknowledge": <boolean>,

                "logging": <boolean>,

                "syslog_msg_id": <int>,

                "severity": "<Enum Severity>",

                "hysteresis": <flot>,

                "localize_name": boolean,

                "can_edit_rule": boolean,

                "can_delete": boolean,

        "action_flags": [
        {
          "action_uid": "1",
          "action_name": "Default Email Notification",
          "action_type": "ACTIONTYPE_EMAIL",
          "key": 1281,
          "delay": 30,
          "interval": 0,
          "count": 1,
          "enabled": true,
          "fire_on_set": true,
          "fire_on_clear": true
        }

    ]

         }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update Event

 

Title

Update Event

URL

/api/events/:eventId

OR

/api/events/:eventName

OR

/api/events/:eventKey

Method

PATCH

URL Params

/api/events/:eventId

OR

/api/events/:eventName

OR

/api/events/:eventKey

 

Note: No HTTP header required to get by id

If URL uses :eventName, then

Required HTTP Header:

By: 'name'

Required HTTP Header:

if URL uses :eventKey, then

Required:

By: 'key'

Data Params

{"data": {

        "type": "events",

        "attributes": {

                "source_id": <integer> /*(either source_id or source_name required for key or name request)*/

                "source_name": <String>, /*(either source_id or source_name required for key or name request)*/

                "source_type": <Enum: SourceType>, /*(This is required if the request is by key or name)*/

                "enabled": <boolean>,

                "auto_acknowledge": <boolean>,

                "logging": <boolean>,

                "severity": <enum Event Severity>,

                "hysteresis": <flot>

                "syslog_msg_id": <int>,

   "action_selection": [
     {
         "id": <int>,
         "fire_on_set": <boolean>,
         "fire_on_clear": <boolean>
     }
   ],

   "add_action_selection": [
   {
       "id": <int>,
       "fire_on_set": <boolean>,
       "fire_on_clear": <boolean>
   }
  ],

       "remove_action_identity": [

       {

            "id":<string>,

            "name": <string>

        }

    ]

        }

    }

}

NOTE: If the request is by name or key, source_id or source_name and source_type must be provided in the request body.

Success Response

Code: 200

Content:

{

    "meta": {

        "id": "<request id>",

        "path": "/api/events/<id>"

    },

    "data": {

        "type": "events",

        "id": "16",

        "attributes": {

            "response": 0

        }

    }

}

Sample Call

http://127.0.0.1:3001/api/events/16

Request Body:

{"data": {

        "type": "events",

        "attributes": {

                "enabled": false,

                "auto_acknowledge": true,

                "logging": true,

                "severity": "EVENT_SEVERITY_NOTICE",

                "hysteresis": 6.6,

                "syslog_msg_id": 25,

"action_selection": [
{
"id": 6,
"fire_on_set": true,
"fire_on_clear": true
}
]

        }

    }

}

 

Sucess Response:

{

    "meta": {

        "id": "bdc88179-2cb8-40b6-b47e-d234fa60c5c5",

        "path": "/api/events/16"

    },

    "data": {

        "type": "events",

        "id": "16",

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete Event

 

Title

Delete Event

URL

/api/events/:eventId

OR

/api/events/:eventName

OR

/api/events/:eventKey

Method

DELETE

URL Params

/api/events/:eventId

OR

/api/events/:eventName

OR

/api/events/:eventKey

 

Note: No HTTP header required to get by id

 

If URL uses :eventName, then

Required HTTP Header:

By: 'name'

sourceType: <Source Type Enum>  - Example sourceType: EVENT_SOURCE_TYPE_DEVICE

sourceName: 'source Name'    - If the source is a device device name should be provided - Example sourceName:Device0391

 

Required HTTP Header:

if URL uses :eventKey, then

Required:

By: 'key'

sourceType: <Source Type Enum>  - Example sourceType: EVENT_SOURCE_TYPE_DEVICE

sourceName: 'source Name'    - If the source is a device device name should be provided - Example sourceName:Device0391

Success Response

Code: 200

Content:

{

    "meta": {

        "id": "<request id>",

        "path": "/api/events/<id>"

    },

    "data": {

        "type": "events",

        "id": "16",

        "attributes": {

            "response": 0

        }

    }

}

Sample Call

http://127.0.0.1:3001/api/events/16

Request Body:

Sucess Response:

{

    "meta": {

        "id": "bdc88179-2cb8-40b6-b47e-d234fa60c5c5",

        "path": "/api/events/16"

    },

    "data": {

        "type": "events",

        "id": "16",

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Help

The Help API is used for retrieving Help information.

 

GET Help Information

 

Title

GET Help Information

URL

/api/help

Method

GET

Success Response

Code: 200
Content:

{
    "meta": {
        "id": "04df2d25-bae5-43aa-ac87-797b2f18ee4c"
    },
    "data": {
        "phone": "+1 (773) 869-1234",
        "web_contact": "
http://www.tripplite.com/software/contact",
        "web_support": "
http://www.tripplite.com/software/support"
    }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Loads

The Loads API retrives a summary of the device’s loads, including status and outlet level metrics, if applicable. It can also be used to change the state of individual loads or the main loads. It uses the following enums:

 

state:

LOAD_STATE_UNKNOWN

LOAD_STATE_OFF

LOAD_STATE_MIXED

 

receptacle_type_supported:

LOAD_RECEPTACLE_UNKNOWN

LOAD_RECEPTACLE_HUBBELL_CS8365C

LOAD_RECEPTACLE_IEC_309_16A

LOAD_RECEPTACLE_IEC_309_3032A

LOAD_RECEPTACLE_IEC_309_6063A

LOAD_RECEPTACLE_IEC_309_30A

LOAD_RECEPTACLE_IEC_309_60A

LOAD_RECEPTACLE_IEC_320_C14

LOAD_RECEPTACLE_IEC_320_C20

LOAD_RECEPTACLE_LOCK_L1520P

LOAD_RECEPTACLE_LOCK_L1530P

LOAD_RECEPTACLE_LOCK_L2120P

LOAD_RECEPTACLE_LOCK_L2130P

LOAD_RECEPTACLE_LOCK_L2230P

LOAD_RECEPTACLE_NEMA_515P

LOAD_RECEPTACLE_NEMA_520P

LOAD_RECEPTACLE_NEMA_530P

LOAD_RECEPTACLE_NEMA_L515P

LOAD_RECEPTACLE_NEMA_L520P

LOAD_RECEPTACLE_NEMA_L530P  

LOAD_RECEPTACLE_NEMA_L620P

LOAD_RECEPTACLE_NEMA_L630P

LOAD_RECEPTACLE_NEMA_L1430P

LOAD_RECEPTACLE_NEMA_L1530P

LOAD_RECEPTACLE_NEMA_L2120P

LOAD_RECEPTACLE_OUTLET_NONE

LOAD_RECEPTACLE_OUTLET_NEMA_515R

LOAD_RECEPTACLE_OUTLET_NEMA_520R

LOAD_RECEPTACLE_OUTLET_NEMA_530R

LOAD_RECEPTACLE_OUTLET_IEC_320_C13

LOAD_RECEPTACLE_OUTLET_IEC_320_C19

LOAD_RECEPTACLE_OUTLET_NEMA_L515R

LOAD_RECEPTACLE_OUTLET_NEMA_L520R

LOAD_RECEPTACLE_OUTLET_NEMA_L530R

LOAD_RECEPTACLE_OUTLET_NEMA_L615R

LOAD_RECEPTACLE_OUTLET_NEMA_L620R

LOAD_RECEPTACLE_OUTLET_NEMA_L630R

 

load_action:

LOAD_ACTION_IDLE

LOAD_ACTION_OFF

LOAD_ACTION_ON

LOAD_ACTION_CYCLE

 

ramp_action:

LOAD_RAMP_REMAINOFF

LOAD_RAMP_OFFAFTERDELAY

 

shed_action:

LOAD_SHED_REMAINOFF

LOAD_SHED_OFFAFTERDELAY

 

 

Indvidual and Main Loads

This API allows reading and updating data of individual loads as well as the main load. This applies only to devices that support these functions.

 

GET All Loads

 

Title

GET All Loads

URL

/api/loads

Method

GET

URL Params

Filters:

Using device_id:

·       /api/loads?filter=[{"name": "device_id", "op": "in_", "val": [1,2,3]} ]

Using group

·       /api/loads?filter=[{"name": "group", "op": "in_", "val": ["group1","group2"]} ]

Using controllable

·       /api/loads?filter=[{"name": "controllable", "op": "in_", "val": [true]} ]

Using receptacle_type

·       /api/loads?filter=[{"name": "receptacle_type", "op": "in_", "val": ["LOAD_RECEPTACLE_UNKNOWN"]} ]

using state:

/api/loads?filter=[{"name": "state", "op": "in_", "val": ["LOAD_STATE_ON"]}]


using state and deviceId:

·       /api/loads?filter=[{"name": "state", "op": "in_", "val": ["LOAD_STATE_OFF"]}, {"name": "device_id", "op": "in_", "val": [1,2,3]}]

Success Response

Code: 200

Content:

{

       "meta": {

             "id": "<request id>",

             "constraints": {

                    "max_items": 0,

                    "min_items": 0,

                    "editable_attributes": [

                          "name",

                          "group_id",

                          "group_name",

                          "description"

                    ],

                    "required_attributes": [

                          "name"

                    ],

                    "delete_allowed": false

             },

             "validation": [{

                          "attribute": "load_number",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "name",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 1,

                          "max_length": 32,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "string"

                    },

                    {

                          "attribute": "device_id",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "device_name",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "string"

                    },

                    {

                          "attribute": "bank",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "circuit",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "group_id",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "group_name",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "string"

                    },

                    {

                          "attribute": "state",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

                                 "LOAD_STATE_UNKNOWN",

                                 "LOAD_STATE_OFF",

                                 "LOAD_STATE_ON",

                                 "LOAD_STATE_MIXED"

                          ],

                          "type": "enum"

                    },

                    {

                          "attribute": "description",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 255,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "string"

                    },

                    {

                          "attribute": "phase",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "controllable",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "boolean"

                    },

                    {

                          "attribute": "receptacle_type_supported",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "boolean"

                    },

                    {

                          "attribute": "receptacle_type",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

                                 "LOAD_RECEPTACLE_UNKNOWN",

                                 "LOAD_RECEPTACLE_INPUT_HUBBELL_CS8365C",

                                 "LOAD_RECEPTACLE_INPUT_IEC_309_16A",

                                 "LOAD_RECEPTACLE_INPUT_IEC_309_3032A",

                                 "LOAD_RECEPTACLE_INPUT_IEC_309_6063A",

                                 "LOAD_RECEPTACLE_INPUT_IEC_309_30A",

                                 "LOAD_RECEPTACLE_INPUT_IEC_309_60A",

                                  "LOAD_RECEPTACLE_INPUT_IEC_320_C14",

                                 "LOAD_RECEPTACLE_INPUT_IEC_320_C20",

                                 "LOAD_RECEPTACLE_INPUT_LOCK_L1520P",

                                 "LOAD_RECEPTACLE_INPUT_LOCK_L1530P",

                                 "LOAD_RECEPTACLE_INPUT_LOCK_L2120P",

                                 "LOAD_RECEPTACLE_INPUT_LOCK_L2130P",

                                 "LOAD_RECEPTACLE_INPUT_LOCK_L2230P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_515P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_520P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_530P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L515P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L520P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L530P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L620P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L630P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L1430P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L1530P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L2120P",

                                 "LOAD_RECEPTACLE_OUTLET_NONE",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_515R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_520R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_530R",

                                 "LOAD_RECEPTACLE_OUTLET_IEC_320_C13",

                                 "LOAD_RECEPTACLE_OUTLET_IEC_320_C19",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L515R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L520R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L530R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L615R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L620R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L630R"

                          ],

                          "type": "enum"

                    },

                    {

                           "attribute": "voltage_supported",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "boolean"

                    },

                    {

                          "attribute": "voltage",

                           "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "float"

                    },

                    {

                          "attribute": "current_supported",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "boolean"

                    },

                    {

                          "attribute": "current",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "float"

                    },

                    {

                          "attribute": "current_precision",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "power_supported",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "boolean"

                    },

                    {

                          "attribute": "power",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    }

             ]

       },

       "data": [{

             "type": "loads",

             "id": "<string>",

             "attributes": {

                    "load_number": "<Integer>",

                    "name": "<Sring>",

                    "device_id": "<Interger>",

                    "device_name": "<String>",

                    "circuit": "<Interger>",

                    "group_id": "<Interger>",

                    "group_name": "<String>",

                    "state": "<Enum LoadState Example: LOAD_STATE_ON>",

                    "description": "<String>",

                    "phase": "<Integer>",

                    "controllable": "<Boolean>",

                    "receptacle_type_supported": "<Boolean>",

                    "receptacle_type": "<ENUM LoadReceptacle>",

                    "voltage_supported": "<Boolean>",

                    "voltage": "<String>",

                    "ramp_action": "<Enum LoadRampAction>",

                    "ramp_delay": "<Integer>",

                    "shed_action": "<Enum LoadShedAction>",

                    "shed_delay": "<Integer>",

                    "current_supported": "<Boolean>",

                    "current": "<String>",

                    "power_supported": "<Boolean>",

                    "power": "<String>",

                    "device_type": "DEVICE_TYPE_UPS",

                    "apparent_power_supported": "<Boolean>",

                    "apparent_power": "<String>",

                    "reactive_power_supported": "<Boolean>",

                    "reactive_power": "<String>",

                    "power_factor_supported": "<Boolean>",

                    "power_factor": "<String>",

                    "frequency_supported": "<Boolean>",

                    "frequency": "<String>",

                    "utilization_supported": "<Boolean>",

                    "utilization": "<String>",

                    "output_24hr_energy_supported": "<Boolean>",

                    "output_24hr_energy": "<String>",

                    "peak_power_supported": "<Boolean>",

                    "peak_power": "<String>",

                    "overcurrent_alarm_supported": "<Boolean>",

                    "overcurrent_alarm": "<String>",

                    "crest_factor_supported": "<Boolean>",

                    "crest_factor": "<String>",

                    "current_limit_supported": "<Boolean>",

                    "current_limit": "<String>",

                    "power_limit_supported": "<Boolean>",

                    "power_limit": "<String>"

 

             }

       }]

}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/loads

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET One Load

 

Title

GET One Load

URL

/api/loads

Method

GET

URL Params

/api/loads/:loadId – Default (No HTTP header required)

OR

/api/loads/:loadName

OR

/api/loads/:loadNumber

 

If URL uses :loadName, then the following

HTTP Header Required:

   By: 'name' 

   deviceId : 'device_id'

 

If URL uses :loadNumber, then the following

HTTP Header Required:

   By: 'number' 

   deviceId : 'device_id'

 

Where device_id is id for device

Example if Id of device is 1 then deviceId :'1'

NOTE in both cases, devieId is required

Success Response

Code: 200

Content:

{

       "meta": {

             "id": "<request id>",

             "constraints": {

                    "max_items": 0,

                    "min_items": 0,

                    "editable_attributes": [

                          "name",

                          "group_id",

                          "group_name",

                          "description"

                    ],

                    "required_attributes": [

                          "name"

                    ],

                    "delete_allowed": false

             },

             "validation": [{

                          "attribute": "load_number",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "name",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 1,

                          "max_length": 32,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "string"

                    },

                    {

                          "attribute": "device_id",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "device_name",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "string"

                    },

                    {

                          "attribute": "bank",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "circuit",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "group_id",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "group_name",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "string"

                    },

                    {

                          "attribute": "state",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

                                 "LOAD_STATE_UNKNOWN",

                                 "LOAD_STATE_OFF",

                                 "LOAD_STATE_ON",

                                 "LOAD_STATE_MIXED"

                          ],

                          "type": "enum"

                    },

                    {

                          "attribute": "description",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 255,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "string"

                    },

                    {

                          "attribute": "phase",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "controllable",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "boolean"

                    },

                    {

                          "attribute": "receptacle_type_supported",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "boolean"

                    },

                    {

                          "attribute": "receptacle_type",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

                                 "LOAD_RECEPTACLE_UNKNOWN",

                                 "LOAD_RECEPTACLE_INPUT_HUBBELL_CS8365C",

                                 "LOAD_RECEPTACLE_INPUT_IEC_309_16A",

                                 "LOAD_RECEPTACLE_INPUT_IEC_309_3032A",

                                 "LOAD_RECEPTACLE_INPUT_IEC_309_6063A",

                                 "LOAD_RECEPTACLE_INPUT_IEC_309_30A",

                                 "LOAD_RECEPTACLE_INPUT_IEC_309_60A",

                                 "LOAD_RECEPTACLE_INPUT_IEC_320_C14",

                                 "LOAD_RECEPTACLE_INPUT_IEC_320_C20",

                                 "LOAD_RECEPTACLE_INPUT_LOCK_L1520P",

                                 "LOAD_RECEPTACLE_INPUT_LOCK_L1530P",

                                 "LOAD_RECEPTACLE_INPUT_LOCK_L2120P",

                                 "LOAD_RECEPTACLE_INPUT_LOCK_L2130P",

                                 "LOAD_RECEPTACLE_INPUT_LOCK_L2230P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_515P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_520P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_530P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L515P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L520P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L530P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L620P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L630P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L1430P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L1530P",

                                 "LOAD_RECEPTACLE_INPUT_NEMA_L2120P",

                                 "LOAD_RECEPTACLE_OUTLET_NONE",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_515R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_520R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_530R",

                                 "LOAD_RECEPTACLE_OUTLET_IEC_320_C13",

                                 "LOAD_RECEPTACLE_OUTLET_IEC_320_C19",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L515R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L520R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L530R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L615R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L620R",

                                 "LOAD_RECEPTACLE_OUTLET_NEMA_L630R"

                          ],

                          "type": "enum"

                    },

                    {

                          "attribute": "voltage_supported",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "boolean"

                    },

                    {

                          "attribute": "voltage",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "float"

                    },

                    {

                          "attribute": "current_supported",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "boolean"

                    },

                    {

                          "attribute": "current",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "float"

                    },

                    {

                          "attribute": "current_precision",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    },

                    {

                          "attribute": "power_supported",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "boolean"

                    },

                    {

                          "attribute": "power",

                          "maximum": 0,

                          "minimum": 0,

                          "default": 0,

                          "multiple_of": 0,

                          "min_length": 0,

                          "max_length": 0,

                          "pattern": "",

                          "enum": [

 

                          ],

                          "type": "integer"

                    }

             ]

       },

       "data": {

             "type": "loads",

             "id": "<string>",

             "attributes": {

                    "load_number": "<Integer>",

                    "name": "<Sring>",

                    "device_id": "<Interger>",

                    "device_name": "<String>",

                    "circuit": "<Interger>",

                    "group_id": "<Interger>",

                    "group_name": "<String>",

                    "state": "LOAD_STATE_ON",

                    "description": "<Enum LoadState>",

                    "phase": "<Integer>",

                    "controllable": "<Boolean>",

                    "receptacle_type_supported": "<Boolean>",

                    "receptacle_type": "<ENM LoadReceptacle>",

                    "voltage_supported": "<Boolean>",

                    "voltage": "<String>",

                    "ramp_action": "<Enum LoadRampAction>",

                    "ramp_delay": "<Integer>",

                    "shed_action": "<Enum LoadShedAction>",

                    "shed_delay": "<Integer>",

                    "current_supported": "<Boolean>",

                    "current": "<String>",

                    "power_supported": "<Boolean>",

                    "power": "<String>",

                    "device_type": "DEVICE_TYPE_UPS",

                    "apparent_power_supported": "<Boolean>",

                    "apparent_power": "<String>",

                    "reactive_power_supported": "<Boolean>",

                    "reactive_power": "<String>",

                    "power_factor_supported": "<Boolean>",

                    "power_factor": "<String>",

                    "frequency_supported": "<Boolean>",

                    "frequency": "<String>",

                    "utilization_supported": "<Boolean>",

                    "utilization": "<String>",

                    "output_24hr_energy_supported": "<Boolean>",

                    "output_24hr_energy": "<String>",

                    "peak_power_supported": "<Boolean>",

                    "peak_power": "<String>",

                    "overcurrent_alarm_supported": "<Boolean>",

                    "overcurrent_alarm": "<String>",

                    "crest_factor_supported": "<Boolean>",

                    "crest_factor": "<String>",

                    "current_limit_supported": "<Boolean>",

                    "current_limit": "<String>",

                    "power_limit_supported": "<Boolean>",

                    "power_limit": "<String>"

 

             }

       }

}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/loads/1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update Load

 

Title

Update Load

URL

/api/loads_execute/:loadId

OR

/api/loads_execute/:loadName

OR

/api/loads_execute/:loadNumber

Note: No HTTP Header is required for loadId

Method

PATCH

URL Params

/api/loads/:loadId – Default (No HTTP header required)

OR

/api/loads/:loadName

OR

/api/loads/:loadNumber

 

If URL uses :loadName, then the following

HTTP Header Required:

   By: 'name' 

If URL uses :loadNumber, then the following

HTTP Header Required:

   By: 'number' 

Success Response

Code: 200

Content:

{

   "data": {

            "type": "loads",

            "attributes": {

                "name": <string>,

                "description": <string>,

                "device_id": <unit32>,              

                "group_id": <unit32>

          }

    }

}                  

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/loads/1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET Main Load

 

This API endpoint provides the main load information of a device.

 

Title

GET Main Load

URL

/api/loads/main

Method

GET

Success Response

Code : 200

Content: {

    "meta": {

        "id": "9dc939c5-73b7-434b-9f58-2ac16edf1cf7",

        "constraints": {},

        "validation": [

            {

                "attribute": "device_id",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "state",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "LOAD_STATE_UNKNOWN",

                    "LOAD_STATE_OFF",

                    "LOAD_STATE_ON",

                    "LOAD_STATE_MIXED"

                ],

                "type": "enum"

            },

            {

                "attribute": "controllable",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            }

        ],

        "path": "/api/loads/main"

    },

    "data": [

        {

            "type": "loads_main",

            "id": "1",

            "attributes": {

                "device_id": "<uint32>",

                "state": "<Enum Load State>",

                "controllable": "<Boolean>"

            }

        }

    ]

}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/loads/main

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Load Control

 

The Load Control APIs enable turn on, turn off and power cycle of individual loads as well as the main load. This applies only to devices that support these functions.

 

Control Indvidual Loads

 

Title

Control Individual Loads

URL

/api/loads_execute/:loadId

OR

/api/loads_execute/:loadName

OR

/api/loads_execute/:loadNumber

Method

PATCH

URL Params

/api/loads_execute/:loadId – Default (No HTTP Header required)

OR

/api/loads_execute/:loadName

OR

/api/loads_execute/:loadNumber

 

If URL uses :loadName, then the following

HTTP Header Required:

   By: 'name' 

If URL uses :loadNumber, then the following

HTTP Header Required:

   By: 'number' 

Data Params

{"data": {

            "type": "loads_execute",

            "attributes": {

                "device_id": <uinit32>,

                "load_action": <Enum :LoadAction>

            }

        }

}

Success Response

Code: 200

Content:

{

    "meta": {

        "id": "e4a4fed4-f3bc-4879-8180-1e4d9d0044f6",

        "path": "/api/loads_execute/"

    },

    "data": {

        "type": "loads_execute",

        "id": "<load identifier>",

        "attributes": {

            "response": 0

        }

    }

}

Sample Call

curl –i -H "Accept: application/vnd.api+json" 
http://localhost:3001/api/loads_execute/1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Control Main Loads

 

Title

Control Main Loads

URL

/api/loads_execute/main/:deviceId

OR

/api/loads_execute/main/:deviceName

NOTE : No HTTP Header is required for deviceId

Method

PATCH

URL Params

if URL uses :deviceName, then

Required Header:

By: 'name'

Data Params

{"data": {

            "type": "loads_execute_main",

            "attributes": {

                "load_action": <Enum :LoadAction>

            }

        }

}

Success Response

Code: 200

Content:

{

    "meta": {

        "id": "e4a4fed4-f3bc-4879-8180-1e4d9d0044f6",

        "path": "/api/loads_execute/main"

    },

    "data": {

        "type": "loads_execute_main",

        "id": "<load identifier>",

        "attributes": {

            "response": 0

        }

    }

}

Sample Call

curl –i -H "Accept: application/vnd.api+json" 
http://localhost:3001//api/loads_execute/main/1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

Load Groups

The Load Groups API retrives a summary of configured Load Groups. It also enables creation, editing and deletion of Load Groups. It uses the following enums:

 

loads:
LOAD_STATE_UNKNOWN
LOAD_STATE_OFF
LOAD_STATE_MIXED

 

 

GET All Load Groups

 

Title

GET All Load Groups

URL

/api/loads_group

Method

GET

URL Params

Filters:

  • Using device_id
    /api/loads_group?filter=[{"name": "device_id", "op": "eq", "val": 1} ]
  • Using device_name
    api/loads_group?filter=[{"name": "device_name", "op": "eq", "val": "Device0391"} ]
  • Using state
    filter=[{"name": "state", "op": "in_", "val": ["LOAD_STATE_UNKNOWN"]} ]
  • Using Enabled
    /api/loads_group?filter=[{"name": "enabled", "op": "eq", "val": false} ]

Success Response

Code: 200 
Content: 

{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  

      }
   },
   "data":[  
      {  
         "type": "loads_group",
         "id":"<string, session>",
         "attributes":{  
            "name":"<string>",
            "device_id":"<int>",
           
"device_name":"<string>",
           
"enabled":"<boolean>",
           
"state":"<enum, STATE>",
            "description":"<string>",
            "number_of_loads":"<int>",
            "load_identity":"[ Array of load identity - Each element has id, name and load_number ]"          

         }
      }
   ]
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/loads_group

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET One Load Group

 

Title

GET One Load Group

URL

/api/loads_group/:loadGroupId

OR

/api/loads_group/:loadGroupName

Method

GET

URL Params

/api/loads_group/:loadGroupId

OR

/api/loads_group/:loadGroupName

 

If URL uses :loadName, then the following

HTTP Header Required:

By: 'name'

deviceId : <device id>

Note: NO HTTP header required to get load by loadGroupId

Success Response

Code: 200 
Content: 

{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  

      }
   },
   "data":{ 
         "type": "loads_group",
         "id":"<string, session>",
         "attributes":{  
            "name":"<string>",
            "device_id":"<int>",
           
"device_name":"<string>",
           
"enabled":"<boolean>",
           
"state":"<enum, STATE>",
            "description":"<string>",
            "number_of_loads":"<int>",
            "load_identity":"[ Array of load identity - Each element has id, name and load_number ]"          

         }
      }
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/loads_group/1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update Load Group

 

Title

Update Load Group

URL

/api/loads_group/:loadGroupId

OR

/api/loads_group/:loadGroupName

NOTE : No HTTP header is required to update load group by load group id

Method

PATCH

URL Params

/api/loads_group/:loadGroupId

OR

/api/loads_group/:loadGroupName

 

If URL uses :loadName, then the following

HTTP Header Required:

By: 'name'

Note: NO HTTP header required to get load by loadGroupId

Data Params

{  
 
   "data":{ 
         "type": "loads_group",
         "id":"<string, session>",
         "attributes":{  
            "name":"<string>",
           
"description":"<string>",
            "device_id":"<int>",
           
"enabled":"<boolean>",
            "add_load_id": [ {id : <int load_id>}]
            "remove_load_id":"[ {id : <int load_id> ]"          

         }
      }
   }
}

OR using current_load_id

 

{  
 
   "data":{ 
         "type": "loads_group",
         "id":"<string, session>",
         "attributes":{  
            "name":"<string>",
           
"description":"<string>",
            "device_id":"<int>",
           
"enabled":"<boolean>",
            "current_load_id": [ {id : <int load_id>}] or [{name : <string loadName>}] or [ {load_number: <string loadNumber>}]       

         }
      }
   }
}

 

Success Response

Code: 200 
Content: 

{

    "meta": {

        "id": "1c3a50fd-b568-4ff6-928f-227e2aa5ee77",

        "path": "/api/loads_group/1"

    },

    "data": {

        "type": "loads_group",

        "id": "<load group identifier>",

        "attributes": {

            "response": 0

        }

    }

}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/loads_group/1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

·       Add_load_id or remove_load_id fields either a list of valid load ids [{id:<loadId>}] or list of valid load name [{name:<loadName>}] can be used

current_load_id can be one of the following

·       [{id : 'loadId'}] - list of load ids

·       [{name : 'loadName'}] - list of load names

·       [{load_number : 'loadNumber'}] - List of load numbers

 

Create Load Group

 

Title

Create Load Group

URL

/api/loads_group

Method

POST

Data Params

{  
 
   "data":{ 
         "type": "loads_group",
         "attributes":{  
            "name":"<string>",
           
"description":"<string>",
            "device_id":"<int>",
           
"enabled":"<boolean>",
            "current_load_id":[ {id : <int load_id>}] or [{name : <string loadName>}] or [ {load_number: <string loadNumber>}]

    

         }
      }
   }
}

Success Response

Code: 200 
Content: 

{

    "meta": {

        "id": "1c3a50fd-b568-4ff6-928f-227e2aa5ee77",

        "path": "/api/loads_group/1"

    },

    "data": {

        "type": "loads_group",

        "id": "<load group identifier>",

        "attributes": {

            "response": 0

        }

    }

}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/loads_group

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete Load Group

 

Title

Delete Load Group

URL

/api/loads_group/:loadGroupId

OR

/api/loads_group/:loadGroupName

NOTE : No HTTP header is required to delete load group by load group id

Method

DELETE

URL Params

/api/loads_group/:loadGroupId

OR

/api/loads_group/:loadGroupName

 

If URL uses :loadName, then the following

HTTP Header Required:

By: 'name'

Note: NO HTTP header required to get load by loadGroupId

Success Response

Code: 200 
Content: 

{

    "meta": {

        "id": "1c3a50fd-b568-4ff6-928f-227e2aa5ee77",

        "path": "/api/loads_group/1"

    },

    "data": {

        "type": "loads_group",

        "id": "<load group identifier>",

        "attributes": {

            "response": 0

        }

    }

}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/loads_group/1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

·       Add_load_id or remove_load_id fields either a list of valid load ids [{id:<loadId>}] or list of valid load name [{name:<loadName>}] can be used

current_load_id can be one of the following

·       [{id : 'loadId'}] - list of load ids

·       [{name : 'loadName'}] - list of load names

·       [{load_number : 'loadNumber'}] - List of load numbers

Logs

The Logs API enables display, configuration and and export of log data. PowerAlert supports four type of logs and uses a separate endpoint for each.

·       Accounting Log

·       Application Log

·       Data Log

·       Event Log

 

Accounting Log API

 

The Accounting Log API enables retrieval of Accounting Log data.

 

GET All Accounting Log Entries

 

Title

GET All Accounting Log Entries

URL

/api/logs/accounting

Method

GET

URL Params

Filtering

'filter' query parameter is used for filtering:

 

Field Equals to Value:

/api/logs/accounting?filter=[{"name":"<field name>","op":"eq","val":<field value>}]

 

Field Contains a Sub String:

/api/logs/accounting?filter=[{"name":"<field name>","op":"like","val":"%<sub string to search>%"}]

 

Combinations:

/api/logs/accounting?filter=[{"name":"<field name>","op":"<op>","val":<val>}, {"name":"<field name>","op":"<op>","val":<val>}]

 

Timestamp Range:

/api/logs/accounting?filter=[{"name":"datetime","op":"ge","val": "YYYY-MM-DD HH:mm:ss"}, {"name":"datetime","op":"le","val": "YYYY-MM-DD HH:mm:ss"}]

 

Timestamp from Date Time:

/api/logs/accounting?filter=[{"name":"datetime","op":"ge","val": "YYYY-MM-DD HH:mm:ss"}]

 

Timestamp till Date Time:

/api/logs/accounting?filter=[{"name":"datetime","op":"le","val": "YYYY-MM-DD HH:mm:ss"}]

 

Sorting

'sort' query parameter is used for sorting:

/api/logs/accounting?sort=<fieldname>

 

Descendant Sort:

/api/logs/accounting?sort=-<fieldname>

 

Multiple Sort:

/api/logs/accounting?sort=<fieldname1>, <fieldname2>

 

Multiple + Descendant Sort:

/api/logs/accounting?sort=<fieldname1>, -<fieldname2>

 

Pagination

/api/logs/accounting?page[size]=<page size>&page[number]=<page number>

 

Default:

page size = 30

page number = 1

Success Response

Code: 200
Content:

{  
   "data":[  
      {  
         "type":"accounting_log_record",
         "attributes":{  
            "datetime":"<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
            "description":"<string, event description>",
             "category":"<string, category type>",
            "origin":"<string, host name or ip>",
            "user":"<string, user name>",
            "count":"<number of occurrences, for flood protection>"
         },
         "id":"<string, log entry id>",
         "links":{  
            "self":"/api/logs/accounting/<log entry id>"
         }
      }
   ],
   "links":{  
      "self":"http://<ip>/api/logs/accounting"
   },
   "meta":{  
      "count":"<number, total accounting log entries count>"
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Get One Accounting Log Entry

 

Title

GET One Accounting Log Entry

URL

/api/logs/accounting/:entry_id

Method

GET

Success Response

Code: 200
Content:
{  
   "data":{  
      "type":"accounting_log_record",
      "attributes":{  
         "datetime":"<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
         "description":"<string, event description>",
         "category":"<string, category type>",
         "origin":"<string, host name or ip>",
         "user":"<string, user name>",
         "count":"<number of occurrences, for flood protection>"
      },
      "id":"<string, log entry id>",
      "links":{  
         "self":"/api/logs/accounting/<log entry id>"
      }
   },
   "links":{  
      "self":"/api/logs/accounting/<log entry id>"
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/logs/accounting/1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET Accounting Logs Filtering Metadata

 

Title

GET Accounting Logs Filtering Metadata

URL

/api/accounting_log/filtering/1

Method

GET

Success Response

Code: 200
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"accounting_log",
      "id":"1",
      "attributes":{  
         "unique_users":[  
            "<string>",
            "<string>"
         ],
         "unique_origins":[  
            "<string>",
            "<string>"
         ],
         "unique_category":[  
            "<string>",
            "<string>"
         ],
         "first_date":"<number, in seconds>",
         "last_date":"<number, in seconds>"
      }
   }
}

Sample Call

curl –i -H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting_log/fitering/1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Data Log API

 

The Data Log API enables retrieval of Time-Series and Historical Roll-Up device metrics. The Time Series view displays the device’s metrics taken at 1-minute increments. The Historical Roll-Up view displays a summary view of the device’s metrics at the following increments: hourly, daily, weekly, monthly and yearly. This API uses the following enums:   

 

device_type:

DEVICE_TYPE_UNKNOWN

DEVICE_TYPE_UPS

DEVICE_TYPE_PDU

DEVICE_TYPE_ENVIROSENSE

DEVICE_TYPE_AC

DEVICE_TYPE_KVM

DEVICE_TYPE_ASSETTRACKER

DEVICE_TYPE_ATS

DEVICE_TYPE_SWITCH

data_type:

VARTYPE_NONE

VARTYPE_INTEGER

VARTYPE_FLOAT

VARTYPE_STRING

VARTYPE_DATE

VARTYPE_ENUMSTRING

VARTYPE_BYTE

VARTYPE_ENUMINTEGER

group:

VARGROUP_ALL

VARGROUP_NONE

VARGROUP_SYSTEM

VARGROUP_DEVICE

VARGROUP_CONTACT

VARGROUP_WATCHDOG

VARGROUP_LOAD

VARGROUP_BATTERY

VARGROUP_INPUT

VARGROUP_OUTPUT

VARGROUP_BYPASS

VARGROUP_ENVIRONMENT

VARGROUP_COOLING

 

Get All Data Log Meta-Data        

 

This API endpoint provides the meta-data for all metrics collected in the data log. The response includes variable name (e.g. Output Current), identifier, group, device name and unit of measurement for each metric.

Title

GET All Data Log Meta-Data

URL

/api/logs/data

Method

GET

Success Response

Code: 200
Content:

{  
   "data":[  
      {  
         "type":"data_log",
         "attributes":{  
            "label":"<string, variable label>",
            "key":"<integer, variable's unique key>",
            "device_id": <integer>,
            "device_type": "<enum, device type>",
            "group": "<enum, variable group>",
            "data_type": "<enum, variable type>",
            "device_name":"<string>",
            "suffix": "<string, data's suffix>"
         },
         "id":"<string, entry id>",
         "links":{  
            "self":"/api/logs/data/<entry id>"
         }
      }
   ],
   "links":{  
      "first":"http://<ip>/api/logs/data",
      "last":"http://<ip>/api/logs/data?page[number]=<last page>",
     
"next":"http://<ip>/api/logs/data?page[number]=<next page>",
      "self":"http://<ip>/api/logs/data"
   },
   "meta":{  
      "count":"<number, total data log headers count>"
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/logs/data

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET Data Log Meta-Data for a Specific Metric

 

This API endpoint provides the meta-data of a specific metric, as determined by its identifier (entry_id).

 

Title

GET Data Log Meta-Data By ID

URL

/api/logs/data/:metrics_id

Method

GET

Success Response

Code: 200
Content:
{
    "data": {
        "type": "data_log",
        "attributes": {

         "type":"data_log",
         "attributes":{  
            "label":"<string, variable label>",
            "key":"<integer, variable's unique key>",
            "device_id": <integer>,
            "device_type": "<enum, device type>",
            "group": "<enum, variable group>",
            "data_type": "<enum, variable type>",
            "device_name":"<string>",
            "suffix": "<string, data's suffix>"
        },
        "id":"<string, entry id>",
        "links": {
            "self": "/api/logs/data/:entry_id"
        }
    },
    "links": {
        "self": "/api/logs/data/:entry_id"
    },
    "jsonapi": {
        "version": "1.0"
    }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/logs/data/1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET Data Log Points 

 

The Data Log API retrieves the device’s Time-Series metrics taken at 1-minute increments.  

 

Title

GET All Data Log Points

URL

/api/logs/data_log_points

Method

GET

URL Params

Filtering

'filter' query parameter is used for filtering:

 

Field Equals to Value, Supported Filters:

/api/logs/data_log_points?filter[resolution]=<resolution type>

Resolution types:

seconds <--- default
hours
days
weeks
months
years

/api/logs/data_log_points?filter[aggregation]=<aggregation method>

Aggregation methods:

average <--- default
min
max

Filtering by id, device_id, key:

/api/logs/data_log_points?filter[id]=<id>

/api/logs/data_log_points?filter[device_id]=<device_id>

/api/logs/data_log_points?filter[key]=<key>

 

Filtering with provided values list:

/api/logs/data_log_points?filter=[{"name":"id","op":"in","val":[<number>, <number>, ...]}]

/api/logs/data_log_points?filter=[{"name":"device_id","op":"in","val":[<number>, <number>, ...]}]

/api/logs/data_log_points?filter=[{"name":"key","op":"in","val":[<number>, <number>, ...]}]

 

Timestamp Range:

/api/logs/data/<data header entry id>/data_log_points?filter=[{"name":"timestamp","op":"ge","val": "YYYY-MM-DD HH:mm:ss"}, {"name":"timestamp","op":"le","val": "YYYY-MM-DD HH:mm:ss"}]

 

/api/logs/data_log_points?filter=[{"name":"timestamp","op":"ge","val": "YYYY-MM-DD HH:mm:ss"}, {"name":"timestamp","op":"le","val": "YYYY-MM-DD HH:mm:ss"}]

 

Timestamp from Date Time:

/api/logs/data/<data header entry id>/data_log_points?filter=[{"name":"timestamp","op":"ge","val": "YYYY-MM-DD HH:mm:ss"}]

/api/logs/data_log_points?filter=[{"name":"timestamp","op":"ge","val": "YYYY-MM-DD HH:mm:ss"}]

 

Timestamp till Date Time:

/api/logs/data/<data header entry id>/data_points?filter=[{"name":"timestamp","op":"le","val": "YYYY-MM-DD HH:mm:ss"}]

/api/logs/data_points?filter=[{"name":"timestamp","op":"le","val": "YYYY-MM-DD HH:mm:ss"}]



Pagination

/api/logs/data?page[size]=<page size>&page[number]=<page number>

/api/logs/data/<data header entry id>?page[size]=<page size>&page[number]=<page number>

 

Default:

page size = 30

page number = 1

Success Response

Code: 200
Content:
{
    "data": [
        {
            "type": "data_log_point",
            "attributes": {
                "timestamp": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
                "key": <integer, variable key>,
                "device_id": <integer, device id>,
                "value": <numeric>
            },
            "id": <string, variable header entry>,
            "links": {
                "self": "/api/logs/data/1/data_log_points"
            }
        },
        {
            "type": "data_log_point",
            "attributes": {
                "timestamp": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
                "key": <integer, variable key>,
                "device_id": <integer, device id>,
                "value": <numeric>
            },           
           "id": <string, variable header entry>,
           "links": {
                "self": "/api/logs/data/<variable header entry>/data_log_points"
            }
        }
    ],
    "links": {
        "self": "http://<ip>/api/logs/data_log_points",
        "first": "http://<ip>/api/logs/data_log_points",
        "last": "http://<ip>/api/logs/data_log_points?page[number]=<last page>",
        "next": "http://<ip>/api/logs/data_log_points?page[number]=<next page>"
    },
    "meta": {
        "count": 1440
    },
    "jsonapi": {
        "version": "1.0"
    }
}

Sample Call

curl –i -H "Accept: application/vnd.api+json" http://localhost:3001/api/logs/data_log_points

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Get Data Log Points Based On Specific Data Log Metrics Identifier

 

Title

Get Data Log Points for specific Metrics Identifier

URL

/api/logs/data/<metrics id>/data_log_points

Method

GET

URL Params

Filtering, pagination and sorting is the same as in data_log_points

Success Response

Code: 200
Content:
{
    "data": [
        {
            "type": "data_log_point",
            "attributes": {
                "timestamp": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
                "key": <integer, variable key>,
                "device_id": <integer, device id>,
                "value": <numeric>
            },
            "id": <string, variable header entry>,
            "links": {
                "self": "/api/logs/data/1/data_log_points"
            }
        },
        {
            "type": "data_log_point",
            "attributes": {
                "timestamp": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
                "key": <integer, variable key>,
                "device_id": <integer, device id>,
                "value": <numeric>
            },           
           "id": <string, variable header entry>,
           "links": {
                "self": "/api/logs/data/<variable header entry>/data_log_points"
            }
        }
    ],
    "links": {
        "self": "http://<ip>/api/logs/data/<data log header entry>/data_log_points",
        "first": "http://<ip>/api/logs/data/<data log header entry>/data_log_points",
        "last": "http://<ip>/api/logs/data/<data log header entry>/data_log_points?page[number]=<last page>",
        "next": "http://<ip>/api/logs/data/<data log header entry>/data_log_points?page[number]=<next page>"
    },
    "meta": {
        "count": <data log points count>
    },
    "jsonapi": {
        "version": "1.0"
    }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Get Data Log Roll-up  

 

This API retrieves a historical summary of the device’s metrics at the following increments: hourly, daily, weekly, monthly and yearly.

Title

Show All Data Log Points Roll-up

URL

/api/logs/data_log_rollup

Method

GET

URL Params

Same filtering queries as in data_log_points, not including timestamp and resolution

pagination and sorting is the same as in data_log_points

Success Response

Code: 200
Content:
{
    "data": [
        {
            "type": "data_log_rollup",
            "attributes": {
                "timestamp": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
                "key": <integer, variable key>,
                "device_id": <integer, device id>,
                "value": <numeric>,
               "resolution": "<string hours, days, weeks, months or years>"
            },
            "id": <string, variable header entry>,
            "links": {
                "self": "/api/logs/data/1/data_log_rollup"
            }
        },
        {
            "type": "data_log_rollup",
            "attributes": {
                "timestamp": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
                "key": <integer, variable key>,
                "device_id": <integer, device id>,
                "value": <numeric>,
                "resolution": "<string hours, days, weeks, months or years>"
            },           
           "id": <string, variable header entry>,
           "links": {
                "self": "/api/logs/data/<variable header entry>/data_log_rollup"
            }
        }
    ],
    "links": {
        "self": "http://<ip>/api/logs/data_log_rollup",
    },
    "meta": {
        "count": 5
    },
    "jsonapi": {
        "version": "1.0"
    }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET Data Log Filtering Metadata

 

Title

GET Data Log Filtering Metadata

URL

/api/data_log/filtering/1

Method

GET

Success Response

Code: 200
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"data_log",
      "id":"1",
      "attributes":{          
         "first_date":"<number, in seconds>",
         "last_date":"<number, in seconds>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Event Log API

 

The Event Log API enables retrieval and configuration of system-related and device events. It uses the following enums: 

 

log_entry_type:

LOG_ENTRY_TYPE_SYSTEM_EVENT

LOG_ENTRY_TYPE_DEVICE_EVENT

LOG_ENTRY_TYPE_VAR_THRESHOLD_CROSSING

LOG_ENTRY_TYPE_CONTROL_EXECUTION

 

severity:

EVENT_LOG_SEVERITY_EMERGENCY

EVENT_LOG_SEVERITY_ALERT

EVENT_LOG_SEVERITY_CRITICAL

EVENT_LOG_SEVERITY_ERROR

EVENT_LOG_SEVERITY_WARNING

EVENT_LOG_SEVERITY_NOTICE

EVENT_LOG_SEVERITY_INFO

EVENT_LOG_SEVERITY_DEBUG

 

event_type:

EVENT_TYPE_STATEFUL

EVENT_TYPE_STATELESS_SETTING

EVENT_TYPE_STATELESS_CLEARING

EVENT_TYPE_STATELESS

 

 

GET All Event Log Entries

 

Title

GET All Event Log Entries

URL

/api/logs/event

Method

GET

URL Params

Filtering

'filter' query parameter is used for filtering:

 

Field Equals to Value:

/api/logs/event?filter=[{"name":"<field name>","op":"eq","val":<field value>}]

 

Field Contains a Sub String:

/api/logs/event?filter=[{"name":"<field name>","op":"like","val":"%<sub string to search>%"}]

 

Combinations:

/api/logs/event?filter=[{"name":"<field name>","op":"<op>","val":<val>}, {"name":"<field name>","op":"<op>","val":<val>}]

 

Timestamp Range:

/api/logs/event?filter=[{"name":"timestamp","op":"ge","val": "YYYY-MM-DD HH:mm:ss"}, {"name":"timestamp","op":"le","val": "YYYY-MM-DD HH:mm:ss"}]

 

Timestamp from Date Time:

/api/logs/event?filter=[{"name":"timestamp","op":"ge","val": "YYYY-MM-DD HH:mm:ss"}]

 

Timestamp till Date Time:

/api/logs/event?filter=[{"name":"timestamp","op":"le","val": "YYYY-MM-DD HH:mm:ss"}]

 

Sorting:

'sort' query parameter is used for sorting:

/api/logs/event?sort=<fieldname>

 

Descendant Sort:

/api/logs/event?sort=-<fieldname>

 

Multiple Sort:

/api/logs/event?sort=<fieldname1>, <fieldname2>

 

Multiple + Descendant Sort:

/api/logs/event?sort=<fieldname1>, -<fieldname2>

 

Default:

Default sorting is by timestamp descending

 

Pagination

/api/logs/event?page[size]=<page size>&page[number]=<page number>

 

Default:

page size = 30

page number = 1

Success Response

Code: 200
Content:

{  
   "data":[  
      {  
         "type":"event_log",
         "attributes":{  
            "description":"<string, event description>",
            "device_model":"<string, relevant if device event>",
            "device_name":"<string, relevant if device event>",
            "log_entry_type":"<enum, log entry type>",
            "message_id":"<uint64, associated syslog message id>",
            "event_type": "<enum, event type>",
            "event_id": "<uint32, event id>",
            "severity":"<enum, log severity>",
            "timestamp":"<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
            "count":"<number of event occurrences, for flood protection>"
         },
         "id":"<string, entry id>",
         "links":{  
            "self":"/api/logs/event/<entry id>"
         },
         "relationships":{  
            "data_points":{  
               "data":[  
                  {  
                     "id":"<string, data point id>",
                     "type":"data_point"
                  },
                  {  
                     "id":"<string, data point id>",
                     "type":"data_point"
                  }
               ]
            }
         }
      }
   ],
   "links":{  
      "first":"
http://<ip>/api/logs/event",
      "last":"http://
<ip>/api/logs/event?page%5Bnumber%5D=<last page>",
      "next":"http://<ip>/api/logs/event?page%5Bnumber%5D=<next page>",
      "self":"
http://<ip>/api/logs/event"
   },
   "meta":{  
      "count":"<number, total event log entries count>"
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET All Event Log Entries with Data points

 

Title

Show All Event Log Entries, include Data Points

URL

/api/logs/event?include=data_points

Method

GET

URL Params

Filtering

'filter' query parameter is used for filtering:

 

Field Equals to Value:

/api/logs/event?filter=[{"name":"<field name>","op":"eq","val":<field value>}]

 

Field Contains a Sub String:

/api/logs/event?filter=[{"name":"<field name>","op":"like","val":"%<sub string to search>%"}]

 

Combinations:

/api/logs/event?filter=[{"name":"<field name>","op":"<op>","val":<val>}, {"name":"<field name>","op":"<op>","val":<val>}]

 

Timestamp Range:

/api/logs/event?filter=[{"name":"timestamp","op":"ge","val": "YYYY-MM-DD HH:mm:ss"}, {"name":"timestamp","op":"le","val": "YYYY-MM-DD HH:mm:ss"}]

 

Timestamp from Date Time:

/api/logs/event?filter=[{"name":"timestamp","op":"ge","val": "YYYY-MM-DD HH:mm:ss"}]

 

Timestamp till Date Time:

/api/logs/event?filter=[{"name":"timestamp","op":"le","val": "YYYY-MM-DD HH:mm:ss"}]

 

Sorting:

'sort' query parameter is used for sorting:

/api/logs/event?sort=<fieldname>

 

Descendant Sort:

/api/logs/event?sort=-<fieldname>

 

Multiple Sort:

/api/logs/event?sort=<fieldname1>, <fieldname2>

 

Multiple + Descendant Sort:

/api/logs/event?sort=<fieldname1>, -<fieldname2>

 

Default:

Default sorting is by timestamp descending

 

Pagination

/api/logs/event?page[size]=<page size>&page[number]=<page number>

 

Default:

page size = 30

page number = 1

Success Response

Code: 200
Content:

{  
      "data":[  

      {  
         "type":"event_log",
         "attributes":{  
            "description":"<string, event description>",
            "device_model":"<string, relevant if device event>",
            "device_name":"<string, relevant if device event>",
            "log_entry_type":"<enum, log entry type>",
            "message_id":"<uint64, associated syslog message id>",
            "event_type": "<enum, event type>",
            "event_id": "<uint32, event id>",
            "severity":"<enum, log severity>",
            "timestamp":"<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
            "count":"<number of event occurrences, for flood protection>"
         },
         "id":"<string, entry id>",
         "links":{  
            "self":"/api/logs/event/<entry id>"
         },
         "relationships":{  
            "data_points":{  
               "data":[  
                  {  
                     "id":"<string, data point id>",
                     "type":"data_point"
                  },
                  {  
                     "id":"<string, data point id>",
                     "type":"data_point"
                  },
                  {  
                     "id":"<string, data point id>",
                     "type":"data_point"
                  }
               ]
            }
         }
      }
   ],
"included":[  
      {  
         "attributes":{  
            "event_id":"<string, associated event log entry id>",
            "name":"<string, data point name>",
            "value":"<string, data point value>",
            "time_offset": "<int64, time offset from event occurred>"
         },
         "id":"<string, data point id>",
         "links":{  
            "self":"/api/logs/event_data_points/<data point id>"
         },
         "type":"data_point"
      },
      {  
         "attributes":{  
            "event_id":"<string, associated event log entry id>",
            "name":"<string, data point name>",
            "value":"<string, data point value>",
            "time_offset": "<int64, time offset from event occurred>"
         },
         "id":"<string, data point id>",
         "links":{  
            "self":"/api/logs/event_data_points/<data point id>"
         },
         "type":"data_point"
      },
      {  
         "attributes":{  
            "event_id":"<string, associated event log entry id>",
            "name":"<string, data point name>",
            "value":"<string, data point value>",
            "time_offset": "<int64, time offset from event occurred>"
         },
         "id":"<string, data point id>",
         "links":{  
            "self":"/api/logs/event_data_points/<data point id>"
         },
         "type":"data_point"
      }
   ],
"links":{  
      "first":"http://<ip>/api/logs/event?include=data_points",
      "last":
"http://<ip>/api/logs/event?include=data_points&page%5Bnumber%5D=<last page>",
      "next":
"http://<ip>/api/logs/event?include=data_points&page%5Bnumber%5D=<next page>",
      "self":"http://<ip>/api/logs/event?include=data_points"
   },
   "meta":{  
      "count":"<number, total event log entries count>"
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET One Event Log Entry

 

Title

GET One Event Log Entry

URL

/api/logs/event/:entry_id

Method

GET

Success Response

Code: 200
Content:
{  
   "data":{  
      "attributes":{  
         "description":"<string, event description>",
         "device_model":"<string, relevant if device event>",
         "device_name":"<string, relevant if device event>",
         "log_entry_type":"<enum, log entry type>",
         "message_id":"<uint64, associated syslog message id>",
         "event_type": "<enum, event type>",
         "event_id": "<uint32, event id>",
         "severity":"<enum, log severity>",
         "timestamp":"<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
         "count":"<number of event occurrences, for flood protection>"
      },
      "id":"<string, entry id>",
      "links":{  
         "self":"/api/logs/event/<entry id>"
      },
      "relationships":{  
         "data_points":{  
            "data":[  
               {  
                  "id":"<string, data point id>",
                  "type":"data_point"
               },
               {  
                  "id":"<string, data point id>",
                  "type":"data_point"
               }
            ]
         }
      },
      "type":"event_log"
   },
   "links":{  
      "self":"/api/logs/event/<entry id>"
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET One Event Log Entry with its Data Points

 

Title

GET One Event Log Entry with its Data Points

URL

/api/logs/event/:entry_id?include=data_points

Method

GET

Success Response

Code: 200
Content:
{  
   "data":{  
      "type":"event_log",
      "attributes":{  
         "description":"<string, event description>",
         "device_model":"<string, relevant if device event>",
         "device_name":"<string, relevant if device event>",
         "log_entry_type":"<enum, log entry type>",
         "message_id":"<uint64, associated syslog message id>",
         "event_type": "<enum, event type>",
         "event_id": "<uint32, event id>",
         "severity":"<enum, log severity>",
         "timestamp":"<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>",
         "count":"<number of event occurrences, for flood protection>"
      },
      "id":"<string, entry id>",
      "links":{  
         "self":"/api/logs/event/<entry id>"
      },
      "relationships":{  
         "data_points":{  
            "data":[  
               {  
                  "id":"<string, data point id>",
                  "type":"data_point"
               },
               {  
                  "id":"<string, data point id>",
                  "type":"data_point"
               },
               {  
                  "id":"<string, data point id>",
                  "type":"data_point"
               }
            ]
         }
      }
   },
   "included":[  
      {  
         "attributes":{  
            "event_id":"<string, event log entry id>",
            "name":"<string, data point name>",
            "value":"<string, data point value>"
            "time_offset": "<int64, time offset from event occurred>"
         },
         "id":"<string, data point id>",
         "links":{  
            "self":"/api/logs/event_data_points/<data point id>"
         },
         "type":"data_point"
      },
      {  
         "attributes":{  
            "event_id":"<string, event log entry id>",
            "name":"<string, data point name>",
            "value":"<string, data point value>",
            "time_offset": "<int64, time offset from event occurred>"
        
},
         "id":"<string, data point id>",
         "links":{  
            "self":"/api/logs/event_data_points/<data point id>"
         },
         "type":"data_point"
      },
      {  
         "attributes":{  
            "event_id":"<string, event log entry id>",
            "name":"<string, data point name>",
            "value":"<string, data point value>",
            "time_offset": "<int64, time offset from event occurred>"
         },
         "id":"<string, data point id>",
         "links":{  
            "self":"/api/logs/event_data_points/<data point id>"
         },
         "type":"data_point"
      }
   ],
   "links":{  
      "self":"/api/logs/event/<entry id>"
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET Event Log Filtering Metadata

 

Title

GET Event Log Filtering Metadata

URL

/api/event_log/filtering/1

Method

GET

Success Response

Code: 200
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"event_log",
      "id":"1",
      "attributes":{  
         "unique_severities":[  
            "<string>",
            "<string>"
         ],
         "unique_devices":[  
            "<string>",
            "<string>"
         ],
         "unique_descriptions":[  
            "<string>",
            "<string>"
         ],
         "first_date":"<number, in seconds>",
         "last_date":"<number, in seconds>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

On-Demand Log Rotation and Log Export

 

The following enums are used for on-demand Log Rotation.

 

logtype:

LOG_TYPE_ACCOUNTING

LOG_TYPE_EVENT

LOG_TYPE_DATA

LOG_TYPE_DATA_ROLLUP

LOG_TYPE_APPLICATION

LOG_TYPE_ALERTS

 

format:

LOG_FORMAT_CSV

LOG_FORMAT_XML

 

export_method:

LOG_ROTATION_ACTION_EMAIL

LOG_ROTATION_ACTION_DOWNLOAD

 

Manual Export

 

Title

Manual Export

URL

/api/log_rotation/export/:logType

Method

POST

URL Params

Required:

logType=[enum, log type]

Example: logType='LOG_TYPE_EVENT'

Data Params

{  
   "data":{  
      "type":"log_rotation",
      "attributes":{  
         "export_method":"<enum, log rotation action>",
         "mail_contact":"<string, contact id, relevant if method is email>",
         "format":"<enum, log format>",
         "clear_log":"<boolean>"
      }
   }
}

Success Response

Code: 201 
Content:

{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"log_rotation",
      "attributes":{  
         "download_path":"<string, path for downloading the log file>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

For LOG_TYPE_DATA:
attribute export_method must be LOG_FORMAT_CSV

·       attribute clear_log is ignored (the log is not cleared)

 

GET Log Export Availability  

 

Title

GET Log Export Availability

URL

/api/log_rotation/export/availability

Method

GET

Data Params

 

Success Response

Code: 200
Content:

{  
   "data":[  
      {  
         "type":"log_rotation",
         "attributes":{  
            "available":"<boolean>"           
         },                
      }
   ],
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Scheduled Actions

The Scheduled Actiona API enables creation and management of scheduled actions, as applicable to the device and connected peripherals.

·       OperationType – This sets the type of scheduled Action. Each operation type has its own set of required attributes.Refer to Table 1 for details.

·       FrequencyType - This sets how often the action occurs. Refer to the ScheduleFrequencyType enums for avialble options. Refer to Table 2 for parameter details related to each frequency type

·       RangeType – This sets the range for a scheduled action. Refer to Table 3 for details on the parameters associated with each range type.

 

This API uses the following enums:

operation_type:

SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST

SCHEDULED_OPERATION_TYPE_ENABLE_ONLINE_MODE

SCHEDULED_OPERATION_TYPE_EXPORT_APPLICATION_LOG

SCHEDULED_OPERATION_TYPE_EXPORT_LOG

SCHEDULED_OPERATION_TYPE_LOAD

SCHEDULED_OPERATION_TYPE_LOAD_GROUP

SCHEDULED_OPERATION_TYPE_RAMP

SCHEDULED_OPERATION_TYPE_REBOOT_OPERATING_SYSTEM

SCHEDULED_OPERATION_TYPE_REBOOT_WEBCARD_LX

SCHEDULED_OPERATION_TYPE_RESTART_DEVICE

SCHEDULED_OPERATION_TYPE_SENSOR

SCHEDULED_OPERATION_TYPE_SHED

SCHEDULED_OPERATION_TYPE_SHUTDOWN_OPERATING_SYSTEM

SCHEDULED_OPERATION_TYPE_TURN_OFF_DEVICE

SCHEDULED_OPERATION_TYPE_TURN_ON_DEVICE

 

SchedulingDayOfWeek:  

SCHEDULING_DAY_OF_WEEK_SUNDAY 

SCHEDULING_DAY_OF_WEEK_MONDAY

SCHEDULING_DAY_OF_WEEK_TUESDAY

SCHEDULING_DAY_OF_WEEK_WEDNESDAY

SCHEDULING_DAY_OF_WEEK_THURSDAY

SCHEDULING_DAY_OF_WEEK_FRIDAY

SCHEDULING_DAY_OF_WEEK_SATURDAY

 

SchedulingMonthOfYear:

SCHEDULING_MONTH_OF_YEAR_JANUARY

SCHEDULING_MONTH_OF_YEAR_FEBRUARY

SCHEDULING_MONTH_OF_YEAR_MARCH

SCHEDULING_MONTH_OF_YEAR_APRIL

SCHEDULING_MONTH_OF_YEAR_MAY

SCHEDULING_MONTH_OF_YEAR_JUNE

SCHEDULING_MONTH_OF_YEAR_JULY

SCHEDULING_MONTH_OF_YEAR_AUGUST

SCHEDULING_MONTH_OF_YEAR_SEPTEMBER

SCHEDULING_MONTH_OF_YEAR_OCTOBER

SCHEDULING_MONTH_OF_YEAR_NOVEMBER

SCHEDULING_MONTH_OF_YEAR_DECEMBER 

 

SchedulingOrdinalType:

SCHEDULING_ORDINAL_FIRST

SCHEDULING_ORDINAL_SECOND

SCHEDULING_ORDINAL_THIRD

SCHEDULING_ORDINAL_FOURTH

SCHEDULING_ORDINAL_LAST

SCHEDULING_MONTH_OF_YEAR_DECEMBER

 

frequency_type:

SCHEDULING_FREQUENCY_TYPE_ONCE

SCHEDULING_FREQUENCY_TYPE_DAILY

SCHEDULING_FREQUENCY_TYPE_WEEKLY

SCHEDULING_FREQUENCY_TYPE_MONTHLYDAYOFMONTH

SCHEDULING_FREQUENCY_TYPE_MONTHLYDAYSOFWEEK

SCHEDULING_FREQUENCY_TYPE_YEARLYDAYOFMONTH

SCHEDULING_FREQUENCY_TYPE_YEARLYORDINAL

 

range_type:

SCHEDULING_RANGE_TYPE_REPEAT_FOREVER

SCHEDULING_RANGE_TYPE_REPEAT_TIMES

SCHEDULING_RANGE_TYPE_REPEAT_UNTIL

 

SchedulingLogType:

SCHEDULING_LOG_TYPE_ACCOUNTING

SCHEDULING_LOG_TYPE_EVENT

SCHEDULING_LOG_TYPE_DATA

SCHEDULING_LOG_TYPE_DATA_ROLLUP

 

SchedulingLogFormatType:

SCHEDULING_LOG_FORMAT_TYPE_CSV

SCHEDULING_LOG_FORMAT_TYPE_XML

 

SchedulingSensorState:  

SCHEDULING_SENSOR_STATE_OPEN

SCHEDULING_SENSOR_STATE_CLOSED

 

SchedulingSensorContact:

SCHEDULING_SENSOR_CONTACT_ONE

SCHEDULING_SENSOR_CONTACT_TWO

 

Load Action:    

LOAD_ACTION_CYCLE

LOAD_ACTION_ON

LOAD_ACTION_OFF

LOAD_ACTION_IDLE

Table 1 - Operation Type Selection Table

                                                          Table 2 – Frequency Type Selection Table

                            

Table 3 – Range Type Selection Table

 

Range Type

Required Parameters

Field Description

SCHEDULING_RANGE_TYPE_REPEAT_FOREVER

No parameter required

The operation runs forever

SCHEDULING_RANGE_TYPE_REPEAT_TIMES

repeat_times:

<integer>

The operation runs <integer> times

SCHEDULING_RANGE_TYPE_REPEAT_UNTIL

repeat_until: <calendar timestamp>

 

Specifies the calendar date and time that the operation runs for the last time

                                               

 

GET All Scheduling Tasks

 

Title

GET All Scheduling Tasks

URL

/api/schedulings

Method

GET

Success Response

 "data": [

        {

            "type": "schedulings",

            "id": "<Stinrg Number Value>",

            "attributes": {

                "name": "<String Task Name>",

                "enabled": <Boolean Value> ,

                "run_on": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00>",

                "run_last": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00>",

                "run_next": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00>",

                "fired_count": <int value>,

                "operation_type": "ENUM ScheduledOperationType",

                //Based on operation_type selection, addational attribute will be included - Look at Table 1

                "frequency_type": "ENUM SchedulingFrequencyType ",

                //Based on frequency_type selection, addational attribute will be included – Look at Table 2

                "range_type": "ENUM SchedulingRangeType",

                //Additional Valid attributes will be included based on range_type selection – Look at Table 3

            }

        }

]

Sample Call

Request: http://127.0.0.1:3001/api/schedulings

Response:

{

    "meta": {

        "id": "8b3985f8-d29f-477a-a2c4-97fd8a33e27f",

        "constraints": {

            "max_items": 0,

            "min_items": 0,

            "editable_attributes": [

                "name",

                "enabled",

                "run_on",

                "frequency",

                "range"

            ],

            "required_attributes": [

                "name",

                "enabled",

                "run_on",

                "operation"

            ],

            "delete_allowed": true

        },

        "validation": [{

                "attribute": "name",

                "maximum": 0,

                "minimum": 0,

                "default": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "run_on",

                "maximum": 0,

                "minimum": 0,

                "default": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "datetime"

            }

        ],

        "path": "/api/schedulings"

    },

    "data": [{

            "type": "schedulings",

            "id": "1",

            "attributes": {

                "name": "task-01",

                "enabled": false,

                "run_on": "2019-12-06T14:38:54-06:00",

                "run_last": "",

                "run_next": "2019-12-17T14:38:54-06:00",

                "fired_count": 0,

                "operation_type": "SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST",

                "device_id": 1,

                 "device_name": "",

                "frequency_type": "SCHEDULING_FREQUENCY_TYPE_ONCE",

                "once": true,

                "range_type": "SCHEDULING_RANGE_TYPE_REPEAT_FOREVER",

                "repeat_forever": true

            }

        },

        {

            "type": "schedulings",

            "id": "2",

            "attributes": {

                "name": "task-02",

                "enabled": false,

                "run_on": "2019-12-06T14:38:54-06:00",

                "run_last": "",

                "run_next": "2019-12-17T14:38:54-06:00",

                "fired_count": 0,

                "operation_type": "SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST",

                "device_id": 2,

                 "device_name": "",

                "frequency_type": "SCHEDULING_FREQUENCY_TYPE_ONCE",

                "once": true,

                "range_type": "SCHEDULING_RANGE_TYPE_REPEAT_FOREVER",

                "repeat_forever": true

            }

        },

        {

            "type": "schedulings",

            "id": "3",

            "attributes": {

                "name": "task-05",

                "enabled": false,

                "run_on": "2019-12-06T14:38:54-06:00",

                "run_last": "",

                "run_next": "2019-12-17T14:38:54-06:00",

                "fired_count": 0,

                "operation_type": "SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST",

                 "device_id": 3,

                 "device_name": "",

                "frequency_type": "SCHEDULING_FREQUENCY_TYPE_ONCE",

                "once": true,

                "range_type": "SCHEDULING_RANGE_TYPE_REPEAT_FOREVER",

                "repeat_forever": true

            }

        },

        {

            "type": "schedulings",

            "id": "4",

            "attributes": {

                "name": "task-06",

                "enabled": false,

                "run_on": "2019-12-06T14:38:54-06:00",

                "run_last": "",

                "run_next": "2019-12-17T14:38:54-06:00",

                "fired_count": 0,

                "operation_type": "SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST",

                "device_id": 4,

                "device_name": ""

                "frequency_type": "SCHEDULING_FREQUENCY_TYPE_ONCE",

                "once": true,

                "range_type": "SCHEDULING_RANGE_TYPE_REPEAT_FOREVER",

                "repeat_forever": true

            }

        },

        {

            "type": "schedulings",

            "id": "5",

            "attributes": {

                "name": "task-11",

                "enabled": true,

                "run_on": "2019-12-06T14:38:54-06:00",

                "run_last": "",

                "run_next": "2019-12-18T14:38:54-06:00",

                "fired_count": 0,

                "operation_type": "SCHEDULED_OPERATION_TYPE_ENABLE_ONLINE_MODE",

                "device_id": 1,

                "device_name": "",

                "frequency_type": "SCHEDULING_FREQUENCY_TYPE_DAILY",

                "range_type": "SCHEDULING_RANGE_TYPE_REPEAT_UNTIL",

                "frequency_days": 2,

                "repeat_until": ""

            }

        }

    ]

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Check List of Enumeration for ENUMS and Table 1, Table 2 and Tabel 3for all allowed attribute of each of operationType, frequencyType or rangeType selection

 

GET One Scheduling Task

 

Title

GET One Scheduling Task

URL

/api/schedulings/:id

OR

/api/schedulings/:name

Note: NO HTTP header required to get schedulings task by ID

Method

GET

URL Params

/api/schedulings/:id

OR

/api/schedulings/:name

Note: No HTTP header required to get by id

http header "By: name" required to get by name

Required:

id=[integer] 
example: id=12

name=[string]

example: ‘task1’

Success Response

Code: 200 
Content: 

{{

    "data": {

        "type": "schedulings",

        "id": "<Stinrg Number Value>",

        "attributes": {

            "name": "<String Task Name>",

            "enabled": "< Boolean Value >",

            "run_on": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00>",

            "run_last": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00>",

            "run_next": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00>",

            "fired_count": "< int value >",

            "operation_type": "ENUM ScheduledOperationType",

            //Based on operation_type selection, addational attribute will be include – Look at Table 1

            "frequency_type": "ENUM SchedulingFrequencyType ",

            //Based on frequency_type selection, addational attribute will be included - Look at Table 2

            "range_type": "ENUM SchedulingRangeType",

            //Addational Valid attributes will be included based on range_type selection - Look at Table 3

        }

    }

}

Sample Call

http://127.0.0.1:3001/api/schedulings/1 - by Id

{

    "meta": {

        "id": "38532ad3-8302-4e0a-9cb0-b488958cd805",

        "constraints": {

            "max_items": 0,

            "min_items": 0,

            "editable_attributes": [

                "name",

                "enabled",

                "run_on",

                "frequency",

                "range"

            ],

            "required_attributes": [

                "name",

                "enabled",

                "run_on",

                "operation"

            ],

            "delete_allowed": true

        },

        "validation": [{

                "attribute": "name",

                "maximum": 0,

                "minimum": 0,

                "default": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "run_on",

                "maximum": 0,

                "minimum": 0,

                "default": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "datetime"

            }

        ],

        "path": "/api/schedulings/1"

    },

    "data": {

        "type": "schedulings",

        "id": "1",

        "attributes": {

            "name": "task-01",

            "enabled": false,

            "run_on": "2019-12-06T14:38:54-06:00",

            "run_last": "",

            "run_next": "2019-12-17T14:38:54-06:00",

            "fired_count": 0,

            "operation_type": "SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST",

            "device_id": 1,

            "device_name": "",

            "frequency_type": "SCHEDULING_FREQUENCY_TYPE_ONCE",

            "once": true,

            "range_type": "SCHEDULING_RANGE_TYPE_REPEAT_FOREVER",

            "repeat_forever": true

        }

    }

}


By Name:

 

http://127.0.0.1:3001/api/schedulings/task01

 

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create Scheduling Task

 

Title

Create Scheduling Task

URL

/api/schedulings

Method

POST

Data Params

{

    "data": {

        "type": "schedulings",

        "attributes": {

            "name": "<String Task Name>",

           "operation_type": "ENUM ScheduledOperationType", //Look at Table 1 (Operation Type Selection Table)

            //based on the operaton_type selection additional attribute is required - Example for operation_type SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST, device_id or device_name is required

            "enabled": "<Boolean Value>",

            "run_on": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00>",

            "frequency_type": "ENUM SchedulingFrequencyType", //Look at Table 2 (Frequency Selction Table)

            //Based on frequency_type selection, additional attribute will be included

            "range_type": "ENUM SchedulingRangeType", // Look at Table 3 – Range Type Selection

            //Additional Valid attributes will be included based on range_type selection 

        }

    }

}

Success Response

Code: 200 
Content: 

{

    "meta": {

        "id": "99c0144b-fd89-4cfe-96b4-65e0689911e3",

        "path": "/api/schedulings/SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST"

    },

    "data": {

        "type": "/api/schedulings",

        "id": "7",

        "attributes": {

            "response": 0

        }

    }

}

Sample Call

URL - http://localhost:3001/api/schedulings

POST Body:

{

    "data": {

        "type": "schedulings",

        "attributes": {

            "name": "taskBatterselfTestOnce",

            "enabled": false,

            "run_on": "2019-12-26T15:38:54-05:00",

            "operation_type": "SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST",

            "frequency_type": "SCHEDULING_FREQUENCY_TYPE_ONCE",

            "device_id": 1

        }

    }

}

 

Response

{

    "meta": {

        "id": "99c0144b-fd89-4cfe-96b4-65e0689911e3",

        "path": "/api/schedulings/SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST"

    },

    "data": {

        "type": "/api/schedulings",

        "id": "7",

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update Scheduling Task

 

Title

Update Scheduling Task

URL

/api/schedulings/:id

OR

/api/schedulings/:name

Note: No HTTP Header required to update scheduling task using id

Method

PATCH

URL Params

/api/schedulings/:id

OR

/api/schedulings/:name

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Required:

id=[integer] 
example: id=12

name=[string]

example: 'autoprobe1'

Data Params

{

    "data": {

        "type": "schedulings",

        "attributes": {

            "name": "<String Task Name>",

            //based on the operaton_type selection additional attribute is required - Example for operation_type SCHEDULED_OPERATION_TYPE_BATTERY_SELF_TEST, device_id or device_name is required

            "enabled": "<Boolean Value>",

            "run_on": "<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00>",

            "frequency_type": "ENUM SchedulingFrequencyType", //

            //Based on frequency_type selection, additional attribute will be included – Look at Table 1 FrequencyType Selection

            "range_type": "ENUM SchedulingRangeType", //Look at Table 3 Range Type Selection 

            //Additional Valid attributes will be included based on range_type selection - Look at Table 3 Range Type Selection 

 

        }

    }

}

Success Response

Code: 200 
Content: 

{

    "meta": {

        "id": "<request id>",

        "path": "<api uri path>"

    },

    "data": {

        "type": "schedulings",

        "id": "<scheduling task id>",

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

·       operation_type cannot be updated but operation type related attribute can be update.

·       device_id and device_name can be updated for device related operation type (Example: SCHEDULED_OPERATION_TYPE_LOAD, SCHEDULED_OPERATION_TYPE_LOAD_GROUP and etc).

·       operation_type needed to be provided to updated allowed operation attribute but type it self can not be updated – Look at Operation Type Selection Table (Table 1)

·       frequency_type and allowed attribute for that frequency type needs to be provided to update frequency – Look at Table 2 – Frequency Type Selection 

range_type and allowed attribute for that range type needs to be provided to update range – Look at Range Type Selection Table

 

 

Delete Scheduling Task

 

Title

Delete Scheduling Task

URL

/api/schedulings/:schedulingId

OR

/api/schedulings/:schedulingName

Note: No HTTP Header required to delete scheduling task using schedulingId

Method

PATCH

URL Params

/api/schedulings/:schedulingId

OR

/api/schedulings/:schedulingName

Note: No HTTP header required to update by id

http header "By: name" required to delete by name

Required:

schedulingId=[int] 
example: schedulingId=1

schedulingName=[string]

example: schedulingName=task01

Success Response

Code: 200 
Content: 

{

    "meta": {

        "id": "<request id>",

        "path": "<api uri path>"

    },

    "data": {

        "type": "schedulings",

        "id": "<scheduling task id>",

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET Suppoted Scheduling Operations

 

Title

GET Supported Scheduling Operations

URL

/api/schedulings/supported

Method

GET

Success Response

Code: 200 
Content:

{

    "meta": {

        "id": "3f29fec7-5907-4161-9bd1-808f2feed0d6",

        "path": "/api/schedulings/supported"

    },

    "data": {

        "type": "schedulings_supported",

        "id": "SchedulingsSupported",

        "attributes": {

            "export_application_log_supported": false,

            "export_log_supported": false,

            "reboot_operating_system_supported": false,

            "reboot_webcard_lx_supported": true,

            "shutdown_operating_supported": false,

            "load_supported": {

                "load_identity_per_device": [{

                    "device": {

                        "id": 1,

                        "name": ""

                    },

                    "loads": [{

                            "id": "1",

                            "name": "Load 1"

                        },

                        {

                            "id": "2",

                            "name": "Load 2"

                        }

                    ]

                }]

            },

            "load_group_supported": {

                "load_identity_per_device": [{

                    "device": {

                        "id": 1,

                        "name": ""

                    },

                    "loads": [{

                            "id": "1",

                            "name": "Load 1"

                        },

                        {

                            "id": "2",

                            "name": "Load 2"

                        }

                    ]

                }]

            },

            "battery_self_test_supported": {

                "devices": [{

                    "id": 1,

                    "name": ""

                }]

            },

            "enable_online_mode_supported": {},

            "ramp_supported": {

                "devices": [{

                    "id": 1,

                    "name": ""

                }]

            },

            "restart_device_supported": {

                "devices": [{

                    "id": 1,

                    "name": ""

                }]

            },

            "sensor_supported": {},

            "shed_supported": {

                "devices": [{

                    "id": 1,

                    "name": ""

                }]

            },

            "turn_off_device_supported": {},

            "turn_on_device_supported": {}

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

System

The System API enables retrieval of ready state, uptime and system configuration information (MAC address, serial number, Operating System, etc).

 

 

GET System Ready Status

 

Title

GET System Ready Status

URL

/api/ready

Method

GET

Success Response

{

    "data": {

        "type": "ready",

        "id": 1,

        "attributes": {

            "progress": 75,

            "system_state": "loading",

            "notifications": "started",

            "authentication": "ready",

            "node": "loading",

            "monitoring": "started",

            "log": "ready",

            "device": "loading",

            "os-config": "started",

            "network-config": "started"

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

1.  The system is ready when "system_state" is equal to  "ready"

2.  Service state could be:

·       loading, service is loading

·       started, service is started, but cannot be accessible because Node.js is not ready

·       down, service is failed to boot up

·       ready, service is ready and can be accessible via REST API

 

GET System Uptime

 

Title

GET System Uptime

URL

/api/system_uptime

Method

GET

Success Response

Code: 200
Content:

{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"system_uptime",
      "attributes":{  
         "days":"<uint32>",
         "hours":"<uint32>",
         "minutes":"<uint32>",
         "seconds":"<float>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

GET System Details

 

This API retrieves system details – MAC address, serial number, Operating System info, etc. It uses the following enums:

 

agent_type:

AGENT_TYPE_PAL_PC

AGENT_TYPE_PAL_PC

AGENT_TYPE_PANSA

AGENT_TYPE_DELTA_WEBCARD

AGENT_TYPE_SINETICA_WEBCARD

AGENT_TYPE_PAL_NETOS6

AGENT_TYPE_PAL_NETOS7

AGENT_TYPE_PANMS

AGENT_TYPE_PAL_NMC5

driver_status:

DRIVER_FILE_NORMAL

DRIVER_FILE_INTERNAL_FAILURE

DRIVER_FILE_MISSING

DRIVER_FILE_CORRUPTED

DRIVER_FILE_OUTDATED

 

 

Title

GET System Details

URL

/api/system_details

Method

GET

Success Response

Code: 200 

Content:

{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
      },
      "validation":[  
         {  
            "attribute":"os_version",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"mac",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"agent_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "AGENT_TYPE_PAL_PC",
               "AGENT_TYPE_PANSA",
               "AGENT_TYPE_DELTA_WEBCARD",
               "AGENT_TYPE_SINETICA_WEBCARD",
               "AGENT_TYPE_PAL_NETOS6",
               "AGENT_TYPE_PAL_NETOS7",
               "AGENT_TYPE_PANMS",
               "AGENT_TYPE_PAL_NMC5"
            ],
            "type":"enum"
         },
         {  
            "attribute":"card_serial",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"version",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"driver_status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "DRIVER_FILE_NORMAL",
               "DRIVER_FILE_INTERNAL_FAILURE",
               "DRIVER_FILE_MISSING",
               "DRIVER_FILE_CORRUPTED",
               "DRIVER_FILE_OUTDATED"
            ],
            "type":"enum"
         },
         {  
            "attribute":"snmp_v3_engine_id",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"energywise_api_version",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":{  
      "type":"system_details",
      "id":"system_details",
      "attributes":{  
         "os_version":"<string>",
         "mac":"<string>",
         "agent_type":"<enum, agent type>",
         "card_serial":"<string>",
         "version":"<string>",
         "driver_status":"<enum, driver file status>",
         "snmp_v3_engine_id":"<string>",
         "energywise_api_version":"<string>"
         "last_backup_date":"<datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

User Accounts

This API enables creation and management of user accounts: Local Users, SNMP Users and Remote Servers. The Local User API is used for creating, editing and deleting local users. SNMP V1/V2 and V3 API is used for creating, editing and deleting SNMP V1/V2 and V3 users, respectively. The Remote Server API API is used for creating, editing and deleting remote server users, i.e. LDAP and RADIUS.

 

Local User

 

The Local User API uses the following enums:

 

preferred_temperature_unit:

TEMPERATURE_CELSIUS

TEMPERATURE_FAHRENHEIT   (default)

 

preferred_date_format:

 DATEFORMAT_MDYYYY (default)

 DATEFORMAT_MDYY

 DATEFORMAT_MMDDYY

 DATEFORMAT_MMDDYYYY

 DATEFORMAT_YYMMDD

 DATEFORMAT_YYYY_MM_DD

 DATEFORMAT_DD_MM_YY

  

DateFormat Enum

Real Date Format

DATEFORMAT_MDYYYY

M/d/yyyy

DATEFORMAT_MDYY

M/d/yy

DATEFORMAT_MMDDYY

MM/dd/yy

DATEFORMAT_MMDDYYYY

MM/dd/yyyy

DATEFORMAT_YYMMDD

yy/MM/DD

DATEFORMAT_YYYY_MM_DD

yyyy-MM-dd

DATEFORMAT_DD_MM_YY

dd-MM-yy

 

preferred_time_format:

TIMEFORMAT_HMMSSTT (default)

TIMEFORMAT_HHMMSSTT

TIMEFORMAT_HMMSS

TIMEFORMAT_HHMMSS

 

           

TimeFormat Enum

Real Time Format

TIMEFORMAT_HMMSSTT

h:mm:ss tt

TIMEFORMAT_HHMMSSTT

hh:mm:ss tt

TIMEFORMAT_HMMSS

h:mm:ss

TIMEFORMAT_HHMMSS

hh:mm:ss

    

preferred_pressure_unit:

PRESSURE_DEFAULT

PRESSURE_BAR

PRESSURE_MPA

PRESSURE_PSI

 

GET All Local Users

 

Title

GET All Local Users

URL

/api/localusers

Method

GET

Success Response

Code: 200
Content:

{
        "meta": {
                 "id": "<request id>",
                 "constraints": {
                         "max_items": 64,
                         "min_items": 0,
                         "editable_attributes": [
                                 "name",
                                 "role",
                                 "session_timeout",
                                 "enabled",
                                 "password",
                                 "full_name",
                                 "contact",
                                 "description",
                                 "sshkey",
                                 "preferred_temperature_unit",
                                 "preferred_timezone",
                                 "preferred_language",
                                 "preferred_date_format",
                                 "preferred_time_format",
                                 "preferred_pressure_unit",
                                 "ip",
                                 "mask",
                                 "idle_timeout",
                                 "idle_timeout_enabled",
                                 "session_timeout_enabled",
                                 "password_aging_enabled",
                                 "password_aging_min_age",
                                 "password_aging_max_age"
                         ],
                         "required_attributes": [
                                 "name",
                                 "password",
                                 "role",
                                 "session_timeout_enabled",
                                 "idle_timeout_enabled"
                         ],
                         "delete_allowed": true
                 },
                 "validation": [{
                                 "attribute": "name",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 6,
                                 "max_length": 32,
                                 "pattern": "[^#\\+,\\-:~\\s][^,:\\s]*",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "password",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 8,
                                 "max_length": 32,
                                 "pattern": "[ -~]*",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "full_name",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 64,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "contact",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 64,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "description",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 64,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "enabled",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "boolean"
                         },
                         {
                                 "attribute": "role",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 1,
                                 "max_length": 32,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "sshkey",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 4096,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "preferred_timezone",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 64,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "preferred_language",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 8,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "preferred_date_format",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
                                         "DATEFORMAT_DEFAULT",
                                         "DATEFORMAT_MDYYYY",
                                         "DATEFORMAT_MDYY",
                                         "DATEFORMAT_MMDDYY",
                                         "DATEFORMAT_MMDDYYYY",
                                         "DATEFORMAT_YYMMDD",
                                         "DATEFORMAT_YYYY_MM_DD",
                                         "DATEFORMAT_DD_MMM_YY"
                                 ],
                                 "type": "enum"
                         },
                         {
                                 "attribute": "preferred_time_format",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
                                         "TIMEFORMAT_DEFAULT",
                                         "TIMEFORMAT_HMMSSTT",
                                         "TIMEFORMAT_HHMMSSTT",
                                         "TIMEFORMAT_HMMSS",
                                         "TIMEFORMAT_HHMMSS"
                                 ],
                                 "type": "enum"
                         },
                         {
                                 "attribute": "preferred_temperature_unit",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
                                         "TEMPERATURE_DEFAULT",
                                         "TEMPERATURE_CELSIUS",
                                         "TEMPERATURE_FAHRENHEIT"
                                 ],
                                 "type": "enum"
                         },
                         {
                                 "attribute": "preferred_pressure_unit",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
                                         "PRESSURE_DEFAULT",
                                         "PRESSURE_BAR",
                                         "PRESSURE_MPA",
                                         "PRESSURE_PSI"
                                 ],
                                 "type": "enum"
                         },
                         {
                                 "attribute": "ip",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 45,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "mask",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 45,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "session_timeout",
                                 "maximum": 999,
                                 "minimum": 30,
                                 "default": 360,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "integer"
                         },
                         {
                                 "attribute": "idle_timeout",
                                 "maximum": 999,
                                 "minimum": 5,
                                 "default": 60,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "integer"
                         },
                         {
                                 "attribute": "password_aging_enabled",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "boolean"
                         },
                         {
                                 "attribute": "password_aging_min_age",
                                 "maximum": 999,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "integer"
                         },
                         {
                                 "attribute": "password_aging_max_age",
                                 "maximum": 999,
                                 "minimum": 1,
                                 "default": 30,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "integer"
                         },
                         {
                                 "attribute": "idle_timeout_enabled",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "boolean"
                         },
                         {
                                 "attribute": "session_timeout_enabled",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "boolean"
                         },
                         {
                                 "attribute": "ui_settings",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 2048,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         }
                 ],
                 "count": 64
        },
        "data": [{
                 "type": "localusers",
                 "id": "<string>",
                 "attributes": {
                         "uid": "<string>",
                         "enabled": "<boolean>",
                         "name": "<string>",
                         "role_id": "<number>",
                         "role_name": "<string>",
                         "role": "<string>",
                         "session_timeout": "<number>",
                         "idle_timeout": "<number>",
                         "session_timeout_enabled": "<boolean>",
                         "idle_timeout_enabled": "<boolean>",
                         "ip": "<string>",
                         "mask": "<string>",
                         "password": "<string>",
                         "proto": "",
                         "full_name": "< string > ",
                         "contact": "< string > ",
                         "description": "< string > ",
                         "password_aging_enabled": "<boolean>",
                         "password_aging_min_age": "<number>",
                         "password_aging_max_age": "<number>",
                         "preferred_timezone": "<string>",
                         "preferred_language": "<string>",
                         "preferred_date_format": "<enum, Date Format>",
                         "preferred_time_format": "<enum, Time Format>",
                         "preferred_temperature_unit": "<enum, Temperature Unit>",
                         "preferred_pressure_unit": "<enum, Pressure Unit>"
                 }
        }]
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET One Local User

 

Title

GET One Local User

URL

/api/localusers/:userId

OR

/api/localusers/:userName

Method

GET

URL Params

/api/localusers/:userId (Default)

OR

/api/localusers/:username (using user name)

 

To use username, the following HTTP Header is required:

By: 'name'

Success Response

Code: 200
Content:

{
        "meta": {
                 "id": "<request id>",
                 "constraints": {
                         "max_items": 64,
                         "min_items": 0,
                         "editable_attributes": [
                                 "name",
                                 "role",
                                 "session_timeout",
                                 "enabled",
                                 "password",
                                 "full_name",
                                  "contact",
                                 "description",
                                 "sshkey",
                                 "preferred_temperature_unit",
                                 "preferred_timezone",
                                 "preferred_language",
                                 "preferred_date_format",
                                 "preferred_time_format",
                                 "preferred_pressure_unit",
                                 "ip",
                                 "mask",
                                 "idle_timeout",
                                 "idle_timeout_enabled",
                                 "session_timeout_enabled",
                                 "password_aging_enabled",
                                 "password_aging_min_age",
                                 "password_aging_max_age"
                         ],
                         "required_attributes": [
                                 "name",
                                 "password",
                                 "role",
                                 "session_timeout_enabled",
                                 "idle_timeout_enabled"
                         ],
                         "delete_allowed": true
                 },
                 "validation": [{
                                 "attribute": "name",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 6,
                                 "max_length": 32,
                                 "pattern": "[^#\\+,\\-:~\\s][^,:\\s]*",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "password",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 8,
                                 "max_length": 32,
                                 "pattern": "[ -~]*",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "full_name",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 64,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "contact",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 64,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "description",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 64,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "enabled",
                                 "maximum": 0,
                                  "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "boolean"
                         },
                         {
                                 "attribute": "role",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 1,
                                 "max_length": 32,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "sshkey",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 4096,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "preferred_timezone",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 64,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "preferred_language",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 8,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "preferred_date_format",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
                                         "DATEFORMAT_DEFAULT",
                                         "DATEFORMAT_MDYYYY",
                                         "DATEFORMAT_MDYY",
                                         "DATEFORMAT_MMDDYY",
                                         "DATEFORMAT_MMDDYYYY",
                                         "DATEFORMAT_YYMMDD",
                                         "DATEFORMAT_YYYY_MM_DD",
                                         "DATEFORMAT_DD_MMM_YY"
                                 ],
                                 "type": "enum"
                         },
                         {
                                 "attribute": "preferred_time_format",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
                                         "TIMEFORMAT_DEFAULT",
                                         "TIMEFORMAT_HMMSSTT",
                                         "TIMEFORMAT_HHMMSSTT",
                                         "TIMEFORMAT_HMMSS",
                                         "TIMEFORMAT_HHMMSS"
                                 ],
                                 "type": "enum"
                         },
                         {
                                 "attribute": "preferred_temperature_unit",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                  "pattern": "",
                                 "enum": [
                                         "TEMPERATURE_DEFAULT",
                                         "TEMPERATURE_CELSIUS",
                                         "TEMPERATURE_FAHRENHEIT"
                                 ],
                                 "type": "enum"
                         },
                         {
                                 "attribute": "preferred_pressure_unit",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
                                         "PRESSURE_DEFAULT",
                                         "PRESSURE_BAR",
                                         "PRESSURE_MPA",
                                         "PRESSURE_PSI"
                                 ],
                                 "type": "enum"
                         },
                         {
                                 "attribute": "ip",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 45,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "mask",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 45,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         },
                         {
                                 "attribute": "session_timeout",
                                 "maximum": 999,
                                 "minimum": 30,
                                 "default": 360,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "integer"
                         },
                         {
                                 "attribute": "idle_timeout",
                                 "maximum": 999,
                                 "minimum": 5,
                                 "default": 60,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "integer"
                         },
                         {
                                 "attribute": "password_aging_enabled",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "boolean"
                         },
                         {
                                 "attribute": "password_aging_min_age",
                                 "maximum": 999,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "integer"
                         },
                         {
                                 "attribute": "password_aging_max_age",
                                 "maximum": 999,
                                 "minimum": 1,
                                 "default": 30,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "integer"
                         },
                         {
                                 "attribute": "idle_timeout_enabled",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "boolean"
                         },
                         {
                                 "attribute": "session_timeout_enabled",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 0,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "boolean"
                         },
                         {
                                 "attribute": "ui_settings",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 0,
                                 "max_length": 2048,
                                 "pattern": "",
                                 "enum": [
 
                                 ],
                                 "type": "string"
                         }
                 ],
                 "count": 64
        },
        "data": {
                 "type": "localusers",
                 "id": "<string>",
                 "attributes": {
                         "uid": "<string>",
                         "enabled": "<boolean>",
                         "name": "<string>",
                         "role_id": "<number>",
                         "role_name": "<string>",
                         "role": "<string>",
                         "session_timeout": "<number>",
                         "idle_timeout": "<number>",
                         "session_timeout_enabled": "<boolean>",
                         "idle_timeout_enabled": "<boolean>",
                         "ip": "<string>",
                         "mask": "<string>",
                         "password": "<string>",
                         "proto": "",
                         "full_name": "< string > ",
                         "contact": "< string > ",
                         "description": "< string > ",
                         "password_aging_enabled": "<boolean>",
                         "password_aging_min_age": "<number>",
                         "password_aging_max_age": "<number>",
                         "preferred_timezone": "<string>",
                         "preferred_language": "<string>",
                         "preferred_date_format": "<enum, Date Format>",
                         "preferred_time_format": "<enum, Time Format>",
                         "preferred_temperature_unit": "<enum, Temperature Unit>",
                         "preferred_pressure_unit": "<enum, Pressure Unit>"
                 }
        }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete One Local User

 

Title

Delete One Local User

URL

/api/localusers/:userId (Default)

OR

/api/localusers/:username (using user name)

Method

DELETE

URL Params

/api/localusers/:userId (Default)

OR

/api/localusers/:username (using user name)

 

To use username, the following HTTP Header is required:

By: 'name'

 

Required:

userId=[string]
example: userId=1

OR:

username=[string]
example: username=localadmin

Success Response

{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"localusers",
      "id":"<string, deleted user id>",
      "attributes":{  
         "response":0
      }
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete Mutiple Local Users

 

Title

Delete Mutiple Local Users

URL

/api/localusers

Method

DELETE

Data Params

{
  "data": [
    { "type": "localusers", "id": "<string, user id>" },
    { "type": "localusers", "id": "<string, user id>" }
  ]
}

Success Response

Code: 200 
Content: 
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "data":[  
         {  
            "type":"localusers",
            "id":"<string, user id>"
         },
         {  
            "type":"localusers",
            "id":"<string, user id>"
         },
         {  
            "type":"localusers",
            "id":"<string, user id>"
         }
      ]
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Create Local User

 

Title

Create Local User

URL

/api/localusers

Method

POST

Data Params

{  
   "data":{  
      "type":"localusers",
      "attributes":{  
         "name":"<name>",
         "role_name":"<string – valid role name>",
         "password":"<string>",
         "enabled":"<boolean>",
         "full_name":"<string>",
         "contact":"<string>",
         "description":"<string>",
         "ip":"<string>",
         "mask":"<string>",
         "session_timeout":"<uint32>",
         "idle_timeout":"<uint32>",
         "session_timeout_enabled":"<boolean>",
         "idle_timeout_enabled":"<boolean>",
         "password_aging_enabled":"<boolean>",
         "password_aging_min_age":"<uint64>",
         "password_aging_max_age":"<uint64>"
      }
   }
}

Success Response

Code: 201 
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"localusers",
      "id":"<string, id of the new user>",
      "attributes":{  
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update Local User

 

Title

Update Local User

URL

/api/localusers/:userId (Default)

OR

/api/localusers/:username (using user name)

Method

PATCH

URL Params

/api/localusers/:userId (Default)

OR

/api/localusers/:username (using user name)

 

To use username, the following HTTP Header is required:

By: 'name'

 

Required:

userId=[string]
example: userId=1

OR:

username=[string]
example: username=localadmin

Data Params

{  
   "data":{  
      "type":"localusers",
      "attributes":{  
         "name":"<string>",
         "password":"<string>",
         "enabled":"<boolean>",
         "role_name":"<string valid role name>",
         "full_name":"<string>",
         "contact":"<string>",
         "description":"<string>",
         "ip":"<string>",
         "mask":"<string>",
         "session_timeout":"<uint32>",
         "idle_timeout":"<uint32>",
         "session_timeout_enabled":"<boolean>",
         "idle_timeout_enabled":"<boolean>",
         "password_aging_enabled":"<boolean>",
         "password_aging_min_age":"<uint64>",
         "password_aging_max_age":"<uint64>"
      }
   }
}

Success Response

Code: 200
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"localusers",
      "id":"<string, updated user id>",
      "attributes":{  
         "response":0
      }
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

SNMP V1/V2C Users

 

The SNMPV1/V2C API endpoint enables creation and management ofg SNMP V1/V2 users. It uses the following enums:

 

proto:

SNMP_PROTOCOL_V1

SNMP_PROTOCOL_V2

SNMP_PROTOCOL_V3

SNMP_PROTOCOL_NONE

 

GET All SNMPV1/V2C Users

 

Title

GET All SNMPv1/v2c Users

URL

/api/snmpv1v2users

Method

GET

Success Response

Code: 200
Content:
{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "community",
            "role",
            "proto",
            "enabled",
            "ip",
            "mask",
            "contact",
            "description"
         ],
         "required_attributes":[  
            "name",
            "community",
            "proto"
         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":6,
            "max_length":32,
            "pattern":"[^#\\+,\\-:~\\s][^,:\\s]*",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"community",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":6,
            "max_length":32,
            "pattern":"[ -~]*",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"ip",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":45,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"mask",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":45,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"contact",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"description",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":[  
      {  
         "type":"snmpv1v2users",
         "id":"<string, user id>",
         "attributes":{  
            "uid":"<string, user id>",
            "proto":"<enum SNMPProto>",
            "name":"<string>",
            "role":"<enum role>",
            "enabled":"<boolean>",
            "ip":"<string>",
            "mask":"<string>",
            "contact":"<string>",
            "description":"<string>"
         }
      }
   ]
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET One SNMPV1/V2c User

 

Title

GET One SNMPv1/v2c User

URL

/api/snmpv1v2users/:userId

OR

/api/snmpv1v2users/:userName

Method

GET

URL Params

/api/snmpv1v2users /:userId (Default)

OR

/api/snmpv1v2users /:username (using user name)

 

To use username, the following HTTP Header is required:

By: 'name'

Success Response

Code: 200 
Content: 
{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "community",
            "role",
            "proto",
            "enabled",
            "ip",
            "mask",
            "contact",
            "description"
         ],
         "required_attributes":[  
            "name",
            "community",
            "proto"
         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":6,
            "max_length":32,
            "pattern":"[^#\\+,\\-:~\\s][^,:\\s]*",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"community",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":6,
            "max_length":32,
            "pattern":"[ -~]*",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"ip",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":45,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"mask",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":45,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"contact",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"description",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":{  
      "type":"snmpv1v2users",
      "id":"<string, user id>",
      "attributes":{  
         "uid":"<string, user id>",
         "proto":"<enum SNMPProto>",
         "name":"<string>",
         "role":"<enum role>",
         "enabled":"<boolean>",
         "ip":"<string>",
         "mask":"<string>",
         "contact":"<string>",
         "description":"<string>"
      }
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete One SNMPV1/V2C Local User

 

Title

Delete One SNMPV1/V2C

URL

/api/snmpv1v2users/:userId (Default)

OR

/api/snmpv1v2users/:username (using user name)

Method

DELETE

URL Params

/api/snmpv1v2users/:userId (Default)

OR

/api/snmpv1v2users/:username (using user name)

 

To use username, the following HTTP Header is required:

By: 'name'

 

Required:

userId=[string]
example: userId=1

OR:

username=[string]
example: username=localadmin

Success Response

Code: 200 
Content: 
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmpv1v2users",
      "id":"<string, deleted user id>",
      "attributes":{  
         "response":0
      }
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete Mutiple SNMPV1/V2c Users

 

Title

Delete Mutiple SNMPV1/V2c Users

URL

/api/snmpv1v2users

Method

DELETE

Data Params

{
  "data": [
    { "type": "snmpv1v2users", "id": "<string, user id>" },
    { "type": "snmpv1v2users", "id": "<string, user id>" }
  ]
}

Success Response

Code: 200 
Content: 
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "data":[  
         {  
            "type":"snmpv1v2users",
            "id":"<string, successfully deleted id>"
         },
         {  
            "type":"snmpv1v2users",
            "id":"<string, successfully deleted id>"
         }
      ]
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

In case of partial success, the response shall include a list of successfully deleted ids and an errors object with error details.
Code: <HTTP Error Code> 
Content: 
{  
   "meta":{  
      "id":"<request id>"
   },
   "errors":[  
      {  
         "code":"<number, HTTP Error Code>",
         "status":"<string, HTTP Status>",
         "title":"<string, error message>"
      }
   ],
   "data":[  
      {  
         "type":"snmpv1v2users",
         "id":"<string, successfully deleted id>"
      },
      {  
         "type":"snmpv1v2users",

·                "id":"<string, successfully deleted id>"
      }
   ]
}

 

Create SNMPV1/V2c User

 

Title

Create SNMPv1/v2c User

URL

/api/snmpv1v2users

Method

POST

URL Params

/api/snmpv1v2users

Data Params

{  
   "data":{  
      "type":"snmpv1v2users",
      "attributes":{  
         "proto":"<SNNMPProto enum>",
         "community":"<string>",
         "name":"<string>",
         "role":"<enum Role>",
         "enabled":"<boolean>",
         "ip":"<string>",
         "mask":"<string>",
         "contact":"<string>",
         "description":"<string>"
      }
   }
}

Success Response

Code: 201 
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmpv1v2users",
      "id":"<string, new user id>",
      "attributes":{  
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update SNMPV1/V2c User

 

Title

Update SNMPv1/v2c user

URL

/api/snmpv1v2users/:userId (Default)

OR

/api/snmpv1v2users/:username (using user name)

Method

PATCH

URL Params

/api/snmpv1v2users/:userId (Default)

OR

/api/snmpv1v2users/:username (using user name)

 

To use username, the following HTTP Header is required:

By: 'name'

 

Required:

userId=[string]
example: userId=1

OR:

username=[string]
example: username=localadmin

Data Params

{  
   "data":{  
      "type":"snmpv1v2users",
      "attributes":{  
         "community":"<string>",
         "name":"<string>",
         "role_name":"<String valid Role Name or role_id (int)>",
         "enabled":"<boolean>",
         "ip":"<string>",
         "mask":"<string>",
         "contact":"<string>",
         "description":"<string>"
      }
   }
}

Success Response

Code: 200
Content:
{  
   "meta":{
      "id":"<request id>"
   },
   "data":{  
      "type":"snmpv1v2users",
      "id":"<string, updated user id>",
      "attributes":{  
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

SNMPV3 Users

 

This API enables creation and management of SNMP V3 users. It uses the following enums: 

 

proto:

SNMP_PROTOCOL_V1

SNMP_PROTOCOL_V2

SNMP_PROTOCOL_V3

SNMP_PROTOCOL_NONE

 

auth_proto:

SNMPV3_AUTH_NO_AUTH_NO_PRIV

SNMPV3_AUTH_AUTH_NOPRIV

SNMPV3_AUTH_AUTH_PRIV

 

priv_proto:

SNMPV3_PRIV_PROTO_DES

SNMPV3_PRIV_PROTO_AES

SNMPV3_AUTH_PROTO_MD5

SNMPV3_AUTH_PROTO_SHA

 

GET All SNMPV3 Users

 

Title

GET All SNMPV3 Users

URL

/api/snmpv3users

Method

GET

Success Response

Code: 200 
Content:
{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "contact",
            "description",
            "enabled",
            "role",
            "method",
            "auth_proto",
            "priv_proto",
            "auth_password",
            "priv_password",
            "ip",
            "mask"
         ],
         "required_attributes":[  
            "name",
            "role",
            "method"
         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":6,
            "max_length":32,
            "pattern":"[^#\\+,\\-:~\\s][^,:\\s]*",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"contact",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"description",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"auth_password",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":8,
            "max_length":32,
            "pattern":"[ -~]*",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"priv_password",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":8,
            "max_length":32,
            "pattern":"[ -~]*",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"ip",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":45,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"mask",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":45,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":{  
      "type":"snmpv3users",
      "id":"<string, user id>",
      "attributes":{  
         "uid":"<string, user id>",
         "enabled":"<boolean>",
         "name":"<string>",
         "role_name":"<String valid role name or role_id (int)>",
         "method":"<enum SNMPV3Auth>",
         "auth_proto":"<enum SNMPAuthProto>",
         "priv_proto":"<enum SNMPPrivProto>",
         "empty_auth_password":"<boolean>",
         "empty_priv_password":"<boolean>",
         "proto":"SNMP_PROTOCOL_V3",
         "contact":"<string>",
         "description":"<string>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Get One SNMP V3 User

 

Title

Get One SNMP V3 User

URL

/api/snmpv3users/:userId

OR

/api/snmpv3users/:userName

Method

GET

URL Params

/api/snmpv3users/:userId (Default)

OR

/api/snmpv3users/:username (using user name)

 

To use username, the following HTTP Header is required:

By: 'name'

Success Response

Code: 200 
Content:
{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "contact",
            "description",
            "enabled",
            "role",
            "method",
            "auth_proto",
            "priv_proto",
            "auth_password",
            "priv_password",
            "ip",
            "mask"
         ],
         "required_attributes":[  
            "name",
            "role",
            "method"
         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":6,
            "max_length":32,
            "pattern":"[^#\\+,\\-:~\\s][^,:\\s]*",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"contact",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"description",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"auth_password",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":8,
            "max_length":32,
            "pattern":"[ -~]*",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"priv_password",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":8,
            "max_length":32,
            "pattern":"[ -~]*",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"ip",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":45,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"mask",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":45,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":{  
      "type":"snmpv3users",
      "id":"<string, user id>",
      "attributes":{  
         "uid":"<string, user id>",
         "enabled":"<boolean>",
         "name":"<string>",
         "role":"<enum role>",
         "method":"<enum SNMPV3Auth>",
         "auth_proto":"<enum SNMPAuthProto>",
         "priv_proto":"<enum SNMPPrivProto>",
         "empty_auth_password":"<boolean>",
         "empty_priv_password":"<boolean>",
         "proto":"SNMP_PROTOCOL_V3",
         "contact":"<string>",
         "description":"<string>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete One SNMPV3 User

 

Title

Delete One SNMPV3 User

URL

/api/snmpv3users/:userId (Default)

OR

/api/snmpv3users/:username (using user name)

Method

DELETE

URL Params

/api/snmpv3users/:userId (Default)

OR

/api/snmpv3users/:username (using user name)

 

To use username, the following HTTP Header is required:

 

By: 'name'

 

Required:

userId=[string]
example: userId=1

OR:

username=[string]
example: username=localadmin

Success Response

Code: 200 
Content: 
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmpv3users",
      "id":"<string, deleted user id>",
      "attributes":{  
         "response":0
      }
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete Mutiple SNMP V3 Users

 

Title

Delete Mutiple SNMP V3 Users

URL

/api/localusers

Method

DELETE

Data Params

{
  "data": [
    { "type": "snmpv3users", "id": "<string, user id>" },
    { "type": "snmpv3users", "id": "<string, user id>" }
  ]
}

Success Response

Code: 200 
Content: 
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "data":[  
         {  
            "type":"snmpv3users",
            "id":"<string, successfully deleted id>"
         },
         {  
            "type":"snmpv3users",
            "id":"<string, successfully deleted id>"
         }
      ]
   }
}

Sample Call

curl -i
-H "Accept: application/vnd.api+json" http://localhost:3001/api/accounting

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

In case of partial success, the response shall include a list of successfully deleted ids and an errors object with error details.
Code: <HTTP Error Code> 
Content: 
{  
   "meta":{  
      "id":"<request id>"
   },
   "errors":[  
      {  
         "code":"<number, HTTP Error Code>",
         "status":"<string, HTTP Status>",
         "title":"<string, error message>"
      }
   ],
   "data":[  
      {  
         "type":"snmpv3users",
         "id":"<string, successfully deleted id>"
      },
      {  
         "type":"snmpv3users",

·                "id":"<string, successfully deleted id>"
      }
   ]
}

 

Create SNMPV3 User

 

Title

Create SNMPv3 User

URL

/api/snmpv3users

Method

POST

Data Params

{  
   "data":{  
      "type":"snmpv3users",
      "attributes":{  
         "enabled":"<boolean>",
         "name":"<string>",
         "role":"<enum role>",
         "method":"<enum SNMPV3Auth>",
         "auth_proto":"<enum SNMPAuthProto>",
         "priv_proto":"<enum SNMPPrivProto>",
         "auth_password":"<string>",
         "priv_password":"<string>",
         "contact":"<string>",
         "description":"<string>"
      }
   }
}

Success Response

Code: 201 
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmpv3users",
      "id":"<string, new user id>",
      "attributes":{  
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update SNMPV3 User

 

Title

Update SNMPV3 User

URL

/api/snmpv3users/:userId (Default)

OR

/api/snmpv3users/:username (using user name)

Method

PATCH

URL Params

/api/snmpv3users/:userId (Default)

OR

/api/snmpv3users/:username (using user name)

 

To use username, the following HTTP Header is required:

By: 'name'

 

Required:

userId=[string]
example: userId=1

OR:

username=[string]
example: username=localadmin

Data Params

{  
   "data":{  
      "type":"snmpv3users",
      "attributes":{  
         "enabled":"<boolean>",
         "name":"<string>",
         "role_name":"<String valid role name>",
         "method":"<enum SNMPV3Auth>",
         "auth_proto":"<enum SNMPAuthProto>",
         "priv_proto":"<enum SNMPPrivProto>",
         "auth_password":"<string>",
         "priv_password":"<string>",
         "contact":"<string>",
         "description":"<string>"
      }
   }
}

Success Response

Code: 200

Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmpv3users",
      "id":"<string, updated user id>",
      "attributes":{  
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Change Password

 

The Change Password API enables changing the login password.

 

 

Title

Change Password

URL

/api/password/:userId (Default)

OR

/api/password/:username (using user name)

Method

PATCH

URL Params

/api/password/:userId (Default)

OR

/api/password/:username (using user name)

 

To use username, the following HTTP Header is required:

By: 'name'

 

Required:

userId=[string]
example: userId=1

OR:

username=[string]
example: username=localadmin

Data Params

{  
   "data":{  
      "type":"password",
      "attributes":{  
         "old_password":"<string>",
         "new_password":"<string>"
      }
   }
}

Success Response

Code: 200 

Content: 

{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"password",
      "id":"<string, user id>",
      "attributes":{  
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

AAA Schemes Settings

 

Th AAA Schemes API enables setting the preferred Accounting and AuthorizationScheme. The available options are listed in the following enums:

 

accounting_scheme or authorization_scheme:

AAA_SCHEME_LOCAL_ONLY

AAA_SCHEME_REMOTE_ONLY

AAA_SCHEME_LOCAL_THEN_REMOTE

AAA_SCHEME_REMOTE_THEN_LOCAL

 

Get AAA Schemes Settings

 

Title

Get Accounting and Authorization Scheme

URL

/api/security/aaa

Method

GET

Success Response

Code: 200 

Content: 

{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "authorization_scheme",
            "accounting_scheme"
         ],
         "required_attributes":[  

         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"authorization_scheme",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "AAA_SCHEME_LOCAL_ONLY",
               "AAA_SCHEME_REMOTE_ONLY",
               "AAA_SCHEME_LOCAL_THEN_REMOTE",
               "AAA_SCHEME_REMOTE_THEN_LOCAL"
            ],
            "type":"enum"
         },
         {  
            "attribute":"accounting_scheme",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "AAA_SCHEME_LOCAL_ONLY",
               "AAA_SCHEME_REMOTE_ONLY",
               "AAA_SCHEME_LOCAL_THEN_REMOTE",
               "AAA_SCHEME_REMOTE_THEN_LOCAL"
            ],
            "type":"enum"
         }
      ]
   },
   "data":{  
      "type":"aaa",
      "id":"<id>",
      "attributes":{  
         "authorization_scheme":"<enum, AAA scheme>",
         "accounting_scheme":"<enum, AAA scheme>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Remote Servers

 

The Remote Servers API enables creation and configuration of Accounting and Authorization servers (RADIUS and LDAP). It uses the following enums:

 

schema:

RADIUS_AUTH_PAP

RADIUS_AUTH_CHAP

RADIUS_AUTH_MS_CHAP

 

server_type:

SERVER_TYPE_LDAP

SERVER_TYPE_RADIUS

 

ldap_type:

LDAP_TYPE_OPEN_LDAP

LDAP_TYPE_MS_ACTIVE_DIRECTORY

 

last_test_status:

TEST_STATUS_UNSPECIFIED

TEST_STATUS_NOT_TESTED

TEST_STATUS_SUCCESS

TEST_STATUS_FAIL

 

Get All Accounting and Authorization Servers

 

This API retrieves the information of all configured Accounting and Authorization servers

 

Title

Get All Accounyting and Authorization Servers

URL

/api/security/aaa_servers

Method

GET

URL Params

additive filters supported by device_id, device_name, group, purpose, parents, keywords

Get all aaa_servers by server_type

/api/security/aaa_servers?filter[server_type]=SERVER_TYPE_LDAP - Returns only LDAP

/api/security/aaa_servers?filter[server_type]=SERVER_TYPE_RADIUS - Returns only RADIUS

 

Data Params

 

Success Response

Code: 200 

Content: 

{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":4,
         "min_items":0,
         "editable_attributes":[  
            "status",
            "name",
            "host",
            "accounting_port",
            "authorization_port",
            "authorization_enabled",
            "accounting_enabled",
            "priority",
            "anonymous_bind",
            "password",
            "server_type",
            "schema",
            "ldap_type",
            "bind_dn",
            "search_base_dn",
            "name_attribute",
            "entry_object_class",
            "search_subfilter",
            "ad_domain"
         ],
         "required_attributes":[  
            "status",
            "name",
            "host",
            "priority",
            "server_type"
         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"host",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"authorization_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"accounting_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"authorization_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"accounting_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"priority",
            "maximum":100,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"anonymous_bind",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"password",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"server_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"enum"
         },
         {  
            "attribute":"schema",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"enum"
         },
         {  
            "attribute":"ldap_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"enum"
         },
         {  
            "attribute":"bind_dn",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":255,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"search_base_dn",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":128,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"name_attribute",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"entry_object_class",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"search_subfilter",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"ad_domain",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":[  
      {  
         "type":"aaa_servers",
         "id":"<string, server id>",
         "attributes":{  
            "uid":"<string, server id>",
            "status":"<boolean>",
            "name":"<string>",
            "host":"<string>",
            "authorization_port":"<uint32>",
            "priority":"<uint32>",
            "server_type":"<enum, Server Type>",
            "last_test_status":"<enum, Test Status>",
            "last_test_message":"<string>",
            "last_test_timestamp":"<number, in MS>",

// For Radius only:

            "schema":"<enum, Radius Auth Schema>",
            "authorization_enabled":"<boolean>",
            "accounting_enabled":"<boolean>",
            "accounting_port":"<uint32>",

// For LDAP only:

            "ldap_type":"<enum, LDAP Type>",
            "anonymous_bind":"<boolean>",
            "bind_dn":"<string>",
            "search_base_dn":"<string>",
            "name_attribute":"<string>",
            "entry_object_class":"<string>",
            "search_subfilter":"<string>",
            "ad_domain":"<string>"
         }
      }
   ]
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Get ONE Accounting and Authorization Server

 

This API retrieves the information of a specific Accounting and Authorization server based on ID or name.

 

Title

Get ONE Accounting and Authorization Server

URL

/api/security/aaa_servers/:serverId (Default)

OR

/api/security/aaa_servers/:serverName (using user name)

Method

PATCH

URL Params

/api/security/aaa_servers/:serverId (Default)

OR

/api/security/aaa_servers/:serverName (using user name)

 

To use serverName, the following HTTP Header is required:

By: 'name'

 

Required:

serverId =[int]
example: serverId=1

OR:

serverName=[string]
example: serverName=server1

Success Response

Code: 200 

Content: 

{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":4,
         "min_items":0,
         "editable_attributes":[  
            "status",
            "name",
            "host",
            "accounting_port",
            "authorization_port",
            "authorization_enabled",
            "accounting_enabled",
            "priority",
            "anonymous_bind",
            "password",
            "server_type",
            "schema",
            "ldap_type",
            "bind_dn",
            "search_base_dn",
            "name_attribute",
            "entry_object_class",
            "search_subfilter",
            "ad_domain"
         ],
         "required_attributes":[  
            "status",
            "name",
            "host",
            "priority",
            "server_type"
         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"host",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"authorization_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"accounting_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"authorization_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"accounting_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"priority",
            "maximum":100,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"anonymous_bind",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"password",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"server_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"enum"
         },
         {  
            "attribute":"schema",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"enum"
         },
         {  
            "attribute":"ldap_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"enum"
         },
         {  
            "attribute":"bind_dn",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":255,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"search_base_dn",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":128,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"name_attribute",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"entry_object_class",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"search_subfilter",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"ad_domain",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":{  
         "type":"aaa_servers",
         "id":"<string, server id>",
         "attributes":{  
            "uid":"<string, server id>",
            "status":"<boolean>",
            "name":"<string>",
            "host":"<string>",
            "authorization_port":"<uint32>",
            "priority":"<uint32>",
            "server_type":"<enum, Server Type>",
            "last_test_status":"<enum, Test Status>",
            "last_test_message":"<string>",
            "last_test_timestamp":"<number, in MS>",

// For Radius only:

            "schema":"<enum, Radius Auth Schema>",
            "authorization_enabled":"<boolean>",
            "accounting_enabled":"<boolean>",
            "accounting_port":"<uint32>",

// For LDAP only:

            "ldap_type":"<enum, LDAP Type>",
            "anonymous_bind":"<boolean>",
            "bind_dn":"<string>",
            "search_base_dn":"<string>",
            "name_attribute":"<string>",
            "entry_object_class":"<string>",
            "search_subfilter":"<string>",
            "ad_domain":"<string>"
         }
      }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 


 

APPENDIX A

HTTP ERROR CODES & ERROR RESPONSE

 

HTTP Code

HTTP Description

Details

200

OK

The request was completed successfully

400

Bad Request

The request was not understood by the server. e.g. improper syntax

401

Unauthorized

The request did not include an authentication token or the token was expired

403

Forbidden

The user did not have permission to access the requested entity

404

Not Found

The server could not locate the requested entity

409

Conflict

The request could not be completed due to a conflict; for example, attempting to create a user with a name that already exists

412

Precondition Failed

The request did not meet a pre-condition; for example, attempting to delete a role that is in use

422

Unprocessable Entity

The server was not able to process the instructions contained in the request

429

Too Many Requests

Excessive requests were sent in a given time period

499

Client Closed Request

The connection was closed while the server was processing a request

500

Internal Server Error

The request was not completed due to an internal error on the server side.

501

Not Implemented

The server lacks the functionality required to fulfill the request

503

Service Unavailable

The server was unavailable

504

Gateway Timeout

The server did not receive a timely response from the upstream server

 

{

  "errors": [

    {

      "code": <http code, e.g: 400>,

      "status": <http status string, e.g: 'Bad Request'>,

      "title": <general error message>,

      "detail": <detail error message>

     }

  ]

}

APPENDIX B

API Validation Metadata

 

Keyword

Description

attribute

Name of attribute in the JSON API "data/attributes" section that validation rules applied to.

multipleOf

The value of "multipleOf" MUST be a number, strictly greater than 0.A numeric instance is valid only if division by this keyword's value results in an integer.

maximum

The value of "maximum" MUST be a number, representing an inclusive upper limit for a numeric instance.If the instance is a number, then this keyword validates only if the instance is less than or exactly equal to "maximum".

minimum

The value of "minimum" MUST be a number, representing an inclusive upper limit for a numeric instance.If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to "minimum".

maxLength

The value of this keyword MUST be a non-negative integer. A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. The length of a string instance is defined as the number of its characters as defined by RFC 7159 [RFC7159].

minLength

The value of this keyword MUST be a non-negative integer. A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. The length of a string instance is defined as the number of its characters as defined by RFC 7159 [RFC7159]. Omitting this keyword has the same behavior as a value of 0.

pattern

The value of this keyword MUST be a string. This string SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect.A string instance is considered valid if the regular expression matches the instance successfully. Recall: regular expressions are not implicitly anchored.

enum

The value of this keyword MUST be an array. This array SHOULD have at least one element. Elements in the array SHOULD be unique.An instance validates successfully against this keyword if its value is equal to one of the elements in this keyword's array value.Elements in the array might be of any value, including null.

type

The value of this keyword MUST be one of the following types ( "boolean", "object", "array", "number", or "string", "enum", "float","integer") which matches any number with a zero fractional part. An instance validates if and only if the instance is in any of the sets listed for this keyword.