• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

AdoptOpenJDK/openjdk-api: DEPRECATED and replaced by of https://github.com/Adopt ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

AdoptOpenJDK/openjdk-api

开源软件地址:

https://github.com/AdoptOpenJDK/openjdk-api

开源编程语言:

JavaScript 94.4%

开源软件介绍:

AdoptOpenJDK API

  • NOTICE: AdoptOpenJDK API v1 Has now been removed.
  • NOTICE: AdoptOpenJDK API v2 Has now been deprecated.
  • NOTICE: If you are using v1 or v2 please move to the latest version as soon as possible. Please raise any migration problems as an issue in the v3 issue tracker.
  • NOTICE: The documentation below is kept for historical purposes.

Overview

The AdoptOpenJDK API provides a way to consume JSON information about the AdoptOpenJDK releases and nightly builds. Sign up to the mailing list where major API updates will be announced, and visit adoptopenjdk.net to find out more about the community.

Deployment

The v2 API is currently deployed on AdoptOpenJDK's Red Hat OpenShift instance. You will need username adoptopenjdk-admin or [email protected] and the password.

OpenShift contains multiple applications. The v2 API is called openjdk-api.

Usage

Here is an example using curl (see the curl documentation):

curl -L 'https://api.adoptopenjdk.net/v2/info/releases/openjdk8'

This command returns information about all 'OpenJDK' releases, and defaults to the latest version of the API.

The following Windows Powershell script uses Invoke-Webrequest to download the latest Windows 64-bit archive.

function Get-RedirectedUrl
{
    Param (
        [Parameter(Mandatory=$true)]
        [String]$URL
    )

    $request = [System.Net.WebRequest]::Create($url)
    $request.AllowAutoRedirect=$false
    $response=$request.GetResponse()

    If ($response.StatusCode -eq "Found")
    {
        $response.GetResponseHeader("Location")
    }
}

$url= "https://api.adoptopenjdk.net/v2/binary/nightly/openjdk8?openjdk_impl=hotspot&os=windows&arch=x64&release=latest&type=jdk"

$fUrl = Get-RedirectedUrl $url
$filename = [System.IO.Path]::GetFileName($fUrl);

Write-Host "Downloading $filename"

[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
Invoke-WebRequest -Uri $url -OutFile $filename

Note on the API rate limit: Add the -i option (e.g. curl -i https://api.adoptopenjdk.net/v2/openjdk8/releases) to return the response header as well as the response body. There is a limit of 100 API calls per hour per IP, and the value of X-RateLimit-Remaining in the response header is useful to determine how many API calls are remaining from this limit.

API v2.0.0 Specification

You can append different paths to the https://api.adoptopenjdk.net/v2/ URL, either in the above curl format, in a browser, or through an HTTP client, to return different JSON information:

/v2/<request type>/<release type>/<version>

For instance /info/nightly/openjdk10:

curl -L 'https://api.adoptopenjdk.net/v2/info/nightly/openjdk10'

Path Parameters

Request Type

info

List of information about builds that match the current query

curl -L 'https://api.adoptopenjdk.net/v2/info/nightly/openjdk8?openjdk_impl=hotspot'
binary

Redirects to the binary that matches your current query. If multiple or no binaries match the query, an error code will be returned

curl -L 'https://api.adoptopenjdk.net/v2/binary/nightly/openjdk8?openjdk_impl=hotspot&os=windows&arch=x64&release=latest&type=jdk'
latestAssets

Returns the latest binary asset for every matching combination of os, arch, type, openjdk_impl, and heap_size query parameters.

i.e to find the latest jdk/jre for linux, x64, normal heap, hotspot:

curl -L 'https://api.adoptopenjdk.net/v2/latestAssets/nightly/openjdk8?os=linux&arch=x64&heap_size=normal&openjdk_impl=hotspot'
[
  {
    "os": "linux",
    "architecture": "x64",
    "binary_type": "jre",
    "openjdk_impl": "hotspot",
    "binary_name": "OpenJDK8U-jre_x64_linux_hotspot_2018-10-12-04-26.tar.gz",
    "binary_link": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2018-10-12-04-26/OpenJDK8U-jre_x64_linux_hotspot_2018-10-12-04-26.tar.gz",
    "binary_size": 40564422,
    "checksum_link": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2018-10-12-04-26/OpenJDK8U-jre_x64_linux_hotspot_2018-10-12-04-26.tar.gz.sha256.txt",
    "version": "8",
    "heap_size": "normal",
    "timestamp": "2018-10-12T04:26:10Z"
  },
  {
    "os": "linux",
    "architecture": "x64",
    "binary_type": "jdk",
    "openjdk_impl": "hotspot",
    "binary_name": "OpenJDK8U-jdk_x64_linux_hotspot_2018-10-12-04-26.tar.gz",
    "binary_link": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2018-10-12-04-26/OpenJDK8U-jdk_x64_linux_hotspot_2018-10-12-04-26.tar.gz",
    "binary_size": 78327417,
    "checksum_link": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2018-10-12-04-26/OpenJDK8U-jdk_x64_linux_hotspot_2018-10-12-04-26.tar.gz.sha256.txt",
    "version": "8",
    "heap_size": "normal",
    "timestamp": "2018-10-12T04:26:10Z"
  }
]

Release Type

Type of release, i.e releases for stable builds or nightly for most recent build.

Version

OpenJDK version, i.e openjdk8, openjdk9, openjdk10, openjdk11, openjdk12, openjdk13, openjdk14, openjdk15

Query Parameters

The data that can be returned can then be filtered to find builds of a specific type

Parameter Query Parameter Name Examples
JVM Implementation openjdk_impl hotspot, openj9
Operating System os windows, linux, mac, solaris, aix
Architecture arch x64, x32, ppc64, s390x, ppc64le, aarch64, arm
Binary Type type jdk, jre
Heap Size heap_size normal, large
Release release latest, jdk8u172-b00-201807161800

In the absence of a given parameter, it will return all elements.

To return latest, hotspot, windows, x64, jdk:

curl -L 'https://api.adoptopenjdk.net/v2/binary/nightly/openjdk8?openjdk_impl=hotspot&os=windows&arch=x64&release=latest&type=jdk'

Multiple values can be supplied for a given parameter like so:

curl 'https://api.adoptopenjdk.net/v2/info/releases/openjdk8?os=windows&os=linux&arch=x32&arch=x64'

This will return all Windows and Linux releases of OpenJDK8 for 32-bit and 64-bit x86 architectures. Multi-value release queries are not currently supported due to some idiosyncrasies with how it affects response formats. Queries such as ?release=latest&release=jdk8u172-b00-201807161800 will return an appropriate error response.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
AdoptOpenJDK/openjdk-api-v3: AdoptOpenJDK API V3 发布时间:2022-06-13
下一篇:
jellyfish/apps/whale-api at main · JellyfishSDK/jellyfish · GitHub发布时间:2022-06-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap