调用GetFile获取文件的详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetFile |
要执行的操作。 |
ProjectId | Long | 是 | 10000 |
DataWorks工作空间的ID,您可以单击页面右上角的小扳手图标,进入工作空间管理页面查看。 |
RegionId | String | 是 | cn-zhangjiakou |
服务所在地域的列表。 |
ProjectIdentifier | String | 否 | dw_project |
DataWorks工作空间的唯一标识符,即数据开发页面顶部切换工作空间处的英文标识。 该参数与ProjectId参数二者必须设置其一,以确定本次API调用操作的DataWorks工作空间。 |
FileId | Long | 否 | 100000001 |
文件的ID,您可以通过ListFiles查询对应文件的ID。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Struct |
文件的详情。 |
|
File | Struct |
文件的基本信息。 |
|
BizId | Long | 1000001 |
文件所属业务流程的ID。 |
CommitStatus | Integer | 0 |
文件当前的提交状态,包括0(未提交最新的代码)和1(已提交最新的代码)。 |
ConnectionName | String | odps_first |
执行文件对应的任务时,所使用的引擎实例ID。 |
Content | String | SHOW TABLES; |
文件的代码。 |
CreateTime | Long | 1593879116000 |
文件创建的时间戳,单位为毫秒。 |
CreateUser | String | 424732**** |
文件创建人的阿里云用户ID。 |
CurrentVersion | Integer | 3 |
文件当前已经提交的最新版本号。 |
FileDescription | String | 我的第一个Dataworks文件 |
文件的描述信息。 |
FileFolderId | String | 2735c2**** |
文件所属文件夹的ID。 |
FileName | String | ods_user_info_d |
文件的名称。 |
FileType | Integer | 10 |
文件的代码类型,常用的代码类型包括6(Shell)、10(ODPS SQL)、11(ODPS MR)、23(数据集成)、24(ODPS Script)、99(虚拟节点)、221(PyODPS 2)、225(ODPS Spark)、227(EMR Hive)、228(EMR Spark)、229(EMR Spark SQL)、230(EMR MR)、239(OSS对象检查)、257(EMR Shell)、258(EMR Spark Shell)、259(EMR Presto)、260(EMR Impala)、900(实时同步)、1089(跨租户节点)、1091(Hologres开发)、1093(Hologres SQL)、1100(赋值节点)、1221(PyODPS 3)。 |
IsMaxCompute | Boolean | true |
标识该资源文件是否需要上传至MaxCompute。 仅当文件是MaxCompute资源文件时才需要配置该参数。 |
LastEditTime | Long | 1593879116000 |
文件最近被编辑的毫秒时间戳。 |
LastEditUser | String | 62465892**** |
最近一次编辑文件的阿里云用户ID。 |
NodeId | Long | 300001 |
提交文件后,在调度系统生成的调度任务的ID。 |
Owner | String | 7775674356**** |
文件责任人的阿里云用户ID。 |
ParentId | Long | -1 |
如果当前文件是组合节点文件的内部文件,该字段标识对应组合节点文件的ID。 |
UseType | String | 0 |
文件所属的功能模块,包括NORMAL(数据开发)、MANUAL(手动任务)、MANUAL_BIZ(手动工作流)、SKIP(数据开发的空跑调度)、ADHOCQUERY(临时查询)和COMPONENT(组件管理)。 |
NodeConfiguration | Struct |
文件的调度配置。 |
|
AutoRerunIntervalMillis | Integer | 120000 |
出错自动重跑间隔,单位为毫秒。对应页面上的调度配置>时间属性>出错自动重跑间隔。页面上的时间单位为分钟,请在调用时注意转换时间。 |
AutoRerunTimes | Integer | 3 |
出错自动重跑的次数。 |
CronExpress | String | 00 05 00 * * ? |
文件定时调度的cron表达式。 |
CycleType | String | DAY |
调度周期的类型,包括NOT_DAY(分钟、小时)和DAY(日、周、月),对应页面上的调度配置>时间属性>调度周期。 |
DependentNodeIdList | String | 5,10,15,20 |
在DependentType为USER_DEFINE时,设置具体依赖的调度任务ID列表,使用英文逗号(,)分隔。对应页面上的调度配置>时间属性>依赖上一周期>自定义后,出现的输入框。 |
DependentType | String | USER_DEFINE |
依赖上一周期的方式,包括NONE(取消勾选依赖上一周期)、SELF(本节点)、CHILD(一层子节点)和USER_DEFINE(自定义)。 |
EndEffectDate | Long | 4155787800000 |
停止自动调度的毫秒时间戳,对应页面上的调度配置>时间属性>生效时间>结束时间的毫秒时间戳。 |
InputList | Array of NodeInputOutput |
文件依赖的上游文件的输出,对应页面中的调度配置>调度依赖>父节点输出名称。 |
|
Input | String | project.001_out |
文件依赖的上游文件的输出,对应页面中的调度配置>调度依赖>父节点输出名称一列的值。 |
OutputList | Array of NodeInputOutput |
文件的输出,对应页面中的调度配置>调度依赖>本节点输出名称。 |
|
Output | String | dw_project.002_out |
文件的输出,对应页面中的调度配置>调度依赖>本节点输出名称一列的值。 |
RefTableName | String | ods_user_info_d |
文件的输出,对应页面中的调度配置>调度依赖>本节点输出表一列的值。 |
ParaValue | String | a=x b=y |
调度参数,对应页面中的调度配置>基础配置>参数。 |
RerunMode | String | ALL_ALLOWED |
重跑属性,包括ALL_ALLOWED(运行成功或失败后皆可重跑)、FAILURE_ALLOWED(运行成功后不可重跑,运行失败后可以重跑)和ALL_DENIED(运行成功或失败皆不可重跑)。对应页面上的调度配置>时间属性>重跑属性。 |
ResourceGroupId | Long | 375827434852437 |
文件发布成任务后,任务执行时对应的资源组。您可以调用ListResourceGroups获取工作空间可用的资源组列表。 |
StartEffectDate | Long | 936923400000 |
开始自动调度的毫秒时间戳,对应页面中的调度配置>时间属性>生效时间>开始时间的毫秒时间戳。 |
Stop | Boolean | false |
是否暂停调度,对应页面中的调度配置>时间属性>暂停调度。 |
ErrorCode | String | Invalid.Tenant.ConnectionNotExists |
错误码。 |
ErrorMessage | String | The connection does not exist. |
错误信息。 |
HttpStatusCode | Integer | 200 |
HTTP状态码。 |
RequestId | String | 0000-ABCD-EFG**** |
本次调用的唯一ID。出现错误后,您可以根据该ID排查问题。 |
Success | Boolean | true |
调用是否成功。 |
示例
请求示例
http(s)://[Endpoint]/?Action=GetFile
&ProjectId=10000
&RegionId=cn-zhangjiakou
&<公共请求参数>
正常返回示例
XML
格式
<RequestId>0000-ABCD-EFG****</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>
<File>
<Owner>7775674356****</Owner>
<TaskRerunIntervalMillis>120000</TaskRerunIntervalMillis>
<CycleType>DAY</CycleType>
<InputList>
<Input>project.001_out</Input>
</InputList>
<InputList>
<Output>dw_project.002_out</Output>
<RefTableName>ods_user_info_d</RefTableName>
</InputList>
<Stop>false</Stop>
<FileName>ods_user_info_d</FileName>
<CurrentVersion>3</CurrentVersion>
<IsMaxCompute>true</IsMaxCompute>
<CronExpress>00 05 00 * * ?</CronExpress>
<ConnectionName>odps_first</ConnectionName>
<StartEffectDate>936923400000</StartEffectDate>
<CommitStatus>0</CommitStatus>
<FileFolderId>2735c2c19d58</FileFolderId>
<ParentId>-1</ParentId>
<TaskRerunTime>3</TaskRerunTime>
<CreateTime>1593879116000</CreateTime>
<UseType>0</UseType>
<DependentType>USER_DEFINE</DependentType>
<CreateUser>424732742562</CreateUser>
<LastEditTime>1593879116000</LastEditTime>
<EndEffectDate>4155787800000</EndEffectDate>
<FileDescription>我的第一个Dataworks文件</FileDescription>
<DependentNodeIdList>5,10,15,20</DependentNodeIdList>
<FileType>10</FileType>
<Content>SHOW TABLES;</Content>
<LastEditUser>624658926432862</LastEditUser>
<NodeId>300001</NodeId>
<RerunMode>ALL_ALLOWED</RerunMode>
<ParaValue>a=x b=y</ParaValue>
<BizId>1000001</BizId>
<OutputList>
<Input>project.001_out</Input>
</OutputList>
<OutputList>
<Output>dw_project.002_out</Output>
<RefTableName>ods_user_info_d</RefTableName>
</OutputList>
</File>
<NodeConfiguration>
<Owner>7775674356****</Owner>
<TaskRerunIntervalMillis>120000</TaskRerunIntervalMillis>
<CycleType>DAY</CycleType>
<InputList>
<Input>project.001_out</Input>
</InputList>
<InputList>
<Output>dw_project.002_out</Output>
<RefTableName>ods_user_info_d</RefTableName>
</InputList>
<Stop>false</Stop>
<FileName>ods_user_info_d</FileName>
<CurrentVersion>3</CurrentVersion>
<IsMaxCompute>true</IsMaxCompute>
<CronExpress>00 05 00 * * ?</CronExpress>
<ConnectionName>odps_first</ConnectionName>
<StartEffectDate>936923400000</StartEffectDate>
<CommitStatus>0</CommitStatus>
<FileFolderId>2735c2c19d58</FileFolderId>
<ParentId>-1</ParentId>
<TaskRerunTime>3</TaskRerunTime>
<CreateTime>1593879116000</CreateTime>
<UseType>0</UseType>
<DependentType>USER_DEFINE</DependentType>
<CreateUser>424732742562</CreateUser>
<LastEditTime>1593879116000</LastEditTime>
<EndEffectDate>4155787800000</EndEffectDate>
<FileDescription>我的第一个Dataworks文件</FileDescription>
<DependentNodeIdList>5,10,15,20</DependentNodeIdList>
<FileType>10</FileType>
<Content>SHOW TABLES;</Content>
<LastEditUser>624658926432862</LastEditUser>
<NodeId>300001</NodeId>
<RerunMode>ALL_ALLOWED</RerunMode>
<ParaValue>a=x b=y</ParaValue>
<BizId>1000001</BizId>
<OutputList>
<Input>project.001_out</Input>
</OutputList>
<OutputList>
<Output>dw_project.002_out</Output>
<RefTableName>ods_user_info_d</RefTableName>
</OutputList>
</NodeConfiguration>
</Data>
<ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
<ErrorMessage>The connection does not exist.</ErrorMessage>
<Success>true</Success>
JSON
格式
{
"RequestId": "0000-ABCD-EFG****",
"HttpStatusCode": 200,
"Data": {
"File": {
"Owner": "7775674356****",
"TaskRerunIntervalMillis": 120000,
"CycleType": "DAY",
"InputList": [
{
"Input": "project.001_out"
},
{
"Output": "dw_project.002_out",
"RefTableName": "ods_user_info_d"
}
],
"Stop": false,
"FileName": "ods_user_info_d",
"CurrentVersion": 3,
"IsMaxCompute": true,
"CronExpress": "00 05 00 * * ?",
"ConnectionName": "odps_first",
"StartEffectDate": 936923400000,
"CommitStatus": 0,
"FileFolderId": "2735c2c19d58",
"ParentId": -1,
"TaskRerunTime": 3,
"CreateTime": 1593879116000,
"UseType": 0,
"DependentType": "USER_DEFINE",
"CreateUser": 424732742562,
"LastEditTime": 1593879116000,
"EndEffectDate": 4155787800000,
"FileDescription": "我的第一个Dataworks文件",
"DependentNodeIdList": "5,10,15,20",
"FileType": 10,
"Content": "SHOW TABLES;",
"LastEditUser": 624658926432862,
"NodeId": 300001,
"RerunMode": "ALL_ALLOWED",
"ParaValue": "a=x b=y",
"BizId": 1000001,
"OutputList": [
{
"Input": "project.001_out"
},
{
"Output": "dw_project.002_out",
"RefTableName": "ods_user_info_d"
}
]
},
"NodeConfiguration": {
"Owner": "7775674356****",
"TaskRerunIntervalMillis": 120000,
"CycleType": "DAY",
"InputList": [
{
"Input": "project.001_out"
},
{
"Output": "dw_project.002_out",
"RefTableName": "ods_user_info_d"
}
],
"Stop": false,
"FileName": "ods_user_info_d",
"CurrentVersion": 3,
"IsMaxCompute": true,
"CronExpress": "00 05 00 * * ?",
"ConnectionName": "odps_first",
"StartEffectDate": 936923400000,
"CommitStatus": 0,
"FileFolderId": "2735c2c19d58",
"ParentId": -1,
"TaskRerunTime": 3,
"CreateTime": 1593879116000,
"UseType": 0,
"DependentType": "USER_DEFINE",
"CreateUser": 424732742562,
"LastEditTime": 1593879116000,
"EndEffectDate": 4155787800000,
"FileDescription": "我的第一个Dataworks文件",
"DependentNodeIdList": "5,10,15,20",
"FileType": 10,
"Content": "SHOW TABLES;",
"LastEditUser": 624658926432862,
"NodeId": 300001,
"RerunMode": "ALL_ALLOWED",
"ParaValue": "a=x b=y",
"BizId": 1000001,
"OutputList": [
{
"Input": "project.001_out"
},
{
"Output": "dw_project.002_out",
"RefTableName": "ods_user_info_d"
}
]
}
},
"ErrorCode": "Invalid.Tenant.ConnectionNotExists",
"ErrorMessage": "The connection does not exist.",
"Success": true
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
500 | InternalError.System | An internal system error occurred. Try again later. | 系统内部错误,请稍后再试。 |
500 | InternalError.UserId.Missing | An internal system error occurred. Try again later. | 系统内部错误,请稍后再试。 |
403 | ResourceNotAuthorized.Api | You are not authorized to access the resources. | 您无法访问未取得授权的资源。 |
429 | Throttling.Api | The request for this resource has exceeded your available limit. | 对该资源的请求已超过您的可用上限。 |
429 | Throttling.System | The DataWorks system is busy. Try again later. | DataWorks系统繁忙,请稍后再试。 |
429 | Throttling.User | Your request is too frequent. Try again later. | 您的请求过于频繁,请尝试放缓请求速度。 |
访问错误中心查看更多错误码。