use of io.hops.hopsworks.api.git.branch.BranchDTO in project hopsworks by logicalclocks.
the class GitResource method getRepositoryBranches.
@ApiOperation(value = "Get branches for the given repository", response = BranchDTO.class)
@GET
@Path("/repository/{repositoryId}/branch")
@Produces(MediaType.APPLICATION_JSON)
@AllowedProjectRoles({ AllowedProjectRoles.DATA_OWNER, AllowedProjectRoles.DATA_SCIENTIST })
@JWTRequired(acceptedTokens = { Audience.API }, allowedUserRoles = { "HOPS_ADMIN", "HOPS_USER" })
@ApiKeyRequired(acceptedScopes = { ApiScope.GIT }, allowedUserRoles = { "HOPS_ADMIN", "HOPS_USER" })
public Response getRepositoryBranches(@Context UriInfo uriInfo, @Context SecurityContext sc, @BeanParam Pagination pagination, @PathParam("repositoryId") Integer repositoryId) throws GitOpException {
GitRepository repository = commandConfigurationValidator.verifyRepository(project, repositoryId);
ResourceRequest resourceRequest = new ResourceRequest(ResourceRequest.Name.BRANCH);
resourceRequest.setOffset(pagination.getOffset());
resourceRequest.setLimit(pagination.getLimit());
BranchDTO repositoryBranches = branchBuilder.build(uriInfo, resourceRequest, project, repository);
return Response.ok().entity(repositoryBranches).build();
}
Aggregations