Package io.jenkins.plugins.quay
Class QuayClient
java.lang.Object
io.jenkins.plugins.quay.QuayClient
Client for interacting with Quay.io REST API v1.
Supports both public and private repositories.
Implements caching with 5-minute TTL.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException class for Quay API errors. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a QuayClient for public repository access.QuayClient(Secret apiToken) Create a QuayClient with optional authentication token as Secret.QuayClient(String apiToken) Create a QuayClient with optional authentication token. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildImageReference(String organization, String repository, String tag) Build the full image reference string.static voidClear the tag cache.Fetch tags from a Quay.io repository.Fetch tags from a Quay.io repository with a specified limit.booleanvalidateRepository(String organization, String repository) Validate a repository exists and is accessible.
-
Constructor Details
-
QuayClient
public QuayClient()Create a QuayClient for public repository access. -
QuayClient
Create a QuayClient with optional authentication token.- Parameters:
apiToken- Quay.io API token (robot token) for private repos, or null for public repos
-
QuayClient
Create a QuayClient with optional authentication token as Secret.- Parameters:
apiToken- Quay.io API token as Secret for private repos, or null for public repos
-
-
Method Details
-
getTags
public List<QuayTag> getTags(String organization, String repository) throws QuayClient.QuayApiException Fetch tags from a Quay.io repository.- Parameters:
organization- The organization/namespacerepository- The repository name- Returns:
- List of tags sorted by most recent first
- Throws:
QuayClient.QuayApiException- if the API call fails
-
getTags
public List<QuayTag> getTags(String organization, String repository, int limit) throws QuayClient.QuayApiException Fetch tags from a Quay.io repository with a specified limit.- Parameters:
organization- The organization/namespacerepository- The repository namelimit- Maximum number of tags to return- Returns:
- List of tags sorted by most recent first
- Throws:
QuayClient.QuayApiException- if the API call fails
-
validateRepository
Validate a repository exists and is accessible.- Parameters:
organization- The organization/namespacerepository- The repository name- Returns:
- true if the repository exists and is accessible
-
clearCache
public static void clearCache()Clear the tag cache. Useful for testing or forcing refresh. -
buildImageReference
Build the full image reference string.- Parameters:
organization- The organization/namespacerepository- The repository nametag- The tag name- Returns:
- Full image reference (e.g., quay.io/org/repo:tag)
-