Power actions on ec2 hosts

Hello foreman users!

I have not been able to get power actions to work through the v2 API on
foreman 1.7.1. I am following the API spec here:

curl -X PUT --user user:pass -H "Content-Type: application/json" -d '{"power_action":"status","host":{}}'


"error": {"message":"undefined method `search_for' for


Full stack trace: http://pastebin.com/dtwx6x2e

The same operation works OK in the UI. I did not find any other threads on

Any help would be appreciated.