查询实时集成作业详情 - ShowRealTimeJobDetails
功能介绍
查询实时集成作业的详细信息,仅支持一键入湖(OneClickCDC)类型的实时集成作业。
调用方法
请参见如何调用API。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
- 如果使用身份策略授权,当前API调用无需身份策略权限。
URI
GET /v2/{project_id}/factory/real-time-jobs/{job_name}
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| project_id | 是 | String | 参数解释: 项目ID,获取方法请参见项目ID和账号ID。 约束限制: 32字符。 取值范围: 小写字母、数字。 默认取值: 不涉及。 |
| job_name | 是 | String | 数据开发作业名称。 |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| workspace | 是 | String | 参数解释: 工作空间ID,获取方法请参见实例ID和工作空间ID。 约束限制: 最大128字符。 取值范围: 不涉及。 默认取值: 不涉及。 |
| X-Auth-Token | 否 | String | 参数解释: IAM Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 约束限制: 使用Token认证时必选,最大长度4096。 取值范围: 不涉及。 默认取值: 不涉及。 |
| X-Project-Id | 否 | String | 参数解释: 项目ID,获取方法请参见项目ID和账号ID。 约束限制: 32字符,多project场景采用AK/SK认证的接口请求,则该字段必选。。 取值范围: 小写字母、数字。 默认取值: 不涉及。 |
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| is_success | Boolean | 执行请求是否成功。“true”表示请求执行成功。 |
| message | String | 系统提示信息,执行成功时,信息可能为空。 |
| job_id | String | 作业ID。 |
| state | String | 作业状态。 |
| migration_type | String | 作业迁移类型。 |
| startup_timestamp | String | INCREMENTAL_DATA作业启动的时间位点。 |
| job_engine_version | String | 运行作业时的引擎版本。 |
| cluster_engine_version | String | 作业关联资源组的引擎版本。 |
| tracking_url | String | MRS Flink作业trackingUrl。 |
| metric_info | String | 作业指标信息。 |
| task_details | Array of TaskDetailInfo objects | 任务详情列表。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| task_id | String | 集成任务ID。 |
| task_name | String | 任务名称,长度限制0-57个字符。 |
| monitor_report_id | String | DLF作业ID。 |
| task_type | String | 任务类型。 |
| external_job_id | String | 计算作业ID,DLI/CCE/DRS执行的作业ID。 |
| source_type | String | 源端类型。 |
| target_type | String | 目的端类型。 |
| tracking_url | String | MRS Flink作业trackingUrl。 |
| state | String | 任务状态。 |
| error_msg | String | 错误信息。 |
| create_time | Long | 任务创建时间,毫秒时间戳。 |
| update_time | Long | 任务更新时间,毫秒时间戳。 |
状态码:400
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 参数解释: 错误码。 取值范围: 不涉及。 |
| error_msg | String | 参数解释: 错误描述。 取值范围: 不涉及。 |
请求示例
查询名称为my_realtime_job的数据开发作业的实时集成作业详情
GET /v2/62099355b894428e8916573ae635f1f9/factory/real-time-jobs/my_realtime_job
响应示例
状态码:200
{
"is_success" : true,
"message" : "",
"job_id" : "36da30dc-b1ea-4f9d-96e1-ddfec9098695",
"state" : "RUNNING",
"migration_type" : "INCREMENTAL_DATA",
"startup_timestamp" : "1701934124000",
"job_engine_version" : "23.12.0",
"cluster_engine_version" : "23.12.0",
"tracking_url" : "https://192.168.0.2/xxxx/application_1",
"metric_info" : "{\"numRecordsIn\":\"1000\",\"numRecordsOut\":\"980\"}",
"task_details" : [ {
"task_id" : "36da30dc-b1ea-4f9d-96e1-ddfec9098695",
"task_name" : "DM_36da30dc-b1ea-4f9d-96e1-ddfec9098695",
"monitor_report_id" : "123456",
"task_type" : "FLINK",
"external_job_id" : "4ac07bd4-850b-4c91-be30-6659cc71ce66",
"source_type" : "mysql",
"target_type" : "kafka",
"tracking_url" : "https://192.168.0.2/xxxx/application_1",
"state" : "RUNNING",
"error_msg" : "",
"create_time" : 1516952770835,
"update_time" : 1516952770835
} ]
} 状态码:400
{
"error_code" : "DLF.30100",
"error_msg" : "Job [my_realtime_job] does not exist."
} SDK代码示例
SDK代码示例如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.dataartsstudio.v1.region.DataArtsStudioRegion; import com.huaweicloud.sdk.dataartsstudio.v1.*; import com.huaweicloud.sdk.dataartsstudio.v1.model.*; public class ShowRealTimeJobDetailsSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); DataArtsStudioClient client = DataArtsStudioClient.newBuilder() .withCredential(auth) .withRegion(DataArtsStudioRegion.valueOf("<YOUR REGION>")) .build(); ShowRealTimeJobDetailsRequest request = new ShowRealTimeJobDetailsRequest(); request.withJobName("{job_name}"); try { ShowRealTimeJobDetailsResponse response = client.showRealTimeJobDetails(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkdataartsstudio.v1.region.dataartsstudio_region import DataArtsStudioRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkdataartsstudio.v1 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = DataArtsStudioClient.new_builder() \ .with_credentials(credentials) \ .with_region(DataArtsStudioRegion.value_of("<YOUR REGION>")) \ .build() try: request = ShowRealTimeJobDetailsRequest() request.job_name = "{job_name}" response = client.show_real_time_job_details(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" dataartsstudio "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth, err := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). SafeBuild() if err != nil { fmt.Println(err) return } hcClient, err := dataartsstudio.DataArtsStudioClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). SafeBuild() if err != nil { fmt.Println(err) return } client := dataartsstudio.NewDataArtsStudioClient(hcClient) request := &model.ShowRealTimeJobDetailsRequest{} request.JobName = "{job_name}" response, err := client.ShowRealTimeJobDetails(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
| 状态码 | 描述 |
|---|---|
| 200 | 成功,返回实时集成作业详情。 |
| 400 | 失败,错误状态响应信息。 |