Skip to content

Commit

Permalink
[SP-1102] - GET/v2/info/versions update and removement of deprecated …
Browse files Browse the repository at this point in the history
…endpoints (apache#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) <dvvasilenko@dev.vtb>
  • Loading branch information
deexidee and Василенко Денис Владимирович (4045091) committed Feb 17, 2023
1 parent 71b7b6f commit 46bca37
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,43 +90,6 @@ public List<Pipeline> get() {
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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
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;
Expand All @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
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;
Expand All @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,6 @@ public List<SpDataStream> get() {
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)
Expand Down

0 comments on commit 46bca37

Please sign in to comment.