Java az aks get-versions -l eastus 的等效代码
Java equivalent code for az aks get-versions -l eastus
我需要使用 Java API.Is 在 azure java sdk 中公开的这个 API 以编程方式列出区域中可用的 aks 版本?如果是在哪里?
我尝试使用 azureClient.containerServices().manager().kubernetesClusters().listKubernetesVersions(Region.US_EAST) 但这并没有给我正确的结果。这是我得到的结果是:
- 1.10.12
- 1.10.13
- 1.11.8
- 1.11.9
- 1.12.6
- 1.12.7
- 1.13.4
- 1.13.5
- 1.14.0
- 1.6.9
- 1.9.10
- 1.9.11
我尝试了以下 cli 命令 az aks get-versions -l eastus。这给了我正确的结果。
Kubernetes 版本升级
------------------ ----------------------
1.12.7 None 可用
1.12.6 1.12.7
1.11.9 1.12.6、1.12.7
1.11.8 1.11.9、1.12.6、1.12.7
1.10.13 1.11.8、1.11.9
1.10.12 1.10.13、1.11.8、1.11.9
1.9.11 1.10.12、1.10.13
1.9.10 1.9.11、1.10.12、1.10.13
如果您 运行 带有参数 --debug
的 Azure CLI 命令,如下所示:
az aks get-versions -l eastus -o table --debug
然后你会得到它是如何实现的细节:
那么你可以知道它调用了Azure RESTAPIContainer Service Client - List Orchestrators to get the information. And you can see how to get the same information through Java. Then you can find the listOrchestrators(String location, String resourceType)
。它与您执行的 Azure CLI 命令的作用相同。
你可以看到 how does the function call the Azure REST API in Java in Github。
我需要使用 Java API.Is 在 azure java sdk 中公开的这个 API 以编程方式列出区域中可用的 aks 版本?如果是在哪里?
我尝试使用 azureClient.containerServices().manager().kubernetesClusters().listKubernetesVersions(Region.US_EAST) 但这并没有给我正确的结果。这是我得到的结果是:
- 1.10.12
- 1.10.13
- 1.11.8
- 1.11.9
- 1.12.6
- 1.12.7
- 1.13.4
- 1.13.5
- 1.14.0
- 1.6.9
- 1.9.10
- 1.9.11
我尝试了以下 cli 命令 az aks get-versions -l eastus。这给了我正确的结果。
Kubernetes 版本升级
------------------ ----------------------
1.12.7 None 可用
1.12.6 1.12.7
1.11.9 1.12.6、1.12.7
1.11.8 1.11.9、1.12.6、1.12.7
1.10.13 1.11.8、1.11.9
1.10.12 1.10.13、1.11.8、1.11.9
1.9.11 1.10.12、1.10.13
1.9.10 1.9.11、1.10.12、1.10.13
如果您 运行 带有参数 --debug
的 Azure CLI 命令,如下所示:
az aks get-versions -l eastus -o table --debug
然后你会得到它是如何实现的细节:
那么你可以知道它调用了Azure RESTAPIContainer Service Client - List Orchestrators to get the information. And you can see how to get the same information through Java. Then you can find the listOrchestrators(String location, String resourceType)
。它与您执行的 Azure CLI 命令的作用相同。
你可以看到 how does the function call the Azure REST API in Java in Github。