0

Whenever i m trying to create image from the given api using curl -:

curl -i -X POST https://lon.servers.api.rackspacecloud.com/v1.1/xxxxxxxxx/servers/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx/createImage -H "X-Auth-Token: xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx" -d '{"createImage" : {"name" : "test_image"}}' -H "Content-type: application/json"

It throws me error -:

{"itemNotFound":{"message":"An unexpected fault occurred.","details":"javax.ws.rs.WebApplicationException","code":404}}* Closing connection #0

I need help in this,how to create a server image using curl. But all other rackspace server api's are working fine for me.

I trie same api with version 1.0, 1.1 and 2.0 but ni success.

Thanks

Vivek Parihar
  • 2,318
  • 18
  • 18

2 Answers2

0

This question was answered over at ServerFault (https://serverfault.com/questions/495087/rackspace-createimage-api-using-curl-is-not-working).

In summary, you will need to change the URL that you are POSTing to to have /action after the UUID, as opposed to /createImage. An example cURL command can be structured as follows:

curl -X POST -H "X-Auth-Token: AUTH-TOKEN" -H "Content-type: application/json" -d '{"createImage" : {"name" : "test"}}' https://lon.servers.api.rackspacecloud.com/v2/ACCOUNT-ID/servers/SERVER-UUID/action
Community
  • 1
  • 1
slade
  • 123
  • 5
0

Thanks to Dave Kuldt. Correct api call is -:

curl -X POST -H "X-Auth-Token: AUTH-TOKEN" -H "Content-type: application/json" -d '{"createImage" : {"name" : "test"}}' https://lon.servers.api.rackspacecloud.com/v2/ACCOUNT-ID/servers/SERVER-UUID/action

Vivek Parihar
  • 2,318
  • 18
  • 18