All Products
Search
Document Center

DataWorks:ListInstances

Last Updated:Oct 31, 2023

Queries instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

ListInstances

The operation that you want to perform.

ProjectEnv

String

Yes

PROD

The environment of the workspace. Valid values: PROD and DEV. A value of PROD indicates the production environment. A value of DEV indicates the development environment.

NodeId

Long

Yes

100000000000

The ID of the node. You can call the ListNodes operation to query the ID of the node.

NodeName

String

No

openmr_8****

The name of the node. You can call the ListNodes operation to query the name of the node.

Owner

String

No

193379****

The ID of the Alibaba Cloud account used by the workspace administrator. You can log on to the Alibaba Cloud Management Console and view the ID on the Basic Information page of the Account Center console.

ProjectId

Long

Yes

12345

The ID of the workspace. You can call the ListProjects operation to query the ID of the workspace.

BizName

String

No

test_bizName

The name of the workflow. You can call the ListBusiness operation to query the name of the workflow.

ProgramType

String

No

ODPS_SQL

The type of the node. You can call the ListNodes operation to query the type of the node.

PageNumber

Integer

No

1

The page number. Minimum value:1. Maximum value: 100.

PageSize

Integer

No

10

The number of entries per page. Default value: 10. Maximum value: 100.

You cannot specify the sorting method for the instances to be returned by this operation. By default, the instances are sorted in descending order of their IDs.

DagId

Long

No

11111

The ID of the directed acyclic graph (DAG). You can set this parameter to the value of the DagId parameter returned by the RunCycleDagNodes, RunSmokeTest, or RunManualDagNodes operation. The RunManualDagNodes operation is used to backfill data, the RunSmokeTest operation is used to perform smoke testing, and the RunManualDagNodes operation is used to run nodes in a manually triggered workflow.

Bizdate

String

No

2020-02-02 00:00:00

The data timestamp of the instances that you want to query. Specify the timestamp in the yyyy-MM-dd HH:mm:ss format.

BeginBizdate

String

No

2020-02-02 00:00:00

The beginning of the time range to query. Specify the time in the yyyy-MM-dd HH:mm:ss format.

EndBizdate

String

No

2020-02-03 00:00:00

The end of the time range to query. Specify the time in the yyyy-MM-dd HH:mm:ss format.

Status

String

No

NOT_RUN

The status of the node. Valid values:

  • NOT_RUN: The node is not run.

  • WAIT_TIME: The node is waiting for the scheduling time to arrive.

  • WAIT_RESOURCE: The node is waiting for resources.

  • RUNNING: The node is running.

  • CHECKING: Data quality is being checked for the node.

  • CHECKING_CONDITION: Branch conditions are being checked for the node.

  • FAILURE: The node fails to run.

  • SUCCESS: The node is successfully run.

Response parameters

Parameter

Type

Example

Description

HttpStatusCode

Integer

200

The HTTP status code.

RequestId

String

E6F0DBDD-5AD****

The request ID. You can locate logs and troubleshoot issues based on the ID.

ErrorMessage

String

The project does not exist.

The error message.

ErrorCode

String

Invalid.Tenant.ProjectNotExists

The error code.

Success

Boolean

true

Indicates whether the request was successful. Valid values:

  • true

  • false

Data

Object

The instances returned.

PageNumber

Integer

1

The page number.

PageSize

Integer

10

The number of entries per page. Maximum value: 100. Default value: 10.

TotalCount

Integer

66

The total number of instances.

Instances

Array of Instance

The information about the instances.

Status

String

NOT_RUN

The status of the node. Valid values:

  • NOT_RUN: The node is not run.

  • WAIT_TIME: The node is waiting for the scheduling time to arrive.

  • WAIT_RESOURCE: The node is waiting for resources.

  • RUNNING: The node is running.

  • CHECKING: Data quality is being checked for the node.

  • CHECKING_CONDITION: Branch conditions are being checked for the node.

  • FAILURE: The node fails to run.

  • SUCCESS: The node is successfully run.

CycTime

Long

1590422400000

The time when the node was scheduled to run.

BeginRunningTime

Long

1590416703313

The time when the instance started to run.

FinishTime

Long

1590416703313

The time when the node stopped running.

ErrorMessage

String

error message

The error message.

This parameter is deprecated. You can call the GetInstanceLog operation to query the error information related to the node.

CreateTime

Long

1590416703313

The time when the instance was generated.

DagId

Long

33845

The ID of the workflow.

Priority

Integer

1

The priority of the instance. Valid values: 1, 3, 5, 7, and 8.

A greater value indicates a higher priority. Default value: 1.

TaskType

String

NORMAL(0)

The scheduling type of the node. Valid values:

  • NORMAL(0): The node is an auto triggered node. The scheduling system regularly runs the node.

  • MANUAL(1): The node is a manually triggered node. The scheduling system does not regularly run the node.

  • PAUSE(2): The node is a frozen node. The scheduling system regularly runs the node but sets the status of the node to failed when the scheduling system starts to run the node.

  • SKIP(3): The node is a dry-run node. The scheduling system regularly runs the node but sets the status of the node to succeeded when the scheduling system starts to run the node.

  • SKIP_UNCHOOSE(4): The node is an unselected node in a temporary workflow. This type of node exists only in temporary workflows. The scheduling system sets the status of the node to succeeded when the scheduling system starts to run the node.

  • SKIP_CYCLE(5): The node is a node that is scheduled by the week or month and is waiting for the scheduled time to arrive. The scheduling system regularly runs the node but sets the status of the node to succeeded when the scheduling system starts to run the node.

  • CONDITION_UNCHOOSE(6): The node is not selected by its ancestor branch node and is run as a dry-run node.

  • REALTIME_DEPRECATED(7): The node has instances that are generated in real time but deprecated. The scheduling system sets the status of the node to succeeded.

ParamValues

String

bizdate=$bizdate tbods=$tbods

The parameters related to the node.

Connection

String

odps_first

The connection string.

BaselineId

Long

123123

The ID of the baseline.

DqcType

Integer

1

Indicates whether the instance is associated with a monitoring rule in Data Quality. Valid values:

  • 0: The instance is associated with a monitoring rule in Data Quality.

  • 1: The instance is not associated with a monitoring rule in Data Quality.

DagType

String

DAILY

The type of the workflow. Valid values:

  • DAILY: The workflow is used to run auto triggered nodes.

  • MANUAL: The workflow is used to run manually triggered nodes.

  • SMOKE_TEST: The workflow is used to perform smoke testing.

  • SUPPLY_DATA: The workflow is used to backfill data.

BusinessId

Long

123

The ID of the workflow.

TaskRerunTime

Integer

0

The number of times the node can be rerun. The value of this parameter can be empty or an integer that is greater than or equal to 0.

  • If the value of this parameter is empty, the number of times that the node can be rerun is not specified.

  • If the value of this parameter is 0, the node cannot be rerun.

  • If the value of this parameter is a positive integer such as n, the node can still be rerun n times. For example, if the value of this parameter is 1, the node can still be rerun once. If the value of this parameter is 2, the node can still be rerun twice.

ModifyTime

Long

1590416703313

The time when the node was last modified.

Repeatability

Boolean

true

Indicates whether the node can be rerun.

RepeatInterval

Long

60000

The interval at which the node is rerun after the node fails to run. Unit: milliseconds.

InstanceId

Long

1234

The ID of the instance.

BeginWaitResTime

Long

1590416703313

The time when the instance started to wait for resources.

RelatedFlowId

Long

123456

The ID of the workflow to which the node belongs.

Bizdate

Long

1590336000000

The data timestamp of the instance. In most cases, the value is one day before the time when the instance was run.

NodeName

String

kzh

The name of the node.

BeginWaitTimeTime

Long

1590416703313

The time when the instance started to wait to be scheduled.

DqcDescription

String

[{"projectName":"ztjy_dim","tableName":"dim_user_agent_manage_area_a","partition":"ds\u003d$[yyyy-mm-dd-1]"}]

The table and partition filter expression in Data Quality that are associated with the node.

NodeId

Long

33115

The ID of the node.

CreateUser

String

Test

The name of the account that is used to run the instance. For example, if an account named Test was used to run the instance to backfill data, the value of this parameter is Test.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListInstances
&ProjectEnv=PROD
&NodeId=100000000000
&NodeName=openmr_8****
&Owner=193379****
&ProjectId=12345
&BizName=test_bizName
&ProgramType=ODPS_SQL
&PageNumber=1
&PageSize=10
&DagId=11111
&Bizdate=2020-02-02 00:00:00
&BeginBizdate=2020-02-02 00:00:00
&EndBizdate=2020-02-03 00:00:00
&Status=NOT_RUN
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListInstancesResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <RequestId>E6F0DBDD-5AD****</RequestId>
    <ErrorMessage>The project does not exist.</ErrorMessage>
    <ErrorCode>Invalid.Tenant.ProjectNotExists</ErrorCode>
    <Success>true</Success>
    <Data>
        <PageNumber>1</PageNumber>
        <PageSize>10</PageSize>
        <TotalCount>66</TotalCount>
        <Instances>
            <Status>NOT_RUN</Status>
            <CycTime>1590422400000</CycTime>
            <BeginRunningTime>1590416703313</BeginRunningTime>
            <FinishTime>1590416703313</FinishTime>
            <ErrorMessage>error message</ErrorMessage>
            <CreateTime>1590416703313</CreateTime>
            <DagId>33845</DagId>
            <Priority>1</Priority>
            <TaskType>NORMAL(0)</TaskType>
            <ParamValues>bizdate=$bizdate tbods=$tbods</ParamValues>
            <Connection>odps_first</Connection>
            <BaselineId>123123</BaselineId>
            <DqcType>1</DqcType>
            <DagType>DAILY</DagType>
            <BusinessId>123</BusinessId>
            <TaskRerunTime>0</TaskRerunTime>
            <ModifyTime>1590416703313</ModifyTime>
            <Repeatability>true</Repeatability>
            <RepeatInterval>60000</RepeatInterval>
            <InstanceId>1234</InstanceId>
            <BeginWaitResTime>1590416703313</BeginWaitResTime>
            <RelatedFlowId>123456</RelatedFlowId>
            <Bizdate>1590336000000</Bizdate>
            <NodeName>kzh</NodeName>
            <BeginWaitTimeTime>1590416703313</BeginWaitTimeTime>
            <DqcDescription>[{"projectName":"ztjy_dim","tableName":"dim_user_agent_manage_area_a","partition":"ds\u003d$[yyyy-mm-dd-1]"}]</DqcDescription>
            <NodeId>33115</NodeId>
            <CreateUser>Test</CreateUser>
        </Instances>
    </Data>
</ListInstancesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "HttpStatusCode" : 200,
  "RequestId" : "E6F0DBDD-5AD****",
  "ErrorMessage" : "The project does not exist.",
  "ErrorCode" : "Invalid.Tenant.ProjectNotExists",
  "Success" : true,
  "Data" : {
    "PageNumber" : 1,
    "PageSize" : 10,
    "TotalCount" : 66,
    "Instances" : {
      "Status" : "NOT_RUN",
      "CycTime" : 1590422400000,
      "BeginRunningTime" : 1590416703313,
      "FinishTime" : 1590416703313,
      "ErrorMessage" : "error message",
      "CreateTime" : 1590416703313,
      "DagId" : 33845,
      "Priority" : 1,
      "TaskType" : "NORMAL(0)",
      "ParamValues" : "bizdate=$bizdate tbods=$tbods",
      "Connection" : "odps_first",
      "BaselineId" : 123123,
      "DqcType" : 1,
      "DagType" : "DAILY",
      "BusinessId" : 123,
      "TaskRerunTime" : 0,
      "ModifyTime" : 1590416703313,
      "Repeatability" : true,
      "RepeatInterval" : 60000,
      "InstanceId" : 1234,
      "BeginWaitResTime" : 1590416703313,
      "RelatedFlowId" : 123456,
      "Bizdate" : 1590336000000,
      "NodeName" : "kzh",
      "BeginWaitTimeTime" : 1590416703313,
      "DqcDescription" : "[{\"projectName\":\"ztjy_dim\",\"tableName\":\"dim_user_agent_manage_area_a\",\"partition\":\"ds\\u003d$[yyyy-mm-dd-1]\"}]",
      "NodeId" : 33115,
      "CreateUser" : "Test"
    }
  }
}

Error codes

For a list of error codes, see Service error codes.