ListDBTaskSQLJobDetail

Updated at:

Retrieves a list of SQL task details.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dms:ListDBTaskSQLJobDetail

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

JobId

integer

Yes

The ID of the SQL task. You can call the ListDBTaskSQLJob operation to obtain the value of this parameter.

1276****

PageNumber

integer

No

The number of the page to return.

1

PageSize

integer

No

The number of entries to return on each page.

20

Tid

integer

No

The ID of the tenant. You can call the GetUserActiveTenant operation to obtain the value of this parameter.

3***

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The ID of the request.

3F044E33-FE09-58F1-8C61-A0F612EC****

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

ErrorMessage

string

The error message.

JobId is mandatory for this action.

ErrorCode

string

The error code.

MissingJobId

DBTaskSQLJobDetailList

array<object>

The list of SQL task details.

object

The list of SQL task details.

JobDetailId

integer

The ID of the SQL task detail.

24723****

CurrentSql

string

The SQL statement that is currently being executed.

update a set id = 1 where id = 1;

ExecuteCount

integer

The number of executions.

1

JobId

integer

The ID of the SQL task.

1276****

DbId

integer

The ID of the physical database.

1988****

Logic

boolean

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

  • true: The database is a logical database.

  • false: The database is a physical database.

false

Skip

boolean

Indicates whether the execution of the SQL script was skipped. Valid values:

  • true: The execution was skipped.

  • false: The execution was not skipped.

false

SqlType

string

The type of the SQL statement, such as DELETE, UPDATE, or ALTER_TABLE.

CREATE_TABLE

Status

string

The status of the SQL task detail. Valid values:

  • INIT: Initialized.

  • PENDING: Pending capture.

  • BE_SCHEDULED: Pending scheduling.

  • FAIL: Execution failed.

  • SUCCESS: Execution succeeded.

  • PAUSE: Paused.

  • DELETE: Deleted.

  • RUNNING: Executing.

SUCCESS

Log

string

The log details.

log_info

StartTime

string

The start time of the SQL execution.

2021-12-16 00:00:00

EndTime

string

The end time of the SQL execution.

2021-12-16 00:00:01

TimeDelay

integer

The execution duration of the SQL statement, in milliseconds.

38

AffectRows

integer

The number of rows affected by the SQL execution.

0

SqlId

integer

The ID of the SQL task detail.

24723****

TotalCount

integer

The total number of SQL tasks.

1

Examples

Success response

JSON format

{
  "RequestId": "3F044E33-FE09-58F1-8C61-A0F612EC****",
  "Success": true,
  "ErrorMessage": "JobId is mandatory for this action.",
  "ErrorCode": "MissingJobId",
  "DBTaskSQLJobDetailList": [
    {
      "JobDetailId": 0,
      "CurrentSql": "update a set id = 1 where id  = 1;",
      "ExecuteCount": 1,
      "JobId": 0,
      "DbId": 0,
      "Logic": false,
      "Skip": false,
      "SqlType": "CREATE_TABLE",
      "Status": "SUCCESS",
      "Log": "log_info",
      "StartTime": "2021-12-16 00:00:00",
      "EndTime": "2021-12-16 00:00:01",
      "TimeDelay": 38,
      "AffectRows": 0,
      "SqlId": 0
    }
  ],
  "TotalCount": 1
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.