Bug 1042567 - [RFE][neutron]: allow filters to use 'like' operation of sqlalchemy
Summary: [RFE][neutron]: allow filters to use 'like' operation of sqlalchemy
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: RFEs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: RHOS Maint
QA Contact:
URL: https://blueprints.launchpad.net/neut...
Whiteboard: upstream_milestone_next upstream_stat...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-13 00:22 UTC by RHOS Integration
Modified: 2015-12-10 20:03 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-19 16:55:10 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description RHOS Integration 2013-12-13 00:22:50 UTC
Cloned from launchpad blueprint https://blueprints.launchpad.net/neutron/+spec/like-op-list.

Description:

currently, the get_xxxs use the in_ to query the resources in filters parameter. It cannot deal with the requirement like ' to list all of the ports which have the ip address like this '10.0.%', or to list all of the network the name of which is like 'test_network%'.
This BP will add an way to deal with it.
for top field:
quantum net-list --name test_network% x_query=like
query = query.filter(Network.name.like('test_network%'))
for sub field:
quantum port-list --fixed-ips ip_address~=10.0.%
query = query.filter(IPAllocation.ip_address.like('10.0.%'))

for API compatible:
we will use the current filters parameter:
quantum net-list --name test_network% x_query=like
filters = {'name': [test_network%],
              'name_x_query': ['like']}
quantum port-list --fixed-ips ip_address~=10.0.%
filters = {'fixed-ips': {'ip_address': ['10.0.%']},
              'fixed-ips_ip_address_x_query': ['like']}

Specification URL (additional information):

None


Note You need to log in before you can comment on or make changes to this bug.