List Pipelines

Get the list of stream processing pipelines in the organization by pages.

Prerequisites

Stream processing pipelines are created with the Stream Processing service.

Request Format

GET https://{apigw-address}/streaming/v2.0/streaming/pipelines

Request Parameters (URI)

Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

orgId

Query

Mandatory

String

The organization ID. How to get the orgId>>

pageSize

Query

Optional

Integer

Number of returned records in each page. The default is 10.

pageNo

Query

Optional

Integer

Number of the current page. The default is 1.

isSystem

Query

Optional

Boolean

Specify whether to return system pipelines (true: returning system pipelines; false: not returning system pipelines). The default is false.

ifReleased

Query

Optional

Boolean

Specify whether to return released pipelines (true: returning released pipelines; false: not returning released pipelines). The default is false.

Response Parameters

Name

Data Type

Description

data

List<JSONObject>

List of queried stream processing pipelines and the count of pipelines. For details, see data

data

Name

Data Type

Description

count

Integer

Count of queried pipelines.

pipelines

List<JSONObject>

Detailed information of queried stream processing pipelines. For details, see pipelines

pipelines

Name

Data Type

Description

orgId

String

Organization ID.

status

String

Status of the stream processing pipeline (possible values are PUBLISHED, RUNNING, PAUSED, and STOPPED).

version

String

Template version that is used by the stream processing pipeline.

pipelineId

String

Stream processing pipeline ID.

pipelineName

String

Stream processing pipeline name.

updateTime

String

When the stream processing pipeline was updated.

alarmConfig

String

Alarm settings of the stream processing pipeline (for example: {\"alarmMode\":1,\"receivers\":\"u15453595541281\"}).

templateType

Integer

Type of the template that is used by the stream processing pipeline. Possible values are 1: Origin Template; 0: Time Window Aggregation Template; 2: Multi-Merging Template; 3: Electric Energy Cal (by Metering Reading) Template; 4: Electric Energy Cal (by Average Power) Template; 5: Electric Energy Cal (by Instant Power) Template.

executionMode

Integer

Running mode of the stream processing pipeline (0: Standalone; 1: Cluster Mode).

resourceConfig

String

Resource configuration of the stream processing pipeline (for example: {\"men\":2.0,\"cpu\":1.0}).

messageChannel

Integer

Message channel that is used by the stream processing pipeline (0: Real-time Channel; 1: Offline Channel).

Error Code

Code

Error Information

Description

61115

Failed to get stream processing job.

Failed to get the details of the stream processing pipeline.

61176

Param must be positive.

Value of the parameters must be positive. Check the validity of the parameter values.

99000

Internal Server Error.

Internal service error.

Sample

Request Sample

url: https://{apigw-address}/streaming/v2.0/pipelines?orgId=yourOrgId&pageSize=1&pageNo=2&isSystem=false&ifReleased=true

method: GET

Return Sample

{
    "msg": "OK",
    "code": 0,
    "data": {
        "pipelines": [{
            "templateType": 1,
            "pipelineName": "extended_point",
            "alarmConfig": "{\"alarmMode\":0,\"receivers\":\"u15547747531551\"}",
            "resourceConfig": "{\"men\":2.0,\"cpu\":1.0}",
            "executionMode": 0,
            "updateTime": "2020-10-28 20:41:01",
            "version": "EDH Streaming Calculator Library 0.1.0",
            "messageChannel": 0,
            "orgId": "o15520323695671",
            "pipelineId": "64740da0-747c-4954-a098-981371e70724",
            "status": "RUNNING"
        }, {
            "templateType": 1,
            "pipelineName": "stream-bat",
            "alarmConfig": "{\"alarmMode\":0,\"receivers\":\"u15880500345361\"}",
            "resourceConfig": "{\"cpu\":0.5,\"men\":1.0}",
            "executionMode": 0,
            "updateTime": "2020-10-01 00:32:32",
            "version": "EDH Streaming Calculator Library 0.2.0",
            "messageChannel": 0,
            "orgId": "o15520323695671",
            "pipelineId": "a4e235fb-b183-405c-9329-6e41bd93e65d",
            "status": "STOPPED"
        }],
        "count": 2
    }
}

Java SDK Sample

import com.alibaba.fastjson.JSONObject;
import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;
import com.envision.apim.poseidon.request.PoseidonRequest;
import org.junit.Before;
import org.junit.Test;

public class Sample {
    private static final String API_Gateway_URL = "https://{domain_url}";
    private Poseidon poseidon;

    private static class Request extends PoseidonRequest {

        public void setBodyParams(String key, Object value) {
            bodyParams().put(key, value);
        }

        public void setMethod(String method) {
            this.method = method;
        }

        private String method;

        @Override
        public String baseUri() {
            return "";
        }

        @Override
        public String method() {
            return method;
        }
    }

    @Before
    public void init() {
        poseidon = Poseidon.config(
                PConfig.init()
                        .appKey("AccessKey of your APP")
                        .appSecret("SecretKey of your APP")
        ).method("GET");
    }

    @Test
    public void ListPipelines() {
        Request request = new Request();

        JSONObject response = poseidon
                .url(API_Gateway_URL + "/streaming/v2.0/streaming/pipelines")
                .queryParam("orgId", "yourOrgId")
                .queryParam("pageSize", "5")
                .queryParam("ifReleased", "true")
                .getResponse(request, JSONObject.class);
        System.out.println(response);
    }
}