Updated on 2022-09-15 GMT+08:00

Querying a Job

Function

This API is used to query jobs.

URI

GET /v1.1/{project_id}/clusters/{cluster_id}/cdm/job/{job_name}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

cluster_id

Yes

String

Cluster ID

job_name

Yes

String

Job name. When this parameter is set to all, all jobs are to be queried.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

filter

No

String

When job_name is all, this parameter is used for fuzzy job filtering.

page_no

No

Integer

Page number

Minimum: 1

page_size

No

Integer

Number of jobs on each page. The value ranges from 10 to 100.

Minimum: 10

Maximum: 100

jobType

No

String

Type of the jobs to be queried

  • jobType=NORMAL_JOB: table/file migration job

  • jobType=BATCH_JOB: entire DB migration job

  • jobType=SCENARIO_JOB: scenario migration job If this parameter is not specified, only table/file migration jobs are queried by default.

Enumeration values:

  • NORMAL_JOB

  • BATCH_JOB

  • SCENARIO_JOB

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Integer

Number of jobs

jobs

Array of Job objects

Job list. For details, see the descriptions of jobs parameters.

page_no

Integer

Page number. Jobs on the specified page will be returned.

page_size

Integer

Number of jobs on each page.

Table 5 Job

Parameter

Type

Description

job_type

String

Job type

  • NORMAL_JOB: table/file migration

  • BATCH_JOB: entire DB migration

  • SCENARIO_JOB: scenario migration

Enumeration values:

  • NORMAL_JOB

  • BATCH_JOB

  • SCENARIO_JOB

from-connector-name

String

Source link type

to-config-values

ConfigValues object

Destination link parameter configuration

to-link-name

String

Destination link name

driver-config-values

ConfigValues object

Job parameter configuration

from-config-values

ConfigValues object

Source link parameter configuration

to-connector-name

String

Destination link type

name

String

Job name, which contains 1 to 240 characters

Minimum: 1

Maximum: 240

from-link-name

String

Source link name

creation-user

String

User who created the job

creation-date

Long

Time when the job was created, accurate to millisecond

update-date

Long

Time when the job was last updated, accurate to millisecond

is_incre_job

Boolean

Incremental or not

flag

Integer

Flag

files_read

Integer

Number of read files

update-user

String

User who last updated the job

external_id

String

External ID

type

String

Task type

execute_start_date

Long

Execution start date

delete_rows

Integer

Number of deleted rows

enabled

Boolean

Whether to activate the link

bytes_written

Long

Number of written bytes

id

Integer

Job ID

is_use_sql

Boolean

Whether to use SQL statements

update_rows

Integer

Number of updated rows

group_name

String

Group name

bytes_read

Long

Number of read bytes

execute_update_date

Long

Execution update date

write_rows

Integer

Number of written rows

rows_written

Integer

Number of written rows

rows_read

Long

Number of rows that are read

files_written

Integer

Number of written files

is_incrementing

Boolean

Incremental or not

execute_create_date

Long

Execution creation date

status

String

Job execution status

  • BOOTING: The job is starting.

  • RUNNING: The job is running.

  • SUCCEEDED: The job was successfully executed.

  • FAILED: The job execution failed.

  • NEW: The job was not executed.

Table 6 ConfigValues

Parameter

Type

Description

configs

Array of configs objects

The data structures of source link parameters, destination link parameters, and job parameters are the same. However, the inputs parameter varies. For details, see the descriptions of configs parameters.

extended-configs

extended-configs object

Extended configuration. For details, see the descriptions of extended-configs parameters.

Table 7 extended-configs

Parameter

Type

Description

name

String

Name

value

String

Value

Table 8 extended-configs

Parameter

Type

Description

name

String

Name

value

String

Value

Table 9 configs

Parameter

Type

Description

inputs

Array of Input objects

Input parameter list. Each element in the list is in name,value format. For details, see the descriptions of inputs parameters. In the from-config-values data structure, the value of this parameter varies with the source link type. For details, see section "Source Job Parameters" in the Cloud Data Migration User Guide. In the to-cofig-values data structure, the value of this parameter varies with the destination link type. For details, see section "Destination Job Parameters" in the Cloud Data Migration User Guide. For details about the inputs parameter in the driver-config-values data structure, see the job parameter descriptions.

name

String

Configuration name. The value is fromJobConfig for a source job, toJobConfig for a destination job, and linkConfig for a link.

id

Integer

Configuration ID

type

String

Configuration type

Table 10 Input

Parameter

Type

Description

name

String

Parameter name

value

String

Parameter value

type

String

Value type

Table 11 extended-configs

Parameter

Type

Description

name

String

Name

value

String

Value

Example Requests

GET /v1.1/1551c7f6c808414d8e9f3c514a170f2e/clusters/6ec9a0a4-76be-4262-8697-e7af1fac7920/cdm/job/all?jobType=NORMAL_JOB

Example Responses

Status code: 200

ok

{
  "total" : 1,
  "jobs" : [ {
    "job_type" : "NORMAL_JOB",
    "from-connector-name" : "elasticsearch-connector",
    "to-config-values" : {
      "configs" : [ {
        "inputs" : [ {
          "name" : "toJobConfig.streamName",
          "value" : "dis-lkGm"
        }, {
          "name" : "toJobConfig.separator",
          "value" : "|"
        }, {
          "name" : "toJobConfig.columnList",
          "value" : "1&2&3"
        } ],
        "name" : "toJobConfig"
      } ]
    },
    "to-link-name" : "dis",
    "driver-config-values" : {
      "configs" : [ {
        "inputs" : [ {
          "name" : "throttlingConfig.numExtractors",
          "value" : "1"
        }, {
          "name" : "throttlingConfig.submitToCluster",
          "value" : "false"
        }, {
          "name" : "throttlingConfig.numLoaders",
          "value" : "1"
        }, {
          "name" : "throttlingConfig.recordDirtyData",
          "value" : "false"
        } ],
        "name" : "throttlingConfig"
      }, {
        "inputs" : { },
        "name" : "jarConfig"
      }, {
        "inputs" : [ {
          "name" : "schedulerConfig.isSchedulerJob",
          "value" : "false"
        }, {
          "name" : "schedulerConfig.disposableType",
          "value" : "NONE"
        } ],
        "name" : "schedulerConfig"
      }, {
        "inputs" : { },
        "name" : "transformConfig"
      }, {
        "inputs" : [ {
          "name" : "retryJobConfig.retryJobType",
          "value" : "NONE"
        } ],
        "name" : "retryJobConfig"
      } ]
    },
    "from-config-values" : {
      "configs" : [ {
        "inputs" : [ {
          "name" : "fromJobConfig.index",
          "value" : "52est"
        }, {
          "name" : "fromJobConfig.type",
          "value" : "est_array"
        }, {
          "name" : "fromJobConfig.columnList",
          "value" : "array_f1_int:long&array_f2_text:string&array_f3_object:nested"
        }, {
          "name" : "fromJobConfig.splitNestedField",
          "value" : "false"
        } ],
        "name" : "fromJobConfig"
      } ]
    },
    "to-connector-name" : "dis-connector",
    "name" : "es_css",
    "from-link-name" : "css"
  } ],
  "page_no" : 1,
  "page_size" : 10
}

Status Codes

Status Code

Description

200

ok

Error Codes

See Error Codes.