查询资源列表
功能介绍
查询资源列表。查询时,可指定返回页号和每页的最大记录数。
- 参数说明 
   
表1 URI参数说明 参数名
是否必选
参数类型
说明
project_id
是
String
项目编号,获取方法请参见项目ID和帐号ID。
offset
否
Integer
分页列表的起始页,默认值为0。取值范围大于等于0。
limit
否
Integer
分页返回结果,指定每页最大记录数,范围[1,100]。
默认值:10
resourceName
否
String
资源名称。
 
请求消息
| 
        参数名  | 
      
        是否必选  | 
      
        参数类型  | 
      
        说明  | 
     
|---|---|---|---|
| 
        workspace  | 
      
        否  | 
      
        String  | 
      
        工作空间id。 
  | 
     
响应消息
| 
        参数名  | 
      
        是否必选  | 
      
        参数类型  | 
      
        说明  | 
     
|---|---|---|---|
| 
        total  | 
      
        是  | 
      
        Integer  | 
      
        总的资源个数。  | 
     
| 
        resources  | 
      
        是  | 
      
        List<Resource>  | 
      
        资源列表。  | 
     
| 
        参数名  | 
      
        是否必选  | 
      
        参数类型  | 
      
        说明  | 
     
|---|---|---|---|
| 
        id  | 
      
        是  | 
      
        String  | 
      
        资源ID,用户查询资源时使用。  | 
     
| 
        name  | 
      
        是  | 
      
        String  | 
      
        资源名称,只能包含英文字母、数字、中文字符、下划线或中划线,且长度为1-32个字符。  | 
     
| 
        type  | 
      
        是  | 
      
        String  | 
      
        资源类型,包含: 
  | 
     
| 
        location  | 
      
        是  | 
      
        String  | 
      
        资源文件所在OBS路径,当类型为jar时,location为主Jar包所在路径。最多256个字符。示例:obs://myBucket/test.jar  | 
     
| 
        dependFiles  | 
      
        否  | 
      
        List<String>  | 
      
        主Jar包所依赖的JAR包、properties文件。总的长度不能超过10240个字符。  | 
     
| 
        desc  | 
      
        否  | 
      
        String  | 
      
        描述,长度不能超过255个字符。  | 
     
| 
        directory  | 
      
        否  | 
      
        String  | 
      
        资源所在目录。 通过DataArts Studio管理控制台 > 数据开发,左侧列表选择。在脚本的目录树上,可以查看到当前已经创建的目录,默认在根目录/。  | 
     
示例
查询资源列表
- 请求
    
GET /v1/b384b9e9ab9b4ee8994c8633aabc9505/resources
 
- 成功响应
   
   
{ "total":1, "resources":[ { "id":"b384b9e9ab9b4ee8994c8633aabc9505" "name":"mrResource", "type":"jar", "location":"obs://00000000dlf-test/hadoop-mapreduce-examples-2.4.1.jar", "dependFiles":[ "obs://00000000dlf-test/depend1.jar", "obs://00000000dlf-test/depend2.jar" ], "desc":"test", "directory":"/resource" } ] } - 失败响应
   
   
{ "error_code":"DLF.3051", "error_msg":"The request parameter is invalid." }