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 (http://docs.openstack.org/api/openstack-image-service/2.0/content/get-image-file.html) .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

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

Question information

Language:
English Edit question
Status:
Answered
For:
Glance Edit question
Assignee:
No assignee Edit question
Last query:
2013-12-10
Last reply:
2013-12-12
Yanis Guenane (yanis-guenane) said : #1

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

Your request is done on API v1

http://localhost:9292/v1/images/a525bf24-fd61-43d3-ab2f-7847ba81f845/file

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' http://127.0.0.1:9292/v1/images/{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

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

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.