Querying a Job

Function

This API is used to query all or a specified job.

URI

  • URI format
    GET /v1.1/{project_id}/clusters/{cluster_id}/cdm/job/{job_name}?filter={filter}&page_no={page_no}&page_size={page_size}&jobType={jobType}
  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain the project ID, see Obtaining the Project ID, Account Name, and AK/SK.

    cluster_id

    Yes

    String

    Cluster ID. Obtain the value from the response for Creating a Cluster.

    job_name

    Yes

    String

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

    filter

    No

    String

    This parameter is used to enable fuzzy filtration when job_name is set to all.

    page_no

    No

    Integer

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

    page_size

    No

    Integer

    Number of jobs on each page

    jobType

    No

    String

    Job type to be queried. The options are as follows:
    • JobType=NORMAL_JOB: table/file migration job
    • JobType=BATCH_JOB: entire DB migration job

    If this parameter is not specified, only table/file migration jobs are queried by default.

Request

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

Response

  • Sample response
    {
      "total": 1,
      "jobs": [{
        "name": "oracle2hive",
        "type": "NORMAL_JOB",
        "creation-user": "cdm",
        "creation-date": 1514880878504,
        "update-date": 1514880878083,
        "update-user": "cdm",
        "status": "NEW",
        "from-link-name": "oraclelink",
        "from-connector-name": "generic-jdbc-connector",
        "to-link-name": "hivelink",
        "to-connector-name": "hive-connector",
        "from-config-values": {
            "configs": [
              {
                "inputs": [
                  {
                    "name": "fromJobConfig.useSql",
                    "value": "false"
                  },
                  {
                    "name": "fromJobConfig.schemaName",
                    "value": "rf_database"
                  },
                  {
                    "name": "fromJobConfig.tableName",
                    "value": "rf_from"
                  },
                  {
                    "name": "fromJobConfig.columnList",
                    "value": "AA&BB"
                  },
                  {
                    "name": "fromJobConfig.incrMigration",
                    "value": "false"
                  },
                  {
                    "name": "fromJobConfig.createOutTable",
                    "value": "false"
                  }
                ],
                "name": "fromJobConfig"
              }
            ]
          },
        "to-config-values": {
            "configs": [
              {
                "inputs": [
                  {
                    "name": "toJobConfig.hive",
                    "value": "hive"
                  },
                  {
                    "name": "toJobConfig.database",
                    "value": "rf_database"
                  },
                  {
                    "name": "toJobConfig.table",
                    "value": "rf_to"
                  },
                  {
                    "name": "toJobConfig.tablePreparation",
                    "value": "DO_NOTHING"
                  },
                  {
                    "name": "toJobConfig.columnList",
                    "value": "aa&bb&cc&dd"
                  },
                  {
                    "name": "toJobConfig.shouldClearTable",
                    "value": "true"
                  }
                ],
                "name": "toJobConfig"
              }
            ]
          },
        "driver-config-values": {
            "configs": [
              {
                "inputs": [
                  {
                    "name": "throttlingConfig.numExtractors",
                    "value": "1"
                  },
                  {
                    "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"
              }
            ]
          }
        }
      }],
      "page_no": 1,
      "page_size": 20
    }
  • Response parameter description

    Parameter

    Mandatory

    Type

    Description

    total

    No

    Integer

    Number of jobs

    jobs

    Yes

    List

    Job list. For details, see Description of the jobs parameter.

    page_no

    No

    Integer

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

    page_size

    No

    Integer

    Number of jobs on each page

    simple

    No

    Boolean

    When this parameter is set to true, compact information will be returned. In other words, only parameter names and values will be returned. Attributes such as size, type, and id will not be returned.

  • Description of the jobs parameter

    Parameter

    Mandatory

    Type

    Description

    name

    Yes

    String

    Job name

    type

    Yes

    String

    Job type. The options are as follows:

    • NORMAL_JOB: table/file migration
    • BATCH_JOB: entire DB migration

    creation-user

    Yes

    String

    User who created a job

    creation-date

    Yes

    Timestamp

    Time when a job is created

    update-date

    Yes

    Timestamp

    Time when a job is updated

    update-user

    No

    String

    User who updated a job

    status

    No

    String

    Status of a job. The options are as follows:

    • BOOTING: The job is starting.
    • RUNNING: The job is running.
    • SUCCEEDED: The job is executed successfully.
    • FAILED: The job failed.
    • NEW: The job has not been executed.

    from-link-name

    Yes

    String

    Source link name

    from-connector-name

    Yes

    String

    Name of the connector of the source link

    to-link-name

    Yes

    String

    Destination link name

    to-connector-name

    Yes

    String

    Name of the connector of the destination link

    from-config-values

    Yes

    Dictionary

    Source link configuration. For details, see Description of from-config-values.

    to-config-values

    Yes

    Dictionary

    Destination link configuration. For details, see Description of to-config-values.

    driver-config-values

    Yes

    Dictionary

    Job parameter configuration. For details, see Description of driver-config-values.

Return Value

  • Normal

    200

  • Abnormal

    Return Value

    Description

    400 Bad Request

    Request error. For details about the returned error code, see Error Code.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    No operation permission.

    404 Not Found

    The requested resource is not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    Service unavailable.