All Products
Search
Document Center

Data Management:ListDBTaskSQLJob

Last Updated:Nov 28, 2024

Queries a list of SQL tasks.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dms:ListDBTaskSQLJoblist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBTaskGroupIdlongYes

The ID of the SQL task group. You can call the GetStructSyncJobDetail operation to obtain this parameter.

1324235
PageNumberlongNo

The number of the page to return.

1
PageSizelongNo

The number of entries to return on each page.

20
TidlongNo

The ID of the tenant.

Note : To view the ID of the tenant, log on to the Data Management (DMS) console and move the pointer over the profile picture in the upper-right corner. For more information, see Manage DMS tenants.
1

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request.

F6C47680-8D2D-43A4-8902-F2740D71A398
Successboolean

Indicates whether the request is successful.

true
ErrorMessagestring

The error message returned if the request failed.

UnknownError
ErrorCodestring

The error code returned if the request failed.

UnknownError
DBTaskSQLJobListarray<object>

The list of the SQL tasks.

DBTaskSQLJobobject

The SQL task.

JobIdlong

The ID of the SQL task.

123435
JobTypestring

The type of the SQL task.

STRUCT_SYNC
Commentstring

The description of the SQL task.

test
DbSearchNamestring

The name that is used to search for the database.

test@xxx:3306【test】
DbIdlong

The ID of the database.

43214523
Logicboolean

Indicates whether the database is a logical database. Valid values:

  • true: The database is a logical database.
  • false: The database is a logical database.
false
CreateTimestring

The time when the SQL task was created.

2021-02-18 17:49:20
LastExecTimestring

The time when the SQL task was last executed.

2021-02-18 17:49:31
DbTaskGroupIdlong

The ID of the SQL task group.

4324132
Statusstring

The state of the SQL task. Valid values:

  • INIT: The SQL task was initialized.
  • PENDING: The SQL task waited to be run.
  • BE_SCHEDULED: The SQL task waited to be scheduled.
  • FAIL: The SQL task failed.
  • SUCCESS: The SQL task was successful.
  • PAUSE: The SQL task was paused.
  • DELETE: The SQL task was deleted.
  • RUNNING: The SQL task was being run.
SUCCESS
Transactionalboolean

Indicates whether the SQL task is executed as a transaction. Valid values:

  • true: The SQL task is executed as a transaction.
  • false: The SQL task is not executed as a transaction.
false
TotalCountlong

The total number of the SQL tasks.

1

Examples

Sample success responses

JSONformat

{
  "RequestId": "F6C47680-8D2D-43A4-8902-F2740D71A398",
  "Success": true,
  "ErrorMessage": "UnknownError",
  "ErrorCode": "UnknownError",
  "DBTaskSQLJobList": [
    {
      "JobId": 123435,
      "JobType": "STRUCT_SYNC",
      "Comment": "test",
      "DbSearchName": "test@xxx:3306【test】",
      "DbId": 43214523,
      "Logic": false,
      "CreateTime": "2021-02-18 17:49:20",
      "LastExecTime": "2021-02-18 17:49:31",
      "DbTaskGroupId": 4324132,
      "Status": "SUCCESS",
      "Transactional": false
    }
  ],
  "TotalCount": 1
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history