use of io.hops.hopsworks.api.project.util.DsPath in project hopsworks by logicalclocks.
the class TensorBoardResource method startTensorBoard.
@ApiOperation(value = "Start a new TensorBoard", response = TensorBoardDTO.class)
@POST
@Produces(MediaType.APPLICATION_JSON)
@AllowedProjectRoles({ AllowedProjectRoles.DATA_OWNER, AllowedProjectRoles.DATA_SCIENTIST })
@JWTRequired(acceptedTokens = { Audience.API }, allowedUserRoles = { "HOPS_ADMIN", "HOPS_USER" })
public Response startTensorBoard(@Context SecurityContext sc, @Context UriInfo uriInfo) throws DatasetException, ProjectException, TensorBoardException, UnsupportedEncodingException, ServiceDiscoveryException {
DsPath dsPath = pathValidator.validatePath(this.project, "Experiments/" + experimentId);
String fullPath = dsPath.getFullPath().toString();
Users user = jWTHelper.getUserPrincipal(sc);
TensorBoardDTO tensorBoardDTO = tensorBoardController.startTensorBoard(experimentId, project, user, fullPath);
waitForTensorBoardLoaded(tensorBoardDTO);
UriBuilder builder = uriInfo.getAbsolutePathBuilder();
return Response.created(builder.build()).entity(tensorBoardDTO).build();
}
use of io.hops.hopsworks.api.project.util.DsPath in project hopsworks by logicalclocks.
the class EnvironmentResource method getYmlPath.
private String getYmlPath(String path) throws DatasetException, ProjectException, UnsupportedEncodingException {
if (Strings.isNullOrEmpty(path)) {
return null;
}
DsPath ymlPath = pathValidator.validatePath(this.project, path);
ymlPath.validatePathExists(inodeController, false);
org.apache.hadoop.fs.Path fullPath = ymlPath.getFullPath();
return fullPath.toString();
}
Aggregations