### Get Distributions Source: https://github.com/foojayio/discoapi/blob/main/README.md Retrieves information about available OpenJDK distributions and their versions. You can also fetch details for a specific distribution. ```APIDOC ## GET /api.foojay.io/disco/v3.0/distributions ### Description Retrieves all available distributions and their versions. ### Method GET ### Endpoint /api.foojay.io/disco/v3.0/distributions ### Response #### Success Response (200) - **distributions** (array) - A list of distribution objects, each containing distribution name and available versions. ``` ```APIDOC ## GET /api.foojay.io/disco/v3.0/distributions/{distribution} ### Description Retrieves details for a specific distribution and its available versions. ### Method GET ### Endpoint /api.foojay.io/disco/v3.0/distributions/{distribution} ### Path Parameters - **distribution** (string) - Required - The name of the distribution (e.g., zulu). ### Response #### Success Response (200) - **distribution_details** (object) - An object containing details about the specified distribution and its versions. ``` -------------------------------- ### GET /packages Source: https://github.com/foojayio/discoapi/blob/main/README.md Retrieves information about available Java packages (JDKs and JREs) with extensive filtering capabilities. ```APIDOC ## GET /packages ### Description This endpoint allows you to query for available Java Development Kits (JDKs) and Java Runtime Environments (JREs) based on a wide range of criteria. ### Method GET ### Endpoint /packages ### Parameters #### Query Parameters - **version** (string) - Optional - Specifies the Java version (e.g., 1.8.0_262, 11.0.9.1, 17-ea.1, 11.0.8..<11.0.10). - **distro** (string) - Optional - Filters by distribution (e.g., aoj, aoj_openj9, corretto, dragonwell, graalvm_ce8, graalvm_ce11, graalvm_ce16, jetbrains, liberica, liberica_native, mandrel, microsoft, ojdk_build, openlogic, oracle, oracle_open_jdk, redhat, sap_machine, semeru, temurin, trava, zulu, zulu_prime). - **architecture** (string) - Optional - Filters by CPU architecture (e.g., aarch64, amd64, arm, arm64, ia64, mips, ppc, ppc64el, ppc64le, ppc64, riscv64, s390, s390x, sparc, sparcv9, x64, x86-64, x86, i386, i486, i586, i686, x86-32). - **archive_type** (string) - Optional - Filters by archive format (e.g., apk, cab, deb, dmg, exe, msi, pkg, rpm, tar, tar.gz, tar.Z, zip). - **package_type** (string) - Optional - Filters by package type (e.g., jdk, jre). - **operating_system** (string) - Optional - Filters by operating system (e.g., aix, alpine_linux, linux, linux_musl, macos, qnx, solaris, windows). - **libc_type** (string) - Optional - Filters by C library type (e.g., c_std_lib, glibc, libc, musl). - **release_status** (string) - Optional - Filters by release status (e.g., ea, ga). - **term_of_support** (string) - Optional - Filters by term of support (e.g., sts, mts, lts). - **bitness** (string) - Optional - Filters by bitness (e.g., 32, 64). - **javafx_bundled** (boolean) - Optional - Filters whether JavaFX is bundled (true or false). - **directly_downloadable** (boolean) - Optional - Filters for directly downloadable packages (true or false). - **latest** (string) - Optional - Specifies how to determine the latest version (e.g., all_of_version, per_distro, overall, available). ### Request Example ``` GET /packages?version=17&operating_system=linux&latest=overall ``` ### Response #### Success Response (200) - **packages** (array) - A list of package objects matching the query criteria. - Each package object may contain fields like `version`, `distro`, `operating_system`, `architecture`, `archive_type`, `package_type`, `url`, etc. #### Response Example ```json { "packages": [ { "version": "17.0.1", "distro": "temurin", "operating_system": "linux", "architecture": "x64", "archive_type": "tar.gz", "package_type": "jdk", "url": "https://example.com/jdk-17.0.1_linux-x64_temurin.tar.gz" } ] } ``` ``` -------------------------------- ### Get Distributions Source: https://context7.com/foojayio/discoapi/llms.txt Returns information about all supported JDK distributions, including available versions and metadata. ```APIDOC ## GET /disco/v3.0/distributions ### Description Returns information about all supported JDK distributions, including available versions and metadata. ### Method GET ### Endpoint /disco/v3.0/distributions ### Parameters #### Path Parameters - **distribution_name** (string) - Optional - The name of the distribution to retrieve (e.g., 'zulu'). ### Response #### Success Response (200) - **result** (array) - An array of distribution objects. - **name** (string) - The name of the distribution. - **api_parameter** (string) - The parameter used to identify the distribution in API calls. - **maintained** (boolean) - Indicates if the distribution is maintained. - **available** (boolean) - Indicates if the distribution is currently available. - **build_of_openjdk** (boolean) - Indicates if it's a build of OpenJDK. - **build_of_graalvm** (boolean) - Indicates if it's a build of GraalVM. - **official_uri** (string) - The official URI for the distribution. - **versions** (array) - An array of available versions for the distribution. - **message** (string) - A message indicating the number of distributions found. #### Response Example ```json { "result": [ { "name": "Zulu", "api_parameter": "zulu", "maintained": true, "available": true, "build_of_openjdk": true, "build_of_graalvm": false, "official_uri": "https://www.azul.com/downloads/", "versions": ["21.0.1", "21", "17.0.9", "17.0.8", "11.0.21", ...] } ], "message": "1 distribution(s) found" } ``` ``` -------------------------------- ### GET /packages Source: https://github.com/foojayio/discoapi/blob/main/README.md Retrieves a list of JDK packages based on specified criteria. You can filter by package type, version, operating system, architecture, and more. The results are returned in reverse alphabetical order of distribution, with Zulu often appearing first due to its wide availability. ```APIDOC ## GET /packages ### Description Retrieves a list of JDK packages based on specified criteria. You can filter by package type, version, operating system, architecture, and more. The results are returned in reverse alphabetical order of distribution, with Zulu often appearing first due to its wide availability. ### Method GET ### Endpoint /packages ### Parameters #### Query Parameters - **latest** (string) - Optional - Use 'available' to get the latest available version. - **package_type** (string) - Required - The type of package, e.g., 'jdk'. - **version** (string) - Required - The major version of the JDK, e.g., '11'. - **javafx_bundled** (boolean) - Optional - Set to 'true' if JavaFX is bundled. - **operating_system** (string) - Required - The target operating system, e.g., 'macos'. - **architecture** (string) - Required - The processor architecture, e.g., 'x64'. - **archive_type** (string) - Optional - The desired archive type, e.g., 'dmg' or 'pkg'. Can be specified multiple times. - **distro** (string) - Optional - Filter results by a specific distribution, e.g., 'liberica'. ### Request Example ``` GET https://api.foojay.io/disco/v3.0/packages?package_type=jdk&latest=available&version=11&javafx_bundled=true&operating_system=macos&architecture=x64&archive_type=dmg&archive_type=pkg ``` ### Response #### Success Response (200) - **result** (array) - An array of package objects matching the criteria. - **id** (string) - Unique identifier for the package. - **archive_type** (string) - The type of archive (e.g., 'dmg', 'pkg'). - **distribution** (string) - The JDK distribution (e.g., 'zulu', 'liberica'). - **major_version** (integer) - The major version number of the JDK. - **java_version** (string) - The full Java version string. - **distribution_version** (string) - The version of the distribution. - **jdk_version** (integer) - The JDK version number. - **latest_build_available** (boolean) - Indicates if the latest build is available. - **release_status** (string) - The release status (e.g., 'ga'). - **term_of_support** (string) - The term of support (e.g., 'lts'). - **operating_system** (string) - The operating system the package is for. - **architecture** (string) - The processor architecture. - **package_type** (string) - The type of package (e.g., 'jdk'). - **javafx_bundled** (boolean) - Indicates if JavaFX is bundled. - **directly_downloadable** (boolean) - Indicates if the package is directly downloadable. - **filename** (string) - The name of the downloaded file. - **links** (object) - Contains URIs for package information and download redirects. - **pkg_info_uri** (string) - URI for package information. - **pkg_download_redirect** (string) - URI for download redirect. - **free_use_in_production** (boolean) - Indicates if free use in production is allowed. - **tck_tested** (string) - Indicates if TCK tested. - **tck_cert_uri** (string) - URI for TCK certificate. - **aqavit_certified** (string) - Indicates if AQAvit certified. - **aqavit_cert_uri** (string) - URI for AQAvit certificate. - **size** (integer) - The size of the package in bytes. - **feature** (array) - List of features. - **message** (string) - A message indicating the number of packages found. #### Response Example ```json { "result": [ { "id": "2dd07b11553c798fa49274d937ba88e9", "archive_type": "dmg", "distribution": "zulu", "major_version": 11, "java_version": "11.0.15+10", "distribution_version": "11.56.19", "jdk_version": 11, "latest_build_available": true, "release_status": "ga", "term_of_support": "lts", "operating_system": "macos", "lib_c_type": "libc", "architecture": "x64", "fpu": "unknown", "package_type": "jdk", "javafx_bundled": true, "directly_downloadable": true, "filename": "zulu11.56.19-ca-fx-jdk11.0.15-macosx_x64.dmg", "links": { "pkg_info_uri": "https://api.foojay.io/disco/v3.0/ids/2dd07b11553c798fa49274d937ba88e9", "pkg_download_redirect": "https://api.foojay.io/disco/v3.0/ids/2dd07b11553c798fa49274d937ba88e9/redirect" }, "free_use_in_production": true, "tck_tested": "yes", "tck_cert_uri": "https://cdn.azul.com/zulu/pdf/cert.zulu11.56.19-ca-fx-jdk11.0.15-macosx_x64.dmg.pdf", "aqavit_certified": "unknown", "aqavit_cert_uri": "", "size": 278223218, "feature": [] } ], "message": "3 package(s) found" } ``` ``` -------------------------------- ### Get JDKs and JREs Source: https://context7.com/foojayio/discoapi/llms.txt Convenience endpoints for searching specifically for JDK or JRE packages. ```APIDOC ## GET /disco/v3.0/packages/jdks or /disco/v3.0/packages/jres ### Description Convenience endpoints for searching specifically for JDK or JRE packages. ### Method GET ### Endpoint /disco/v3.0/packages/jdks or /disco/v3.0/packages/jres ### Query Parameters - **version** (string) - Required - The Java version to search for (e.g., '21'). - **operating_system** (string) - Required - Operating system (e.g., 'linux'). - **architecture** (string) - Required - CPU architecture (e.g., 'x64'). ### Response #### Success Response (200) (Same response structure as 'Search Packages' endpoint, but filtered for JDKs or JREs respectively.) #### Response Example (for /jdks) ```json { "result": [ { "id": "...", "archive_type": "tar.gz", "distribution": "temurin", "major_version": 21, "java_version": "21.0.1+12", "distribution_version": "21.0.1", "jdk_version": 21, "latest_build_available": true, "release_status": "ga", "term_of_support": "lts", "operating_system": "linux", "lib_c_type": "glibc", "architecture": "x64", "package_type": "jdk", "javafx_bundled": false, "directly_downloadable": true, "filename": "OpenJDK21U-jdk_x64_linux_hotspot_21.0.1_12.tar.gz", "links": { "pkg_info_uri": "https://api.foojay.io/disco/v3.0/ids/...". "pkg_download_redirect": "https://api.foojay.io/disco/v3.0/ids/.../redirect" }, "free_use_in_production": true, "tck_tested": "yes", "aqavit_certified": "yes", "size": 210000000 } ], "message": "1 JDK package(s) found" } ``` ``` -------------------------------- ### Get JRE Packages Source: https://github.com/foojayio/discoapi/blob/main/README.md Retrieves a list of JRE packages specifically. This endpoint is a shortcut for filtering packages by type 'jre'. ```APIDOC ## GET /api.foojay.io/disco/v3.0/packages/jres ### Description Retrieves a list of JRE packages matching the specified criteria. ### Method GET ### Endpoint /api.foojay.io/disco/v3.0/packages/jres ### Query Parameters (Same query parameters as `/packages` endpoint, with `package_type` pre-filtered to 'jre') ### Response #### Success Response (200) - **packages** (array) - A list of JRE package objects matching the query parameters. ``` -------------------------------- ### Construct Package Search Queries with cURL Source: https://context7.com/foojayio/discoapi/llms.txt Build comprehensive queries for the `/packages` endpoint by combining various parameters such as version, distribution, architecture, and operating system. This allows for precise filtering of Java Development Kits (JDKs) and Java Runtime Environments (JREs). The example demonstrates a query for a production JDK. ```bash # Version parameters version=17 # Exact version (e.g., 17, 11.0.9.1, 17-ea.1) version=11.0.8..11.0.10 # Version range # Distribution distro=temurin # Options: aoj, aoj_openj9, corretto, dragonwell, # graalvm_ce8, graalvm_ce11, graalvm_ce16, # graalvm_ce17, graalvm, graalvm_community, # jetbrains, liberica, liberica_native, mandrel, # microsoft, ojdk_build, openlogic, oracle, # oracle_open_jdk, redhat, sap_machine, semeru, # semeru_certified, temurin, trava, zulu, zulu_prime # Architecture architecture=x64 # Options: aarch64, amd64, arm, arm64, ia64, mips, # ppc, ppc64el, ppc64le, ppc64, riscv64, s390, # s390x, sparc, sparcv9, x64, x86-64, x86 # Archive type archive_type=tar.gz # Options: apk, cab, deb, dmg, exe, msi, pkg, # rpm, tar, tar.gz, tar.Z, zip # Package type package_type=jdk # Options: jdk, jre # Operating system operating_system=linux # Options: aix, alpine_linux, linux, linux_musl, # macos, qnx, solaris, windows # C library type libc_type=glibc # Options: c_std_lib, glibc, libc, musl # Release status release_status=ga # Options: ea (early access), ga (general availability) # Term of support term_of_support=lts # Options: sts, mts, lts # Bitness bitness=64 # Options: 32, 64 # Boolean filters javafx_bundled=true # true, false directly_downloadable=true # true, false # Latest filter latest=available # Options: all_of_version, per_distro, overall, available # Example: Complete query for production JDK curl "https://api.foojay.io/disco/v3.0/packages?\ version=21&\ distro=temurin&\ package_type=jdk&\ operating_system=linux&\ architecture=x64&\ archive_type=tar.gz&\ release_status=ga&\ term_of_support=lts&\ directly_downloadable=true&\ latest=available" ``` -------------------------------- ### Get JDK Packages Source: https://github.com/foojayio/discoapi/blob/main/README.md Retrieves a list of JDK packages specifically. This endpoint is a shortcut for filtering packages by type 'jdk'. ```APIDOC ## GET /api.foojay.io/disco/v3.0/packages/jdks ### Description Retrieves a list of JDK packages matching the specified criteria. ### Method GET ### Endpoint /api.foojay.io/disco/v3.0/packages/jdks ### Query Parameters (Same query parameters as `/packages` endpoint, with `package_type` pre-filtered to 'jdk') ### Response #### Success Response (200) - **packages** (array) - A list of JDK package objects matching the query parameters. ``` -------------------------------- ### Get Packages Source: https://github.com/foojayio/discoapi/blob/main/README.md Retrieves a list of OpenJDK packages based on various filters. You can specify parameters like distribution, major version, operating system, architecture, and more to narrow down the search. ```APIDOC ## GET /api.foojay.io/disco/v3.0/packages ### Description Retrieves a list of OpenJDK packages matching the specified criteria. ### Method GET ### Endpoint /api.foojay.io/disco/v3.0/packages ### Query Parameters - **distribution** (string) - Optional - Filter by distribution name. - **major_version** (integer) - Optional - Filter by major Java version. - **operating_system** (string) - Optional - Filter by operating system. - **architecture** (string) - Optional - Filter by architecture. - **package_type** (string) - Optional - Filter by package type (jdk or jre). - **javafx_bundled** (boolean) - Optional - Filter by javafx bundled status. - **archive_type** (string) - Optional - Filter by archive type. - **release_status** (string) - Optional - Filter by release status (GA or EA). - **term_of_support** (string) - Optional - Filter by term of support (LTS, MTS, STS). - **lib_c_type** (string) - Optional - Filter by C library type. - **directly_downloadable** (boolean) - Optional - Filter by direct download availability. ### Response #### Success Response (200) - **packages** (array) - A list of package objects matching the query parameters. ``` -------------------------------- ### GET /ids/{id} Source: https://github.com/foojayio/discoapi/blob/main/README.md Retrieves package information, including the direct download URI, using a package ID. This endpoint is useful for obtaining the specific download link after identifying a package. ```APIDOC ## GET /ids/{id} ### Description Retrieves package information, including the direct download URI, using a package ID. This endpoint is useful for obtaining the specific download link after identifying a package. ### Method GET ### Endpoint `/ids/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the package. ### Request Example ```json { "example": "GET https://api.foojay.io/disco/v3.0/ids/2dd07b11553c798fa49274d937ba88e9" } ``` ### Response #### Success Response (200) - **result** (array) - An array of package objects, each containing download and signature information. - **filename** (string) - The name of the package file. - **direct_download_uri** (string) - The direct URL to download the package. - **download_site_uri** (string) - The URI of the download site. - **signature_uri** (string) - The URI of the package signature. - **checksum_uri** (string) - The URI of the checksum. - **checksum** (string) - The checksum of the package. - **checksum_type** (string) - The type of checksum (e.g., sha256). - **message** (string) - An informational message about the request. #### Response Example ```json { "result": [ { "filename": "zulu11.56.19-ca-fx-jdk11.0.15-macosx_x64.dmg", "direct_download_uri": "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-fx-jdk11.0.15-macosx_x64.dmg", "download_site_uri": "", "signature_uri": "", "checksum_uri": "", "checksum": "b6a13e91a10011d05b3daa53339bef97b8a949aea00bf671af0feecd979a24b9", "checksum_type": "sha256" } ], "message": "" } ``` ``` -------------------------------- ### Get Package IDs Source: https://github.com/foojayio/discoapi/blob/main/README.md Retrieves a list of unique package identifiers. This can be useful for referencing specific builds or for further querying. ```APIDOC ## GET /api.foojay.io/disco/v3.0/ids ### Description Retrieves a list of unique identifiers for all available packages. ### Method GET ### Endpoint /api.foojay.io/disco/v3.0/ids ### Response #### Success Response (200) - **ids** (array) - A list of unique package ID strings. ``` -------------------------------- ### Get All Major Versions Source: https://context7.com/foojayio/discoapi/llms.txt Returns all available Java major versions, optionally filtered by release status or maintenance status. ```APIDOC ## GET /disco/v3.0/major_versions ### Description Returns all available Java major versions, optionally filtered by release status or maintenance status. ### Method GET ### Endpoint /disco/v3.0/major_versions ### Query Parameters - **ea** (boolean) - Optional - Filter by early access status. - **ga** (boolean) - Optional - Filter by general availability status. - **maintained** (boolean) - Optional - Filter by currently maintained versions. ### Response #### Success Response (200) - **result** (array) - An array of major version objects. - **major_version** (integer) - The major version number. - **term_of_support** (string) - The term of support (e.g., 'lts'). - **maintained** (boolean) - Indicates if the version is currently maintained. - **message** (string) - A message indicating the number of versions found. #### Response Example ```json { "result": [ {"major_version": 21, "term_of_support": "lts", "maintained": true}, {"major_version": 17, "term_of_support": "lts", "maintained": true}, {"major_version": 11, "term_of_support": "lts", "maintained": true}, {"major_version": 8, "term_of_support": "lts", "maintained": true} ], "message": "4 major version(s) found" } ``` ``` -------------------------------- ### Get Distributions - Bash Source: https://context7.com/foojayio/discoapi/llms.txt Fetches information about all supported JDK distributions from the foojay Disco API. Allows retrieving all distributions or details for a specific one by its API parameter. Uses simple curl commands. ```bash # Get all distributions curl "https://api.foojay.io/disco/v3.0/distributions" # Get a specific distribution (Zulu) curl "https://api.foojay.io/disco/v3.0/distributions/zulu" # Response example: { "result": [ { "name": "Zulu", "api_parameter": "zulu", "maintained": true, "available": true, "build_of_openjdk": true, "build_of_graalvm": false, "official_uri": "https://www.azul.com/downloads/", "versions": ["21.0.1", "21", "17.0.9", "17.0.8", "11.0.21", ...] } ], "message": "1 distribution(s) found" } ``` -------------------------------- ### Get Package Download Information by ID Source: https://context7.com/foojayio/discoapi/llms.txt Retrieve direct download URLs, checksums, and signature URIs for a specific package using its unique ID. ```APIDOC ## GET /ids/{packageId} ### Description Retrieves direct download URLs and checksums for a specific package by ID. ### Method GET ### Endpoint `/ids/{packageId}` ### Parameters #### Path Parameters - **packageId** (string) - Required - The unique identifier of the package. ### Request Example ```bash curl "https://api.foojay.io/disco/v3.0/ids/a2a505f4d8956eb730c1ef285b23c269" ``` ### Response #### Success Response (200) - **result** (array) - An array of package information objects. - **filename** (string) - The name of the package file. - **direct_download_uri** (string) - The direct URL to download the package. - **download_site_uri** (string) - The URI of the download site (if applicable). - **signature_uri** (string) - The URI for the package's signature file. - **checksum_uri** (string) - The URI for the package's checksum file. - **checksum** (string) - The checksum value of the package. - **checksum_type** (string) - The type of checksum (e.g., "sha256"). - **message** (string) - An optional message associated with the response. #### Response Example ```json { "result": [ { "filename": "OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz", "direct_download_uri": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz", "download_site_uri": "", "signature_uri": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz.sig", "checksum_uri": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz.sha256.txt", "checksum": "7b175dbe0d6e3c9c23b6ed96449b018c2c243b76309e064c897c5c8f1e2bd925", "checksum_type": "sha256" } ], "message": "" } ``` ``` -------------------------------- ### Get Major Versions Source: https://github.com/foojayio/discoapi/blob/main/README.md Retrieves a list of major Java versions supported by the API. You can filter by early access (ea) or general availability (ga) builds, or request only maintained versions. ```APIDOC ## GET /api.foojay.io/disco/v3.0/major_versions ### Description Retrieves all major versions supported by the API. ### Method GET ### Endpoint /api.foojay.io/disco/v3.0/major_versions ### Query Parameters - **ea** (boolean) - Optional - Include early access builds. - **ga** (boolean) - Optional - Include only general availability builds. - **maintained** (boolean) - Optional - Include only maintained versions. ### Response #### Success Response (200) - **versions** (array) - A list of major version strings. ``` -------------------------------- ### Get Package Download Information with cURL Source: https://context7.com/foojayio/discoapi/llms.txt Retrieve direct download URLs, checksums, and signature URIs for a specific package using its ID via cURL. The API returns a JSON object containing details about the package, including download links and checksums. The `-L` flag can be used for direct redirects to download files. ```bash # Get package info (includes direct download URI) curl "https://api.foojay.io/disco/v3.0/ids/a2a505f4d8956eb730c1ef285b23c269" # Response example: { "result": [ { "filename": "OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz", "direct_download_uri": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz", "download_site_uri": "", "signature_uri": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz.sig", "checksum_uri": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz.sha256.txt", "checksum": "7b175dbe0d6e3c9c23b6ed96449b018c2c243b76309e064c897c5c8f1e2bd925", "checksum_type": "sha256" } ], "message": "" } # Direct redirect to download (useful for automation scripts) curl -L "https://api.foojay.io/disco/v3.0/ids/a2a505f4d8956eb730c1ef285b23c269/redirect" -o jdk.tar.gz ``` -------------------------------- ### Get All Major Versions - Bash Source: https://context7.com/foojayio/discoapi/llms.txt Retrieves all available Java major versions from the foojay Disco API. Supports filtering by release status (early access, general availability) and maintenance status. Uses simple curl commands. ```bash # Get all major versions curl "https://api.foojay.io/disco/v3.0/major_versions" # Get only early access major versions curl "https://api.foojay.io/disco/v3.0/major_versions?ea=true" # Get only general availability versions curl "https://api.foojay.io/disco/v3.0/major_versions?ga=true" # Get only currently maintained versions (e.g., 8, 11, 17, 21) curl "https://api.foojay.io/disco/v3.0/major_versions?maintained=true" # Response example: { "result": [ {"major_version": 21, "term_of_support": "lts", "maintained": true}, {"major_version": 17, "term_of_support": "lts", "maintained": true}, {"major_version": 11, "term_of_support": "lts", "maintained": true}, {"major_version": 8, "term_of_support": "lts", "maintained": true} ], "message": "4 major version(s) found" } ``` -------------------------------- ### Build and Run Application with Gradle (Bash) Source: https://context7.com/foojayio/discoapi/llms.txt This snippet demonstrates essential Gradle commands for building, testing, and running the application. It includes commands for creating a shadow JAR (fat JAR) which bundles all dependencies. ```bash # Build the application ./gradlew build # Run tests ./gradlew test # Create shadow JAR (fat JAR with all dependencies) ./gradlew shadowJar # Run the application ./gradlew run ``` -------------------------------- ### Docker Deployment and Execution (Bash) Source: https://context7.com/foojayio/discoapi/llms.txt This snippet outlines the steps for building a Docker image for the DiscoAPI and running it as a container. It shows how to map ports and set environment variables for configuration. ```bash # Build Docker image docker build -t discoapi . # Run with environment variables docker run -d \ -p 8080:8080 \ -e MONGODB_URI="mongodb://localhost:27017" \ -e FOOJAY_API_BASE_URL="https://api.foojay.io/disco" \ -e FOOJAY_API_ENVIRONMENT="production" \ discoapi ``` -------------------------------- ### Redirect to Package Download Source: https://context7.com/foojayio/discoapi/llms.txt Provides a direct redirect to the package download URL, useful for automation scripts. ```APIDOC ## GET /ids/{packageId}/redirect ### Description Directly redirects the client to the download URL for the specified package ID. ### Method GET ### Endpoint `/ids/{packageId}/redirect` ### Parameters #### Path Parameters - **packageId** (string) - Required - The unique identifier of the package. ### Request Example ```bash curl -L "https://api.foojay.io/disco/v3.0/ids/a2a505f4d8956eb730c1ef285b23c269/redirect" -o jdk.tar.gz ``` ### Response #### Success Response (302 Found) - The response will be a redirect to the actual download URL of the package. #### Response Example (HTTP 302 Found with Location header pointing to the download URL) ``` -------------------------------- ### Search Packages Source: https://context7.com/foojayio/discoapi/llms.txt Search for JDK/JRE packages with comprehensive filtering options. ```APIDOC ## GET /disco/v3.0/packages ### Description Search for JDK/JRE packages with comprehensive filtering options. ### Method GET ### Endpoint /disco/v3.0/packages ### Query Parameters - **version** (string) - Required - The Java version to search for (e.g., '17', '21'). - **package_type** (string) - Optional - Type of package ('jdk' or 'jre'). - **operating_system** (string) - Optional - Operating system (e.g., 'linux', 'windows', 'macos'). - **architecture** (string) - Optional - CPU architecture (e.g., 'x64', 'aarch64'). - **archive_type** (string) - Optional - Type of archive (e.g., 'tar.gz', 'zip', 'msi'). Can be specified multiple times. - **latest** (string) - Optional - Filter for the latest available package ('available'). - **distro** (string) - Optional - Filter by distribution name (e.g., 'temurin'). - **javafx_bundled** (boolean) - Optional - Filter for packages with JavaFX bundled. ### Response #### Success Response (200) - **result** (array) - An array of package objects. - **id** (string) - Unique identifier for the package. - **archive_type** (string) - Type of archive. - **distribution** (string) - The distribution name. - **major_version** (integer) - The major version number. - **java_version** (string) - The full Java version string. - **distribution_version** (string) - The distribution's version string. - **jdk_version** (integer) - The JDK version number. - **latest_build_available** (boolean) - Indicates if the latest build is available. - **release_status** (string) - Release status (e.g., 'ga'). - **term_of_support** (string) - Term of support (e.g., 'lts'). - **operating_system** (string) - Operating system. - **lib_c_type** (string) - Type of C library (e.g., 'glibc'). - **architecture** (string) - CPU architecture. - **package_type** (string) - Type of package ('jdk' or 'jre'). - **javafx_bundled** (boolean) - Indicates if JavaFX is bundled. - **directly_downloadable** (boolean) - Indicates if the package can be downloaded directly. - **filename** (string) - The filename of the package. - **links** (object) - Links related to the package. - **pkg_info_uri** (string) - URI for package information. - **pkg_download_redirect** (string) - URI for package download redirect. - **free_use_in_production** (boolean) - Indicates if free to use in production. - **tck_tested** (string) - Indicates TCK testing status. - **aqavit_certified** (string) - Indicates AQAvit certification status. - **size** (integer) - The size of the package in bytes. - **message** (string) - A message indicating the number of packages found. #### Response Example ```json { "result": [ { "id": "a2a505f4d8956eb730c1ef285b23c269", "archive_type": "tar.gz", "distribution": "temurin", "major_version": 17, "java_version": "17.0.9+9", "distribution_version": "17.0.9", "jdk_version": 17, "latest_build_available": true, "release_status": "ga", "term_of_support": "lts", "operating_system": "linux", "lib_c_type": "glibc", "architecture": "x64", "package_type": "jdk", "javafx_bundled": false, "directly_downloadable": true, "filename": "OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz", "links": { "pkg_info_uri": "https://api.foojay.io/disco/v3.0/ids/a2a505f4d8956eb730c1ef285b23c269", "pkg_download_redirect": "https://api.foojay.io/disco/v3.0/ids/a2a505f4d8956eb730c1ef285b23c269/redirect" }, "free_use_in_production": true, "tck_tested": "yes", "aqavit_certified": "yes", "size": 195432567 } ], "message": "1 package(s) found" } ``` ``` -------------------------------- ### Retrieve Direct Download URI using Package ID - JSON Response Source: https://github.com/foojayio/discoapi/blob/main/README.md This JSON response shows the structure returned when querying the DiscoAPI's ids endpoint with a package ID. It includes details like filename, direct download URI, and checksum information. ```json { "result":[ { "filename":"zulu11.56.19-ca-fx-jdk11.0.15-macosx_x64.dmg", "direct_download_uri":"https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-fx-jdk11.0.15-macosx_x64.dmg", "download_site_uri":"", "signature_uri":"", "checksum_uri":"", "checksum":"b6a13e91a10011d05b3daa53339bef97b8a949aea00bf671af0feecd979a24b9", "checksum_type":"sha256" } ], "message":"" } ``` -------------------------------- ### Search Packages Source: https://context7.com/foojayio/discoapi/llms.txt Search for Java packages based on various criteria such as version, distribution, architecture, OS, and more. ```APIDOC ## GET /packages ### Description Searches for Java packages based on a comprehensive set of query parameters. ### Method GET ### Endpoint `/packages` ### Parameters #### Query Parameters - **version** (string) - Optional - Exact version (e.g., "17", "11.0.9.1") or version range (e.g., "11.0.8..11.0.10"). - **distro** (string) - Optional - Distribution name (e.g., "temurin", "corretto"). See "Supported Distributions" for a full list. - **architecture** (string) - Optional - CPU architecture (e.g., "x64", "aarch64"). - **archive_type** (string) - Optional - Type of archive (e.g., "tar.gz", "zip"). - **package_type** (string) - Optional - Type of package (e.g., "jdk", "jre"). - **operating_system** (string) - Optional - Operating system (e.g., "linux", "windows"). - **libc_type** (string) - Optional - C library type (e.g., "glibc", "musl"). - **release_status** (string) - Optional - Release status (e.g., "ga", "ea"). - **term_of_support** (string) - Optional - Term of support (e.g., "lts", "sts"). - **bitness** (string) - Optional - Bitness of the package (e.g., "64", "32"). - **javafx_bundled** (boolean) - Optional - Whether JavaFX is bundled (true/false). - **directly_downloadable** (boolean) - Optional - Whether the package is directly downloadable (true/false). - **latest** (string) - Optional - Filter for the latest available package (e.g., "available", "per_distro"). ### Request Example ```bash curl "https://api.foojay.io/disco/v3.0/packages?version=21&distro=temurin&package_type=jdk&operating_system=linux&architecture=x64&archive_type=tar.gz&release_status=ga&term_of_support=lts&directly_downloadable=true&latest=available" ``` ### Response #### Success Response (200) - The response will contain a JSON object with a list of matching packages, similar in structure to the response for the `/ids/{packageId}` endpoint, but potentially with more entries. #### Response Example (A JSON array of package objects matching the query criteria) ```