我目前正在尝试以编程方式获取我在Windows Azure订阅下运行的所有虚拟机的列表.为此,我尝试使用Azure REST API(https://management.core.windows.net),而不是使用power-shell cmdlet.
使用cmdlet,我可以运行"Get-AzureVM"并获取所有具有ServiceName,Name和Status的VM的列表,而无需任何修改.问题是我在文档中找不到如何通过API列出VM.
我查看了各种Azure REST API,但一直无法找到任何内容.VM REST API的文档未显示或提供列表功能.
我错过了某个地方的基本面吗?
// Create the request.
// https://management.core.windows.net/<subscription-id>/services/hostedservices
requestUri = new Uri("https://management.core.windows.net/"
+ subscriptionId
+ "/services/"
+ operation);
Run Code Online (Sandbox Code Playgroud)
这就是我用于请求的基础.我可以获得托管服务的列表,但不能获得虚拟机.