Problem
=======
The GET /ports API only support exact matching when filtering by IP address.
Providing support for more powerful regex matching filtering could be very
useful.
Usecase
=======
Nova allows filtering instance by IP address and it is in regex matching
manner, but it now has serious performance issue [1]. How to enhance the
performance of this filter has been discussed in Queens PTG [2]. When
filtering instance by IP addresses, first calling Neutron port list API
with IP address filtering, and then retrieve the instance UUID in Nova
side could be a possible solution to improve the performance.
As Nova allows regex manner filtering, it could be better to make Neutron
also support regex matching.
Proposal
========
Adding regex matching support in DB layer using "LIKE" SQL phrase.
References
==========
[1] https://bugs.launchpad.net/nova/+bug/1711303
[2] http://lists.openstack.org/pipermail/openstack-dev/2017-September/122258.html
This sounds reasonable. So long as we make sure to sanitize the query to avoid SQL injection attacks, I am fine with this :)