GetFile

Updated at:

Queries the information about a file.

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:*

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectId

integer

No

The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the workspace ID.

You must configure this parameter or the ProjectIdentifier parameter to determine the DataWorks workspace to which the operation is applied.

10000

ProjectIdentifier

string

No

The name of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the workspace name.

You must configure this parameter or the ProjectId parameter to determine the DataWorks workspace to which the operation is applied.

dw_project

FileId

integer

No

The ID of the file. You can call the ListFiles operation to obtain the ID.

100000001

NodeId

integer

No

The ID of the node that is scheduled. You can call the ListFiles operation to obtain the node ID.

200000001

Response elements

Element

Type

Description

Example

object

The response parameters.

HttpStatusCode

integer

The HTTP status code returned.

200

ErrorMessage

string

The error message returned.

The connection does not exist.

RequestId

string

The ID of the request. You can use the ID to troubleshoot issues.

0000-ABCD-EFG****

ErrorCode

string

The error code returned.

Invalid.Tenant.ConnectionNotExists

Success

boolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

Data

object

The details of the file.

File

object

The basic information about the file.

CommitStatus

integer

Indicates whether the latest code in the file is committed. Valid values: 0 and 1. The value 0 indicates that the latest code in the file is not committed. The value 1 indicates that the latest code in the file is committed.

0

AutoParsing

boolean

Indicates whether the automatic parsing feature is enabled for the file. Valid values:

  • true: The automatic parsing feature is enabled for the file.

  • false: The automatic parsing feature is not enabled for the file.

This parameter corresponds to the Analyze Code parameter that is displayed after Same Cycle is selected in the Dependencies section of the Properties tab in the DataWorks console.

true

Owner

string

The ID of the Alibaba Cloud account used by the file owner.

7775674356****

CreateTime

integer

The time when the file was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1593879116000

FileType

integer

The type of the code for the file. The code for files varies based on the file type. For more information, see DataWorks nodes.

10

CurrentVersion

integer

The latest submitted version number of the file.

3

BizId

integer

The ID of the workflow to which the file belongs. This parameter is deprecated and replaced by the BusinessId parameter.

1000001

LastEditUser

string

The ID of the Alibaba Cloud account used to last modify the file.

62465892****

FileName

string

The name of the file.

ods_user_info_d

ConnectionName

string

The name of the data source used to run the task corresponding to the file.

odps_source

UseType

string

The module to which the file belongs. Valid values:

  • NORMAL: The file is used for Data Studio.

  • MANUAL: The file is used for a manually triggered node.

  • MANUAL_BIZ: The file is used for a manually triggered workflow.

  • SKIP: The file is used for a dry-run Data Studio node.

  • ADHOCQUERY: The file is used for an ad hoc query.

  • COMPONENT: The file is used for component management.

NORMAL

FileFolderId

string

The ID of the folder to which the file belongs.

2735c2****

ParentId

integer

The ID of the node group file to which the current file belongs. This parameter is returned only if the current file is an inner file of the node group file.

-1

CreateUser

string

The ID of the Alibaba Cloud account used to create the file.

424732****

IsMaxCompute

boolean

Indicates whether the file needs to be uploaded to MaxCompute.

This parameter applies only to MaxCompute resource files.

true

BusinessId

integer

The ID of the workflow to which the file belongs.

1000001

FileDescription

string

The description of the file.

My first DataWorks file

DeletedStatus

string

The status of the file. Valid values:

  • NORMAL: The file is not deleted.

  • RECYCLE_BIN: The file is stored in the recycle bin.

  • DELETED: The file is deleted.

RECYCLE

LastEditTime

integer

The time when the file was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1593879116000

Content

string

The code in the file.

SHOW TABLES;

NodeId

integer

The ID of the auto triggered node that is generated in the scheduling system after the file is committed.

300001

AdvancedSettings

string

The advanced configurations of the node.

This parameter is valid for an EMR node. This parameter corresponds to the Advanced Settings tab in the right-side navigation pane on the configuration tab of the node in the DataWorks console.

Note

You cannot configure advanced parameters for EMR Shell nodes.

For information about the advanced parameters of each type of EMR node, see Develop EMR tasks.

{"priority":"1","ENABLE_SPARKSQL_JDBC":false,"FLOW_SKIP_SQL_ANALYZE":false,"queue":"default"}

FileId

integer

The ID of the file.

100000001

NodeConfiguration

object

The scheduling configurations of the file.

RerunMode

string

Indicates whether the node that corresponds to the file can be rerun. Valid values:

  • ALL_ALLOWED: The node can be rerun regardless of whether it is successfully run or fails to run.

  • FAILURE_ALLOWED: The node can be rerun only after it fails to run.

  • ALL_DENIED: The node cannot be rerun regardless of whether it is successfully run or fails to run.

This parameter corresponds to the Rerun parameter in the Schedule section of the Properties tab in the DataWorks console.

ALL_ALLOWED

SchedulerType

string

