Bug 1042567

Summary: [RFE][neutron]: allow filters to use 'like' operation of sqlalchemy
Product: Red Hat OpenStack Reporter: RHOS Integration <rhos-integ>
Component: RFEsAssignee: RHOS Maint <rhos-maint>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: markmc, yeylon
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://blueprints.launchpad.net/neutron/+spec/like-op-list
Whiteboard: upstream_milestone_next upstream_status_needs-code-review upstream_definition_obsolete
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-19 16:55:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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