Power on VM through Rest API fails with 'No content to map to Object due to end of input', 500

Badge +3
Hi all,

When powering on VMs through the Rest API, this always seems to fail with an internal server error 500.

{ "message": "No content to map to Object due to end of input"}The rest call is the following:

https://IPADDRESS:9440/api/nutanix/v0.8/vms/357af50f-32c5-42b9-a4a0-c38456f21365/power_op/offIs this because I make a wrong rest call? The VM is certainly available in Acropolis. A power on through the GUI works as a charm.

Any help is greatly appreciated!

Best regards,
Pieter-Jan Saveyn

Best answer by Jon 28 July 2016, 18:55

View original

This topic has been closed for comments

3 replies

Userlevel 6
Badge +29
In my opinion, The best way to trace these API calls back is to use the "developer console" in your browser.

For example, in Chrome (which I use on Moc OS), you go Chrome > View > Developer > Developer Tools, and take a look at the "network" tab.

That will actually trace all of the REST calls from the GUI to the backend, and you can sleuth out the exact calls that the GUI uses, and model your calls based on that.
Badge +3
Hello Jon,

Thanks for the reply.

I followed your advice and was able to solve the problem. It seems that the 'set_power_sate' rest call was the one I needed to use instead of the 'power_op/on'.

Thanks for the help!
Pieter-Jan Saveyn
Userlevel 1
Badge +10
Hello Pieter-Jan Saveyn,

Actually power_op/{on|off} works, just add {"logicalTimestamp": N} json object to the body.
I dont know, why it looks for the logicalTimestamp, though in the API explorer it says, it is an optional parameter.