I'm attempting to reboot/restart an Azure virtual machine through the REST interface.
I created a virtual machine through the Azure portal and it appears as running under the Virtual Machines tab on the left.
The url I am using for this operation is as follows:
https://management.core.windows.net/{my-subscription-guid}/services/hostedservices/cloudvm-test/deployments/cloudvm-test/roles/cloudvm-test/Operations
You can see "cloudvm-test" repeated as the hosted service name, the deployment name and the role name because that's how it appears in the xml you get back from calling Get Hosted Service Properties. Even though a Virtual Machine is not a classic hosted service, it appears in this xml and so I just use the values I find there. One of the concerns I have is whether I'm building the URL correctly.
Anyway, using the above URL, I build my request as expected, and POST a body of:
<RestartRoleOperation xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<OperationType>RestartRoleOperation</OperationType></RestartRoleOperation>
The error I receive is a 404, stating that "The resource service name hostedservices is not supported".
Not that it really matters, but I'm writing in Objective C. If you have an example in C# I can deal with it fine.