获取任务脚本历史列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
edas:ReadSchedulerxJobQuery |
list |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| JobId |
integer |
是 |
任务 ID,在控制台的任务管理页面中获取 |
92583 |
| GroupId |
string |
是 |
应用 ID,在控制台的应用管理页面中获取 |
testSchedulerx.defaultGroup |
| Namespace |
string |
是 |
命名空间 ID,在控制台的命名空间页面中获取 |
4F68ABED-AC31-4412-9297-D9A8F0401108 |
| NamespaceSource |
string |
否 |
特殊第三方才需要填写 |
schedulerx |
| RegionId |
string |
是 |
地域 ID |
cn-hangzhou |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| Code |
integer |
返回码 |
200 |
| Message |
string |
附加信息,仅出错时返回错误信息 |
job is not existed, jobId=302 |
| RequestId |
string |
请求唯一 ID |
4F68ABED-AC31-4412-9297-D9A8F0401108 |
| Success |
boolean |
调用接口是否成功。取值如下: true:成功 false:失败 |
true |
| Data |
object |
|
|
| JobScriptHistoryInfos |
array<object> |
|
|
|
object |
|||
| VersionesDescription |
string |
脚本版本描述 |
init version |
| Creator |
string |
创建人 |
1272118248844842 |
| CreateTime |
string |
创建时间 |
2025-03-12 14:52:42 |
| ScriptContent |
string |
脚本内容 |
#!/bin/bash # The following are built-in variables provided by the system to retrieve job runtime information echo "Job parameters: #{schedulerx.jobParameters}" echo "Sharding ID: #{schedulerx.shardingId}" echo "Sharding parameters: #{schedulerx.shardingParameters}" echo "Total shards: #{schedulerx.shardingNum}" echo "Retry attempts: #{schedulerx.attempt}" echo "Trigger type: #{schedulerx.triggerType}" echo "Schedule timestamp: #{schedulerx.scheduleTime}" echo "Data timestamp: #{schedulerx.dataTime}" # The last line of output will be returned as the result echo "hello world" # exit 1 indicates failure exit 0 |
示例
正常返回示例
JSON格式
{
"Code": 200,
"Message": "job is not existed, jobId=302",
"RequestId": "4F68ABED-AC31-4412-9297-D9A8F0401108",
"Success": true,
"Data": {
"JobScriptHistoryInfos": [
{
"VersionesDescription": "init version",
"Creator": "1272118248844842",
"CreateTime": "2025-03-12 14:52:42\n",
"ScriptContent": "#!/bin/bash\n\n# The following are built-in variables provided by the system to retrieve job runtime information\necho \"Job parameters: #{schedulerx.jobParameters}\"\necho \"Sharding ID: #{schedulerx.shardingId}\"\necho \"Sharding parameters: #{schedulerx.shardingParameters}\"\necho \"Total shards: #{schedulerx.shardingNum}\"\necho \"Retry attempts: #{schedulerx.attempt}\"\necho \"Trigger type: #{schedulerx.triggerType}\"\necho \"Schedule timestamp: #{schedulerx.scheduleTime}\"\necho \"Data timestamp: #{schedulerx.dataTime}\"\n\n# The last line of output will be returned as the result\necho \"hello world\"\n\n# exit 1 indicates failure\nexit 0\n"
}
]
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。