/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 |
---|---|---|
| boolean | This must be set to true. |
| 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 | ||
---|---|---|---|---|
| boolean |
| ||
| boolean |
| ||
| string |
| ||
| string | 10 | ||
| string | Unique id of violation generated by Unravel. | ||
| string | AutoAction name, for instance Resource contention in cluster (allocated memory). | ||
| string |
| ||
| string | admin | ||
| string | admin | ||
| integer | Time, in Unix epoch format, tempalte was cretaed. | ||
| string | Time, in Unix epoch format, template was last edited. | ||
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 | |||
| string |
| ||
| string | |||
| string |
| ||
| string | |||
| string | |||
| array | Actions to take upon violation | ||
| integer | 1 | ||
| array |
| ||
| integer | 0 | ||
| array |
| ||
| integer | 0 | ||
| array |
| ||
| integer | 0 | ||
| array |
| ||
| integer | |||
| integer | |||
| integer | |||
| integer | 0 | ||
| integer | 0 | ||
| integer | 0 | ||
| integer | 0 | ||
| integer | America/Los_Angeles | ||
| 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" } ]