调用GetFileVersion获取文件的版本详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| FileId |
integer |
是 |
文件的 ID,您可以通过 ListFiles 查询对应文件的 ID。 |
1000001 |
| ProjectId |
integer |
否 |
DataWorks 工作空间的 ID,您可以单击页面右上角的小扳手图标,进入工作空间管理页面查看。 |
1000011 |
| ProjectIdentifier |
string |
否 |
DataWorks 工作空间的唯一标识符,即数据开发页面顶部切换工作空间处的英文标识。 该参数与 ProjectId 参数二者必须设置其一,以确定本次 API 调用操作的 DataWorks 工作空间。 |
dw_project |
| FileVersion |
integer |
是 |
需要查询的文件版本。 |
2 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| HttpStatusCode |
integer |
HTTP 状态码。 |
200 |
| ErrorMessage |
string |
错误信息。 |
The connection does not exist. |
| RequestId |
string |
本次调用的唯一 ID。出现错误后,您可以根据该 ID 排查问题。 |
0000-ABCD-EFG**** |
| ErrorCode |
string |
错误码。 |
Invalid.Tenant.ConnectionNotExists |
| Success |
boolean |
调用是否成功。
|
true |
| Data |
object |
文件的版本详情。 |
|
| FileContent |
string |
生成本次文件版本的文件代码。 |
SHOW TABLES; |
| IsCurrentProd |
boolean |
本次文件版本是否为当前生产环境的最新版本。
|
true |
| Status |
string |
文件版本当前的状态,取值如下:
|
COMMITTED |
| NodeContent |
string |
本次文件版本生成时的调度配置。 |
{"cycleType":0,"cronExpress":"00 05 00 * * ?"} |
| CommitUser |
string |
生成本次文件版本的阿里云用户 ID。 |
7384234**** |
| Comment |
string |
本次文件版本的说明。 |
Second version submission |
| FilePropertyContent |
string |
生成本次文件版本的文件基本信息。 |
{"fileName":"ods_user_info_d","fileType":10} |
| FileName |
string |
生成本次文件版本的文件名。 |
ods_user_info_d |
| UseType |
string |
文件所属的功能模块,取值如下:
|
0 |
| ChangeType |
string |
本次文件版本的变更类型,包括 CREATE、UPDATE 和 DELETE。 |
UPDATE |
| FileVersion |
integer |
文件的版本。 |
2 |
| CommitTime |
integer |
文件版本生成的毫秒时间戳。 |
1593881265000 |
| NodeId |
integer |
文件版本生成时对应的调度任务 ID。 |
3000001 |
示例
正常返回示例
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": "\t\n7384234****\n",
"Comment": "Second version submission",
"FilePropertyContent": "{\"fileName\":\"ods_user_info_d\",\"fileType\":10}",
"FileName": "ods_user_info_d",
"UseType": "0",
"ChangeType": "UPDATE",
"FileVersion": 2,
"CommitTime": 1593881265000,
"NodeId": 3000001
}
}
错误码
|
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. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。