创建航线任务
POST
/openapi/v0.9/task/api/v1/workspaces/{proj_uuid}/flight-tasks
es-task-service
请求参数
Path 参数
proj_uuid
string
项目uuid
示例值:
b2049481-9698-4796-87f3-6dbe6fe998ea
Header 参数
x-user-token
string
必需
默认值:
{{x-user-token}}
X-Request-Id
string
可选
默认值:
{% mock 'uuid' %}
Body 参数application/json
business_type
enum<integer>
可选
required: false
枚举值:
1
cloud_to_cloud_id
string
可选
required: false
示例值:
105ddd05-34ce-46b6-a872-cb32b8c98f64
default_name
string
航线任务的默认名称
示例值:
["新建计划"]
dow
array[integer]
可选
min 1
max 7
>= 1 items<= 7 items
示例值:
[1,2,3]
landing_dock_sn
string
必需
name
string
飞行任务名称
out_of_control_action_in_flight
enum<integer>
必需
min 1
max 2
>= 1<= 2
枚举值:
12
示例值:
[1]
push_c2c_organization_uuid
string
可选
repeat_type
enum<integer>
可选
enum: 0 1 2 3 4 5 6 7 8
0-不重复, 1-每几秒, 2-每几分钟, 3-每几小时, 4-每几天, 5-每几周, 6-每几月(按日期), 7-每几月(按星期), 8-绝对每年
<= 8
枚举值:
012345678
示例值:
[1]
resumable_status
enum<string>
续飞状态
枚举值:
automanual
示例值:
["auto"]
rth_altitude
number
必需
min 15
max 1500
>= 15<= 1500
示例值:
[15]
rth_mode
enum<integer>
必需
min 0
max 1
>= 0<= 1
枚举值:
01
示例值:
[0]
sn
string
执行任务的设备sn
示例值:
["SN123456"]
subscription_alert_cloud_to_cloud_frequency
integer
云云对接告警频率
subscription_alert_email_frequency
integer
邮件告警频率
subscription_alert_phone_frequency
integer
短信告警频率
subscription_alert_user_web_frequency
integer
用户站内订阅频率
subscription_receive_type
array[string]
可选
示例值:
[["email","phone","user_web","cloud_to_cloud"]]
subscription_user_id
array[string]
订阅用户ID列表
tags
array[string]
必需
min 0
max 10
unique
<= 10 items
示例值:
[["tag1","tag2"]]
task_type
必需
enum: 1 2 3 5
-1 表示立即任务
-2 表示重复任务
-3 表示单次定时任务
-5 表示连续任务
Any of
time_zone
string
必需
example: asia/shanghai
示例值:
asia/shanghai
wayline_duration
number
必需
min 1
>= 1
示例值:
[1712985600]
wayline_precision_type
enum<integer>
必需
min 0
max 1
>= 0<= 1
枚举值:
01
示例值:
[0]
wayline_uuid
string
必需
wom
integer
一个月中的第几周
>= 1<= 4
示例值:
[1]
示例
{
"name": "新建计划74",
"wayline_uuid": "bd4618a6-2228-465d-8230-1548d316b9ef",
"sn": "8UUDM8800AU840",
"landing_dock_sn": "",
"task_type": 2,
"out_of_control_action_in_flight": 1,
"rth_mode": 1,
"repeat_type": 6,
"time_zone": "Asia/Shanghai",
"default_name": "新建计划",
"wayline_precision_type": 1,
"wayline_duration": 156136.202469,
"rth_altitude": 120,
"resumable_status": "manual",
"interval": 1,
"dom": [
8,
9,
10
],
"begin_at": 1749191400,
"end_at": 1751299199,
"extended_begin_at": [
1749191400
]
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST '/openapi/v0.9/task/api/v1/workspaces/b2049481-9698-4796-87f3-6dbe6fe998ea/flight-tasks' \
--header 'x-user-token;' \
--header 'X-Request-Id: {% mock '\''uuid'\'' %}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "新建计划74",
"wayline_uuid": "bd4618a6-2228-465d-8230-1548d316b9ef",
"sn": "8UUDM8800AU840",
"landing_dock_sn": "",
"task_type": 2,
"out_of_control_action_in_flight": 1,
"rth_mode": 1,
"repeat_type": 6,
"time_zone": "Asia/Shanghai",
"default_name": "新建计划",
"wayline_precision_type": 1,
"wayline_duration": 156136.202469,
"rth_altitude": 120,
"resumable_status": "manual",
"interval": 1,
"dom": [
8,
9,
10
],
"begin_at": 1749191400,
"end_at": 1751299199,
"extended_begin_at": [
1749191400
]
}'
返回响应
🟢200成功
application/json
Body
code
integer
响应码
message
string
响应消息
data
object
resp.CreateTaskResp
task
object
任务信息
示例
{
"code": 0,
"message": "string",
"data": {
"task": {
"begin_at": [
1712985600
],
"uuid": [
"1234567890"
],
"wayline_validity_check_codes": [
1,
2,
3
]
}
}
}
修改于 2025-06-26 09:55:59