Region filtering for endpoints does not work

Bug #1482772 reported by Daniel Gonzalez Nothnagel
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Lin Hua Cheng
python-keystoneclient
Fix Released
Undecided
Lin Hua Cheng
python-openstackclient
Invalid
Undecided
Lin Hua Cheng

Bug Description

When i run “openstack endpoint list --os-url http://192.168.33.10:5000/v3 --os-identity-api-version=3 --service identity --interface public --region RegionTwo” i would expect that it only lists endpoints from RegionTwo. But i get the identity endpoint from RegionOne. Here is the output:
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| 4b3efc615c044fb4a2c70ca2e5e7bba9 | RegionOne | keystone | identity | True | public | http://192.168.33.10:5000/v2.0 |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+

As this snippet from the debug output from openstackclient shows, the client sends the correct query to keystone. So i assume this is a filtering problem in keystone.

DEBUG: requests.packages.urllib3.connectionpool "GET /v3/endpoints?interface=public&service_id=050872861656437184778a822032d8d6&region=RegionTwo HTTP/1.1" 200 506
DEBUG: keystoneclient.session RESP: [200] content-length: 506 vary: X-Auth-Token keep-alive: timeout=5, max=96 server: Apache/2.4.7 (Ubuntu) connection: Keep-Alive date: Fri, 07 Aug 2015 19:37:08 GMT content-type: application/json x-openstack-request-id: req-72481573-7fff-4ae0-9a2f-33584b476bd3
RESP BODY: {"endpoints": [{"region_id": "RegionOne", "links": {"self": "http://192.168.33.10:35357/v3/endpoints/4b3efc615c044fb4a2c70ca2e5e7bba9"}, "url": "http://192.168.33.10:5000/v2.0", "region": "RegionOne", "enabled": true, "interface": "public", "service_id": "050872861656437184778a822032d8d6", "id": "4b3efc615c044fb4a2c70ca2e5e7bba9"}], "links": {"self": "http://192.168.33.10:35357/v3/endpoints?interface=public&service_id=050872861656437184778a822032d8d6&region=RegionTwo", "previous": null, "next": null}}

Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

According to the V3 API docs, only interface and service_id are the supported query parameter: http://specs.openstack.org/openstack/keystone-specs/api/v3/identity-api-v3.html#list-endpoints

Opened a bug to remove the region query parameter from OSC.

Changed in keystone:
status: New → Invalid
Changed in python-openstackclient:
assignee: nobody → Lin Hua Cheng (lin-hua-cheng)
Changed in python-keystoneclient:
assignee: nobody → Lin Hua Cheng (lin-hua-cheng)
Revision history for this message
Dolph Mathews (dolph) wrote :

Or, we could do the opposite and add it to the API documentation and service-side implementation. I certainly find the use case valuable (filtering the configured `endpoint list` by region).

As a side note, there are a many attributes that likely fall into this situation and it'd be great to fix them all at once.

Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :
Changed in keystone:
status: Invalid → Confirmed
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

Going to add the region as filter in the List Endpoint

Changed in keystone:
assignee: nobody → Lin Hua Cheng (lin-hua-cheng)
Revision history for this message
Dolph Mathews (dolph) wrote :

Please include it in keystone-specs/api

Revision history for this message
Sean Dague (sdague) wrote :

+1 for adding this feature to Keystone proper

Changed in keystone:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone-specs (master)

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

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

Reviewed: https://review.openstack.org/213356
Committed: https://git.openstack.org/cgit/openstack/keystone-specs/commit/?id=eb8a0bd406d899cfc3f260d365682b064e19a398
Submitter: Jenkins
Branch: master

commit eb8a0bd406d899cfc3f260d365682b064e19a398
Author: lin-hua-cheng <email address hidden>
Date: Fri Aug 14 15:16:53 2015 -0700

    Add region_id filter in List Endpoints API

    Change-Id: Ibb5170c5cec78a1b5a6d178dfcc4b5348f541e0f
    Partial-Bug: #1482772

Revision history for this message
Steve Martinelli (stevemar) wrote :
Changed in python-keystoneclient:
status: New → Invalid
Changed in python-openstackclient:
status: New → Invalid
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

OSC and KSC do already have the filter, however the filter it is passing is "region" instead of "region_id".

There are still some work needed to change the filter name to region_id.

Changed in python-keystoneclient:
status: Invalid → Confirmed
Changed in python-openstackclient:
status: Invalid → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

No need to fix OSC, KSC will perform the translation from region to region_id.

Changed in python-openstackclient:
status: Confirmed → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/215378
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=076af38dcfc2c135b20470e3a18a7ebbd77d7103
Submitter: Jenkins
Branch: master

commit 076af38dcfc2c135b20470e3a18a7ebbd77d7103
Author: lin-hua-cheng <email address hidden>
Date: Thu Aug 20 16:43:25 2015 -0700

    Add region_id filter for List Endpoints API

    Change-Id: Ic4d60a046df1f231d02a45998c8a0ef7c5b7b107
    Closes-bug: #1482772

Changed in keystone:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

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

Changed in python-keystoneclient:
status: Confirmed → In Progress
Changed in keystone:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/216501
Committed: https://git.openstack.org/cgit/openstack/python-keystoneclient/commit/?id=03d5d8effc973dd4951fb825c4f7d885f883f9bb
Submitter: Jenkins
Branch: master

commit 03d5d8effc973dd4951fb825c4f7d885f883f9bb
Author: lin-hua-cheng <email address hidden>
Date: Mon Aug 24 19:43:31 2015 -0700

    Use region_id filter for List Endpoints

    The old region filter didn't work, it was not available
    in Keystone.

    Change-Id: Ic4d60a046df1f231d02a45998c8a0ef7c5b7b107
    Closes-bug: #1482772

Changed in python-keystoneclient:
status: In Progress → Fix Committed
Changed in python-keystoneclient:
milestone: none → 1.7.1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: liberty-3 → 8.0.0
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.