调用ListFileVersions查询文件的版本列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| FileId |
integer |
是 |
文件的 ID, 您可以通过 ListFiles 查询对应文件的 ID。 |
100000001 |
| ProjectId |
integer |
否 |
DataWorks 工作空间的 ID, 您可以单击页面右上角的小扳手图标,进入工作空间管理页面查看。 |
100001 |
| ProjectIdentifier |
string |
否 |
DataWorks 工作空间的唯一标识符,即数据开发页面顶部切换工作空间处的英文标识。 该参数与 ProjectId 参数二者必须设置其一,以确定本次 API 调用操作的 DataWorks 工作空间。 |
dw_project |
| PageNumber |
integer |
否 |
请求的数据页数, 用于翻页。 |
1 |
| PageSize |
integer |
否 |
每页显示的条数,默认为 10 条, 最大 100 条。 |
10 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果 。 |
||
| HttpStatusCode |
integer |
HTTP 状态码 。 |
200 |
| ErrorMessage |
string |
错误信息 。 |
The connection does not exist. |
| RequestId |
string |
请求 ID 。 |
0000-ABCD-EFG**** |
| ErrorCode |
string |
错误码 。 |
Invalid.Tenant.ConnectionNotExists |
| Success |
boolean |
调用是否成功。取值如下:
|
true |
| Data |
object |
文件的版本列表 。 |
|
| PageNumber |
integer |
当前数据页的页码 。 |
1 |
| PageSize |
integer |
当前数据页的大小 。 |
10 |
| TotalCount |
integer |
满足查询条件的数据总条数 。 |
13 |
| FileVersions |
array<object> |
文件的版本详情列表 。 |
|
|
object |
文件的版本详情 。 |
||
| FileContent |
string |
生成本次文件版本的文件代码 。 |
SHOW TABLES; |
| Status |
string |
文件版本当前的状态, 包括 COMMITTING(提交中)、COMMITTED 或 CHECK_OK(已提交)、PACKAGED(准备发布)、DEPLOYING(发布中)、DEPLOYED(已发布)和 CANCELLED(取消发布)。 |
COMMITTED |
| IsCurrentProd |
boolean |
本次文件版本是否为当前生产环境的最新版本。
|
false |
| CommitUser |
string |
生成本次文件版本的阿里云用户 ID 。 |
73842342**** |
| NodeContent |
string |
生成本次文件版本的调度配置 。 |
{"cycleType":0,"cronExpress":"00 05 00 * * ?"} |
| Comment |
string |
本次文件版本的说明 。 |
Second version submission |
| FilePropertyContent |
string |
生成本次文件版本的文本基本信息 。 |
{"fileName":"ods_user_info_d","fileType":10} |
| FileName |
string |
生成本次文件版本的文件名 。 |
ods_user_info_d |
| UseType |
string |
文件所属的功能模块, 包括 NORMAL(数据开发)、MANUAL(手动任务)、MANUAL_BIZ(手动工作流)、SKIP(数据开发的空跑调度)、ADHOCQUERY(临时查询)和 COMPONENT(组件管理)。 |
NORMAL |
| ChangeType |
string |
本次文件版本的变更类型,包括 CREATE、UPDATE 和 DELETE 。 |
UPDATE |
| FileVersion |
integer |
文件的版本 。 |
2 |
| CommitTime |
integer |
生成文件版本的毫秒时间戳 。 |
1593881265000 |
| NodeId |
integer |
生成文件版本时对应的调度任务 ID 。 |
1234 |
示例
正常返回示例
JSON格式
{
"HttpStatusCode": 200,
"ErrorMessage": "The connection does not exist.",
"RequestId": "0000-ABCD-EFG****",
"ErrorCode": "Invalid.Tenant.ConnectionNotExists",
"Success": true,
"Data": {
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 13,
"FileVersions": [
{
"FileContent": "SHOW TABLES;",
"Status": "COMMITTED",
"IsCurrentProd": false,
"CommitUser": "73842342****\n",
"NodeContent": "{\"cycleType\":0,\"cronExpress\":\"00 05 00 * * ?\"}",
"Comment": "Second version submission",
"FilePropertyContent": "{\"fileName\":\"ods_user_info_d\",\"fileType\":10}",
"FileName": "ods_user_info_d",
"UseType": "NORMAL",
"ChangeType": "UPDATE",
"FileVersion": 2,
"CommitTime": 1593881265000,
"NodeId": 1234
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 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. | 没有权限,请授权 |
| 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. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。