在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:AdoptOpenJDK/openjdk-api开源软件地址:https://github.com/AdoptOpenJDK/openjdk-api开源编程语言:JavaScript 94.4%开源软件介绍:AdoptOpenJDK API
OverviewThe 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. DeploymentThe v2 API is currently deployed on AdoptOpenJDK's Red Hat OpenShift instance. You will need username OpenShift contains multiple applications. The v2 API is called UsageHere is an example using 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 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
API v2.0.0 SpecificationYou can append different paths to the /v2/<request type>/<release type>/<version> For instance /info/nightly/openjdk10: curl -L 'https://api.adoptopenjdk.net/v2/info/nightly/openjdk10' Path ParametersRequest TypeinfoList of information about builds that match the current query curl -L 'https://api.adoptopenjdk.net/v2/info/nightly/openjdk8?openjdk_impl=hotspot' binaryRedirects 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' latestAssetsReturns the latest binary asset for every matching combination of 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 TypeType of release, i.e VersionOpenJDK version, i.e Query ParametersThe data that can be returned can then be filtered to find builds of a specific type
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 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论