Generalized filters

Cinder introduced generalized resource filters since Pike, it has the
same purpose as query_volume_filters option, but it’s more convenient
and can be applied to more cinder resources, administrator can control the
allowed filter keys for non-admin user by editing the filter
configuration file. Also since this feature, cinder will raise
400BadRequest if any invalid query filter is specified.

resource_query_filters_file is introduced to cinder to represent the
filter config file path, and the config file accepts the valid filter keys
for non-admin user with json format:

{"volume":["name","status","metadata"]}

the key volume (singular) here stands for the resource you want to apply and the value
accepts an list which contains the allowed filters collection, once the configuration
file is changed and API service is restarted, cinder will only recognize this filter
keys, NOTE: the default configuration file will include all the filters we already
enabled.

Not all the attributes are supported at present, so we add this table below to
indicate which filter keys are valid and can be used in the configuration.

Since v3.34 we could use ‘~’ to indicate supporting querying resource by inexact match,
for example, if we have a configuration file as below:

{"volume":["name~"]}

User can query volume both by name=volume and name~=volume, and the volumes
named volume123 and a_volume123 are both valid for second input while neither are
valid for first. The supported APIs are marked with “*” below in the table.