本文介绍了如何使用REST API启动Azure VM(已取消分配)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里发现了一个非常奇怪的问题:在Azure Powershell中,我们可以使用Start-AzureVM-服务名称"mypc"-名称"mypc"对于两个VM state = stop或stop(Deallocated).但是对于Azure Mangement API我们只能将启动角色用于VM state = stop >

VM state = stop(已取消分配)无法使用该API.如何使用REST API以State = Stop(deallocated)启动VM?谢谢.

解决方案

Windows Azure PowerShell cmdlet使用服务管理REST API-但它使用未记录 2013-06-01版本.可能只有在Service Management REST API的未记录版本中才可以执行此操作.

通过使用 Fiddler 代理,您可以查看cmdlet的实际作用. request-这使您可以访问调用的操作(URL)以及发送和接收的有效负载.另外,您可以查看PowerShell cmdlet ,该源可在GitHub上获得.

I found a very strange problem here:In Azure powershell, we can useStart-AzureVM -ServiceName "mypc" -Name "mypc"for both VM state= stop or stop(Deallocated).But for Azure Mangement APIWe can use start role only for VM state= stop

VM state=stop(deallocated) can't use that API..How can I use REST API to start VM with State=Stop(deallocated)?Thanks.

解决方案

The Windows Azure PowerShell cmdlets use the Service Management REST API - but it uses an undocumented 2013-06-01 version. It is possible that this operation is available only in the undocumented version of the Service Management REST API.

You can see what the cmdlets actually do by using Fiddler to proxy the request - this gives you access to the operation invoked (URL) as well as the payload sent and received. Alternatively, you can look at the PowerShell cmdlets source which is available on GitHub.

这篇关于如何使用REST API启动Azure VM(已取消分配)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 00:07