ListInstances

Updated at:

Retrieves a list of instances.

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

dataworks:*

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectEnv

string

Yes

The runtime environment. Valid values:

  • PROD: production environment.

  • DEV: development environment.

Valid values:

  • PROD :

    Production environment.

  • DEV :

    Development environment.

PROD

NodeId

integer

No

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

100000000000

NodeName

string

No

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

openmr_8****

Owner

string

No

The ID of the owner, which is the UID of the workspace administrator. You can logon to the Alibaba Cloud Management Console and view the UID in the Security Settings section of the account management page.

193379****

ProjectId

integer

Yes

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

12345

BizName

string

No

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

test_bizName

ProgramType

string

No

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

ODPS_SQL

PageNumber

integer

No

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

1

PageSize

integer

No

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

10

DagId

integer

No

The DAG ID. The DagId can be the DagId returned by operations such as RunCycleDagNodes for data backfill, RunSmokeTest for smoke testing, and RunManualDagNodes for manual workflows.

11111

Bizdate

string

No

The date for which to retrieve the instance list. Format: yyyy-MM-dd HH:mm:ss.

2020-02-02 00:00:00

BeginBizdate

string

No

The start date for which to retrieve the instance list. Format: yyyy-MM-dd HH:mm:ss.

2020-02-02 00:00:00

EndBizdate

string

No

The end date for which to retrieve the instance list. Format: yyyy-MM-dd HH:mm:ss.

2020-02-03 00:00:00

Status

string

No

The status of the node. Valid values:

  • NOT_RUN: The node is not run.

  • WAIT_TIME: The node is waiting for the scheduled time (DueTime or CycTime) to arrive.

  • WAIT_RESOURCE: The node is waiting for resources.

  • RUNNING: The node is running.

  • CHECKING: The node has been sent to Data Quality for data validation.

  • CHECKING_CONDITION: The node is undergoing branch condition verification.

  • FAILURE: Failed to execute.

  • SUCCESS: Execute successfully.

NOT_RUN

OrderBy

string

No

The sorting rule for the returned results. Valid values:

  • CREATE_TIME_DESC: sorted by creation time in descending order.

  • INSTANCE_ID_DESC: default value. Sorted by instance ID in descending order.

Valid values:

  • CREATE_TIME_DESC :

    Sorted by creation time in descending order.

  • INSTANCE_ID_DESC :

    Sorted by instance ID in descending order.

INSTANCE_ID_DESC

Response elements

Element

Type

Description

Example

object

The response parameters.

HttpStatusCode

integer

The HTTP status code.

200

RequestId

string

The request ID. You can use this ID to locate logs and troubleshoot issues.

E6F0DBDD-5AD****

ErrorMessage

string

The error message.

The project does not exist.

ErrorCode

string

The error code.

Invalid.Tenant.ProjectNotExists

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

Data

object

The list of instances.

PageNumber

integer

The page number.

1

PageSize

integer

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

10

TotalCount

integer

The total number of instances.

66

Instances

array<object>

The instance information.

object

The returned data.

Status

string

The status of the node. Valid values:

  • NOT_RUN(1): The node is not run.

  • WAIT_TIME(2): The node is waiting for the scheduled time to arrive.

  • WAIT_RESOURCE(3): The node has been sent to the execution engine and is waiting for resources to be scheduled.

  • RUNNING(4): The node is running.

  • CHECKING(7): The node has finished running and has been sent to Data Quality for data verification.

  • CHECKING_CONDITION(8): The node has finished running and is undergoing branch condition verification.

  • WAIT_TRIGGER(9): The node is waiting to be triggered. A trigger-based node enters this state after the waiting time elapses.

  • FAILURE(5): The node failed to run.

  • SUCCESS(6): The node ran successfully.

NOT_RUN

CycTime

integer

The scheduled runtime of the node.

The value is a 13-digit number, such as 1590422400000.

1590422400000

BeginRunningTime

integer

The time when the instance started running.

The value is a 13-digit number, such as 1590416703313.

1590416703313

FinishTime

integer

The time when the scheduled node finished running.

The value is a 13-digit number, such as 1590416703313.

1590416703313

ErrorMessage

string

[Deprecated] The error message of the instance run. You can call GetInstanceLog to obtain the error information of the executed task.

error message

CreateTime

integer

The time when the instance was created.

The value is a 13-digit number, such as 1590416703313.

1590416703313

DagId

integer

The workflow ID.

33845

Priority

integer

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

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

1

TaskType

string

The scheduling type of the task instance. Valid values:

  • NORMAL(0): The node is a normal scheduled node that is triggered by daily scheduling.

  • MANUAL(1): The node is a manual node that is not triggered by daily scheduling.

  • PAUSE(2): The node is a frozen node that is triggered by daily scheduling but is set to failed when scheduling starts.

  • SKIP(3): The node is a dry-run node that is triggered by daily scheduling but is set to successful when scheduling starts.

  • SKIP_UNCHOOSE(4): The node is an unselected node in a temporary workflow. It exists only in temporary workflows and is set to successful when scheduling starts.

  • SKIP_CYCLE(5): The node is a weekly or monthly node whose scheduling cycle has not arrived. It is triggered by daily scheduling but is set to successful when scheduling starts.

  • CONDITION_UNCHOOSE(6): The upstream instance contains a branch (IF) node, but this downstream node is not selected by the branch node and is set to a dry-run node.

  • REALTIME_DEPRECATED(7): The node is an expired periodic instance generated in real time. This type of node is set to successful.

NORMAL(0)

ParamValues

string

The parameter information.

bizdate=$bizdate tbods=$tbods

Connection

string

The connection string.

odps_source

BaselineId

integer

The baseline ID.

123123

DqcType

integer

The DQC type. Valid values:

  • 0: associated with DQC.

  • 1: not associated with DQC.

1

DagType

string

The type of the workflow. Valid values:

  • DAILY(0): daily scheduling workflow.

  • MANUAL(1): manual task workflow.

  • SMOKE_TEST(2): smoke testing workflow.

  • SUPPLY_DATA(3): data backfill workflow.

  • MANUAL_FLOW(4): manually triggered dataflow PAI workflow (such as running a workflow in the IDE).

  • BUSINESS_PROCESS_DAG(5): manual business process workflow.

DAILY

BusinessId

integer

The business process ID.

123

TaskRerunTime

integer

The number of remaining reruns for the instance. The value can be empty or an integer greater than or equal to 0.

  • Empty: The node corresponding to this instance does not have automatic rerun configured.

  • 0: The instance cannot be rerun.

  • An integer greater than 0 (n): The instance can be rerun n times. For example, if the value is 1, the remaining rerun count is 1. If the value is 2, the remaining rerun count is 2, and so on. The initial value is the automatic rerun count defined for the corresponding node plus 1.

0

ModifyTime

integer

The time when the scheduled node was last modified.

The value is a 13-digit number, such as 1590416703313.

1590416703313

Repeatability

boolean

Indicates whether the instance task can be rerun.

true

RepeatInterval

integer

The interval at which the node is rescheduled after a failure. Unit: milliseconds.

60000

InstanceId

integer

The instance ID.

1234

BeginWaitResTime

integer

The time when the instance started waiting for resources.

The value is a 13-digit number, such as 1590416703313.

1590416703313

RelatedFlowId

integer

The ID of the associated business process.

123456

Bizdate

integer

The business date of the scheduled node. This is typically the day before the node runs.

The value is a 13-digit number, such as 1590336000000.

1590336000000

NodeName

string

The node name.

kzh

BeginWaitTimeTime

integer

The time when the instance started waiting for scheduling.

The value is a 13-digit number, such as 1590416703313.

1590416703313

DqcDescription

string

The DQC partitioning rule string.

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

NodeId

integer

The node ID.

33115

CreateUser

string

The user who triggered the instance to run. For example, if user Test triggered a data backfill instance, the CreateUser is Test.

Test

Examples

Success response

JSON format

{
  "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_source",
        "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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.