Get My Flow

Search workflows that meet the specified conditions.

Prerequisites

The user must belong to the OU which the target workflow belongs to.

Request Format

GET https://{apigw-address}/dataflow-batch-service/v2.0/flows?action=getMyFlow&searchValue={}&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>>
searchValue Query false String Conditions for search (if not specified, all workflows of the user will be returned)

Response Parameters

Name Data Type Description
data List<FlowSimpInfo> Collection of searched workflows, with each element representing a FlowSimpInfo struct, which contains basic information of a workflow. See FlowSimpleInfo Struct

FlowSimpleInfo Struct

Sample

{
    "flow_id": "2526",
    "editable": true,
    "flow_name": "testIns",
    "cycle": "mi"
}

Parameters

Name Data Type Description
flow_id String Workflow ID
editable Boolean Whether the workflow is editable
flow_name String Name of the workflow
cycle String Scheduling cycle (M: Month; W: Week; D: Day; H: Hour; mi: Minute)

Error Code

See Common Error Codes.

Sample

Request Sample

url: https://{apigw-address}/dataflow-batch-service/v2.0/flows?action=getMyFlow&searchValue={}&userId={}&orgId={}

method: GET

Return Sample

{
    "status": 0,
    "msg": "Success",
    "data": [
        {
            "flow_id": "3318",
            "editable": true,
            "flow_name": "reduce_entity",
            "cycle": "D"
        },
        {
            "flow_id": "2809",
            "editable": true,
            "flow_name": "map",
            "cycle": "D"
        },
        {
            "flow_id": "3257",
            "editable": true,
            "flow_name": "shell",
            "cycle": "D"
        },
        {
            "flow_id": "2515",
            "editable": true,
            "flow_name": "testWorkflow122",
            "cycle": "D"
        },
        {
            "flow_id": "2980",
            "editable": true,
            "flow_name": "8",
            "cycle": "D"
        },
        {
            "flow_id": "2979",
            "editable": true,
            "flow_name": "integrattt",
            "cycle": "D"
        }
    ]
}

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 myFlowsTest(){
        //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("searchValue","2");
        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/flows?action=getMyFlow")
                    .getResponse(request, JSONObject.class);

            System.out.println(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }