查询作业详情 - ShowFlinkJob
功能介绍
查看一个作业的详情信息。
调试
您可以在API Explorer中调试该接口。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限及授权项说明。
- 如果使用身份策略授权,需具备如下身份策略权限。
授权项
Action
访问级别
Access Level
资源类型(*为必须)
Resource Type (*: required)
条件键
Condition Key
别名
Alias
依赖的授权项
Dependencies
dli:jobs:get
read
jobs *
-
-
URI
- URI格式
- 参数说明
表1 URI参数说明 参数名称
是否必选
参数类型
说明
project_id
是
String
项目编号,用于资源隔离。获取方式请参考获取项目ID。
job_id
是
String
作业ID。
请求消息
无请求参数。
响应消息
| 参数名称 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| is_success | 否 | String | 执行请求是否成功。“true”表示请求执行成功。 |
| message | 否 | String | 系统提示信息,执行成功时,信息可能为空。 |
| job_detail | 否 | Object | 作业详情。请参见表3。 |
| 参数名称 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| job_id | 否 | Long | 作业ID。 |
| name | 否 | String | 作业名称。长度限制:0-57个字符。 |
| desc | 否 | String | 作业描述。长度限制:0-512个字符。 |
| job_type | 否 | String | 作业类型。
|
| status | 否 | String | 作业状态。 作业的状态如下:
|
| status_desc | 否 | String | 作业状态描述。 |
| create_time | 否 | Long | 作业创建时间。 |
| start_time | 否 | Long | 作业启动时间。 |
| user_id | 否 | String | 作业所属用户标识。 |
| queue_name | 否 | String | 队列名称。长度限制:1-128个字符。 |
| project_id | 否 | String | 作业所属项目标识。 |
| sql_body | 否 | String | Stream SQL语句。 |
| savepoint_path | 否 | String | 手动产生的Checkpoint的保存路径。 |
| run_mode | 否 | String | 作业运行模式。
|
| job_config | 否 | Object | 作业配置, 具体参数说明请参见表4。 |
| main_class | 否 | String | jar包主类。例如,org.apache.spark.examples.streaming.JavaQueueStream |
| entrypoint_args | 否 | String | jar包作业运行参数,多个参数之间空格分隔。 |
| execution_graph | 否 | String | 作业执行计划。 |
| update_time | 否 | Long | 作业更新时间。 |
| user_name | 否 | String | 用户名,当“show_detail”为“false”时独有。 |
| duration | 否 | Long | 作业运行时长。 单位ms,“show_detail”为“false”时独有。 |
| root_id | 否 | Long | 父作业ID。“show_detail”为“false”时独有。 |
| graph_editor_enabled | 否 | Boolean | 作业的流图是否可编辑。“true”表示作业的流图可以编辑,“false”表示作业的流图不可以编辑。 |
| has_savepoint | 否 | Boolean | 作业是否有保存点。“true”表示作业有保存点,“false”表示作业没有保存点。 |
| edge_group_ids | 否 | Array of Strings | 边缘计算组ID列表。多个ID以逗号分隔。 |
| restart_times | 否 | Integer | 重启次数。 |
| 参数名称 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| checkpoint_enabled | 否 | Boolean | 是否开启作业自动快照功能。
默认为“false”。 |
| checkpoint_interval | 否 | Integer | 快照时间间隔。 单位为秒,默认值为“10”。 |
| checkpoint_mode | 否 | String | 快照模式,两种可选:
默认值为“exactly_once”。 |
| log_enabled | 否 | Boolean | 是否启用日志存储。默认为“false”。 |
| obs_bucket | 否 | String | OBS桶名。 |
| root_id | 否 | Integer | 父作业ID。 |
| edge_group_ids | 否 | Array of Strings | 边缘计算组ID列表。多个ID以逗号分隔。 |
| manager_cu_number | 否 | Integer | 管理单元CU数。默认为“1”。 |
| graph_editor_enabled | 否 | Boolean | 流图编辑开关。默认为“false”。 |
| graph_editor_data | 否 | String | 流图编辑数据。默认为null。 |
| executor_number | 否 | Integer | 作业使用计算节点个数。 |
| executor_cu_number | 否 | Integer | 计算节点cu数。 |
| cu_number | 否 | Integer | 用户为作业选择的CU数量。 “show_detail”为“true”时独有。
默认为“2”。 |
| parallel_number | 否 | Integer | 用户设置的作业并行数。 “show_detail”为“true”时独有。
默认为“1”。 |
| smn_topic | 否 | String | SMN主题名。当作业异常时,向该SMN主题推送告警信息。 |
| restart_when_exception | 否 | Boolean | 是否开启异常重启功能。 |
| resume_checkpoint | 否 | Boolean | 异常自动重启时,是否从最新checkpoint恢复。默认值为“false”。 |
| resume_max_num | 否 | Integer | 异常重试最大次数。-1代表无限。 |
| checkpoint_path | 否 | String | 检查点保存路径。 |
| idle_state_retention | 否 | Integer | 空闲状态过期周期。 |
| config_url | 否 | String | 用户上传的config包OBS路径。 |
| udf_jar_url | 否 | String | 用户已上传到DLI资源管理系统的程序包名,用户sql作业的udf jar通过该参数传入。 |
| dirty_data_strategy | 否 | String | 作业脏数据策略。
|
| entrypoint | 否 | String | 用户已上传到DLI资源管理系统的程序包名,用户自定义作业主类所在的jar包。 |
| dependency_jars | 否 | Array of Strings | 用户已上传到DLI资源管理系统的程序包名,用户自定义作业的其他依赖包。 |
| dependency_files | 否 | Array of Strings | 用户已上传到DLI资源管理系统的资源包名,用户自定义作业的依赖文件。 |
| tm_cus | 否 | int | 单TM所占CU数。 |
| tm_slot_num | 否 | int | 单TM Slot数。 |
| image | 否 | String | 自定义镜像。格式为:组织名/镜像名:镜像版本。 当用户设置“feature”为“custom”时,该参数生效。用户可通过与“feature”参数配合使用,指定作业运行使用自定义的Flink镜像。关于如何使用自定义镜像,请参考《数据湖探索用户指南》。 |
| feature | 否 | String | 自定义作业特性。表示用户作业使用的Flink镜像类型。
|
| flink_version | 否 | String | Flink版本。当用户设置“feature”为“basic”时,该参数生效。用户可通过与“feature”参数配合使用,指定作业运行使用的DLI基础Flink镜像的版本。 |
| execution_agency_urn | 否 | String | 授权给DLI的委托名。Flink1.15版本时支持配置该参数。 |
| operator_config | 否 | String | 各算子并行度参数,以json的形式展示各算子id和并行度。 |
| static_estimator_config | 否 | String | 静态流图资源预估参数,以json的形式展示。 |
| runtime_config | 否 | String | Flink作业运行时自定义优化参数。 |
| real_cu_number | 否 | Integer | 实际使用的CU数。默认值为“0”,表示此时以“cu_number”的值为准。 |
| resource_config_version | 否 | String | 资源配置版本。可选值 "v1" ,"v2".默认为“v1”。 v2版本对比于v1模版不支持设置CU数量,支持直接设置Job Manager Memory和Task Manager Memory。 v1:适用于Flink 1.12、Flink 1.15 V2:适用于Flink 1.15、Flink 1.17 优先推荐使用V2版本的参数设置。 |
| resource_config | 否 | Object | Flink 作业的资源配置。 具体参数说明请参考表5。 资源配置版本 为 "v2"时,配置生效,资源配置版本 为 "v1"时,配置无效。 |
| 参数名称 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| max_slot | 否 | integer | 该参数用于设置单个TaskManager可以提供的并行任务数量。每个Task Slot可以并行执行一个任务。增加 Task Slots 可以提高 TaskManager 的并行处理能力,但也会增加资源消耗。 Task Slots的数量与TaskManager的CPU数相关联,因为每个CPU可以提供一个Task Slot。 单TM Slot默认值为1。最小并行数不能小于1。 |
| parallel_number | 否 | integer | 作业的并行数,指作业中各个算子的并行执行的子任务的数量,算子的子任务数就是其对应算子的并行度。默认值为“1”。 |
| jobmanager_resource_spec | 否 | Object | JobManager资源规格。具体参数说明请参考表5。 |
| taskmanager_resource_spec | 否 | Object | TaskManager资源规格。具体参数说明请参考表6。 |
请求示例
无
响应示例
- 作业类型为:flink_jar_job,参考响应样例如下:
{ "is_success": "true", "message": "作业详情查询成功", "job_detail": { "job_id": 104, "user_id": "011c99a26ae84a1bb963a75e7637d3fd", "queue_name": "flinktest", "project_id": "330e068af1334c9782f4226acc00a2e2", "name": "jptest", "desc": "", "sql_body": "", "run_mode": "exclusive_cluster", "job_type": "flink_jar_job", "job_config": { "checkpoint_enabled": false, "checkpoint_interval": 10, "checkpoint_mode": "exactly_once", "log_enabled": false, "obs_bucket": null, "root_id": -1, "edge_group_ids": null, "graph_editor_enabled": false, "graph_editor_data": "", "manager_cu_number": 1, "executor_number": null, "executor_cu_number": null, "cu_number": 2, "parallel_number": 1, "smn_topic": null, "restart_when_exception": false, "idle_state_retention": 3600, "config_url": null, "udf_jar_url": null, "dirty_data_strategy": null, "entrypoint": "FemaleInfoCollection.jar", "execution_agency_urn": "myAgencyName", "dependency_jars": [ "FemaleInfoCollection.jar", "ObsBatchTest.jar" ], "dependency_files": [ "FemaleInfoCollection.jar", "ReadFromResource" ] }, "main_class": null, "entrypoint_args": null, "execution_graph": null, "status": "job_init", "status_desc": "", "create_time": 1578466221525, "update_time": 1578467395713, "start_time": null } } - 作业类型为:flink_opensource_sql_job,参考响应样例如下:
{ "is_success": "true", "message": "The job information query succeeds.", "job_detail": { "job_type": "flink_opensource_sql_job", "status_desc": "", "create_time": 1637632872828, "sql_body": "xxx", "savepoint_path": null, "main_class": null, "queue_name": "xie_container_general", "execution_graph": "xxx", "start_time": 1638433497621, "update_time": 1638449337993, "job_config": { "checkpoint_enabled": true, "checkpoint_interval": 600, "checkpoint_mode": "exactly_once", "log_enabled": true, "obs_bucket": "dli-test", "root_id": -1, "edge_group_ids": null, "graph_editor_enabled": false, "graph_editor_data": "", "manager_cu_number": 1, "executor_number": null, "executor_cu_number": null, "cu_number": 2, "parallel_number": 3, "smn_topic": "", "restart_when_exception": true, "resume_checkpoint": true, "resume_max_num": -1, "checkpoint_path": null, "idle_state_retention": 3600, "config_url": null, "udf_jar_url": "test/flink_test-1.0-SNAPSHOT-jar-with-dependencies.jar", "dirty_data_strategy": "0", "entrypoint": "test/flink_test-1.0-SNAPSHOT-jar-with-dependencies.jar", "dependency_jars": null, "dependency_files": null, "tm_cus": 1, "tm_slot_num": 3, "image": null, "feature": null, "flink_version": null, "operator_config": "xxx", "static_estimator_config": "xxx", "execution_agency_urn": "myAgencyName", "runtime_config": null }, "user_id": "xxx", "project_id": "xxx", "run_mode": "exclusive_cluster", "job_id": 90634, "name": "test_guoquan", "desc": "", "entrypoint_args": null, "status": "job_cancel_success" } }
错误码
调用接口出错后,将不会返回上述结果,而是返回错误码和错误信息,更多介绍请参见错误码。