You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2021/09/24 14:28:29 UTC
[incubator-streampipes] branch dev updated: [STREAMPIPES-427]
Modify paths of data explorer resources
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 1c02250 [STREAMPIPES-427] Modify paths of data explorer resources
1c02250 is described below
commit 1c02250cdc849026f461e697a15c6ce5695a624c
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 16:28:21 2021 +0200
[STREAMPIPES-427] Modify paths of data explorer resources
---
.../apache/streampipes/ps/DataLakeResourceV3.java | 3 +--
.../apache/streampipes/ps/DataLakeResourceV4.java | 27 ++++++++--------------
.../ps/PipelineElementTemplateResource.java | 2 +-
.../impl/datalake/DataLakeDashboardResource.java | 2 +-
.../rest/impl/datalake/DataLakeWidgetResource.java | 2 +-
.../impl/datalake/PersistedDataStreamResource.java | 2 +-
.../app-transport-monitoring-rest.service.ts | 6 ++---
.../datalake/datalake-rest.service.ts | 4 ++--
.../apis/data-view-data-explorer.service.ts | 6 ++---
.../apis/datalake-rest.service.ts | 2 +-
10 files changed, 24 insertions(+), 32 deletions(-)
diff --git a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java
index 07bf7cc..900a812 100644
--- a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java
+++ b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java
@@ -20,7 +20,6 @@ package org.apache.streampipes.ps;
import org.apache.streampipes.dataexplorer.utils.DataExplorerUtils;
import org.apache.streampipes.model.datalake.DataLakeMeasure;
-import org.apache.streampipes.model.message.Notification;
import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
@@ -31,7 +30,7 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;
-@Path("/v3/users/{username}/datalake")
+@Path("/v3/datalake")
public class DataLakeResourceV3 extends AbstractRestResource {
// private DataLakeManagementV3 dataLakeManagement;
//
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 25874a1..cd09dfe 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
@@ -47,7 +47,7 @@ class Placeholder {
}
-@Path("v4/users/{username}/datalake")
+@Path("v4/datalake")
public class DataLakeResourceV4 extends AbstractRestResource {
private static final Logger logger = LoggerFactory.getLogger(DataLakeResourceV4.class);
@@ -68,8 +68,7 @@ public class DataLakeResourceV4 extends AbstractRestResource {
@Consumes(MediaType.APPLICATION_JSON)
@Operation(summary = "Configure the parameters of the data lake", tags = {"Data Lake"},
responses = {@ApiResponse(responseCode = "200", description = "Configuration was successful")})
- public Response configureMeasurement(@Parameter(in = ParameterIn.PATH, description = "username", required = true) @PathParam("username") String username,
- @Parameter(in = ParameterIn.QUERY, description = "should any parameter be reset to its default value?") @DefaultValue("false") @QueryParam("resetToDefault") boolean resetToDefault,
+ public Response configureMeasurement(@Parameter(in = ParameterIn.QUERY, description = "should any parameter be reset to its default value?") @DefaultValue("false") @QueryParam("resetToDefault") boolean resetToDefault,
@Parameter(in = ParameterIn.DEFAULT, description = "the configuration parameters") DataLakeConfiguration config) {
return ok(this.dataLakeManagement.editMeasurementConfiguration(config, resetToDefault));
}
@@ -80,8 +79,7 @@ public class DataLakeResourceV4 extends AbstractRestResource {
responses = {
@ApiResponse(responseCode = "200", description = "Data from measurement series successfully removed"),
@ApiResponse(responseCode = "400", description = "Measurement series with given id not found")})
- public Response deleteData(@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
+ public Response deleteData(@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) {
@@ -95,8 +93,7 @@ public class DataLakeResourceV4 extends AbstractRestResource {
responses = {
@ApiResponse(responseCode = "200", description = "Measurement series successfully dropped from Data Lake"),
@ApiResponse(responseCode = "400", description = "Measurement series with given id or related event property not found")})
- public Response dropMeasurementSeries(@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) {
+ public Response dropMeasurementSeries(@Parameter(in = ParameterIn.PATH, description = "the id of the measurement series", required = true) @PathParam("measurementID") String measurementID) {
boolean isSuccessDataLake = this.dataLakeManagement.removeMeasurement(measurementID);
@@ -118,7 +115,7 @@ public class DataLakeResourceV4 extends AbstractRestResource {
@Operation(summary = "Get a list of all measurement series", tags = {"Data Lake"},
responses = {
@ApiResponse(responseCode = "200", description = "array of stored measurement series", content = @Content(array = @ArraySchema(schema = @Schema(implementation = DataLakeMeasure.class))))})
- public Response getAll(@Parameter(in = ParameterIn.PATH, description = "username", required = true) @PathParam("username") String username) {
+ public Response getAll() {
List<DataLakeMeasure> allMeasurements = this.dataLakeManagement.getAllMeasurements();
return ok(allMeasurements);
}
@@ -131,8 +128,7 @@ public class DataLakeResourceV4 extends AbstractRestResource {
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 = DataSeries.class)))})
- public Response getData(@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
+ public Response getData(@Parameter(in = ParameterIn.PATH, description = "the id of the measurement series", required = true) @PathParam("measurementID") String measurementID
, @Parameter(in = ParameterIn.QUERY, description = "the columns to be selected (comma-separated)") @QueryParam(QP_COLUMNS) String columns
, @Parameter(in = ParameterIn.QUERY, description = "start date for slicing operation") @QueryParam(QP_START_DATE) Long startDate
, @Parameter(in = ParameterIn.QUERY, description = "end date for slicing operation") @QueryParam(QP_END_DATE) Long endDate
@@ -170,8 +166,7 @@ public class DataLakeResourceV4 extends AbstractRestResource {
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 = DataSeries.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
+ public Response downloadData(@Parameter(in = ParameterIn.PATH, description = "the id of the measurement series", required = true) @PathParam("measurementID") String measurementID
, @Parameter(in = ParameterIn.QUERY, description = "the columns to be selected (comma-separated)") @QueryParam(QP_COLUMNS) String columns
, @Parameter(in = ParameterIn.QUERY, description = "start date for slicing operation") @QueryParam(QP_START_DATE) Long startDate
, @Parameter(in = ParameterIn.QUERY, description = "end date for slicing operation") @QueryParam(QP_END_DATE) Long endDate
@@ -210,8 +205,7 @@ public class DataLakeResourceV4 extends AbstractRestResource {
@Operation(summary = "Get the configuration parameters of the data lake", tags = {"Data Lake"},
responses = {
@ApiResponse(responseCode = "200", description = "configuration parameters", content = @Content(schema = @Schema(implementation = DataLakeConfiguration.class)))})
- public Response getMeasurementConfiguration(@Parameter(in = ParameterIn.PATH, description = "username", required = true) @PathParam("username") String username,
- @Parameter(in = ParameterIn.QUERY, description = "the id of a specific configuration parameter") @QueryParam("parameterID") String parameterID) {
+ public Response getMeasurementConfiguration(@Parameter(in = ParameterIn.QUERY, description = "the id of a specific configuration parameter") @QueryParam("parameterID") String parameterID) {
return ok(this.dataLakeManagement.getDataLakeConfiguration());
}
@@ -221,8 +215,7 @@ public class DataLakeResourceV4 extends AbstractRestResource {
@Operation(summary = "Label data points of the measurement series with given id", tags = {"Data Lake"},
responses = {
@ApiResponse(responseCode = "200", description = "Labeling was successful")})
- public Response labelData(@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
+ public Response labelData(@Parameter(in = ParameterIn.PATH, description = "the id of the measurement series", required = true) @PathParam("measurementID") String measurementID
, @Parameter(in = ParameterIn.DEFAULT, description = "the label details that should be written into database") Placeholder body
, @Parameter(in = ParameterIn.QUERY, description = "start date for slicing operation") @QueryParam("startDate") String startDate
@@ -238,7 +231,7 @@ public class DataLakeResourceV4 extends AbstractRestResource {
@Operation(summary = "Remove all stored measurement series from Data Lake", tags = {"Data Lake"},
responses = {
@ApiResponse(responseCode = "200", description = "All measurement series successfully removed")})
- public Response removeAll(@Parameter(in = ParameterIn.PATH, description = "username", required = true) @PathParam("username") String username) {
+ public Response removeAll() {
boolean isSuccess = this.dataLakeManagement.removeAllMeasurements();
return Response.ok(isSuccess).build();
}
diff --git a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java
index 5f6faf1..dfa5bbc 100644
--- a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java
+++ b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java
@@ -36,7 +36,7 @@ import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-@Path("/v2/users/{username}/pipeline-element-templates")
+@Path("/v2/pipeline-element-templates")
public class PipelineElementTemplateResource extends AbstractRestResource {
@GET
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeDashboardResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeDashboardResource.java
index cb41a22..1bc5976 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeDashboardResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeDashboardResource.java
@@ -24,7 +24,7 @@ import org.apache.streampipes.storage.api.IDashboardStorage;
import javax.ws.rs.Path;
-@Path("/v3/users/{username}/datalake/dashboard")
+@Path("/v3/datalake/dashboard")
public class DataLakeDashboardResource extends AbstractDashboardResource {
protected IDashboardStorage getDashboardStorage() {
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeWidgetResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeWidgetResource.java
index 5ddefd2..e2d7a79 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeWidgetResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeWidgetResource.java
@@ -27,7 +27,7 @@ import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-@Path("/v3/users/{username}/datalake/dashboard/widgets")
+@Path("/v3/datalake/dashboard/widgets")
public class DataLakeWidgetResource extends AbstractRestResource {
@GET
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/PersistedDataStreamResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/PersistedDataStreamResource.java
index 5e796ff..3ff6459 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/PersistedDataStreamResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/PersistedDataStreamResource.java
@@ -31,7 +31,7 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.ArrayList;
-@Path("/v3/users/{username}/datalake/pipelines")
+@Path("/v3/datalake/pipelines")
public class PersistedDataStreamResource extends AbstractPipelineExtractionResource<DataLakeMeasure> {
private static final String DataLakeAppId = "org.apache.streampipes.sinks.internal.jvm.datalake";
diff --git a/ui/src/app/app-transport-monitoring/services/app-transport-monitoring-rest.service.ts b/ui/src/app/app-transport-monitoring/services/app-transport-monitoring-rest.service.ts
index bd7950d..3f278c1 100644
--- a/ui/src/app/app-transport-monitoring/services/app-transport-monitoring-rest.service.ts
+++ b/ui/src/app/app-transport-monitoring/services/app-transport-monitoring-rest.service.ts
@@ -120,7 +120,7 @@ export class AppTransportMonitoringRestService {
}
getDeleteUrl(index: string) {
- return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/datalake/delete/' +index;
+ return this.baseUrl + '/api/v2' + '/datalake/delete/' +index;
}
getTransportProcessesUrl(): string {
@@ -148,11 +148,11 @@ export class AppTransportMonitoringRestService {
}
private get url() {
- return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/datalake/data'
+ return this.baseUrl + '/api/v2' + '/datalake/data';
}
private get imagePath() {
return this.url + "/images";
}
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/core-services/datalake/datalake-rest.service.ts b/ui/src/app/core-services/datalake/datalake-rest.service.ts
index 57d8e27..a12a317 100644
--- a/ui/src/app/core-services/datalake/datalake-rest.service.ts
+++ b/ui/src/app/core-services/datalake/datalake-rest.service.ts
@@ -36,11 +36,11 @@ export class DatalakeRestService {
}
private get dataLakeUrlV3() {
- return this.baseUrl + '/api/v3/users/' + this.authStatusService.email + '/datalake';
+ return this.baseUrl + '/api/v3' + '/datalake';
}
private get dataLakeUrlV4() {
- return this.baseUrl + '/api/v4/users/' + this.authStatusService.email + '/datalake';
+ return this.baseUrl + '/api/v4' + '/datalake';
}
diff --git a/ui/src/app/platform-services/apis/data-view-data-explorer.service.ts b/ui/src/app/platform-services/apis/data-view-data-explorer.service.ts
index 4b17bab..91c8ef6 100644
--- a/ui/src/app/platform-services/apis/data-view-data-explorer.service.ts
+++ b/ui/src/app/platform-services/apis/data-view-data-explorer.service.ts
@@ -65,15 +65,15 @@ export class DataViewDataExplorerService {
}
private get persistedDataStreamsUrl() {
- return `${this.baseUrl}/api/v3/users/${this.authStatusService.email}/datalake/pipelines`;
+ return `${this.baseUrl}/api/v3/datalake/pipelines`;
}
private get dashboardUrl() {
- return `${this.baseUrl}/api/v3/users/${this.authStatusService.email}/datalake/dashboard`;
+ return `${this.baseUrl}/api/v3/datalake/dashboard`;
}
private get dashboardWidgetUrl() {
- return `${this.baseUrl}/api/v3/users/${this.authStatusService.email}/datalake/dashboard/widgets`;
+ return `${this.baseUrl}/api/v3/datalake/dashboard/widgets`;
}
getWidget(widgetId: string): Observable<DataExplorerWidgetModel> {
diff --git a/ui/src/app/platform-services/apis/datalake-rest.service.ts b/ui/src/app/platform-services/apis/datalake-rest.service.ts
index 22093c1..09e472d 100644
--- a/ui/src/app/platform-services/apis/datalake-rest.service.ts
+++ b/ui/src/app/platform-services/apis/datalake-rest.service.ts
@@ -35,7 +35,7 @@ export class DatalakeRestService {
}
private get dataLakeUrl() {
- return this.baseUrl + '/api/v4/users/' + this.authStatusService.email + '/datalake';
+ return this.baseUrl + '/api/v4' + '/datalake';
}
getAllMeasurementSeries(): Observable<DataLakeMeasure[]> {