All Products
Search
Document Center

:GetFileVersion

最終更新日:Dec 20, 2023

Queries the details of a file version.

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

GetFileVersion

The operation that you want to perform. Set the value to GetFileVersion.

FileId

Long

Yes

1000001

The file ID. You can call the ListFiles operation to query the ID.

ProjectId

Long

No

10000

The DataWorks workspace ID. You can click the Workspace Manage icon in the upper-right corner of the DataStudio page to go to the Workspace page and view the workspace ID.

ProjectIdentifier

String

No

dw_project

The unique identifier of the DataWorks workspace. You can click the identifier in the upper-left corner of the DataStudio page to switch to another workspace.

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

FileVersion

Integer

Yes

2

The file version whose details you want to query.

Response parameters

Parameter

Type

Example

Description

HttpStatusCode

Integer

200

The HTTP status code returned.

ErrorMessage

String

The connection does not exist.

The error message returned.

RequestId

String

0000-ABCD-EFG****

The request ID. You can troubleshoot issues based on the ID.

ErrorCode

String

Invalid.Tenant.ConnectionNotExists

The error code returned.

Success

Boolean

true

Indicates whether the request was successful. Valid values:

  • true

  • false

Data

Object

The details of the file version.

FileContent

String

SHOW TABLES;

The code in the file of the current version.

IsCurrentProd

Boolean

true

Indicates whether the version is the latest version in the production environment. Valid values:

  • true

  • false

Status

String

COMMITTED

The status of the file version. Valid values:

  • COMMITTING

  • COMMITTED or CHECK_OK

  • PACKAGED

  • DEPLOYING

  • DEPLOYED

  • CANCELLED

NodeContent

String

{"cycleType":0,"cronExpress":"00 05 00 * * ?"}

The scheduling configurations of the task that generates the file of the current version.

CommitUser

String

7384234****

The ID of the Alibaba Cloud account that is used to generate the file of the current version.

Comment

String

Second version

The description of the file version.

FilePropertyContent

String

{"fileName":"ods_user_info_d","fileType":10}

The basic information about the file.

FileName

String

ods_user_info_d

The name of the file.

UseType

String

0

The functional module to which the file belongs. Valid values:

  • 0: NORMAL, which indicates DataStudio.

  • 1: MANUAL, which indicates a manually triggered task.

  • 2: MANUAL_BIZ, which indicates a manually triggered workflow.

  • 3: SKIP, which indicates a dry-run task in DataStudio.

  • 10: ADHOCQUERY, which indicates an ad hoc query.

  • 30: COMPONENT, which indicates a snippet.

ChangeType

String

UPDATE

The type of the change to the file of the current version. Valid values: CREATE, UPDATE, and DELETE.

FileVersion

Integer

2

The file version.

CommitTime

Long

1593881265000

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

NodeId

Long

3000001

The ID of the auto triggered task that generates the file of the current version.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetFileVersion
&FileId=1000001
&ProjectId=10000
&ProjectIdentifier=dw_project
&FileVersion=2
&<Common request parameters>

Sample success responses

XML format

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

<GetFileVersionResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <ErrorMessage>The connection does not exist.</ErrorMessage>
    <RequestId>0000-ABCD-EFG****</RequestId>
    <ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
    <Success>true</Success>
    <Data>
        <FileContent>SHOW TABLES;</FileContent>
        <IsCurrentProd>true</IsCurrentProd>
        <Status>COMMITTED</Status>
        <NodeContent>{"cycleType":0,"cronExpress":"00 05 00 * * ?"}</NodeContent>
        <CommitUser>7384234****</CommitUser>
        <Comment>Second version</Comment>
        <FilePropertyContent>{"fileName":"ods_user_info_d","fileType":10}</FilePropertyContent>
        <FileName>ods_user_info_d</FileName>
        <UseType>0</UseType>
        <ChangeType>UPDATE</ChangeType>
        <FileVersion>2</FileVersion>
        <CommitTime>1593881265000</CommitTime>
        <NodeId>3000001</NodeId>
    </Data>
</GetFileVersionResponse>

JSON format

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

{
  "HttpStatusCode" : 200,
  "ErrorMessage" : "The connection does not exist.",
  "RequestId" : "0000-ABCD-EFG****",
  "ErrorCode" : "Invalid.Tenant.ConnectionNotExists",
  "Success" : true,
  "Data" : {
    "FileContent" : "SHOW TABLES;",
    "IsCurrentProd" : true,
    "Status" : "COMMITTED",
    "NodeContent" : "{\"cycleType\":0,\"cronExpress\":\"00 05 00 * * ?\"}",
    "CommitUser" : "7384234****",
    "Comment": "Second version",
    "FilePropertyContent" : "{\"fileName\":\"ods_user_info_d\",\"fileType\":10}",
    "FileName" : "ods_user_info_d",
    "UseType" : 0,
    "ChangeType" : "UPDATE",
    "FileVersion" : 2,
    "CommitTime" : 1593881265000,
    "NodeId" : 3000001
  }
}

Error codes

HTTP status code

Error code

Error message

Description

429

Throttling.Api

The request for this resource has exceeded your available limit.

The number of requests for the resource has exceeded the upper limit.

429

Throttling.System

The DataWorks system is busy. Try again later.

The DataWorks system is busy. Try again later.

429

Throttling.User

Your request is too frequent. Try again later.

Excessive requests have been submitted within a short period of time. Try again later.

500

InternalError.System

An internal system error occurred. Try again later.

An internal error occurred. Try again later.

500

InternalError.UserId.Missing

An internal system error occurred. Try again later.

An internal error occurred. Try again later.

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