-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #130 - Add catalog REST endpoint
- Loading branch information
Showing
2 changed files
with
47 additions
and
29 deletions.
There are no files selected for viewing
29 changes: 0 additions & 29 deletions
29
webapp/src/main/java/com/manorrock/toyger/webapp/ApiVersionCheckResource.java
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
webapp/src/main/java/com/manorrock/toyger/webapp/V2Resource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.manorrock.toyger.webapp; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
/** | ||
* @author MAnfred Riem ([email protected]) | ||
*/ | ||
@Path("v2") | ||
public class V2Resource { | ||
|
||
/** | ||
* The API version check. | ||
* | ||
* Return status 200 with header 'Docker-Distribution-API-Version: | ||
* registry/2.0'. | ||
* | ||
* @see | ||
* https://distribution.github.io/distribution/spec/api/#api-version-check | ||
* @return the response. | ||
*/ | ||
@GET | ||
public Response apiVersionCheck() { | ||
return Response | ||
.ok() | ||
.header("Docker-Distribution-API-Version", "registry/2.0") | ||
.build(); | ||
} | ||
|
||
/** | ||
* The catalog. | ||
* | ||
* @see https://distribution.github.io/distribution/spec/api/#listing-repositories | ||
* @return the response. | ||
*/ | ||
@GET | ||
@Path("_catalog") | ||
@Produces("application/json") | ||
public Response catalog() { | ||
return Response | ||
.ok() | ||
.entity("{}") | ||
.build(); | ||
} | ||
} |