当前位置:   article > 正文

Azkaban API 文档 详细讲解_azkaban installation failed. error unzipping file.

azkaban installation failed. error unzipping file.

Azkaban API 文档 详细讲解

Authenticate
Create a Project
Delete a Project
Upload a Project Zip
Fetch Flows of a Project
Fetch Jobs of a Flow
Fetch Executions of a Flow
Fetch Running Executions of a Flow
Execute a Flow
Cancel a Flow Execution
Schedule a period-based Flow (Deprecated)
Flexible scheduling using Cron
Fetch a Schedule
Unschedule a Flow
Set a SLA
Fetch a SLA
Pause a Flow Execution
Resume a Flow Execution
Fetch a Flow Execution
Fetch Execution Job Logs
Fetch Flow Execution Updates

  1. Authenticate 获取user session id
    Method: POST
    Request URL: /?action=login
    Parameter Location: Request Query String

Request Parameters
Parameter Description
action=login The fixed parameter indicating the login action.
username The Azkaban username.
password The corresponding password.

Response Object
Parameter Description
error Return an error message if the login attempt fails.
session.id Return a session id if the login attempt succeeds.

Request URL:
curl -k -X POST --data “action=login&username=azkaban&password=azkaban” https://localhost:8443
response body:
{ “session.id” : “bf8dd33b-cfc1-465a-a1c7-55edee8818f1”, “status” : “success” }

2.Create a Project 创建一个project
Method: POST
Request URL: /manager?action=create
Parameter Location: Request Query

Request Parameters
Parameter Description
session.id The user session id.
action=create The fixed parameter indicating the create project action.
name The project name to be uploaded.
description The description for the project. This field cannot be empty.

Response Object 1. (if the request succeeds):
Parameter Description
status The status of the creation attempt.
path The url path to redirect
action The action that is suggested for the frontend to execute. (This is designed for the usage of the Azkaban frontend javascripts, external users can ignore this field.)

Request URL:
curl -k -X POST --data “session.id=9089beb2-576d-47e3-b040-86dbdc7f523e&name=aaaa&description=11” https://localhost:8443/manager?action=create
response body:
{ “status”:“success”, “path”:“manager?project=aaaa”, “action”:“redirect” }

3.Delete a Project 删除一个project
Method: GET
Request URL: /manager?delete=true
Parameter Location: Request Query

Request Parameters
Parameter Description
session.id The user session id.
delete=true The fixed parameter to indicate the deleting project action.
project The project name to be deleted.

Request URL:
curl -k --get --data “session.id=bca1d75d-6bae-4163-a5b0-378a7d7b5a91&delete=true&project=test-delete-project” https://localhost:8443/manager
response body:
{}

4.Upload a Project Zip 上传一个zip文件
Method: POST
Content-Type: multipart/mixed
Request URL: /manager?ajax=upload
Parameter Location: Request Body

Request Parameters
Parameter Description
session.id The user session id.
ajax=upload The fixed parameter to the upload action.
project The project name to be uploaded.
file The project zip file. The type should be set as application/zip or application/x-zip-compressed.
Response Object
Parameter Description
error The error message if the upload attempt fails.
projectId The numerical id of the project
version The version number of the upload

Request URL:

curl -k -i -H “Content-Type: multipart/mixed” -X POST --form ‘session.id=e7a29776-5783-49d7-afa0-b0e688096b5e’ --form ‘ajax=upload’ --form ‘file=@myproject.zip;type=application/zip’ --form ‘project=MyProject;type/plain’ https://localhost:8443/manager

response body:
{ “error” : “Installation Failed.\nError unzipping file.”, “projectId” : “192”, “version” : “1” }

