Skip to content

Commit

Permalink
fix(grafana): add redirecting endpoint for archived recordings (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Apr 15, 2024
1 parent af04262 commit 36922a2
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/main/java/io/cryostat/recordings/Recordings.java
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,26 @@ public Uni<String> uploadActiveToGrafana(@RestPath long targetId, @RestPath long
return recordingHelper.uploadToJFRDatasource(targetId, remoteId);
}

@POST
@Path("/api/beta/recordings/{connectUrl}/{filename}/upload")
@RolesAllowed("write")
public Response uploadArchivedToGrafanaBeta(
@RestPath String connectUrl, @RestPath String filename) throws Exception {
var jvmId = Target.getTargetByConnectUrl(URI.create(connectUrl)).jvmId;
return Response.status(RestResponse.Status.PERMANENT_REDIRECT)
.location(
URI.create(
String.format(
"/api/v3/grafana/%s",
recordingHelper.encodedKey(jvmId, filename))))
.build();
}

@POST
@Path("/api/beta/fs/recordings/{jvmId}/{filename}/upload")
@RolesAllowed("write")
public Response uploadArchivedToGrafanaBeta(@RestPath String jvmId, @RestPath String filename)
throws Exception {
public Response uploadArchivedToGrafanaFromPath(
@RestPath String jvmId, @RestPath String filename) throws Exception {
return Response.status(RestResponse.Status.PERMANENT_REDIRECT)
.location(
URI.create(
Expand Down

0 comments on commit 36922a2

Please sign in to comment.