use of io.hops.hopsworks.api.git.remote.GitRepositoryRemoteDTO in project hopsworks by logicalclocks.
the class GitResource method getRepositoryRemotes.
@ApiOperation(value = "Get repository configured remotes: git remotes -v", response = GitRepositoryRemoteDTO.class)
@GET
@Path("/repository/{repositoryId}/remote")
@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 getRepositoryRemotes(@Context UriInfo uriInfo, @Context SecurityContext sc, @PathParam("repositoryId") Integer repositoryId) throws GitOpException {
GitRepository repository = commandConfigurationValidator.verifyRepository(project, repositoryId);
ResourceRequest resourceRequest = new ResourceRequest(ResourceRequest.Name.REMOTE);
GitRepositoryRemoteDTO dto = gitRepositoryRemoteBuilder.build(uriInfo, resourceRequest, project, repository);
return Response.ok().entity(dto).build();
}
use of io.hops.hopsworks.api.git.remote.GitRepositoryRemoteDTO in project hopsworks by logicalclocks.
the class GitResource method getRepositoryRemote.
@ApiOperation(value = "Get repository remote of a particular name", response = GitRepositoryRemoteDTO.class)
@GET
@Path("/repository/{repositoryId}/remote/{remoteName}")
@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 getRepositoryRemote(@Context UriInfo uriInfo, @Context SecurityContext sc, @PathParam("repositoryId") Integer repositoryId, @PathParam("remoteName") String remoteName) throws GitOpException {
if (Strings.isNullOrEmpty(remoteName)) {
throw new IllegalArgumentException("Remote name is empty");
}
GitRepository repository = commandConfigurationValidator.verifyRepository(project, repositoryId);
ResourceRequest resourceRequest = new ResourceRequest(ResourceRequest.Name.REMOTE);
GitRepositoryRemoteDTO dto = gitRepositoryRemoteBuilder.build(uriInfo, resourceRequest, project, repository, remoteName);
return Response.ok().entity(dto).build();
}
Aggregations