AutoAction endpoints
/autoactions
Gets a list of all active and inactive AutoActions.
GET http://unravel-host
:3000/api/v1/autoactions?enabled={boolean}
None.
Required parameters are highlighted
.
Name | Type | Description | ||
---|---|---|---|---|
| boolean | Filters by active or inactive status. Valid values:
|
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.
|
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 } ]
/autoactions/metrics
Gets a list of AutoAction metrics.
GET http://unravel-host
:3000/api/v1/autoactions/metrics
None.
None.
Name | Type | Description |
---|---|---|
[no name] | array | JSON structure containing a list of metrics. |
Request:
curl -X GET "http://myserver.com:3000/api/v1/autoactions/metrics" -H "accept: application/json" -H "Authorization: JWT token
"
Response body:
[ "appCount", "elapsedTime", "allocatedMB", "allocatedVCores", "runningContainers", "memorySeconds", "vcoreSeconds", "jobCount", "elapsedAppTime", "mapsTotal", "mapsCompleted", "reducesTotal", "reducesCompleted", "mapsPending", "mapsRunning", "reducesPending", "reducesRunning", "newReduceAttempts", "runningReduceAttempts", "failedReduceAttempts", "killedReduceAttempts", "successfulReduceAttempts", "newMapAttempts", "runningMapAttempts", "failedMapAttempts", "killedMapAttempts", "successfulMapAttempts", "badId", "connection", "ioError", "wrongLength", "wrongMap", "wrongReduce", "fileBytesRead", "fileBytesWritten", "fileReadOps", "fileLargeReadOps", "fileWriteOps", "hdfsBytesRead", "hdfsBytesWritten", "hdfsReadOps", "hdfsLargeReadOps", "hdfsWriteOps", "mapInputRecords", "mapOutputRecords", "mapOutputBytes", "mapOutputMaterializedBytes", "splitRawBytes", "combineInputRecords", "combineOutputRecords", "reduceInputGroups", "reduceShuffleBytes", "reduceInputRecords", "reduceOutputRecords", "spilledRecords", "shuffledMaps", "failedShuffle", "mergedMapOutputs", "gcTimeMillis", "cpuMilliseconds", "physicalMemoryBytes", "virtualMemoryBytes", "committedHeapBytes", "totalLaunchedMaps", "totalLaunchedReduces", "dataLocalMaps", "slotsMillisMaps", "slotsMillisReduces", "millisMaps", "millisReduces", "vcoresMillisMaps", "vcoresMillisReduces", "mbMillisMaps", "mbMillisReduces", "bytesRead", "bytesWritten", "duration", "totalDfsBytesRead", "totalDfsBytesWritten", "inputRecords", "outputRecords", "outputToInputRecordsRatio", "totalJoinInputRowCount", "totalJoinOutputRowCount", "inputPartitions", "outputPartitions", "joinInputRowCount", "joinOutputRowCount", "joinOutputToInputRowRatio" ]
/autoactions/recent_violations
Gets a list of recent AutoAction violations.
GET http://unravel-host
:3000/api/v1/autoactions/recent_violations?start_time={timestamp}&end_time={timestamp}&limit={integer}"
None.
Required parameters are highlighted
.
Name | Type | Description |
---|---|---|
| string | Starting date of date range. Format: |
| string | Ending date of date range. Format: |
| integer | Maximum number of violations to return. Default: 100 |
Name | Type | Description |
---|---|---|
[violation] | array | JSON structure containing a list of violations |
Name | Type | Description | |||
---|---|---|---|---|---|
| integer | Application type:
| |||
| string | Cluster name on which the AutAction violation occurred. | |||
| string | App Id which violated the AutoAction. | |||
| integer | Time of the violation in Unix epoch format. | |||
| string | AutoAction name assigned at creation. | |||
| string | Each violation has an entityId assigned by Unravel. | |||
| string | The user who created the AutoAction, typically admin. | |||
| string | The queue name on which the AuotAction violation occurred. |
Request:
curl -X GET "http://tnode75.unraveldata.com:3000/api/v1/autoactions/recent_violations?start_time=2019-11-01&end_time=2019-11-31&limit=1" -H "accept: application/json" -H "Authorization: JWT token
"
Response body:
[ { "entityType": 0, "clusterName": "N/A", "appId": "http://node.company.com:3000/#/app/operations/charts/impala?from=1578397319224&to=1578397919224&at=1578397619224&interval=1m", "eventTime": 1578397619224, "eventName": "Long running impala query", "entityId": "8496537073757152411", "user": "N/A", "queue": "N/A" } ]
/autoactions/recent_violations?eventType=AAVA
Gets a list of recent AutoAction violations filtered by app type.
GET http://unravel-host
:3000/api/v1/autoactions/recent_violations?eventType=AAVA?start_time={timestamp}&end_time={timestamp}&limit={integer}"
None.
Required parameters are highlighted
.
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
| string | The app's owner. | ||||||
| string | The app's Id. | ||||||
| string | The type of app. You must specify one or more of the following. Use a comma separated list to specify multiple app types.
| ||||||
| string | Starting date of date range. Format: | ||||||
| string | Ending date of date range. Format: | ||||||
| integer | Maximum number of violations to return. Default: 100 |
Name | Type | Description |
---|---|---|
[violation] | array | JSON structure containing a list of violations grouped by event type. |
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
| integer | App type.
| ||||||
| string | Cluster the violating app was on at time of violation. | ||||||
| string | Violating app's Id. This is unique to the app. | ||||||
| integer | Time the violation occurred. (Unix epoch format) | ||||||
| string | Name assigned when AutoAction was created. | ||||||
| string | An unique ID associated with the AutoAction; generated by Unravel. | ||||||
| string | Username of AutoAction's creator. | ||||||
| string | Queue the violating app was in at time of violation. |
Request:
curl -X GET "http://node.company.com:3000/api/v1/autoactions/recent_violations?start_time=2019-11-01&end_time=2019-11-31&limit=1" -H "accept: application/json" -H "Authorization: JWT token
"
Response body:
[ { "entityType": 0, "clusterName": "N/A", "appId": "http://node.company.com:3000/#/app/operations/charts/impala?from=1578397319224&to=1578397919224&at=1578397619224&interval=1m", "eventTime": 1578397619224, "eventName": "Long running impala query", "entityId": "8496537073757152411", "user": "N/A", "queue": "N/A" } ]
/autoactions/templates?is_enabled=true&is_admin=true
Gets a list of Unravel's predefined AutoAction templates.
GET http://unravel-host
:3000/api/v1/autoactions/templates?is_enabled={boolean}&is_admin=true
None.
Name | Type | Description |
---|---|---|
| boolean | This must be set to true. |
| boolean | This must be set to true. |
Name | Type | Description |
---|---|---|
[violation] | array | JSON structure containing a list of violations grouped by event type. |
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" |
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" } ]