You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by eb...@apache.org on 2021/06/11 18:47:44 UTC

[incubator-streampipes] 11/16: [STREAMPIPES-349] Add endpoint definition for downloading data from data lake (as csv- or json-file)

This is an automated email from the ASF dual-hosted git repository.

ebi pushed a commit to branch STREAMPIPES-349
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 2e875437f777ca8ad3f2f2a0405c6482ba728328
Author: Daniel Ebi <eb...@fzi.de>
AuthorDate: Fri Jun 11 20:04:14 2021 +0200

    [STREAMPIPES-349] Add endpoint definition for downloading data from data lake (as csv- or json-file)
---
 .../apache/streampipes/ps/DataLakeResourceV4.java  | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java
index fd6ab92..caf76e8 100644
--- a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java
+++ b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java
@@ -121,6 +121,30 @@ public class DataLakeResourceV4 extends AbstractRestResource {
     }
 
     @GET
+    @Path("/measurements/{measurementID}/download")
+    @Produces(MediaType.APPLICATION_OCTET_STREAM)
+    @Operation(summary = "Download data from a single measurement series by a given id", tags = {"Data Lake"},
+            responses = {
+                    @ApiResponse(responseCode = "400", description = "Measurement series with given id and requested query specification not found"),
+                    @ApiResponse(responseCode = "200", description = "requested data", content = @Content(schema = @Schema(implementation = DataResult.class)))})
+    public Response downloadData(@Parameter(in = ParameterIn.PATH, description = "username", required = true) @PathParam("username") String username
+            , @Parameter(in = ParameterIn.PATH, description = "the id of the measurement series", required = true) @PathParam("measurementID") String measurementID
+            , @Parameter(in = ParameterIn.QUERY, description = "start date for slicing operation") @QueryParam("startDate") Long startDate
+            , @Parameter(in = ParameterIn.QUERY, description = "end date for slicing operation") @QueryParam("endDate") Long endDate
+            , @Parameter(in = ParameterIn.QUERY, description = "page number for paging operation") @QueryParam("page") Integer page
+            , @Parameter(in = ParameterIn.QUERY, description = "maximum number of retrieved query results") @QueryParam("limit") Integer limit
+            , @Parameter(in = ParameterIn.QUERY, description = "offset") @QueryParam("offset") Integer offset
+            , @Parameter(in = ParameterIn.QUERY, description = "grouping tags (comma-separated) for grouping operation") @QueryParam("groupBy") String groupBy
+            , @Parameter(in = ParameterIn.QUERY, description = "ordering of retrieved query results (ASC or DESC - default is ASC)") @QueryParam("order") String order
+            , @Parameter(in = ParameterIn.QUERY, description = "name of aggregation function used for grouping operation") @QueryParam("aggregationFunction") String aggregationFunction
+            , @Parameter(in = ParameterIn.QUERY, description = "time interval for aggregation (e.g. 1m - one minute) for grouping operation") @QueryParam("timeInterval") String timeInterval
+            , @Parameter(in = ParameterIn.QUERY, description = "format specification (csv, json - default is csv) for data download") @QueryParam("format") String format) {
+        /**
+         * TODO: implementation of method stump
+         */
+    }
+
+    @GET
     @Path("/configuration")
     @Produces(MediaType.APPLICATION_JSON)
     @Operation(summary = "Get the configuration parameters of the data lake", tags = {"Data Lake"},