ListJobScriptHistory - 获取任务脚本历史列表

更新时间:
复制为 MD 格式

获取任务脚本历史列表。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

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"
      }
    ]
  }
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情