Class QuayClient

java.lang.Object
io.jenkins.plugins.quay.QuayClient

public class QuayClient extends Object
Client for interacting with Quay.io REST API v1. Supports both public and private repositories. Implements caching with 5-minute TTL.
  • Constructor Details

    • QuayClient

      public QuayClient()
      Create a QuayClient for public repository access.
    • QuayClient

      public QuayClient(String apiToken)
      Create a QuayClient with optional authentication token.
      Parameters:
      apiToken - Quay.io API token (robot token) for private repos, or null for public repos
    • QuayClient

      public QuayClient(Secret apiToken)
      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/namespace
      repository - 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/namespace
      repository - The repository name
      limit - Maximum number of tags to return
      Returns:
      List of tags sorted by most recent first
      Throws:
      QuayClient.QuayApiException - if the API call fails
    • validateRepository

      public boolean validateRepository(String organization, String repository)
      Validate a repository exists and is accessible.
      Parameters:
      organization - The organization/namespace
      repository - 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

      public static String buildImageReference(String organization, String repository, String tag)
      Build the full image reference string.
      Parameters:
      organization - The organization/namespace
      repository - The repository name
      tag - The tag name
      Returns:
      Full image reference (e.g., quay.io/org/repo:tag)