The scheduling type of the node. Valid values:

  • NORMAL: The node is an auto triggered node.

  • MANUAL: The node is a manually triggered node. Manually triggered nodes cannot be automatically triggered. They correspond to the nodes in the Manually Triggered Workflows pane.

  • PAUSE: The node is a paused node.

  • SKIP: The node is a dry-run node. Dry-run nodes are started as scheduled but the system sets the status of the nodes to successful when it starts to run them.

NORMAL

Stop

boolean

Indicates whether the scheduling for the node is suspended Valid values:

  • true: The scheduling for the node is suspended.

  • false: The scheduling for the node is not suspended.

This parameter corresponds to the Recurrence parameter in the Schedule section of the Properties tab in the DataWorks console.

false

ParaValue

string

The scheduling parameters of the node.

This parameter corresponds to the Parameters section of the Properties tab in the DataWorks console. For more information about the configurations of the scheduling parameters, see Configure scheduling parameters.

a=x b=y

StartEffectDate

integer

The start time of automatic scheduling. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter corresponds to the Validity Period parameter in the Schedule section of the Properties tab in the DataWorks console.

936923400000

EndEffectDate

integer

The end time of automatic scheduling. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter corresponds to the Validity Period parameter in the Schedule section of the Properties tab in the DataWorks console.

4155787800000

CycleType

string

The type of the scheduling cycle. Valid values: NOT_DAY and DAY. The value NOT_DAY indicates that the node is scheduled to run by minute or hour. The value DAY indicates that the node is scheduled to run by day, week, or month.

This parameter corresponds to the Scheduling Cycle parameter in the Schedule section of the Properties tab in the DataWorks console.

DAY

DependentNodeIdList

string

The ID of the node on which the node corresponding to the file depends when the DependentType parameter is set to USER_DEFINE. Multiple IDs are separated by commas (,).

The value of this parameter is equivalent to the ID of the node that you specified after you select Previous Cycle and set Depend On to Other Nodes in the Dependencies section of the Properties tab in the DataWorks console.

5,10,15,20

ResourceGroupId

integer

The ID of the resource group that is used to run the node. You can call the ListResourceGroups operation to query the available resource groups in the workspace.

375827434852437

DependentType

string

The type of the cross-cycle scheduling dependency of the node. Valid values:

  • SELF: The instance generated for the node in the current cycle depends on the instance generated for the node in the previous cycle.

  • CHILD: The instance generated for the node in the current cycle depends on the instances generated for the descendant nodes at the nearest level of the node in the previous cycle.

  • USER_DEFINE: The instance generated for the node in the current cycle depends on the instances generated for one or more specified nodes in the previous cycle.

  • NONE: No cross-cycle scheduling dependency type is selected for the node.

USER_DEFINE

AutoRerunTimes

integer

The number of automatic reruns that are allowed after an error occurs.

3

AutoRerunIntervalMillis

integer

The interval between automatic reruns after an error occurs. Unit: milliseconds.

This parameter corresponds to the Rerun Interval parameter that is displayed after the Auto Rerun upon Error check box is selected in the Schedule section of the Properties tab in the DataWorks console.

The interval that you specify in the DataWorks console is measured in minutes. Pay attention to the conversion between the units of time when you call the operation.

120000

CronExpress

string

The CRON expression that represents the periodic scheduling policy of the node.

00 05 00 * * ?

InputList

array<object>

The output names of the parent files on which the current file depends.

object

The upstream file output information.

Input

string

The output name of the parent file on which the current file depends.

This parameter corresponds to the Output Name of Ancestor Node parameter under Parent Nodes after Same Cycle is selected in the Dependencies section of the Properties tab in the DataWorks console.

project.001_out

ParseType

string

The mode of the configuration file dependency. Valid values:

  • MANUAL: Scheduling dependencies are manually configured.

  • AUTO: Scheduling dependencies are automatically parsed.

MANUAL

OutputList

array<object>

The output names of the current file.

This parameter corresponds to the Output Name parameter under Output after Same Cycle is selected in the Dependencies section of the Properties tab in the DataWorks console.

object

The file output information.

RefTableName

string

The output table name of the current file.

This parameter corresponds to the Output Table Name parameter under Output after Same Cycle is selected in the Dependencies section of the Properties tab in the DataWorks console.

ods_user_info_d

Output

string

The output name of the current file.

This parameter corresponds to the Output Name parameter under Output after Same Cycle is selected in the Dependencies section of the Properties tab in the DataWorks console.

dw_project.002_out

StartImmediately

boolean

Indicates whether a node is immediately run after the node is deployed to the production environment.

This parameter is valid only for an EMR Spark Streaming node or an EMR Streaming SQL node. This parameter corresponds to the Start Method parameter in the Schedule section of the Configure tab in the DataWorks console.

true

InputParameters

array<object>

Input context parameters of the node.

This parameter corresponds to the Input Parameters table in the Input and Output Parameters section of the Properties tab in the DataWorks console.

object

The returned result.

ParameterName

string

The name of the input parameter of the node. In the code, you can use the ${...} method to reference the input parameter of the node.