5.Fetch Flows of a Project 获取一个project的任务流
Method: GET
Request URL: /manager?ajax=fetchprojectflows
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.
ajax=fetchprojectflows The fixed parameter indicating the fetchProjectFlows action.
project The project name to be fetched.
Response Object
Parameter Description
project The project name.
projectId The numerical id of the project.
flows A list of flow ids. Example values: [{“flowId”: “aaa”}, {“flowId”: “bbb”}]
request URL:
curl -k --get --data “session.id=bf8dd33b-cfc1-465a-a1c7-55edee8818f1&ajax=fetchprojectflows&project=report” https://localhost:8443/manager

response body:
{ “flows” : [ { “flowId” : “mkt_report_finish” }, { “flowId” : “time_slot_18_finish” }, { “flowId” : “important_finish” }, { “flowId” : “hourly_report” }, { “flowId” : “boss_finish” }, { “flowId” : “time_slot_0_finish” }, { “flowId” : “essential_finish” }, { “flowId” : “coupon_finish” }, { “flowId” : “daily_report” }, { “flowId” : “hourly_report_fake” }, { “flowId” : “monthly_report” }, { “flowId” : “brand_daily_1430” }, { “flowId” : “competing_sale_monitor_1800” }, { “flowId” : “time_slot_13_finish” }, { “flowId” : “ltd_finish” }, { “flowId” : “normal_finish” }, { “flowId” : “competing_sale_monitor_2330” }, { “flowId” : “publish_report” } ], “project” : “report”, “projectId” : 19 }

6.Fetch Jobs of a Flow 获取一个任务流的job
Method: GET
Request URL: /manager?ajax=fetchflowgraph
Parameter Location: Request Query String

