List Workflow Directories¶
Get all the content in the workflow
directory of the current OU, including workflow files and sub-directories.
Prerequisites¶
The user must belong to the OU which the target directories belong to.
Request Format¶
GET https://{apigw-address}/dataflow-batch-service/v2.0/directories?action=listWorkFlowDirs&userId={}&orgId={}
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required or Not |
Data Type |
Description |
---|---|---|---|---|
userId |
Query |
true |
String |
User ID. How to get userId>> |
orgId |
Query |
true |
String |
Organization ID which the user belongs to. How to get orgId>> |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
List<WorkFlowDir> |
Collection of the WorkFlowDir structs, which contain all the workflow files and sub-directories. See WorkFlowDir Struct |
WorkFlowDir Struct¶
Sample¶
{
"children": []
"title":"Workflow",
"type": 1,
"key": "249a33bd419a4710b1567f5088f8955b"
"isDirectory":true
}
Parameters¶
Name |
Data Type |
Description |
---|---|---|
children |
List<WorkFlowDir> |
List of files or sub-directories |
title |
String |
Name of files or sub-directories |
type |
String |
Type of directory (0: Data Integration; 1: Workflow; 2: Data Resource; 3: Hql; 4: Common Resource) |
key |
String |
Directory ID |
isDirectory |
Boolean |
Directory or file (true: directory; false: file) |
Error Code¶
Code |
Message |
Description |
---|---|---|
62109 |
Server internal exception |
Server internal exception |
Sample¶
Request Sample¶
url: https://{apigw-address}/dataflow-batch-service/v2.0/directories?action=listWorkFlowDirs&userId={}&orgId={}
method: GET
Return Sample¶
"status": 0,
"msg": " Success",
"data": [
{
"children": [
{
"children": [],
"title": "String1",
"type": 1,
"key": "***************",
"isDirectory": true
},
{
"children": [
{
"editable": true,
"title": "workflow1",
"type": 1,
"key": 2512,
"isDirectory": false
}
],
"title": "ffdir",
"type": 1,
"key": "**************",
"isDirectory": true
},
{
"children": [],
"title": "dirt",
"type": 1,
"key": "************",
"isDirectory": true
}
],
"title": "Workflow",
"type": 1,
"key": "***************",
"isDirectory": true
}
]
}
Java SDK Sample¶
import com.alibaba.fastjson.JSONObject;
import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;
public class Request extends PoseidonRequest {
public void setQueryParam(String key, Object value){
QueryParams().put(key, value);
}
public void setHeaderParam(String key, String value){
headerParams().put(key, value);
}
public void setBodyParam(Map<String, Object> bodyPara){
bodyParams().putAll(bodyPara);
}
public void setMethod(String method) {
this.method = method;
}
private String method;
public String baseUri() {
return "";
}
public String method() {
return method;
}
}
public void listWorkFlowDirsTest(){
//1. Select Application Registration from the left navigation bar of EnOS Console.
//2. Open the App Detail page to get the AccessKey and SecretKey of the application.
String accessKey = "********************";
String secretKey = "********************";
//Create a request and save the required parameters in the map of the Query.
Request request = new Request();
request.setQueryParam("userId","your_userId");
request.setQueryParam("orgId","your_orgId");
request.setMethod("GET");
try {
JSONObject response = Poseidon.config(PConfig.init().appKey(accessKey).appSecret(secretKey).debug())
.url("https://{apigw-address}/dataflow-batch-service/v2.0/directories?action=listWorkFlowDirs")
.getResponse(request, JSONObject.class);
System.out.println(response);
} catch (Exception e) {
e.printStackTrace();
}
}