Getting wrong http response in glance?

Asked by anusha rayani on 2013-12-10

On issuing the command "curl -i -X GET -H "Content-Type: application/json" -H "X-Auth-Token: $AUTH_TOKEN" http://localhost:9292/v1/images/a525bf24-fd61-43d3-ab2f-7847ba81f845/file" . Here as expected I should get a 204 response ( .Instead I am getting http 404 error as follows ::

HTTP/1.1 404 Not Found
Content-Length: 154
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-72563706-3247-49cf-8c4b-03ca46b30333
Date: Tue, 10 Dec 2013 14:43:36 GMT

  <title>404 Not Found</title>
  <h1>404 Not Found</h1>
  The resource could not be found.<br /><br />

Question information

English Edit question
Glance Edit question
No assignee Edit question
Last query:
Last reply:
Yanis Guenane (yanis-guenane) said : #1

Hi Anusha, you are using two differnts version of the API

Your request is done on API v1


When the documentation you are refering to is made on v2 of the API.

In v1 the /images/{image}/file endpoint does not exist thus the 404.

Hope it helps,

Yanis Guenane

Yanis Guenane (yanis-guenane) said : #2

To do what you are actually trying to accomplish, download the image. Simply run a GET against /images/{id}

curl -i -X GET -H 'X-Auth-Token: YOURTOKEN' -H 'Content-Type: application/octet-stream' -H 'User-Agent: python-glanceclient'{imageid}

If I have used same version of api also ,404 error got reflected.
curl -i -X GET -H "Content-Type: application/json" -H "X-Auth-Token: $AUTH_TOKEN" http://localhost:9292/v2/images/ffb8790f-3229-4ff9-b4f3-ff345c13a32d/file.
HTTP/1.1 404 Not Found
Content-Length: 176
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-acd3223d-8c51-4ff5-bf0a-4b94f5944e82
Date: Thu, 12 Dec 2013 11:46:36 GMT

  <title>404 Not Found</title>
  <h1>404 Not Found</h1>
  An object with the specified identifier was not found.<br /><br />

Yanis Guenane (yanis-guenane) said : #4

The error message says it all

An object with the specified identifier was not found

Make sure the id you are inputing matchs the id of the image and not owner id by mistake.

The call to /image/{image_id}/file in v2 does work.

Can you help with this problem?

Provide an answer of your own, or ask anusha rayani for more information if necessary.

To post a message you must log in.