/autoactions
Gets a list of all active and inactive AutoActions.
Request
GET http://unravel-host
:3000/api/v1/autoactions?enabled={boolean}
Path parameters
None.
Query parameters
Required parameters are highlighted
.
Name | Type | Description | ||
---|---|---|---|---|
| boolean | Filters by active or inactive status. Valid values:
|
Response body
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
| boolean |
| ||||||
| boolean | Indicates an admin has access the AutoAction template. This is always | ||||||
| string | Defined by Unravel. Default: | ||||||
| string | Defined by Unravel. Default: | ||||||
| string | An unique ID associated with the AutoAction; generated by Unravel. | ||||||
| string | AutoAction name assigned by the user who defined the AutoAction. | ||||||
| string | Description assigned by the user. | ||||||
| string | User who created the AutoAction. | ||||||
| string | Last user who edited the AutoAction. | ||||||
| string | The time the AutoAction was created. Format: Unix epoch format. | ||||||
| string | The time the AutoAction was last edited. Format: Unix epoch format. | ||||||
| array | The AutoActions rules. When there are two or more trules are defined they are evaulated in conjunction using either AND, OR, or SAME, in other words, rule 1 AND rule2. | ||||||
Logical Operator | array | Logic operator for evaulating multiple rules. AND, OR, or SAME. See SAME logical operator for comprehensive description and example of the SAME operator. | ||||||
| string | The scope the violation must take place in: User, Queue, Cluster, or App Name, | ||||||
| string | Metric to use for comparision. You can obtain the list of available metrics using the AutoAction Metrics API or in the User Guide SAME page. | ||||||
| string | >, >=, ==, <, <;= | ||||||
| string | State the app must be in for the violation to occurr. Valid states are: new, new_saving, submitted, accepted, scheduled, allocated, allocatedSaving, launched, running, finishing, finished, killed, failed, undefined, newAny, allocatedAny, pending, and * (all). | ||||||
| string | Value for comparision, for example, allocated memory <= 10. | ||||||
| array | Actions to take upon violation. If no actions are specified the violation is logged. | ||||||
| integer | Mode to use for cluster scope evaluation. The violation can only occur if it falls within the scope as defined below.
| ||||||
| array | List of cluster names. | ||||||
| string | Regular expression (regex) to be used to generate names for the | ||||||
| integer | Mode to use for queue scope evaluation. The violation can only occur if it falls within the scope as defined below.
| ||||||
| array | List of queue names. | ||||||
| integer | Regular expression (regex) to be used to generate names for the | ||||||
| integer | Mode to use for user evaluation. The action is triggered for:
| ||||||
| array | List of user names. | ||||||
| integer | Regular expression (regex) to be used to generate names for the | ||||||
| integer | Mode to use for app evaluation. The action is triggered for:
| ||||||
| array | List of app names. | ||||||
| integer | Regular expression (regex) to be used to generate names for the | ||||||
| integer | The length of time a violation must continually occur before the AutoAction is triggered, allowing time for the violator to "self correct".
| ||||||
| integer | Time period to use when | ||||||
| integer | The time period during which the AutoAction is active, i.e., can be triggered. It is always 2.
|
Examples
Fetch active AutoActions:
curl -X GET "http://node.companh.com:3000/api/v1/autoactions?enabled=true" -H"accept: application/json" -H "accept: application/json" -H "Authorization: JWT
token
"
Response body:
[ { "enabled": true, "admin": true, "policy_name": "AutoAction2", "policy_id": 10, "instance_id": "7952742540109537242", "name_by_user": "check for queue cluster user ", "description_by_user": "", "created_by": "admin", "last_edited_by": "admin", "created_at": 1579173259517, "updated_at": 1579503284485, "rules": [ { "scope": "user",] "metric": "appCount", "compare": ">",] "state": "new",]" "value": 34 } ], "actions": [ ], "cluster_mode": 2, "cluster_list": [ "default", "QACDH63B1" ], "cluster_transform": "", "queue_mode": 2, "queue_list": [ "root.unravel", "default", "root.users.unravel" ], "queue_transform": "", "user_mode": 2, "user_list": [ "unravel@UNRAVELDATA.COM" ], "user_transform": "", "app_mode": 2, "app_list": [ "appi1" ], "app_transform": "", "sustain_mode": 0, "sustain_time": 0, "time_mode": 2 } ]