Request Parameters
Parameter Description
session.id The user session id.
ajax=fetchflowgraph The fixed parameter indicating the fetchProjectFlows action.
project The project name to be fetched.
flow The project id to be fetched.
Response Object
Parameter Description
project The project name.
projectId The numerical id of the project.
flow The flow id fetched.
nodes A list of job nodes belonging to this flow. Structure:{ “id”: “job.id” “type”: “job.type” “in”: [“job.ids that this job is directly depending upon. Indirect ancestors is not in cluded in this list”]}Example values: [{“id”: “first_job”, “type”: “java”}, {“id”: “second_job”, “type”: “command”, “in

request URL:

curl -k --get --data “session.id=bf8dd33b-cfc1-465a-a1c7-55edee8818f1&ajax=fetchflowgraph&project=report&flow=mkt_report_finish” https://localhost:8443/manager

response body:
{ “nodes” : [ { “in” : [ “product_conversion_ratio” ], “id” : “baidu_search_keyword”, “type” : “command” }, { “in” : [ “credit_wall_monitor” ], “id” : “commercial_effect_key_word_app”, “type” : “command” }, { “in” : [ “mkt_cps” ], “id” : “credit_wall_monitor”, “type” : “command” }, { “in” : [ “mkt_report_start” ], “id” : “mkt_app”, “type” : “command” }, { “in” : [ “mkt_report_start” ], “id” : “mkt_brand”, “type” : “command” }, { “in” : [ “new_client_seq” ], “id” : “mkt_cps”, “type” : “command” }, { “in” : [ “mkt_report_start” ], “id” : “mkt_info_flow”, “type” : “command” }, { “in” : [ “commercial_effect_key_word_app” ], “id” : “mkt_kpi_monitor”, “type” : “command” }, { “in” : [ “baidu_search_keyword” ], “id” : “mkt_report_finish”, “type” : “command” }, { “id” : “mkt_report_start”, “type” : “command” }, { “in” : [ “mkt_report_start” ], “id” : “mkt_search”, “type” : “command” }, { “in” : [ “mkt_app”, “mkt_brand”, “mkt_info_flow”, “mkt_search” ], “id” : “new_client_seq”, “type” : “command” }, { “in” : [ “mkt_kpi_monitor” ], “id” : “platform_conversion”, “type” : “command” }, { “in” : [ “platform_conversion” ], “id” : “product_conversion_ratio”, “type” : “command” } ], “project” : “report”, “projectId” : 19, “flow” : “mkt_report_finish” }

7.Fetch Executions of a Flow 获取一个任务流执行的情况(可选择返返回的最近十条,最早十条等)

Method: GET
Request URL: /manager?ajax=fetchFlowExecutions
Parameter Location: Request Query String

Request Parameters
Parameter Description
session.id The user session id.
ajax=fetchFlowExecutions The fixed parameter indicating the fetchFlowExecutions action.
project The project name to be fetched.
flow The flow id to be fetched.
start The start index(inclusive) of the returned list.
length The max length of the returned list. For example, if the start index is 2, and the length is 10, then the returned list will include executions of indices: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11].
Response Object
Parameter Description
executions A list of execution objects, with the resquested start index and length.
total The total number of all relevant execution
project The project name fetched.
projectId The numerical project id fetched.
flow The flow id fetched.
from The start index of the fetched executions
length The length of the fetched executions.

Request URL:

curl -k --get --data “session.id=bf8dd33b-cfc1-465a-a1c7-55edee8818f1&ajax=fetchFlowExecutions&project=report&flow=mkt_report_finish&start=0&length=3” https://localhost:8443/manager

response body:
{ “total” : 287, “executions” : [ { “submitTime” : 1537927226258, “submitUser” : “azkaban”, “startTime” : 1537927226315, “endTime” : 1537929605989, “flowId” : “mkt_report_finish”, “projectId” : 19, “execId” : 110031, “status” : “SUCCEEDED” }, { “submitTime” : 1537840825992, “submitUser” : “azkaban”, “startTime” : 1537840826042, “endTime” : 1537843396741, “flowId” : “mkt_report_finish”, “projectId” : 19, “execId” : 109735, “status” : “SUCCEEDED” }, { “submitTime” : 1537754425822, “submitUser” : “azkaban”, “startTime” : 1537754425872, “endTime” : 1537757060229, “flowId” : “mkt_report_finish”, “projectId” : 19, “execId” : 109445, “status” : “SUCCEEDED” } ], “length” : 3, “project” : “report”, “from” : 0, “projectId” : 19, “flow” : “mkt_report_finish” }

8.Fetch Running Executions of a Flow 获取一个任务流正在执行的Execution情况(一个job)
Method: GET
Request URL: /executor?ajax=getRunning
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.
ajax=getRunning The fixed parameter indicating the getRunning action.
project The project name to be fetched.
flow The flow id to be fetched.
Response Object
Parameter Description
execIds A list of execution ids fetched. Example values: [301, 302, 111, 999]

Request URL:

curl -k --data “session.id=bf8dd33b-cfc1-465a-a1c7-55edee8818f1&ajax=getRunning&project=report&flow=mkt_report_finish” https://localhost:8443/executor

response body:
{}

9.Execute a Flow 执行一个任务流
Method: GET
Request URL: /executor?ajax=executeFlow
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.Example Values: 30d538e2-4794-4e7e-8a35-25a9e2fd5 300
ajax=executeFlow The fixed parameter indicating the current ajax action is executeFlow.
project The project name of the executing flow.Example Values: run-all-jobs
flow The flow id to be executed.Example Values: test-flow
disabled (optional) A list of job names that should be disabled for this execution. Should be formatted as a JSON Array String.Example Values: [“job_name_1”, “job_name_2”, “job_name_N”]
successEmails (optional) A list of emails to be notified if the execution succeeds. All emails are delimitted with [,|;|\s+].Example Values: foo@email.com,bar@email.com
failureEmails (optional) A list of emails to be notified if the execution fails. All emails are delimitted with [,|;|\s+].Example Values: foo@email.com,bar@email.com
successEmailsOverride (optional) Whether uses system default email settings to override successEmails.Possible Values: true, false
failureEmailsOverride (optional) Whether uses system default email settings to override failureEmails.Possible Values: true, false
notifyFailureFirst (optional) Whether sends out email notifications as long as the first failure occurs.Possible Values: true, false
notifyFailureLast (optional) Whether sends out email notifications as long as the last failure occurs.Possible Values: true, false
failureAction (Optional) If a failure occurs, how should the execution behaves.Possible Values: finishCurrent, cancelImmediately, finishPossible
concurrentOption (Optional) Concurrent choices. Use ignore if nothing specifical is required.Possible Values: ignore, pipeline, skip
flowOverride[flowProperty] (Optional) Override specified flow property with specified value.Example Values : flowOverride[failure.email]=test@ gmail.com
Response Object
Parameter Description
error Error message if the call has failed
flow The executed flow id
execid The execution id

Request URL:
curl -k --get --data ‘session.id=189b956b-f39f-421e-9a95-e3117e7543c9’ --data ‘ajax=executeFlow’ --data ‘project=azkaban-test-project’ --data ‘flow=test’ https://localhost:8443/executor

Response body:
{

    message:"Execution submitted successfully with exec id 295",

    project:"foo-demo",

    flow:"test",

    execid:295
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

}

10.Cancel a Flow Execution 取消一个正在运行的任务流
Method: GET
Request URL: /executor?ajax=cancelFlow
Parameter Location: Request Query String

Request Parameters
Parameter Description
session.id The user session id.
ajax=cancelFlow The fixed parameter indicating the current ajax action is cancelFlow.
execid The execution id.

Request URL:

curl -k --data “session.id=34ba08fd-5cfa-4b65-94c4-9117aee48dda&ajax=cancelFlow&execid=302” https://localhost:8443/executor

response body:
if success:

{ }

else:

{

“error” : “Execution 302 of flow test isn’t running.”

}

11.Schedule a period-based Flow (Deprecated) 调度一个时间段的任务流

Method: POST
Request URL: /schedule?ajax=scheduleFlow
Parameter Location: Request Query String

Request Parameters
Parameter Description
session.id The user session id.
ajax=scheduleFlow The fixed parameter indicating the action is to schedule a flow.
projectName The name of the project.
projectId The id of the project. You can find this with Fetch Flows of a Project.
flowName The name of the flow.
scheduleTime(with timezone) The time to schedule the flow. Example: 12,00,pm,PDT (Unless UTC is specified, Azkaban will take current server’s default timezone instead)
scheduleDate The date to schedule the flow. Example: 07/22/2014
is_recurring=on (optional) Flags the schedule as a recurring schedule.
period (optional) Specifies the recursion period. Depends on the “is_recurring” flag being set. Example: 5w Possible Values:
M Months
w Weeks
d Days
h Hours
m Minutes
s Seconds

Request URL:

a) One time schedule 一次执行

curl -k https://HOST:PORT/schedule -d “ajax=scheduleFlow&projectName=PROJECT_NAME&flow=FLOW_NAME&projectId=PROJECT_ID&scheduleTime=12,00,pm,PDT&scheduleDate=07/22/2014” -b azkaban.browser.session.id=SESSION_ID

b) Recurring schedule 定期执行

curl -k https://HOST:PORT/schedule -d “ajax=scheduleFlow&is_recurring=on&period=5w&projectName=PROJECT_NAME&flow=FLOW_NAME&projectId=PROJECT_ID&scheduleTime=12,00,pm,PDT&scheduleDate=07/22/2014” -b azkaban.browser.session.id=SESSION_ID

response body:
if success: { “message” : “PROJECT_NAME.FLOW_NAME scheduled.”, “status” : “success” }
else : { “message” : “Permission denied. Cannot execute FLOW_NAME”, “status” : “error” }
12.Flexible scheduling using Cron 使用Cron进行灵活调度(自定义时间段)
Method: POST
Request URL: /schedule?ajax=scheduleCronFlow
Parameter Location: Request Query String

Request Parameters
Parameter Description
session.id The user session id.
ajax=scheduleCronFlow The fixed parameter indicating the action is to use cron to schedule a flow.
projectName The name of the project.
flow The name of the flow.
cronExpression A CRON expression is a string comprising 6 or 7 fields separated by white space that represents a set of times. In azkaban, we use Quartz Cron Format.

