Get Pipeline Details

获取指定流数据处理任务的详细信息。

前提条件

已通过流数据处理服务创建流数据处理任务,并获取到流数据处理任务的ID。

请求格式

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

请求参数(URI)

名称 位置(Path/Query) 必需/可选 数据类型 描述
pipelineId Path 必需 String 流数据处理任务ID,可通过 EnOS管理门口 > 流数据处理 > 流运维 页面查看,或通过调用 List Pipelines 接口获取。
orgId Query 必需 String 用户所属的组织ID。如何获取orgId信息>>
ifReleased Query 可选 Boolean 指定流数据处理任务是否已发布。true:已发布的任务;false:未发布的任务(仍处于设计状态的任务);默认为false。

响应参数

名称 数据类型 描述
data List<JSONObject> 返回流数据处理任务的详细信息。详见 data

data

名称 数据类型 描述
desc String 流数据处理描述信息。
pipelineId String 流数据处理任务ID。
pipelineName String 流数据处理任务名称。
version String 流数据处理任务使用的模板版本。
templateType Integer 流数据处理任务使用的模板类型。1:原生模板;0:时间窗口聚合模板;2:多路归并模板;3:电量计算模板(按表读数);4:电量计算模板(按平均功率);5:电量计算模板(按瞬时功率)。
templateName String 流数据处理任务使用的模板名称。
messageChannel Integer 流数据处理任务的消息通道模式。0:实时通道;1:离线通道。
pipelineJson JSONObject 流数据处理任务配置JSON。

错误码

代码 错误信息 描述
61108 Stream processing job does not exit. 流数据处理任务不存在。
99000 Internal Server Error. 服务内部错。

示例

请求示例

url: https://{apigw-address}/streaming/v2.0/streaming/pipeline/{pipelineId}?orgId=yourOrgId

method: GET

返回示例

{
  "code": 0,
  "msg": "OK",
  "data": {
   "pipelineId": "eec1c103-xxxx-44f6-9045-696dd1c873bb",
   "pipelineName": "Demo",
   "messageChannel": "0",
   "templateType": 2,
   "templateName": {
      "en_us": "xxx",
      "zh_cn": "电量计算模板(按平均功率)"
   },
   "version": "0.1.0",
   "desc": "",
   "pipelineJson": {
      "points": [
         {
            "inputPointId": "YL_Turbine_Model::YL.Meter.Input39",
            "outputPointId": "YL_Turbine_Model::YL.Merter.PI.Out11",
            "detailOutputPointId": null,
            "minValue": "0",
            "maxValue": "10000",
            "maxValueInclude": true,
            "minValueInclude": true,
            "exceptionPolicy": "2"
         }
      ],
      "piDetail": false
   }
}

Java SDK调用示例

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 GetPipelineDetails() {
        Request request = new Request();

        JSONObject response = poseidon
                .url(API_Gateway_URL + "/streaming/v2.0/streaming/pipeline/{pipelineId}")
                .queryParam("orgId", "yourOrgId")
                .getResponse(request, JSONObject.class);
        System.out.println(response);
    }
}