Parts of os-quota-sets APIs are wrong

Bug #1274153 reported by Liyingjun on 2014-01-29
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openstack-api-site
High
Liyingjun

Bug Description

The following APIs is wrong:
GET v2/​{tenant_id}​/os-quota-sets Shows quotas for a tenant.
PUT v2/​{tenant_id}​/os-quota-sets Updates quotas for a tenant.
GET v2/​{tenant_id}​/os-quota-sets/​{tenant_id}​/​{user_id} Enables an admin user to show quotas for a specified tenant and user.
PUT v2/​{tenant_id}​/os-quota-sets/​{tenant_id}​/​{user_id} Updates quotas for a specified tenant/project and user.
It should be:
v2/​{tenant_id}​/os-quota-sets/{tenant_id}
v2/​{tenant_id}​/os-quota-sets/{tenant_id}?user_id={user_id}

Liyingjun (liyingjun) wrote :
Download full text (12.4 KiB)

Following are the outputs of CLI DEBUG:

$ nova --debug quota-show --tenant ba1b812de60441a78f2e26197b0effce

REQ: curl -i 'http://192.168.94.129:5000/v2.0/tokens' -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-novaclient" -d '{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "123123"}}}'

RESP: [200] CaseInsensitiveDict({'date': 'Tue, 14 Jan 2014 01:25:08 GMT', 'vary': 'X-Auth-Token', 'content-length': '4291', 'content-type': 'application/json'})
RESP BODY: {"access": {"token": {"issued_at": "2014-01-14T01:25:08.580631", "expires": "2014-01-15T01:25:08Z", "id": "4e08f3cbb320465185bce3e7fd050f16", "tenant": {"description": null, "enabled": true, "id": "edd8a3405acd41f589c821acb68a57e0", "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.94.129:8774/v2/edd8a3405acd41f589c821acb68a57e0", "region": "RegionOne", "internalURL": "http://192.168.94.129:8774/v2/edd8a3405acd41f589c821acb68a57e0", "id": "643a2912f517488e892735be0fc8b621", "publicURL": "http://192.168.94.129:8774/v2/edd8a3405acd41f589c821acb68a57e0"}], "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://192.168.94.129:9696/", "region": "RegionOne", "internalURL": "http://192.168.94.129:9696/", "id": "5b7731fff9b34b468e33874f1d5cfe56", "publicURL": "http://192.168.94.129:9696/"}], "endpoints_links": [], "type": "network", "name": "neutron"}, {"endpoints": [{"adminURL": "http://192.168.94.129:8776/v2/edd8a3405acd41f589c821acb68a57e0", "region": "RegionOne", "internalURL": "http://192.168.94.129:8776/v2/edd8a3405acd41f589c821acb68a57e0", "id": "77a18364b7ee4a63bbfa79a27a719392", "publicURL": "http://192.168.94.129:8776/v2/edd8a3405acd41f589c821acb68a57e0"}], "endpoints_links": [], "type": "volumev2", "name": "cinder"}, {"endpoints": [{"adminURL": "http://192.168.94.129:8774/v3", "region": "RegionOne", "internalURL": "http://192.168.94.129:8774/v3", "id": "3424daa47e774410a6c67c5e23f5db59", "publicURL": "http://192.168.94.129:8774/v3"}], "endpoints_links": [], "type": "computev3", "name": "nova"}, {"endpoints": [{"adminURL": "http://192.168.94.129:3333", "region": "RegionOne", "internalURL": "http://192.168.94.129:3333", "id": "73094bf82b8e44d4876bf631abbdafb9", "publicURL": "http://192.168.94.129:3333"}], "endpoints_links": [], "type": "s3", "name": "s3"}, {"endpoints": [{"adminURL": "http://192.168.94.129:9292", "region": "RegionOne", "internalURL": "http://192.168.94.129:9292", "id": "4af8412f41d441bdad3452009b770fee", "publicURL": "http://192.168.94.129:9292"}], "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://192.168.94.129:8777", "region": "RegionOne", "internalURL": "http://192.168.94.129:8777", "id": "116461b5b6dd4fc5875fab23f9402e7d", "publicURL": "http://192.168.94.129:8777"}], "endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints": [{"adminURL": "http://192.168.94.129:8000/v1", "region": "RegionOne", "internalURL": "http://192.168.94.129:8000/v1", "id": "47995fe8a15b4c4fb477532fa69e77c3", "publicURL": "http://192.168.94.129:8000/v1"}], "endpoints_lin...

Liyingjun (liyingjun) on 2014-01-29
affects: openstack-manuals → openstack-api-site
Anne Gentle (annegentle) on 2014-01-29
Changed in openstack-api-site:
status: New → Confirmed
importance: Undecided → High
Liyingjun (liyingjun) on 2014-01-29
Changed in openstack-api-site:
assignee: nobody → Liyingjun (liyingjun)

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

Changed in openstack-api-site:
status: Confirmed → In Progress
Liyingjun (liyingjun) wrote :

Seems like v2/​{tenant_id}​/os-quota-sets/​{tenant_id}​/​{user_id} is explained under `Request parameters`: user_id, The user ID. Specify in the URI as a query string: user_id={user_id}, so no problem about this.

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

commit 1c2d7de2a712601ead43105d47e20e07fb31f1f5
Author: liyingjun <email address hidden>
Date: Tue Jan 14 10:30:35 2014 +0800

    Add missing tenant_id param behinds os-quota-sets

    These two APIs missing tenant_id param.
    GET v2/{tenant_id}/os-quota-sets Shows quotas for a tenant.
    PUT v2/{tenant_id}/os-quota-sets Updates quotas for a tenant.
    Should be like:
    GET v2/{tenant_id}/os-quota-sets/{tenant_id} Shows quotas for a tenant.
    PUT v2/{tenant_id}/os-quota-sets/{tenant_id} Updates quotas for a tenant.

    Change-Id: I07581b69835cde3063b109cae564a591386762c8
    Closes-bug: 1274153

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

Duplicates of this bug

Other bug subscribers