Queries file versions.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListFileVersions |
The operation that you want to perform. |
FileId | Long | Yes | 100000001 |
The ID of the file. You can call the ListFiles operation to query the ID. |
ProjectId | Long | Yes | 10000 |
The ID of the DataWorks workspace. You can click the Workspace Manage icon in the upper-right corner of the DataStudio page to go to the Workspace Management page and view the workspace ID. |
RegionId | String | Yes | cn-zhangjiakou |
The region 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 specify either this parameter or ProjectId to determine the DataWorks workspace to which the operation is applied. |
PageNumber | Integer | No | 1 |
The number of the page to return. |
PageSize | Integer | No | 10 |
The number of entries to return on each page. Default value:10. Maximum value: 100. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Data | Struct |
The file versions returned. |
|
FileVersions | Array of FileVersion |
The details of the file version. |
|
ChangeType | String | UPDATE |
The type of the change to the file of the current version. Valid values: CREATE, UPDATE, and DELETE. |
Comment | String | Second version |
The description of the file version. |
CommitTime | Long | 1593881265000 |
The time when the file version was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
CommitUser | String | 73842342**** |
The ID of the Alibaba Cloud account used to create the file of the current version. |
FileContent | String | SHOW TABLES; |
The code in the file of the current version. |
FileName | String | ods_user_info_d |
The name of the file of the current version. |
FilePropertyContent | String | {"fileName":"ods_user_info_d","fileType":10} |
The basic information about the file of the current version. |
FileVersion | Integer | 2 |
The version of the file. |
IsCurrentProd | Boolean | false |
Indicates whether the file version is the same as the latest file version in the production environment. |
NodeContent | String | {"cycleType":0,"cronExpress":"00 05 00 * * ?"} |
The scheduling configurations for the node that corresponds to the file of the current version. |
NodeId | Long | 1234 |
The ID of the auto triggered node that corresponds to the file of the current version. |
Status | String | COMMITTED |
The status of the file of the current version. Valid values: COMMITTING, COMMITTED, CHECK_OK, PACKAGED, DEPLOYING, DEPLOYED, and CANCELLED. |
UseType | String | NORMAL |
The functional module to which the file belongs. Valid values: NORMAL, MANUAL, MANUAL_BIZ, SKIP, ADHOCQUERY, and COMPONENT. The value SKIP indicates that the node corresponding to the file is run in dry-run mode. |
PageNumber | Integer | 1 |
The page number of the returned page. |
PageSize | Integer | 10 |
The number of entries returned per page. |
TotalCount | Integer | 13 |
The total number of entries returned. |
ErrorCode | String | Invalid.Tenant.ConnectionNotExists |
The error code returned. |
ErrorMessage | String | The connection does not exist. |
The error message returned. |
HttpStatusCode | Integer | 200 |
The HTTP status code returned. |
RequestId | String | 0000-ABCD-EFG**** |
The ID of the request. |
Success | Boolean | true |
Indicates whether the request is successful. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ListFileVersions
&FileId=100000001
&ProjectId=10000
&RegionId=cn-zhangjiakou
&<Common request parameters>
Sample success responses
XML
format
<RequestId>0000-ABCD-EFG****Q</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>
<TotalCount>13</TotalCount>
<FileVersions>
<Status>COMMITTED</Status>
<CommitUser>73842342****</CommitUser>
<Comment>Second version</Comment>
<CommitTime>1593881265000</CommitTime>
<FileName>ods_user_info_d</FileName>
<FilePropertyContent>{"fileName":"ods_user_info_d","fileType":10}</FilePropertyContent>
<UseType>NORMAL</UseType>
<IsCurrentProd>false</IsCurrentProd>
<FileContent>SHOW TABLES;</FileContent>
<ChangeType>UPDATE</ChangeType>
<FileVersion>2</FileVersion>
<NodeId>3000001</NodeId>
<NodeContent>{"cycleType":0,"cronExpress":"00 05 00 * * ?"}</NodeContent>
</FileVersions>
<PageSize>10</PageSize>
<PageNumber>1</PageNumber>
</Data>
<Success>true</Success>
JSON
format
{
"RequestId": "0000-ABCD-EFG****Q",
"HttpStatusCode": 200,
"Data": {
"TotalCount": 13,
"FileVersions": {
"Status": "COMMITTED",
"CommitUser": "73842342****",
"Comment": "Second version",
"CommitTime": 1593881265000,
"FileName": "ods_user_info_d",
"FilePropertyContent": "{\"fileName\":\"ods_user_info_d\",\"fileType\":10}",
"UseType": "NORMAL",
"IsCurrentProd": false,
"FileContent": "SHOW TABLES;",
"ChangeType": "UPDATE",
"FileVersion": 2,
"NodeId": 3000001,
"NodeContent": "{\"cycleType\":0,\"cronExpress\":\"00 05 00 * * ?\"}"
},
"PageSize": 10,
"PageNumber": 1
},
"Success": true
}
Error codes
Http status code | Error code | Error message | Description |
---|---|---|---|
500 | InternalError.System | An internal system error occurred. Try again later. | The error message returned because an internal system error has occurred. Try again later. |
500 | InternalError.UserId.Missing | An internal system error occurred. Try again later. | The error message returned because an internal system error has occurred. Try again later. |
403 | ResourceNotAuthorized.Api | You are not authorized to access the resources. | The error message returned because you are not authorized to access the resources. |
429 | Throttling.Api | The request for this resource has exceeded your available limit. | The error message returned because the number of requests for the resource has exceeded the upper limit. |
429 | Throttling.System | The DataWorks system is busy. Try again later. | The error message returned because the DataWorks system is busy. Try again later. |
429 | Throttling.User | Your request is too frequent. Try again later. | The error message returned because excessive requests have been submitted in a short period of time. Try again later. |
For a list of error codes, visit the API Error Center.