Image id after create image action REST API

asked 2015-04-27 05:58:43 -0500

suraj gravatar image

I am using REST API to create an image using the create image server action. It is successfully creating the image but not returning any response. After the image creation how can i get the image id for further reference? Should i get all the images and search using the image name which i have?

edit retag flag offensive close merge delete


I am using a request like below: curl -si -k --connect-timeout 2 -m 1200 -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token:{token}" -d '{"createImage":{"name":"image_name"}}' "http://{host}:{port}/v2/{project}/servers/{serverid}/action". It wont return img_id

suraj gravatar imagesuraj ( 2015-05-29 03:39:19 -0500 )edit

I could find another way to poll and find the details using the image name. I can pass image name as below. So it helped me to resolve the issue. http://{host:port}/v2/images?name=image_name"

suraj gravatar imagesuraj ( 2015-05-29 03:40:52 -0500 )edit