Job Management
Reminders:
- Please read Access and Authentication REST API and understand how authentication works.
- On Curl command line, don't forget to quote the URL if it contains the special char
&.
Get Job List
-
GET http://host:port/kylin/api/jobs -
URL Parameters
-
time_filter-requiredint
-
project-optionalstring, project name -
statuses-optionalstring,job status,Optional values:PENDING,RUNNING,FINISHED,ERROR,DISCARDED,STOPPED,Separate multiple values with commas -
page_offset-optionalint, offset of returned result, 0 by default -
page_size-optionalint, quantity of returned result per page, 10 by default -
sort_by-optionalstring, sort field, optional values:last_modifiedby default,project id,job_name,target_subject,create_time,total_duration -
reverse-optionalboolean, whether sort reverse, "true" by default -
key-optionalstring, filter field, support job id or object name
-
-
HTTP Header
Accept: application/vnd.apache.kylin-v4-public+jsonAccept-Language: cnContent-Type: application/json;charset=utf-8
-
Curl Request Example
curl -X GET \
'http://host:port/kylin/api/jobs?time_filter=0&page_size=1' \
-H 'Accept: application/vnd.apache.kylin-v4-public+json' \
-H 'Accept-Language: cn' \
-H 'Authorization: Basic QURNSU46S1lMSU4=' \
-H 'Content-Type: application/json;charset=utf-8' -
Response Example
{
"code":"000",
"data":{
"value":[
{
"id":"232bf69f-6cdf-4dcc-a3aa-b6ca7651e98c",
"last_modified":0,
"duration":91020,
"exec_start_time":1577764731199,
"steps":null,
"job_status":"FINISHED",
"job_name":"INDEX_BUILD",
"data_range_start":0,
"data_range_end":9223372036854775807,
"target_model":"5b54898a-dd75-4146-abbe-de77c0cf77fb",
"target_segments":[
"3344c9bb-83fa-4128-803b-e18f27b0ccf8"
],
"step_ratio":1,
"create_time":1577764730069,
"wait_time":1130,
"target_subject":"AUTO_MODEL_KYLIN_ACCOUNT_1",
"target_subject_error":false,
"project":"test",
"submitter":"ADMIN",
"exec_end_time":1577764822219,
"tag":"mark"
}
],
"offset":0,
"limit":1,
"total_size":1364
},
"msg":""
}
Operate Job
-
PUT http://host:port/kylin/api/jobs/status -
URL Parameters
-
action-requiredstring, action types for jobs. Optional values are below:RESUME, resume selected jobs from paused/error statusDISCARD, discard selected jobsPAUSE, pause selected jobsRESTART, restart selected jobs
-
project-optionalstring, project name. If onlyprojectis defined, it will operate all jobs under this project. Note:projectandjob_idscannot be empty at the same time. -
job_ids-optionalarray<string>, job id. If onlyjob_idsis defined, it will operate all jobs with those ids. Note:projectandjob_idscannot be empty at the same time. -
statuses-optionalarray<string>, filter jobs by statuses based on the filtering results ofprojectandjob_ids.PENDING, pending jobsRUNNING, running jobsFINISHED, finished jobsERROR, error jobsDISCARDED, discarded jobs
-
-
HTTP Header
Accept: application/vnd.apache.kylin-v4-public+jsonAccept-Language: cnContent-Type: application/json;charset=utf-8
-
Curl Request Example
curl -X PUT \
'http://host:port/kylin/api/jobs/status' \
-H 'Accept: application/vnd.apache.kylin-v4-public+json' \
-H 'Accept-Language: cn' \
-H 'Authorization: Basic QURNSU46S1lMSU4=' \
-H 'Content-Type: application/json;charset=utf-8' \
-d '{
"action" : "PAUSE",
"job_ids" : [
"d7e4a098-10b6-4961-85b4-9eebfe29eb25",
"80f4d168-1074-4218-875c-4c70a4334029"
],
"project" : "ssb"
}' -
Response Example
{
"code":"000",
"data":"",
"msg":""
}