Alarms

Alarms management in Carriots.

Create

Create alarm

URL: http://api.carriots.com/alarms/
HTTP method: POST

Attributes:

Attribute Description
name (mandatory) Text. 50 characters max.
Unique.
alarm name.
Example: parkingcontrol
description (optional) Text. 200 characters max.
alarm description.
Example: Temperature sensor
entity (mandatory) JSON with fileds:
"entity_type" text, one of project, service, group, asset or device
"id" text, entity id_developer
custom_data (optional) Text. 200 characters max
Custom data
Example: tag1, tag2
severity (mandatory) Integer, 1 by default
Alarm severity
Example: 3
state (mandatory) Text, one of active, acknowledged, closed or disabled Alarm state Example: closed
enabled (mandatory) Boolean. Valid values: 0, 1, true or false.
Model enabled, default true
Example: true

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2001 message: alarm persisted details:
400 Request not valid
Possible values:
- code: 4001 message: Json bad formed details:
- code: 4003 message: validation error details: {field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }
Show

Alarm show

URL: http://api.carriots.com/alarms/-- ID_developer --/
HTTP method: GET
Response: json/xml

Response codes

Code Description
200 Operation successfull
Possible values:
- Alarm JSon/xml
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid {field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }
List

Alarm list, max. 1000

URL: http://api.carriots.com/alarms/
HTTP method: GET
Response: json/xml

Parameters:

Attribute Description
name (optional) Text. 50 characters max.
Filter list result by field name.
Example: m001
custom_data (optional) Text. 50 characters max. Filter list result by field custom_data
severity (optional) Integer. Filter list result by field severity
type (optional) Text. On of control, sdk, api_rest or system Filter list result by field type
state (optional) Text, one of active, acknowledged, closed or disabled Filter list result by field state.
enabled (optional) Boolean. Valid values: 0, 1, true or false.
Filter list result by field enabled.
Example: true
owner (optional) username.
Filter list result by field owner.
Example: jlopez
updater (optional) username.
Filter list result by field updater.
Example: jlopez
created_at (optional) Timestamp.
Filter list result by field created_at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: created_at=1337009328
max (optional) Integer. Values between 1 and 1000.
Defines the number of results to be returned. Max and default value is 1000.
Example: 250
sort (optional) Field name.
Sort the result by the given field. Default value is name.
Example: creation_date
order (optional) Integer. Valid values: -1 or 1
Result order criteria: -1 for descending and 1 for ascending.
Example: -1
offset (optional) Integer.
Result offset. List will begin at the given offset.
Example: 100

Response codes

Code Description
200 Operation successfull
Possible values:
- total_documents:result numbers result: Alarm JSON objects set
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid {field: error message,...}
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }
Update

Alarm update

URL: http://api.carriots.com/alarms/-- ID_developer --/
HTTP method: PUT

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2005 message: alarm updated details:Model JSON object
400 Request not valid
Possible values:
- code: 4001 message: nonexistent file details:
- code: 4003 message: validation error details:{field: error message,...}
- code: 4004 message: format parameter invalid details:{field: error message,...}
- code: 4005 message: concurrency error details:{version: }
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }
Delete

Alarm delete

URL: http://api.carriots.com/alarms/-- ID_developer --/
HTTP method: DELETE

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2004 message: alarm deleted details:
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }