Azkaban API 接口文档汇总
l Authenticate
l Create a Project
l Delete a Project
l Upload a Project Zip
l Fetch Flows of a Project
l Fetch Jobs of a Flow
l Fetch Executions of a Flow
l Fetch Running Executions of a Flow
l Execute a Flow
l Cancel a Flow Execution
l Schedule a period-based Flow (Deprecated)
l Flexible scheduling using Cron
l Fetch a Schedule
l Unschedule a Flow
l Set a SLA
l Fetch a SLA
l Pause a Flow Execution
l Resume a Flow Execution
l Fetch a Flow Execution
l Fetch Execution Job Logs
l 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):
Para
mete
r
statu
s
path
Description
The status of the creation attempt.
The url path to redirect
Para
mete
r
actio
n
Description
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
Parame
ter
session.i
d
The user session id.
Description
Parame
ter
ajax=up
load
Description
The fixed parameter to the upload action.
project
The project name to be uploaded.
The project zip file. The type should be set
file
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=fetchprojectflow
s
The fixed parameter indicating the fetchProjectFlows
action.
project
The project name to be fetched.
Response Object
Paramete
r
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
}