Image list api is wrong

Bug #1290857 reported by Telles Mota Vidal Nóbrega
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openstack-api-site
Fix Released
High
Raildo Mascena de Sousa Filho

Bug Description

The Compute API explains that to list images you need to call v2/images but this information is wrong because the right url is v2/{project_id}/images

The problem can be found here:
http://api.openstack.org/api-ref-compute.html#compute_images

The error is on all the calls for images in the compute api

    GET v2/images Lists IDs, names, and links for available images.
    GET v2/images/detail Lists all details for available images.
    GET v2/images/​{image_id}​ Gets details for a specified image.
    DELETE v2/images/​{image_id}​ Deletes a specified image.

The url should be:
    GET v2/{project_id}/images Lists IDs, names, and links for ...
    GET v2/{project_id}/images/detail Lists all details for available images.
    GET v2/{project_id}/images/​{image_id}​ Gets details for a specified image.
    DELETE v2/{project_id}/images/​{image_id}​ Deletes a specified image.

Tags: compute-api v2
Changed in nova:
assignee: nobody → Telles Mota Vidal Nóbrega (tellesmvn)
Changed in nova:
status: New → Confirmed
affects: nova → openstack-api-site
description: updated
description: updated
Revision history for this message
Anne Gentle (annegentle) wrote :

To fix, update the WADL file in api-site/api-ref/src/wadls/compute-api/src/v2/wadl/os-compute-2-wadl so that both /images and /flavors are wrapped in the {tenant_id} resource.

 So line 29 of that wadl has the start point of the <resource id="tenant_id" and line 132 has the </resource> end wrapper, but it seems that should wrap to line 184.

Rebuild with mvn clean generate-sources to see if it does what it should.

Revision history for this message
Anne Gentle (annegentle) wrote :

This seems to be cropping up again and again... I fixed it with https://review.openstack.org/#/c/21522/2/api-ref/src/wadls/compute-api/src/os-compute-2.wadl -- take a look at that to see how to fix it again.

Changed in openstack-api-site:
importance: Undecided → High
Revision history for this message
Telles Mota Vidal Nóbrega (tellesmvn) wrote :

Thanks,

Anne Gentle (annegentle)
tags: added: compute-api
tags: added: v2
Changed in openstack-api-site:
assignee: Telles Mota Vidal Nóbrega (tellesmvn) → Raildo Mascena de Sousa Filho (raildo)
Revision history for this message
Anne Gentle (annegentle) wrote :

To fix, move the </resource> end tag to encompass both images and flavors.

Revision history for this message
Raildo Mascena de Sousa Filho (raildo) wrote :

I just got to change that, and also checked the images metadata must have tenant_id. I will submit a patch. Thank you.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to api-site (master)

Fix proposed to branch: master
Review: https://review.openstack.org/99985

Changed in openstack-api-site:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to api-site (master)

Reviewed: https://review.openstack.org/99985
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=cc449ce86fe0348c2458074a0f4bae2eef6d36c4
Submitter: Jenkins
Branch: master

commit cc449ce86fe0348c2458074a0f4bae2eef6d36c4
Author: Raildo Mascena <email address hidden>
Date: Fri Jun 13 15:33:52 2014 -0300

    Fix bug Image, Flavors and Image metadata api is wrong

    This patch inclute {tenant_id} in some calls like:

    GET v2/{tenant_id}/images Lists IDs, names, and links for ...
    GET v2/{tenant_id}/images/detail Lists all details for available images.
    GET v2/{tenant_id}/images/​{image_id}​ Gets details for a specified image.
    DELETE v2/{tenant_id}/images/​{image_id}​ Deletes a specified image.

    The same change will happen for Flavors and Image metadata.

    bug 1290857

    Change-Id: I71765759b558fbfd283a227876638684c2659116

Changed in openstack-api-site:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.