All Products
Search
Document Center

DataWorks:GetDag

Last Updated:Sep 03, 2024

Queries the information about a directed acyclic graph (DAG). You can call the GetDag operation to query the information about the DAG for a manually triggered workflow, a manually triggered node, or a data backfill instance. However, you cannot query the information about the DAG for an auto triggered node or an auto triggered workflow.

Operation description

Supported DAG types:

  • MANUAL: DAG for a manually triggered workflow
  • SMOKE_TEST: DAG for a smoke testing workflow
  • SUPPLY_DATA: DAG for a data backfill instance
  • BUSINESS_PROCESS_DAG: DAG for a one-time workflow

Supported DAG states:

  • CREATED
  • RUNNING
  • FAILURE
  • SUCCESS

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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
dataworks:*get
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DagIdlongYes

The ID of the DAG. You can use one of the following method to obtain the ID:

  • Call the RunCycleDagNodes operation and obtain the value of the Data response parameter.
  • Call the RunSmokeTest operation and obtain the value of the Data response parameter.
  • Call the RunManualDagNodes operation and obtain the value of the DagId response parameter.
123141452344525
ProjectEnvstringYes

The environment of the workspace. Valid values: PROD and DEV.

PROD

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

HttpStatusCodeinteger

The HTTP status code.

200
RequestIdstring

The request ID.

7782a299-b291-4fee-8424-cf8058efa8e8
ErrorMessagestring

The error message.

The connection does not exist.
ErrorCodestring

The error code.

Invalid.Tenant.ConnectionNotExists
Successboolean

Indicates whether the request was successful.

true
Dataobject

The details of the DAG.

Typestring

The type of the DAG. Valid values: MANUAL, SMOKE_TEST, SUPPLY_DATA, and BUSINESS_PROCESS_DAG. The value MANUAL indicates the DAG for a manually triggered workflow. The value SMOKE_TEST indicates the DAG for a smoke testing workflow. The value SUPPLY_DATA indicates the DAG for a data backfill instance. The value BUSINESS_PROCESS_DAG indicates the DAG for a one-time workflow.

MANUAL_FLOW
Statusstring

The status of the DAG. Valid values: CREATED, RUNNING, FAILURE, and SUCCESS.

FAILURE
FinishTimelong

The time when the DAG finished running.

1605052800000
CreateTimelong

The time when the DAG was created.

1605052800000
ProjectIdlong

The workspace ID.

112345
DagIdlong

The DAG ID.

351249682
Gmtdatelong

The time when the DAG was scheduled to run.

1605052800000
StartTimelong

The time when the DAG started to run.

1605052800000
CreateUserstring

The creator.

1736629400048545
Bizdatelong

The data timestamp.

1605052800000
Namestring

The name of the DAG.

test_dag
ModifyTimelong

The time when the DAG was last modified.

1605052800000
OpSeqlong

The sequence number of the operation.

123

Examples

Sample success responses

JSONformat

{
  "HttpStatusCode": 200,
  "RequestId": "7782a299-b291-4fee-8424-cf8058efa8e8",
  "ErrorMessage": "The connection does not exist.",
  "ErrorCode": "Invalid.Tenant.ConnectionNotExists",
  "Success": true,
  "Data": {
    "Type": "MANUAL_FLOW",
    "Status": "FAILURE",
    "FinishTime": 1605052800000,
    "CreateTime": 1605052800000,
    "ProjectId": 112345,
    "DagId": 351249682,
    "Gmtdate": 1605052800000,
    "StartTime": 1605052800000,
    "CreateUser": "1736629400048545",
    "Bizdate": 1605052800000,
    "Name": "test_dag",
    "ModifyTime": 1605052800000,
    "OpSeq": 123
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history