You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2023/02/17 17:29:52 UTC
[streampipes] branch dev updated: [SP-1102] - GET/v2/info/versions update and removement of deprecated endpoints (#1192)
This is an automated email from the ASF dual-hosted git repository.
bossenti pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 46bca376b [SP-1102] - GET/v2/info/versions update and removement of deprecated endpoints (#1192)
46bca376b is described below
commit 46bca376bb3435674fc4e71213bce0af01e5c8b1
Author: Denis Vasilenko <33...@users.noreply.github.com>
AuthorDate: Fri Feb 17 20:29:46 2023 +0300
[SP-1102] - GET/v2/info/versions update and removement of deprecated endpoints (#1192)
* [SP-1102] - Swagger doc description for endpoint "/v2/info/versions" in rest/impl/Version.class and removal of endpoints marked @Deprecated(since = "0.71.0", forRemoval = true).
* checkstyle violation fix
* GET /v2/setup/configured Swagger doc is provided
---------
Co-authored-by: Василенко Денис Владимирович (4045091) <dv...@dev.vtb>
---
.../streampipes/rest/impl/PipelineResource.java | 37 ----------------------
.../org/apache/streampipes/rest/impl/Setup.java | 3 ++
.../org/apache/streampipes/rest/impl/Version.java | 3 ++
.../rest/impl/pe/DataStreamResource.java | 22 -------------
4 files changed, 6 insertions(+), 59 deletions(-)
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java
index 5cb020986..eafa7179d 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java
@@ -90,43 +90,6 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
return PipelineManager.getAllPipelines();
}
- /**
- * @deprecated use {@link #get()} instead.
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/own")
- @JacksonSerialized
- @Operation(summary = "Get all pipelines assigned to the current user",
- tags = {"Pipeline"},
- responses = {
- @ApiResponse(content = {
- @Content(
- mediaType = "application/json",
- array = @ArraySchema(schema = @Schema(implementation = Pipeline.class)))
- })})
- @PreAuthorize(AuthConstants.HAS_READ_PIPELINE_PRIVILEGE)
- @PostFilter("hasPermission(filterObject.pipelineId, 'READ')")
- @Deprecated(since = "0.71.0", forRemoval = true)
- public List<Pipeline> getOwn() {
- return PipelineManager.getAllPipelines();
- }
-
- /**
- * @deprecated use {@link #get()} instead.
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/system")
- @JacksonSerialized
- @Operation(summary = "Get all system pipelines assigned to the current user",
- tags = {"Pipeline"})
- @PreAuthorize(AuthConstants.HAS_READ_PIPELINE_PRIVILEGE)
- @Deprecated(since = "0.71.0", forRemoval = true)
- public Response getSystemPipelines() {
- return ok(getPipelineStorage().getSystemPipelines());
- }
-
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/{pipelineId}/status")
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Setup.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Setup.java
index 9efe5baa2..0874680c8 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Setup.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Setup.java
@@ -23,6 +23,7 @@ import org.apache.streampipes.config.backend.BackendConfig;
import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
import com.google.gson.JsonObject;
+import io.swagger.v3.oas.annotations.Operation;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
@@ -36,6 +37,8 @@ public class Setup extends AbstractRestResource {
@GET
@Path("/configured")
@Produces(MediaType.APPLICATION_JSON)
+ @Operation(summary = "Endpoint is used by UI to determine whether the core is running upon startup",
+ tags = {"Configurated"})
public Response isConfigured() {
JsonObject obj = new JsonObject();
if (BackendConfig.INSTANCE.isConfigured()) {
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Version.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Version.java
index 810509603..cb55d32fc 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Version.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Version.java
@@ -21,6 +21,8 @@ import org.apache.streampipes.manager.info.SystemInfoProvider;
import org.apache.streampipes.manager.info.VersionInfoProvider;
import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
+import io.swagger.v3.oas.annotations.Operation;
+
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
@@ -33,6 +35,7 @@ public class Version extends AbstractAuthGuardedRestResource {
@GET
@Path("/versions")
@Produces(MediaType.APPLICATION_JSON)
+ @Operation(summary = "Provides health-check and information about current backend version.", tags = {"Version"})
public Response getVersionInfo() {
return ok(new VersionInfoProvider().makeVersionInfo());
}
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/pe/DataStreamResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/pe/DataStreamResource.java
index 506b5de55..760d664f9 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/pe/DataStreamResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/pe/DataStreamResource.java
@@ -65,28 +65,6 @@ public class DataStreamResource extends AbstractAuthGuardedRestResource {
return getDataStreamResourceManager().findAllAsInvocation();
}
- @GET
- @Path("/own")
- @Produces({MediaType.APPLICATION_JSON, SpMediaType.JSONLD})
- @JacksonSerialized
- @PreAuthorize(AuthConstants.HAS_READ_PIPELINE_ELEMENT_PRIVILEGE)
- @PostFilter("hasPermission(filterObject.elementId, 'READ')")
- @Deprecated(since = "0.71.0", forRemoval = true)
- public List<SpDataStream> getOwn() {
- return getDataStreamResourceManager().findAllAsInvocation();
- }
-
- @DELETE
- @Path("/own/{elementId}")
- @Produces(MediaType.APPLICATION_JSON)
- @JacksonSerialized
- @PreAuthorize(AuthConstants.HAS_DELETE_PIPELINE_ELEMENT_PRIVILEGE)
- @Deprecated(since = "0.71.0", forRemoval = true)
- public Response removeOwn(@PathParam("elementId") String elementId) {
- getDataStreamResourceManager().delete(elementId);
- return constructSuccessMessage(NotificationType.STORAGE_SUCCESS.uiNotification());
- }
-
@DELETE
@Path("/{elementId}")
@Produces(MediaType.APPLICATION_JSON)