Request URL:
curl -k -d ajax=scheduleCronFlow -d projectName=wtwt -d flow=azkaban-training --data-urlencode cronExpression=“0 23/30 5,7-10 ? * 6#3” -b “azkaban.browser.session.id=XXXXXXXXXXXXXX” http://localhost:8081/schedule
Response:
if success:

{

“message” : “PROJECT_NAME.FLOW_NAME scheduled.”,

“scheduleId” : SCHEDULE_ID,

“status” : “success”

}

else:

{

“message” : “Cron expression must exist.”,

“status” : “error”

}

{

“message” : “Permission denied. Cannot execute FLOW_NAME”,

“status” : “error”

}

{

“message” : “This expression <*****> can not be parsed to quartz cron.”,

“status” : “error”

}

13.Fetch a Schedule 获取指定Project,flow下的数据流的调度

Method: GET
Request URL: /schedule?ajax=fetchSchedule
Parameter Location: Request Query String

Request Parameters
Parameter Description
session.id The user session id.
ajax=fetchSchedule The fixed parameter indicating the schedule.
projectId The id of the project.
flowId The name of the flow.

request URL:

curl -k --get --data “session.id=XXXXXXXXXXXXXX&ajax=fetchSchedule&projectId=1&flowId=test” http://localhost:8081/schedule
response body:

{ “schedule”:{ “cronExpression”:“0 * 9 ? * *”, “nextExecTime”:“2017-04-01 09:00:00”, “period”:“null”, “submitUser”:“azkaban”, “executionOptions”:{ “notifyOnFirstFailure”:false, “notifyOnLastFailure”:false, “failureEmails”:[], “successEmails”:[], “pipelineLevel”:null, “queueLevel”:0, “concurrentOption”:“skip”, “mailCreator”:“default”, “memoryCheck”:true, “flowParameters”:{ }, “failureAction”:“FINISH_CURRENTLY_RUNNING”, “failureEmailsOverridden”:false, “successEmailsOverridden”:false, “pipelineExecutionId”:null, “disabledJobs”:[] }, “scheduleId”:“3”, “firstSchedTime”:“2017-03-31 11:45:21” } }

14.Unschedule a Flow 取消数据流的调度

Method: POST
Request URL: /schedule?action=removeSched
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.
action=removeSched The fixed parameter indicating the action is to unschedule a flow.
scheduleId The id of the schedule. You can find this in the Azkaban UI on the /schedule page.

Request URL:

curl -k https://HOST:PORT/schedule -d “action=removeSched&scheduleId=SCHEDULE_ID” -b azkaban.browser.session.id=SESSION_ID

response body:

if success:

{

“message” : “flow FLOW_NAME removed from Schedules.”,

“status” : “success”

}

else:

{

“message” : “Schedule with ID SCHEDULE_ID does not exist”,

“status” : “error”

}

15.Set a SLA 设置告警模块
Method: POST
Request URL: /schedule?ajax=setSla
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.
ajax=setSla The fixed parameter indicating the action is to set a SLA.
scheduleId The id of the shchedule. You can find this with Fetch a Schedule .
slaEmails A list of SLA alert emails. Example: slaEmails=a@example.com;b@example .com
settings[…] Rules of SLA. Format is settings[…]=[id],[rule],[durati on],[emailAction],[killAction]. Example: settings[0]=aaa,SUCCESS,5:00,true ,false

Resquest URL:

curl -k -d “ajax=setSla&scheduleId=1&slaEmails=a@example.com;b@example.com&settings[0]=aaa,SUCCESS,5:00,true,false&settings[1]=bbb,SUCCESS,10:00,false,true” -b “azkaban.browser.session.id=XXXXXXXXXXXXXX” “http://localhost:8081/schedule”

respose body:

if success:

{

}

else:

{

“error” : “azkaban.scheduler.ScheduleManagerException: Unable to parse duration for a SLA that needs to take actions!”

}

16.Fetch a SLA 获取资源调度的报警模块

Method: GET
Request URL: /schedule?ajax=slaInfo
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.
ajax=slaInfo The fixed parameter indicating the SLA.
scheduleId The id of the shchedule. You can find this with Fetch a Schedule .

Request URL:

curl -k --get --data “session.id=XXXXXXXXXXXXXX&ajax=slaInfo&scheduleId=1” http://localhost:8081/schedule"

response body:

{

    "settings" : [ {

    "duration" : "300m",

    "rule" : "SUCCESS",

    "id" : "aaa",

    "actions" : [ "EMAIL" ]

    }, {

    "duration" : "600m",

    "rule" : "SUCCESS",

    "id" : "bbb",

    "actions" : [ "KILL" ]

    } ],

    "slaEmails" : [ "a@example.com", "b@example.com" ],

    "allJobNames" : [ "aaa", "ccc", "bbb", "start", "end" ]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25

}

17.Pause a Flow Execution 暂停一个执行的任务流

Method: GET
Request URL: /executor?ajax=pauseFlow
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.
ajax=pauseFlow The fixed parameter indicating the current ajax action is pauseFlow.
execid The execution id.

Request URL:

curl -k --data “session.id=34ba08fd-5cfa-4b65-94c4-9117aee48dda&ajax=pauseFlow&execid=303” https://localhost:8443/executor

response body:

if success:{}

else:{

“error” : “Execution 303 of flow test isn’t running.”

}

18.Resume a Flow Execution 释放一个暂停的执行的任务流(继续跑暂停的任务流)
Method: GET
Request URL: /executor?ajax=resumeFlow
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.
ajax=resumeFlow The fixed parameter indicating the current ajax action is resumeFlow.
execid The execution id.

Request URL:

curl -k --data “session.id=34ba08fd-5cfa-4b65-94c4-9117aee48dda&ajax=resumeFlow&execid=303” https://localhost:8443/executor

response body:

if success:

{}

else:

{

“error” : “Execution 303 of flow test isn’t running.”

}

19.Fetch a Flow Execution 获取一个任务流执行的情况 (制定的执行的id)
Method: GET
Request URL: /executor?ajax=fetchexecflow
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.
ajax=fetchexecflow The fixed parameter indicating the fetchexecflow action.
execid The execution id to be fetched.

Request URL:

curl -k --data “session.id=34ba08fd-5cfa-4b65-94c4-9117aee48dda&ajax=fetchexecflow&execid=304” https://localhost:8443/executor

response body:

{

    "attempt" : 0,

    "submitUser" : "1",

    "updateTime" : 1407779495095,

    "status" : "FAILED",

    "submitTime" : 1407779473318,

    "projectId" : 192,

    "flow" : "test",

    "endTime" : 1407779495093,

    "type" : null,

    "nestedId" : "test",

    "startTime" : 1407779473354,

    "id" : "test",

    "project" : "test-azkaban",

    "nodes" : [ {

    "attempt" : 0,

    "startTime" : 1407779495077,

    "id" : "test",

    "updateTime" : 1407779495077,

    "status" : "CANCELLED",

    "nestedId" : "test",

    "type" : "command",

    "endTime" : 1407779495077,

    "in" : [ "test-foo" ]

    }, {

    "attempt" : 0,

    "startTime" : 1407779473357,

    "id" : "test-bar",

    "updateTime" : 1407779484241,

    "status" : "SUCCEEDED",

    "nestedId" : "test-bar",

    "type" : "pig",

    "endTime" : 1407779484236

    }, {

    "attempt" : 0,

    "startTime" : 1407779484240,

    "id" : "test-foobar",

    "updateTime" : 1407779495073,

    "status" : "FAILED",

    "nestedId" : "test-foobar",

    "type" : "java",

    "endTime" : 1407779495068,

    "in" : [ "test-bar" ]

    }, {

    "attempt" : 0,

    "startTime" : 1407779495069,

    "id" : "test-foo",

    "updateTime" : 1407779495069,

    "status" : "CANCELLED",

    "nestedId" : "test-foo",

    "type" : "java",

    "endTime" : 1407779495069,

    "in" : [ "test-foobar" ]

    } ],

    "flowId" : "test",

    "execid" : 304
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109

}

