ListDBTaskSQLJobDetail

更新时间:
复制 MD 格式

Gets the details of the SQL task.

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 this ID.

1276****

PageNumber

integer

No

The page number.

1

PageSize

integer

No

The number of entries per page.

20

Tid

integer

No

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

3***

Response elements

Element

Type

Description

Example

object

The data returned in the response.

RequestId

string

The request ID.

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 that is returned.

JobId is mandatory for this action.

ErrorCode

string

The error code that is returned.

MissingJobId

DBTaskSQLJobDetailList

array<object>

The details of the SQL jobs.

object

The details of the SQL job.

JobDetailId

integer

The ID of the SQL job 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 job.

1276****

DbId

integer

The ID of the physical database.

1988****

Logic

boolean

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

  • true: a logical database

  • false: a physical database

false

Skip

boolean

Indicates whether the SQL script is skipped. Valid values:

  • true: The script was skipped.

  • false: The script was not skipped.

false

SqlType

string

The type of the SQL statement. Examples: DELETE, UPDATE, and ALTER_TABLE.

CREATE_TABLE

Status

string

The status of the SQL job. Valid values:

  • INIT: The job is being initialized.

  • PENDING: The job is pending to be fetched.

  • BE_SCHEDULED: The job is to be scheduled.

  • FAIL: The job failed.

  • SUCCESS: The job was successful.

  • PAUSE: The job is paused.

  • DELETE: The job is deleted.

  • RUNNING: The job is running.

SUCCESS

Log

string

The execution log of the SQL job.

log_info

StartTime

string

The time when the SQL execution started.

2021-12-16 00:00:00

EndTime

string

The time when the SQL execution ended.

2021-12-16 00:00:01

TimeDelay

integer

The duration of the SQL execution, in milliseconds.

38

AffectRows

integer

The number of affected rows.

0

SqlId

integer

The ID of the SQL statement.

TotalCount

integer

The total number of SQL jobs.

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.