Search Flow¶
Search the basic information of workflows that meet the specified conditions (including workflows of other users in the OU).
Prerequisites¶
The user must belong to the OU which the target workflows belong to.
Request Format¶
POST https://{apigw-address}/dataflow-batch-service/v2.0/flows?action=search&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>> |
Request Parameters (Body)¶
Name |
Required or Not |
Data Type |
Description |
---|---|---|---|
expression |
false |
String |
Expression for searching workflows |
pagination |
false |
Pagination Struct |
Paging parameter. See Pagination Struct |
Pagination Struct¶
Sample¶
{
"pagination": {
"pageNo": 0,
"pageSize": 10,
"sorters": [{
"field": "flow_name",
"order": "ASC"
}]
}
}
Parameters¶
Name |
Required or Not |
Data Type |
Description |
---|---|---|---|
pageNo |
true |
Integer |
Request pages, starting from 0 |
pageSize |
true |
Integer |
Number of records in each page, which must be greater than 0 |
sorters |
false |
Sorter Struct |
Pagination sorting method |
sorters.field |
true |
String |
Pagination field name |
sorters.order |
false |
String |
ASC means ascending order; DESC means descending order, which is set as ASC by default |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
List<PageFlow> |
Collection of PageFlow structs, which contain the basic information of searched workflows. See PageFlow Struct |
PageFlow Struct¶
Sample¶
{
"flow_id": "21",
"flow_name": "dim_wtg_full"
}
Parameters¶
Name |
Data Type |
Description |
---|---|---|
flow_id |
Integer |
Workflow ID |
flow_name |
String |
Name of workflow |
Error Code¶
See Common Error Codes.
Sample¶
Request Sample¶
url: https://{apigw-address}/dataflow-batch-service/v2.0/flows?action=search&userId={}&orgId={}
method: POST
requestBody:
{
"expression": "",
"pagination":{
"pageNo": 0,
"pageSize": 10,
"sorters": [{
"field": "update_time",
"order": "ASC"
}]
}
}
Return Sample¶
{
"status": 0,
"msg": " Success",
"data": [
{
"flow_id": "20",
"flow_name": "vd_text"
},
{
"flow_id": "21",
"flow_name": "dim_wtg_full"
},
{
"flow_id": "22",
"flow_name": "wenl_dim_fact_downtime"
}
]
}
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 pagingFlowsTest(){
//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");
HashMap<String,Object> bodyMap= new HashMap<String, Object>(2);
bodyMap.put("expression","");
HashMap<String,Object> paginationMap= new HashMap<String, Object>(3);
paginationMap.put("pageNo",0);
paginationMap.put("pageSize",10);
List<HashMap<String,Object>> list = new ArrayList<HashMap<String,Object>>();
HashMap<String,Object> sorterMap= new HashMap<String, Object>(2);
sorterMap.put("field","update_time");
sorterMap.put("order","ASC");
list.add(sorterMap);
paginationMap.put("sorters",list);
bodyMap.put("pagination",paginationMap);
request.setBodyParam(bodyMap);
request.setMethod("POST");
try {
JSONObject response = Poseidon.config(PConfig.init().appKey(accessKey).appSecret(secretKey).debug())
.url("https://{apigw-address}/dataflow-batch-service/v2.0/flows?action=search")
.getResponse(request, JSONObject.class);
System.out.println(response);
} catch (Exception e) {
e.printStackTrace();
}
}