Skip to content

Commit

Permalink
Fixes #130 - Add catalog REST endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem committed Dec 20, 2023
1 parent cfde865 commit 96120af
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 29 deletions.

This file was deleted.

47 changes: 47 additions & 0 deletions webapp/src/main/java/com/manorrock/toyger/webapp/V2Resource.java
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();
}
}

0 comments on commit 96120af

Please sign in to comment.