Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new repository query APIs #151

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,14 @@ Response getRemoteRepositoryByUrl( @QueryParam( "packageType" ) final String pac
@GET
@Path( "/isEmpty" )
Response isStoreEmpty();

@GET
@Path( "/storekeys/{packageType}" )
@Produces( APPLICATION_JSON )
Response getStoreKeys( @PathParam( "packageType" ) final String pkgType );

@GET
@Path( "/endpoints/{packageType}" )
@Produces( APPLICATION_JSON )
Response getEndpoints( @PathParam( "packageType" ) final String pkgType );
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.commonjava.indy.service.ui.models.repository.ArtifactStore;
import org.commonjava.indy.service.ui.models.repository.SimpleBooleanResultDTO;
import org.commonjava.indy.service.ui.models.repository.StoreListingDTO;
import org.commonjava.indy.service.ui.models.stats.EndpointViewListing;
import org.eclipse.microprofile.openapi.annotations.Operation;
import org.eclipse.microprofile.openapi.annotations.media.Content;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
Expand All @@ -37,6 +38,7 @@
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
import java.util.Map;

import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.eclipse.microprofile.openapi.annotations.enums.ParameterIn.PATH;
Expand Down Expand Up @@ -250,4 +252,28 @@ public Response getStoreEmpty()
return client.isStoreEmpty();
}

@Operation(
summary = "Retrieve a listing of the artifact stores available on the system. This is especially useful for setting up a network of Indy instances that reference one another" )
@APIResponse( responseCode = "200",
content = @Content( schema = @Schema( implementation = EndpointViewListing.class ) ),
description = "The artifact store listing" )
@Path( "/endpoints/{packageType}" )
@GET
@Produces( APPLICATION_JSON )
public Response getEndpoints( @PathParam( "packageType" ) final String pkgType )
{
return client.getEndpoints( pkgType );
}

@Operation( summary = "Retrieve a listing of the artifact stores keys available on the system." )
@APIResponse( responseCode = "200", content = @Content( schema = @Schema( implementation = Map.class ) ),
description = "The artifact store keys listing" )
@Path( "/storekeys/{packageType}" )
@GET
@Produces( APPLICATION_JSON )
public Response getStoreKeys( @PathParam( "packageType" ) final String pkgType )
{
return client.getStoreKeys( pkgType );
}

}
Loading