All Products
Search
Document Center

DataWorks:GetResource

Last Updated:Nov 05, 2025

Queries the information about a file resource.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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
ProjectIdstringNo

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

You must configure this parameter to specify the DataWorks workspace to which the API operation is applied.

10000
IdstringYes

The ID of the file resource.

860438872620113XXXX

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

E871F6C0-2EFF-5790-A00D-C57543EEXXXX
Resourceobject

The information about the file resource.

Idstring

The ID of the file resource.

860438872620113XXXX
ProjectIdstring

The ID of the workspace to which the file resource belongs.

10000
Namestring

The name of the file resource.

OpenAPI_Test_Resource. py
Ownerstring

The owner of the file resource.

110755000425XXXX
CreateTimelong

The time when the file resource was created. This value is a UNIX timestamp.

1700539206000
ModifyTimelong

The time when the file resource was last modified. This value is a UNIX timestamp.

1700539206000
Specstring

The FlowSpec field information about the file resource. For more information, see FlowSpec .

{ "version": "1.1.0", "kind": "Resource", "spec": { "fileResources": [ { "name": "OpenAPI_Test_Resource.py", "id": "631478864897630XXXX", "script": { "content": "", "path": "XX/OpenAPI_Test/Resource_Test/OpenAPI_Test_Resource.py", "runtime": { "command": "ODPS_PYTHON" } }, "type": "python", "file": { "storage": {} }, "datasource": { "name": "odps_first", "type": "odps" }, "metadata": { "owner": "110755000425XXXX" } } ] } }

Examples

Sample success responses

JSONformat

{
  "RequestId": "E871F6C0-2EFF-5790-A00D-C57543EEXXXX",
  "Resource": {
    "Id": "860438872620113XXXX",
    "ProjectId": 10000,
    "Name": "OpenAPI_Test_Resource. py",
    "Owner": "110755000425XXXX",
    "CreateTime": 1700539206000,
    "ModifyTime": 1700539206000,
    "Spec": {
      "version": "1.1.0",
      "kind": "Resource",
      "spec": {
        "fileResources": [
          {
            "name": "OpenAPI_Test_Resource.py",
            "id": "631478864897630XXXX",
            "script": {
              "content": "",
              "path": "XX/OpenAPI_Test/Resource_Test/OpenAPI_Test_Resource.py",
              "runtime": {
                "command": "ODPS_PYTHON"
              }
            },
            "type": "python",
            "file": {
              "storage": {}
            },
            "datasource": {
              "name": "odps_first",
              "type": "odps"
            },
            "metadata": {
              "owner": "110755000425XXXX"
            }
          }
        ]
      }
    }
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2025-01-13The response structure of the API has changedView Change Details