Search in sources :

Example 1 with TorrentExtendedStatusJSON

use of io.hops.hopsworks.dela.old_dto.TorrentExtendedStatusJSON in project hopsworks by logicalclocks.

the class DelaProjectService method getExtendedDetails.

@GET
@Path("/transfers/{publicDSId}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@AllowedProjectRoles({ AllowedProjectRoles.DATA_SCIENTIST, AllowedProjectRoles.DATA_OWNER })
@JWTRequired(acceptedTokens = { Audience.API }, allowedUserRoles = { "HOPS_ADMIN", "HOPS_USER" })
public Response getExtendedDetails(@PathParam("publicDSId") String publicDSId, @Context SecurityContext sc) throws DelaException {
    TorrentId torrentId = new TorrentId(publicDSId);
    TorrentExtendedStatusJSON resp = delaTransferCtrl.details(torrentId);
    return successResponse(resp);
}
Also used : TorrentId(io.hops.hopsworks.dela.old_dto.TorrentId) TorrentExtendedStatusJSON(io.hops.hopsworks.dela.old_dto.TorrentExtendedStatusJSON) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) Consumes(javax.ws.rs.Consumes) GET(javax.ws.rs.GET) JWTRequired(io.hops.hopsworks.jwt.annotation.JWTRequired) AllowedProjectRoles(io.hops.hopsworks.api.filter.AllowedProjectRoles)

Example 2 with TorrentExtendedStatusJSON

use of io.hops.hopsworks.dela.old_dto.TorrentExtendedStatusJSON in project hopsworks by logicalclocks.

the class TransferDelaController method details.

public TorrentExtendedStatusJSON details(TorrentId torrentId) throws DelaException {
    if (!delaStateController.transferDelaAvailable()) {
        throw new DelaException(RESTCodes.DelaErrorCode.DELA_TRANSFER_NOT_AVAILABLE, Level.SEVERE, DelaException.Source.LOCAL);
    }
    try {
        ClientWrapper<TorrentExtendedStatusJSON> rc = ClientWrapper.httpInstance(TorrentExtendedStatusJSON.class).setTarget(settings.getDELA_TRANSFER_HTTP_ENDPOINT()).setPath("/library/extended").setPayload(torrentId);
        TorrentExtendedStatusJSON result = rc.doPost();
        return result;
    } catch (IllegalStateException ise) {
        throw new DelaException(RESTCodes.DelaErrorCode.COMMUNICATION_FAILURE, Level.SEVERE, DelaException.Source.DELA, null, ise.getMessage(), ise);
    }
}
Also used : TorrentExtendedStatusJSON(io.hops.hopsworks.dela.old_dto.TorrentExtendedStatusJSON) DelaException(io.hops.hopsworks.exceptions.DelaException)

Aggregations

TorrentExtendedStatusJSON (io.hops.hopsworks.dela.old_dto.TorrentExtendedStatusJSON)2 AllowedProjectRoles (io.hops.hopsworks.api.filter.AllowedProjectRoles)1 TorrentId (io.hops.hopsworks.dela.old_dto.TorrentId)1 DelaException (io.hops.hopsworks.exceptions.DelaException)1 JWTRequired (io.hops.hopsworks.jwt.annotation.JWTRequired)1 Consumes (javax.ws.rs.Consumes)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1