20.Fetch Execution Job Logs 根据指定的session.id && jobid &&exec_id,来获取对应付的任务日志

Method: GET
Request URL: /executor?ajax=fetchExecJobLogs
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.
ajax=fetchExecJobLogs The fixed parameter indicating the fetchExecJobLogs action.
execid The unique id for an execution.
jobId The unique id for the job to be fetched.
offset The offset for the log data.
length The length of the log data. For example, if the offset set is 10 and the length is 1000, the returned log will starts from the 10th character and has a length of 1000 (less if the remaining log is less than 1000 long).

Request URL:

curl -k --data “session.id=9089beb2-576d-47e3-b040-86dbdc7f523e&ajax=fetchExecJobLogs&execid=297&jobId=test-foobar&offset=0&length=100” https://localhost:8443/executor

response body:

{

    "data" : "05-08-2014 16:53:02 PDT test-foobar INFO - Starting job test-foobar at 140728278",

    "length" : 100,

    "offset" : 0
  • 1
  • 2
  • 3
  • 4
  • 5

}

21.Fetch Flow Execution Updates 获取任务流执行的更新情况
Method: GET
Request URL: /executor?ajax=fetchexecflowupdate
Parameter Location: Request Query String
Request Parameters
Parameter Description
session.id The user session id.
ajax=fetchexecflowupdate The fixed parameter indicating the fetch execution updates action.
execid The execution id.
lastUpdateTime The criteria to filter by last update time. Set the value to be -1 if all job information are needed.
Response Object
Parameter Description
id The flow id.
flow The flow name.
startTime The start time of this flow execution.
updateTime The last updated time of this flow execution.
endTime The end time of this flow execution (if it finishes).
status The current status of the flow.
attempt The attempt number of this flow execution.
nodes Information for each execution job. Containing the following fields:{ “attempt”: String, “startTime”: Number, “id”: String (the job id), “updateTime”:Number, “status”: String, “endTime”: Number}

Request URL:

curl -k --data “execid=301&lastUpdateTime=-1&session.id=6668c180-efe7-46a-8dd2-e36508b440d8” https://localhost:8443/executor?ajax=fetchexecflowupdate

Response bpdy:

{

    "id" : "test",

    "startTime" : 1407778382894,

    "attempt" : 0,

    "status" : "FAILED",

    "updateTime" : 1407778404708,

    "nodes" : [ {

    "attempt" : 0,

    "startTime" : 1407778404683,

    "id" : "test",

    "updateTime" : 1407778404683,

    "status" : "CANCELLED",

    "endTime" : 1407778404683

    }, {

    "attempt" : 0,

    "startTime" : 1407778382913,

    "id" : "test-job-1",

    "updateTime" : 1407778393850,

    "status" : "SUCCEEDED",

    "endTime" : 1407778393845

    }, {

    "attempt" : 0,

    "startTime" : 1407778393849,

    "id" : "test-job-2",

    "updateTime" : 1407778404679,

    "status" : "FAILED",

    "endTime" : 1407778404675

    }, {

    "attempt" : 0,

    "startTime" : 1407778404675,

    "id" : "test-job-3",

    "updateTime" : 1407778404675,

    "status" : "CANCELLED",

    "endTime" : 1407778404675

    } ],

    "flow" : "test",

    "endTime" : 1407778404705
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71

}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/675696
推荐阅读
相关标签
  

闽ICP备14008679号