调用条件、权限、请求字段、响应字段与错误处理。
请求与权限
POSThttps://openapi.qwenwork.ai/v1/scheduler/tasks/{id}/resume
鉴权:Authorization: Bearer <access_token>;使用用户 OAuth 授权获得的访问令牌。
所需业务 Scope:scheduler.task.resume
契约声明的授权方式:组织授权(organization)、个人授权(personal)
Scope 需由平台为应用开通;用户须有相应业务权限,目标资源须在其可访问范围内。个人/组织方式是否为该应用开放,以控制台实际配置为准。
功能与限制
使用用户 OAuth token,需要 scheduler.task.resume。只支持用户 OAuth Token。将任务 status 置为 active 并重新入云调度池,恢复前校验模型档位可用性。仅任务归属用户可恢复;不存在或已删除返回 404。不接受 user_id 等身份参数和查询参数。路径参数
| 参数 | 类型 | 必填 | 说明及约束 |
|---|---|---|---|
id | string | 是 | 任务 ID(UUID)。 格式:"uuid" |
请求体
公开契约未声明请求体。不要自行添加身份字段或未经声明的业务字段。成功响应
保持各业务接口原始响应结构,不统一添加code/msg/data 包装。
HTTP 200
成功,返回更新后的任务对象。 响应类型:application/json
| 字段 | 类型 | 必含 | 说明及约束 |
|---|---|---|---|
action | object | 是 | 额外字段:false |
action.execution_target | object | 是 | 额外字段:false |
action.execution_target.device_id | string | 否 | desktop 必填,cloud 不可携带。 |
action.execution_target.device_name | string | 否 | — |
action.execution_target.kind | string | 是 | 可选值:["cloud", "desktop"] |
created_at | string | 是 | 格式:"date-time" |
delete_after_run | boolean | 是 | 仅 at 触发器可为 true。 默认值:false |
description | string | 是 | — |
id | string | 是 | 格式:"uuid" |
name | string | 是 | 最短长度:1 最长长度:100 |
status | string | 是 | 默认值:"active" 可选值:["active", "paused"] |
target | object | 是 | 额外字段:false |
target.kind | string | 是 | — |
target.payload | object | 是 | 额外字段:"受 Schema 约束,见完整契约" |
trigger | object | 是 | — |
trigger | object | 是 | 恰好满足一种:分支 1 额外字段:false |
trigger.kind | string | 是 | 恰好满足一种:分支 1 固定值:"at" |
trigger.spec | object | 是 | 恰好满足一种:分支 1 额外字段:true |
trigger.spec.fire | string | 是 | 恰好满足一种:分支 1 格式:"date-time" |
trigger.spec.rest_day | object | 否 | 恰好满足一种:分支 1 额外字段:true |
trigger.spec.rest_day.enabled | boolean | 否 | 恰好满足一种:分支 1 — |
trigger.spec.rest_day.region | string | 否 | 恰好满足一种:分支 1 — |
trigger.spec.rest_day.skip_on | string | 否 | 恰好满足一种:分支 1 可选值:["WORKDAY", "HOLIDAY"] |
trigger | object | 是 | 恰好满足一种:分支 2 额外字段:false |
trigger.kind | string | 是 | 恰好满足一种:分支 2 固定值:"every" |
trigger.spec | object | 是 | 恰好满足一种:分支 2 额外字段:true |
trigger.spec.interval_ns | integer | 是 | 恰好满足一种:分支 2 最小值(含):60000000000 最大值(含):31536000000000000 |
trigger.spec.rest_day | object | 否 | 恰好满足一种:分支 2 额外字段:true |
trigger.spec.rest_day.enabled | boolean | 否 | 恰好满足一种:分支 2 — |
trigger.spec.rest_day.region | string | 否 | 恰好满足一种:分支 2 — |
trigger.spec.rest_day.skip_on | string | 否 | 恰好满足一种:分支 2 可选值:["WORKDAY", "HOLIDAY"] |
trigger.spec.start_from | string | 是 | 恰好满足一种:分支 2 格式:"date-time" |
trigger | object | 是 | 恰好满足一种:分支 3 额外字段:false |
trigger.kind | string | 是 | 恰好满足一种:分支 3 固定值:"cron" |
trigger.spec | object | 是 | 恰好满足一种:分支 3 额外字段:true |
trigger.spec.expr | string | 是 | 恰好满足一种:分支 3 五段 Cron 表达式 |
trigger.spec.rest_day | object | 否 | 恰好满足一种:分支 3 额外字段:true |
trigger.spec.rest_day.enabled | boolean | 否 | 恰好满足一种:分支 3 — |
trigger.spec.rest_day.region | string | 否 | 恰好满足一种:分支 3 — |
trigger.spec.rest_day.skip_on | string | 否 | 恰好满足一种:分支 3 可选值:["WORKDAY", "HOLIDAY"] |
trigger.spec.tz | string | 是 | 恰好满足一种:分支 3 IANA 时区,如 Asia/Shanghai |
type | string | 是 | 固定值:"time" |
updated_at | string | 是 | 格式:"date-time" |
错误响应
| HTTP | 说明及处理 |
|---|---|
400 | 任务 ID 或请求不合法。 |
401 | 用户凭证无效、过期或凭证类型不支持。 |
403 | 缺少 scheduler.task.resume Scope 或任务不属于当前用户。 |
404 | 任务不存在或已删除。 |
422 | 任务配置的模型当前不可用(MODE_UNAVAILABLE)。 |
500 | 业务处理失败。 |
502 | 网关上游响应失败。 |
503 | 网关或业务依赖不可用。 |
504 | 请求超时。 |
完整字段契约
下方 JSON 包含本接口完整请求、响应、错误 Schema、嵌套约束和公开扩展定义,可复制用于核对。未声明的成功示例不作推测。展开完整接口 OpenAPI JSON
展开完整接口 OpenAPI JSON
Copy
{
"components": {
"schemas": {
"Action": {
"additionalProperties": false,
"properties": {
"execution_target": {
"additionalProperties": false,
"properties": {
"device_id": {
"description": "desktop 必填,cloud 不可携带。",
"type": "string"
},
"device_name": {
"type": "string"
},
"kind": {
"enum": [
"cloud",
"desktop"
],
"type": "string"
}
},
"required": [
"kind"
],
"type": "object"
}
},
"required": [
"execution_target"
],
"type": "object"
},
"Error": {
"additionalProperties": false,
"properties": {
"error": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"reason": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
},
"GatewayError": {
"additionalProperties": false,
"properties": {
"code": {
"type": "integer"
},
"data": {
"type": "null"
},
"msg": {
"type": "string"
}
},
"required": [
"code",
"msg",
"data"
],
"type": "object"
},
"Task": {
"additionalProperties": false,
"properties": {
"action": {
"$ref": "#/components/schemas/Action"
},
"created_at": {
"format": "date-time",
"type": "string"
},
"delete_after_run": {
"default": false,
"description": "仅 at 触发器可为 true。",
"type": "boolean"
},
"description": {
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"status": {
"default": "active",
"enum": [
"active",
"paused"
],
"type": "string"
},
"target": {
"additionalProperties": false,
"properties": {
"kind": {
"type": "string"
},
"payload": {
"additionalProperties": {},
"type": "object"
}
},
"required": [
"kind",
"payload"
],
"type": "object"
},
"trigger": {
"$ref": "#/components/schemas/Trigger"
},
"type": {
"const": "time",
"type": "string"
},
"updated_at": {
"format": "date-time",
"type": "string"
}
},
"required": [
"name",
"description",
"trigger",
"target",
"action",
"status",
"delete_after_run",
"id",
"type",
"created_at",
"updated_at"
],
"type": "object"
},
"Trigger": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"kind": {
"const": "at",
"type": "string"
},
"spec": {
"additionalProperties": true,
"properties": {
"fire": {
"format": "date-time",
"type": "string"
},
"rest_day": {
"additionalProperties": true,
"properties": {
"enabled": {
"type": "boolean"
},
"region": {
"type": "string"
},
"skip_on": {
"enum": [
"WORKDAY",
"HOLIDAY"
],
"type": "string"
}
},
"type": "object"
}
},
"required": [
"fire"
],
"type": "object"
}
},
"required": [
"kind",
"spec"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"kind": {
"const": "every",
"type": "string"
},
"spec": {
"additionalProperties": true,
"properties": {
"interval_ns": {
"maximum": 31536000000000000,
"minimum": 60000000000,
"type": "integer"
},
"rest_day": {
"additionalProperties": true,
"properties": {
"enabled": {
"type": "boolean"
},
"region": {
"type": "string"
},
"skip_on": {
"enum": [
"WORKDAY",
"HOLIDAY"
],
"type": "string"
}
},
"type": "object"
},
"start_from": {
"format": "date-time",
"type": "string"
}
},
"required": [
"interval_ns",
"start_from"
],
"type": "object"
}
},
"required": [
"kind",
"spec"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"kind": {
"const": "cron",
"type": "string"
},
"spec": {
"additionalProperties": true,
"properties": {
"expr": {
"description": "五段 Cron 表达式",
"type": "string"
},
"rest_day": {
"additionalProperties": true,
"properties": {
"enabled": {
"type": "boolean"
},
"region": {
"type": "string"
},
"skip_on": {
"enum": [
"WORKDAY",
"HOLIDAY"
],
"type": "string"
}
},
"type": "object"
},
"tz": {
"description": "IANA 时区,如 Asia/Shanghai",
"type": "string"
}
},
"required": [
"expr",
"tz"
],
"type": "object"
}
},
"required": [
"kind",
"spec"
],
"type": "object"
}
]
}
},
"securitySchemes": {
"OpenPlatformBearer": {
"scheme": "bearer",
"type": "http"
}
}
},
"openapi": "3.1.0",
"paths": {
"/v1/scheduler/tasks/{id}/resume": {
"post": {
"description": "使用用户 OAuth token,需要 scheduler.task.resume。只支持用户 OAuth Token。将任务 status 置为 active 并重新入云调度池,恢复前校验模型档位可用性。仅任务归属用户可恢复;不存在或已删除返回 404。不接受 user_id 等身份参数和查询参数。",
"operationId": "resumeSchedulerTask",
"parameters": [
{
"description": "任务 ID(UUID)。",
"in": "path",
"name": "id",
"required": true,
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Task"
}
}
},
"description": "成功,返回更新后的任务对象。",
"headers": {
"X-Request-ID": {
"description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Error"
},
{
"$ref": "#/components/schemas/GatewayError"
}
]
}
}
},
"description": "任务 ID 或请求不合法。",
"headers": {
"X-Request-ID": {
"description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"401": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Error"
},
{
"$ref": "#/components/schemas/GatewayError"
}
]
}
}
},
"description": "用户凭证无效、过期或凭证类型不支持。",
"headers": {
"X-Request-ID": {
"description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"403": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Error"
},
{
"$ref": "#/components/schemas/GatewayError"
}
]
}
}
},
"description": "缺少 scheduler.task.resume Scope 或任务不属于当前用户。",
"headers": {
"X-Request-ID": {
"description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"404": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Error"
},
{
"$ref": "#/components/schemas/GatewayError"
}
]
}
}
},
"description": "任务不存在或已删除。",
"headers": {
"X-Request-ID": {
"description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"422": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Error"
},
{
"$ref": "#/components/schemas/GatewayError"
}
]
}
}
},
"description": "任务配置的模型当前不可用(MODE_UNAVAILABLE)。",
"headers": {
"X-Request-ID": {
"description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"500": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Error"
},
{
"$ref": "#/components/schemas/GatewayError"
}
]
}
}
},
"description": "业务处理失败。",
"headers": {
"X-Request-ID": {
"description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"502": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Error"
},
{
"$ref": "#/components/schemas/GatewayError"
}
]
}
}
},
"description": "网关上游响应失败。",
"headers": {
"X-Request-ID": {
"description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"503": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Error"
},
{
"$ref": "#/components/schemas/GatewayError"
}
]
}
}
},
"description": "网关或业务依赖不可用。",
"headers": {
"X-Request-ID": {
"description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"504": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Error"
},
{
"$ref": "#/components/schemas/GatewayError"
}
]
}
}
},
"description": "请求超时。",
"headers": {
"X-Request-ID": {
"description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
}
},
"security": [
{
"OpenPlatformBearer": []
}
],
"summary": "恢复(启用)定时任务",
"tags": [
"定时任务"
]
}
}
},
"info": {
"title": "恢复(启用)定时任务",
"version": "2026-11-24"
},
"servers": [
{
"url": "https://openapi.qwenwork.ai"
}
]
}