Sentiaus commented on code in PR #6447:
URL: https://github.com/apache/texera/pull/6447#discussion_r3636495632
##########
file-service/src/main/scala/org/apache/texera/service/resource/DatasetResource.scala:
##########
@@ -1361,6 +1305,187 @@ class DatasetResource extends LazyLogging {
}
}
+ @POST
+ @RolesAllowed(Array("REGULAR", "ADMIN"))
+ @Path("/{did}/drive-export")
+ @Consumes(Array(MediaType.APPLICATION_JSON))
+ def exportDatasetToDrive(
+ @PathParam("did") did: Integer,
+ @QueryParam("dvid") dvid: Integer,
+ @QueryParam("latest") latest: java.lang.Boolean,
+ request: DriveExportRequest,
+ @Auth user: SessionUser
+ ): Response = {
+ if
(!request.sessionUri.startsWith("https://www.googleapis.com/upload/drive/")) {
+ throw new BadRequestException("Invalid session URI")
+ }
+ withTransaction(context) { ctx =>
Review Comment:
@xuang7 removed the building of the ZIP and Drive PUT request from
withTransaction.
I'm not able to use StreamingOutput because this would require implementing
the logic + error handling from hitting Google's resumable API repeatedly (This
is the end goal), however this would add additional complexity that hasn't been
discussed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]