Home

/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

enabled

boolean

Filters by active or inactive status.

Valid values:

true: Show only active AutoActions
false: Show only inactive AutoActions
Response body

Name

Type

Description

enabled

boolean

true: active AutoAction
false: inactive AutoAction

admin

boolean

Indicates an admin has access the AutoAction template. This is always true.

policy_name

string

Defined by Unravel. Default: AutoAction2.

policy_id

string

Defined by Unravel. Default: 10.

instance_id

string

An unique ID associated with the AutoAction; generated by Unravel.

name_by_user

string

AutoAction name assigned by the user who defined the AutoAction.

description_by_user

string

Description assigned by the user.

created_by

string

User who created the AutoAction.

last_edited_by

string

Last user who edited the AutoAction.

created_at

string

The time the AutoAction was created. Format: Unix epoch format.

updated_at

string

The time the AutoAction was last edited. Format: Unix epoch format.

rules

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.

scope

string

The scope the violation must take place in: User, Queue, Cluster, or App Name,

metric

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.

compare

string

>, >=, ==, <, <;=

state

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).

value

string

Value for comparision, for example, allocated memory <= 10.

actions

array

Actions to take upon violation. If no actions are specified the violation is logged.

cluster_mode

integer

Mode to use for cluster scope evaluation. The violation can only occur if it falls within the scope as defined below.

0:: Cluster scope is not being used.
1: All clusters (the cluster_list is irrelevant).
2: Only the clusters listed.
3: All clusters except the clusters listed.

cluster_list

array

List of cluster names.

cluster_transform

string

Regular expression (regex) to be used to generate names for the cluster_list. All names which match the expression are added to the cluster_list and used when evaluating the scope as defined by cluster_mode.

queue_mode

integer

Mode to use for queue scope evaluation. The violation can only occur if it falls within the scope as defined below.

0: Queue scope is not being used.
1: All queues (the queue_list is irrelevant).
2: Only the queues listed.
3: All clusters except the queues listed are considered.

queue_list

array

List of queue names.

queue_transform

integer

Regular expression (regex) to be used to generate names for the queue_list. All names which match the expression are added to the queue_list All names which match the expression are added to the cluster_list and used when evaluating the scope as defined by queue_mode.

user_mode

integer

Mode to use for user evaluation. The action is triggered for:

0: User scope is not being used.
1: All users (the user_list is irrelevant).
2: Only the users listed.
3: All users except the users listed.

user_list

array

List of user names.

user_transform

integer

Regular expression (regex) to be used to generate names for the user_list. All names which match the expression are added to the user_list and used when evaluating the scope as defined by user_mode.

app_mode

integer

Mode to use for app evaluation. The action is triggered for:

0: App scope is not being used
1: All apps (the app_listis irrelevant).
2: Only the apps listed are considered.
3: All apps except the apps listed are considered.

app_list

array

List of app names.

app_transform

integer

Regular expression (regex) to be used to generate names for the app_list. All names which match the expression are added to the user_list and used when evaluating the scope as defined by app_mode.

sustain_mode

integer

The length of time a violation must continually occur before the AutoAction is triggered, allowing time for the violator to "self correct".

0: Off.
1: On.

sustain_time

integer

Time period to use when sustain_modeis on.

time_mode

integer

The time period during which the AutoAction is active, i.e., can be triggered. It is always 2.

1: AutoAction is always active.
2: AutoAction is active daily..
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
  }
]