Job endpoints
/jobs
Gets total job count, at one hour intervals.
GET http://unravel-host
:3000/api/v1/jobs?from={timestamp}&to={timestamp}
None.
Name | Type | Description |
---|---|---|
| string | Start date. Format |
| string | End date. Format |
[ "string" ]
Request:
curl -X GET "http://http://myserver.com:3000/api/v1/jobs" -H "accept: application/json" -H "Authorization: JWT token
"
/jobs/bystatus
Gets the total job count per job type, at one hour intervals, in a given time window.
GET http://unravel-host
:3000/api/v1/jobs/bystatus?from={timestamp}&to={timestamp}
None.
Required parameters are highlighted
.
Name | Type | Description |
---|---|---|
| string | Start date. Format |
| string | End date. Format |
[ "string" ]
Request:
curl -X GET "http://http://myserver.com:3000/api/v1/jobs/bystatus" -H "accept: application/json" -H "Authorization: JWT token
"
/jobs/bytype
Gets the total job count per job type, at one hour intervals, in a given time window.
GET http://unravel-host
:3000/api/v1/jobs/bytype?from={timestamp}&to={timestamp}
None.
Required parameters are highlighted
.
Name | Type | Description |
---|---|---|
| string | Start date. Format |
| string | End date. Format |
[ "string" ]
Request:
curl -X GET "http://http://myserver.com:3000/api/v1/jobs/bytype" -H "accept: application/json" -H "Authorization: JWT token
"
/jobs/count
Gets the number of jobs in a given timeframe, grouped by state, app type, user, or queue.
GET http://unravel-host
:3000/api/v1/jobs/count?from={time}&to={time}&groupBy={category}&interval={polling_interval}
None.
Required parameters are highlighted
.
Name | Type | Description |
---|---|---|
| string | Start time in Unix epoch format. |
| string | End time in Unix epoch format. |
| string | Job category. Valid values are |
| string | Polling interval. Valid values are |
groupBy
is state
:{ "date": [epoch-timestamp
], "RUNNING": {epoch-timestamp
: average }, "ACCEPTED": {epoch-timestamp
: average } }
groupBy
is applicationType
:{ { "date" : [ // array of polling epoch-timestampepoch-timestamp
], APP_TYPE : { // APP_TYPE mr | hive | spark | pig | cascading | impala | tez // for each polling interval where the app type is runningepoch-timestamp
: count } }
groupBy
is user
:{ "date": [epoch-timestamp
], userName: {epoch-timestamp
: average } }
groupBy
is queue
:{ "date": [epoch-timestamp
], queue Name: {epoch-timestamp
: average } }
groupBy
set to state
:Request:
curl -X GET "http://myserver.com:3000/api/v1/jobs/count?to=1536275822&groupBy=state&interval=1h&from=1535671022" -H "accept: application/json" -H "Authorization: JWT token
"
Response:
{ "date": [ 1535626800000 ], "RUNNING": { "1535626800000": "1.3333333333" }, "ACCEPTED": { "1535695200000": "1" } }
groupBy
set to applicationType
:curl -X GET "http://localhost:3000/api/v1/jobs/count?to=1536280789&groupBy=applicationType&interval=1h&from=1535675989" -H "accept: application/json" -H "Authorization: JWT token
"
Response:
{ "date": [ 1535644800000, 1535695200000, 1535698800000, 1535702400000, 1535706000000, 1535709600000, 1535731200000, 1535745600000, 1535814000000, 1535817600000, 1535904000000, 1535961600000, 1535990400000, 1536030000000, 1536037200000, 1536040800000 ], "MAPREDUCE": { "1535644800000": "1", "1535695200000": "1", "1535698800000": "1", "1535702400000": "1", "1535706000000": "1", "1535709600000": "1", "1535731200000": "1", "1535745600000": "1", "1535814000000": "1", "1535817600000": "1", "1535904000000": "1", "1535961600000": "1.5", "1535990400000": "1", "1536030000000": "1", "1536037200000": "1", "1536040800000": "1.1538461539" }, "SPARK": { "1535698800000": "1" } }
groupBy
set to user
:curl -X GET "http://localhost:3000/api/v1/jobs/count?to=1536281730&groupBy=user&interval=1h&from=1535676930" -H "accept: application/json" -H "Authorization: JWT token
"
Response:
{ "date": [ 1535695200000, 1535698800000, 1535702400000, 1535706000000, 1535709600000, 1535731200000, 1535745600000, 1535814000000, 1535817600000, 1535904000000 ], "root": { "1535695200000": "1", "1535709600000": "1", "1535731200000": "1", "1535745600000": "1", "1535814000000": "1", "1535817600000": "1", "1535904000000": "1" }, "hdfs": { "1535698800000": "1", "1535702400000": "1", "1535706000000": "1" } }
groupBy
set to queue
:curl -X GET "http://localhost:3000/api/v1/jobs/count?to=1536339111&groupBy=queue&interval=1h&from=1535734311" -H "accept: application/json" -H "Authorization: JWT token
"
Response:
{ "date": [ 1535695200000, 1535698800000, 1535702400000, 1535706000000, 1535709600000, 1535731200000, 1535745600000, 1535814000000, 1535817600000, 1535904000000, 1535961600000, 1535990400000, 1536030000000, 1536037200000, 1536040800000, 1536044400000, 1536048000000, 1536051600000, 1536055200000, 1536058800000, 1536076800000 ], "root.users.root": { "1535695200000": "1", "1535709600000": "1", "1535731200000": "1", "1535745600000": "1", "1535814000000": "1", "1535817600000": "1", "1535904000000": "1", "1535961600000": "1", "1535990400000": "1", "1536030000000": "1", "1536037200000": "1", "1536040800000": "1", "1536076800000": "1" }, "root.users.hdfs": { "1535698800000": "1", "1535702400000": "1", "1535706000000": "1", "1535961600000": "2", "1536040800000": "1.1304347826", "1536044400000": "1", "1536055200000": "1.3333333333", "1536058800000": "1" }, "root.users.user11": { "1535698800000": "1" }, "root.abcdefghijklmnopqrstuvwxyz": { "1536037200000": "1", "1536040800000": "1", "1536044400000": "1" } }