This parameter corresponds to the Parameter Name parameter in the Input Parameters table in the Input and Output Parameters section of the Properties tab in the DataWorks console.

input

ValueSource

string

The value source of the input parameter of the node.

This parameter corresponds to the Value Source parameter in the Input Parameters table in the Input and Output Parameters section of the Properties tab in the DataWorks console.

project_001.parent_node:outputs

OutputParameters

array<object>

Output context parameters of the node.

This parameter corresponds to the Output Parameters table in the Input and Output Parameters section of the Properties tab in the DataWorks console.

object

The returned result.

ParameterName

string

The name of the output parameter of the node.

This parameter corresponds to the Parameter Name parameter in the Output Parameters table in the Input and Output Parameters section of the Properties tab in the DataWorks console.

output

Value

string

The expression of the output context parameter of the node.

This parameter corresponds to the Value parameter in the Output Parameters table in the Input and Output Parameters section of the Properties tab in the DataWorks console.

${bizdate}

Type

string

The type of the output parameter of the node. Valid values:

  • 1: indicates a constant.

  • 2: indicates a variable.

  • 3: indicates a pass-through variable from a parameter node.

This parameter corresponds to the Type parameter in the Output Parameters table in the Input and Output Parameters section of the Properties tab in the DataWorks console.

1

Description

string

The description of the output parameter of the node.

It's a context output parameter.

ApplyScheduleImmediately

string

Indicates whether scheduling configurations immediately take effect after the deployment.

true

IgnoreParentSkipRunningProperty

string

Indicates whether to skip the dry-run property of the ancestor nodes of the node that corresponds to the file. This parameter corresponds to the Skip the dry-run property of the ancestor node parameter that is displayed after you configure the Depend On parameter in the Dependencies section of the Properties tab in the DataWorks console.

true

Timeout

integer

The timeout period.

1

ImageId

string

The ID of the custom image.

m-bp1h4b5a8ogkbll2f3tr

Examples

Success response

JSON format

{
  "HttpStatusCode": 200,
  "ErrorMessage": "The connection does not exist.",
  "RequestId": "0000-ABCD-EFG****",
  "ErrorCode": "Invalid.Tenant.ConnectionNotExists",
  "Success": true,
  "Data": {
    "File": {
      "CommitStatus": 0,
      "AutoParsing": true,
      "Owner": "7775674356****",
      "CreateTime": 1593879116000,
      "FileType": 10,
      "CurrentVersion": 3,
      "BizId": 1000001,
      "LastEditUser": "62465892****",
      "FileName": "ods_user_info_d",
      "ConnectionName": "odps_source",
      "UseType": "NORMAL",
      "FileFolderId": "2735c2****",
      "ParentId": -1,
      "CreateUser": "424732****",
      "IsMaxCompute": true,
      "BusinessId": 1000001,
      "FileDescription": "My first DataWorks file",
      "DeletedStatus": "RECYCLE",
      "LastEditTime": 1593879116000,
      "Content": "SHOW TABLES;",
      "NodeId": 300001,
      "AdvancedSettings": "{\\\"priority\\\":\\\"1\\\",\\\"ENABLE_SPARKSQL_JDBC\\\":false,\\\"FLOW_SKIP_SQL_ANALYZE\\\":false,\\\"queue\\\":\\\"default\\\"}",
      "FileId": 100000001
    },
    "NodeConfiguration": {
      "RerunMode": "ALL_ALLOWED",
      "SchedulerType": "NORMAL",
      "Stop": false,
      "ParaValue": "a=x b=y",
      "StartEffectDate": 936923400000,
      "EndEffectDate": 4155787800000,
      "CycleType": "DAY",
      "DependentNodeIdList": "5,10,15,20",
      "ResourceGroupId": 375827434852437,
      "DependentType": "USER_DEFINE",
      "AutoRerunTimes": 3,
      "AutoRerunIntervalMillis": 120000,
      "CronExpress": "00 05 00 * * ?",
      "InputList": [
        {
          "Input": "project.001_out",
          "ParseType": "MANUAL"
        }
      ],
      "OutputList": [
        {
          "RefTableName": "ods_user_info_d",
          "Output": "dw_project.002_out"
        }
      ],
      "StartImmediately": true,
      "InputParameters": [
        {
          "ParameterName": "input",
          "ValueSource": "project_001.parent_node:outputs"
        }
      ],
      "OutputParameters": [
        {
          "ParameterName": "output",
          "Value": "${bizdate}",
          "Type": "1",
          "Description": "It's a context output parameter."
        }
      ],
      "ApplyScheduleImmediately": "true",
      "IgnoreParentSkipRunningProperty": "true",
      "Timeout": 1,
      "ImageId": "m-bp1h4b5a8ogkbll2f3tr"
    },
    "ResourceDownloadLink": {
      "downloadLink": "http://xx"
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

500 InternalError.System An internal system error occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later.
403 Forbidden.Access Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. No permission, please authorize
429 Throttling.Api The request for this resource has exceeded your available limit.
429 Throttling.System The DataWorks system is busy. Try again later.
429 Throttling.User Your request is too frequent. Try again later.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.