GET /api/v3/analytics_engines
List all analytics_engines

Returns a list of all analytics_engines belonging to an account as per the specified criteria. This API is paginated and returns 20 groups by default. A analytics_engine is uniquely identified by a 'analytics_engine_key'. This key should be used in all the other API referencing a particular analytics_engine.

Params

Param name Description
page
optional

Page number of results to be fetched, Default 1


Value: Must be Integer.
per
optional

Number of analytics_engine records to be returned in one page, Default 20


Value: Must be Integer.
order_by
optional

Field on which results should be sorted


Value: Must be a String
order
optional

Order, “asc” or “desc”, in which results should be sorted.


Value: Must be a String
timestamp_format
optional

Format, “str” or “int”, in which timestamps should be returned, Default “int”


Value: Must be a String
search
optional

Keywords based on which analytics_engines should be searched. Currently you can search analytics_engines on - analytics_engine_key or name


Value: Must be a String
scope
optional

Matching condition if multiple keywords are specified for search. Valid values are “all” or “any”. Default is “all”


Value: Must be a String
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
field_list
optional

List of fields required in the result.


Value: Must be an array of any type

GET /api/v3/analytics_engines/:analytics_engine_key
Fetch details of a specific analytics_engine

Returns details of the analytics_engine specified

Params

Param name Description
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request - get details of the specified analytics_engine (analytics_engine_key specified as a part of the url)
  curl -X GET -H "Content-Type:application/json" -H "X-Auth-Token:DarTKU-eUJ7md2vS-lFroA" https://datonis.altizon.com/api/v3/analytics_engines/t2514225a7

Response (details of the analytics_engine requested)
{
  "analytics_engine": {
    "enabled": true,
    "expression": "$event.data.power < 500",
    "name": "Power monitoring analytics_engine",
    "analytics_engine_applicability": 3,
    "analytics_engine_applicability_value": "27ce8667143fa217b3eb9ecbedcbacdc28addt97,16dc891e4b255735d7tafete13e6fdc412628t84",
    "analytics_engine_key": "t2514225a7",
    "analytics_engine_type": null,
    "time_between_triggers": 1800,
    "user_visible_expression": null
  }
}

POST /api/v3/analytics_engines
Create a analytics_engine

Creates a analytics_engine with given parameters

Params

Param name Description
analytics_engine
required

Map containing the details of the analytics_engine to be created


Value: Must be a Hash
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request
  curl -X POST -H "Content-Type:application/json" -H "X-Auth-Token:DarTKU-eUJ7md2vS-lFroA" -d '{"analytics_engine":{"configuration":{"iter":"10"},"description":"test1","name":"e8"}}' https://datonis.altizon.com/api/v3/analytics_engines

Response (containing details of the analytics_engine created)
{
  "analytics_engine": {
    "analytics_engine_key": "766f1f4ef8",
    "cmdline": null,
    "configuration": {
      "iter": "10"
    },
    "created_at": 1440065331,
    "description": "test1",
    "name": "e8",
    "payload": null,
    "updated_at": 1440065331
  }
}

PUT /api/v3/analytics_engines/:analytics_engine_key/add_files
Adds datonis_files to a analytics_engine

Adds specified datonis_files to specified analytics_engine

Params

Param name Description
datonis_file_keys
optional

Comma separated list of file keys to be added to the analytics_engine


Value: Must be an array of any type
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request - containing the list of datonis_files to be added
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"datonis_file_keys":["edae369ta1"]}' https://api.datonis.io/api/v3/analytics_engines/da6eff3ec7/add_files

Response (returns details of the analytics_engine with updated datonis_files)
{
  "analytics_engine": {
    "analytics_engine_key": "da6eff3ec7",
    "cmdline": "",
    "configuration": {
      "key": "value",
      "new key": "value"
    },
    "created_at": 1453890933,
    "description": "",
    "name": "engine-01",
    "updated_at": 1453964459,
    "datonis_files": [
      {
        "created_at": 1453961421,
        "datonis_file_key": "b68176t6t4",
        "description": "",
        "driver_class": "",
        "name": "mongodb-driver-3.0.2.jar",
        "type": "jar",
        "updated_at": 1453961421
      },
      {
        "created_at": 1453963406,
       ...

PUT /api/v3/analytics_engines/:analytics_engine_key/remove_files
Removes datonis_files from the analytics_engine

Removes specified datonis_files from specified analytics_engine

Params

Param name Description
datonis_file_keys
optional

Comma separated list of file keys to be removed to the analytics_engine


Value: Must be an array of any type
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request - containing the list of datonis_files to be removed
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"datonis_file_keys":["edae369ta1"]}' https://api.datonis.io/api/v3/analytics_engines/da6eff3ec7/remove_files

Response (returns details of the analytics_engine with updated datonis_files)
{
  "analytics_engine": {
    "analytics_engine_key": "da6eff3ec7",
    "cmdline": "",
    "configuration": {
      "key": "value",
      "new key": "value"
    },
    "created_at": 1453890933,
    "description": "",
    "name": "engine-01",
    "updated_at": 1453964459,
    "datonis_files": [
      {
        "created_at": 1453961421,
        "datonis_file_key": "b68176t6t4",
        "description": "",
        "driver_class": "",
        "name": "mongodb-driver-3.0.2.jar",
        "type": "jar",
        "updated_at": 1453961421
      },
      {
        "created_at": 1453963406,
       ...

PUT /api/v3/analytics_engines/:analytics_engine_key
Updates a analytics_engine

Updates the analytics_engine with given parameters

Params

Param name Description
analytics_engine
required

Map containing the details of the analytics_engine to be updated


Value: Must be a Hash
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:Ko2rILQPWNxzFj1zudWx7g" -d -d '{"analytics_engine":{"configuration":{"foo":"bar1"},"description":"test2","name":"ee", "cmdline":"$SPARK_HOME/bin/spark-submit ..."}}' https://datonis.altizon.com/api/v3/analytics_engines/89a6t97t4c

Response (containing details of the analytics_engine updated)
{
  "analytics_engine": {
    "analytics_engine_key": "89a6t97t4c",
    "cmdline": "$SPARK_HOME/bin/spark-submit ...",
    "configuration": {
      "foo": "bar1"
    },
    "created_at": 1440064473,
    "description": "test2",
    "name": "ee",
    "payload": "null",
    "updated_at": 1440066246
  }
}

DELETE /api/v3/analytics_engines/:analytics_engine_key
Deletes the specified analytics_engine

Deletes the specified analytics_engine from the system

Params

Param name Description
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request
  curl -X DELETE -H "Content-Type:application/json" -H "X-Auth-Token:Ko2rILQPWNxzFj1zudWx7g"  https://datonis.altizon.com/api/v3/analytics_engines/89a6t97t4c

Response
{
}