Home

/autoactions/templates?is_enabled=true&is_admin=true

Gets a list of Unravel's predefined AutoAction templates.

Request
GET http://unravel-host:3000/api/v1/autoactions/templates?is_enabled={boolean}&is_admin=true
Path parameters

None.

Query parameters

Name

Type

Description

is_enabled

boolean

This must be set to true.

is_admin

boolean

This must be set to true.

Response Body

Name

Type

Description

[violation]

array

JSON structure containing a list of violations grouped by event type.

Template

Name

Type

Value

admin

boolean

true

enabled

boolean

true

policy_name

string

AutoAction 2

policy_id

string

10

instance_id

string

Unique id of violation generated by Unravel.

name_by_user

string

AutoAction name, for instance Resource contention in cluster (allocated memory).

description_by_user

string

 

created_by

string

admin

last_edited_by

string

admin

created_at

integer

Time, in Unix epoch format, tempalte was cretaed.

updated_at

string

Time, in Unix epoch format, template was last edited.

rules

Note: The rules are defined based upon the purpose of the template, for example, Resource contention in cluster (allocated memory).

array

One or more rules. If more than one, the rules must be logically combined

Logical operator

AND, OR, or SAME when more than one rule

scope

string

 

metric

string

compare

string

 

state

string

value

string

actions

array

Actions to take upon violation

cluster_mode

integer

1

cluster_list

array

 

queue_mode

integer

0

queue_list

array

 

app_mode

integer

0

applist

array

 

user_mode

integer

0

user_list

array

 

sustain_mode

integer

sustain_time

integer

time_mode

integer

start_hour

integer

0

start__min

integer

0

end_hour

integer

0

end_min

integer

0

dt_zone

integer

America/Los_Angeles

tool_tip

integer

This reflect the purpose of the template. For example, "AutoAction policy for a cluster where the application running in this cluster has allocated memory exceeding the specified threshold"

Examples

Request:

curl -X GET "http://no.company.com:3000/api/v1/autoactions/templates?is_enabled=true&is_admin=true" -H "accept: application/json "Authorization: JWT token"

Response body:

[
  {
    "admin": true,
    "enabled": true,
    "policy_name": "AutoAction2",
    "policy_id": 10,
    "instance_id": "8876002422463862009",
    "name_by_user": "Resource contention in cluster (allocated memory)",
    "description_by_user": "",
    "created_by": "admin",
    "last_edited_by": "admin",
    "created_at": 1516155266280,
    "updated_at": 1516155344636,
    "rules": [
      {
        "SAME": [
          {
            "scope": "clusters",
            "metric": "allocatedMB",
            "compare": ">",
            "value": 0
          },
          {
            "scope": "clusters",
            "metric": "appCount",
            "compare": ">",
            "state": "pending",
            "value": 0
          }
        ]
      }
    ],
    "actions": [
    ],
    "cluster_mode": 1,
    "cluster_list": [
      
    ],
    "queue_mode": 0,
    "queue_list": [
      
    ],
    "app_mode": 0,
    "app_list": [
      
    ],
    "user_mode": 0,
    "user_list": [
      
    ],
    "time_mode": 0,
    "start_hour": 0,
    "start_min": 0,
    "end_hour": 0,
    "end_min": 0,
    "dt_zone": "America/Los_Angeles",
    "tooltip": "AutoAction policy for a cluster where the application running in this cluster has allocated memory exceeding the specified threshold"
  } 
]