Skip to content

Commit

Permalink
server: Return derived data provider descriptor when deleting it
Browse files Browse the repository at this point in the history
Update swagger description for deletion and method name.

Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
  • Loading branch information
bhufmann committed Nov 4, 2024
1 parent d648fd4 commit 423f696
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,8 @@ public void testCreationDeletionOfDerivedDataProviders() throws IOException, URI
try (Response response = dpDeletionEndpoint.request().delete()) {
assertNotNull(response);
assertEquals(Status.OK.getStatusCode(), response.getStatus());
DataProviderDescriptorStub deletedDp = response.readEntity(DataProviderDescriptorStub.class);
assertEquals(derivedDp, deletedDp);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.ANN;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.CFG_CREATE_DESC;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.CFG_KEYS_DESC;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.DP_CFG_EX;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.CFG_TYPE_ID;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.COLUMNS;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.COLUMNS_EX;
Expand All @@ -24,6 +23,7 @@
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.DIRECTION;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.DIRECTION_COUNT;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.DIRECTION_EX;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.DP_CFG_EX;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.DT;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.ELEMENT;
import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.ELEMENT_EX;
Expand Down Expand Up @@ -1326,11 +1326,11 @@ public Response createDataProvider(
@Tag(name = OCG)
@Produces(MediaType.APPLICATION_JSON)
@Operation(summary = "Delete a configuration instance of a given configuration type", responses = {
@ApiResponse(responseCode = "200", description = "The derived data provider (and it's configuration) was successfully deleted", content = @Content(schema = @Schema(implementation = org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.model.Configuration.class))),
@ApiResponse(responseCode = "200", description = "Returns the deleted derived data provider descriptor. The derived data provider (and it's configuration) was successfully deleted.", content = @Content(schema = @Schema(implementation = DataProvider.class))),
@ApiResponse(responseCode = "400", description = INVALID_PARAMETERS, content = @Content(schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "404", description = PROVIDER_CONFIG_NOT_FOUND, content = @Content(schema = @Schema(implementation = String.class))),
})
public Response deleteDerivedOutput(
public Response deleteDerivedProvider(
@Parameter(description = EXP_UUID) @PathParam("expUUID") UUID expUUID,
@Parameter(description = OUTPUT_ID) @PathParam("outputId") String outputId,
@Parameter(description = OUTPUT_ID) @PathParam("derivedOutputId") String derivedOutputId) {
Expand Down Expand Up @@ -1370,7 +1370,7 @@ public Response deleteDerivedOutput(
return Response.status(Status.NOT_FOUND).entity(NO_SUCH_PROVIDER).build();
}
configurator.removeDataProviderDescriptor(experiment, derivedDescriptor);
return Response.ok().build();
return Response.ok(derivedDescriptor).build();
} catch (TmfConfigurationException e) {
return Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build();
}
Expand Down

0 comments on commit 423f696

Please sign in to comment.