neutron/neutron/extensions/availability_zone_filter.py
Hongbin Lu 7899ef2671 Adjust filters on listing availability zones
In before, filtering of AZs is using the filter implementation of
agents. To filter the AZs, users need to find the AZ fields to filter,
locate their corresponding fields in agent, and compile the filters
based on the mapping between AZ and agent. This is undesirable.

This patch improve the filtering of AZ by converting the AZ filters
to agent filters. The supporting AZ filters are:
* name: the name of the availability zone
* state: the value is either 'available' or 'unavailable'
* resource: the value is either 'network' or 'router'

NOTE: For backward-compatibility, the old filters still works but
its usage is discourage.

APIImpact: Add filters to specify attributes of availability zones

Needed-By: Icbf427f20ca912a40d68e8042abeeabffeb3005f
Change-Id: Id882f949cc73a34290c311f3ce3d69d1b809c29f
2018-06-29 19:15:29 +00:00

19 lines
780 B
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from neutron.extensions import _availability_zone_filter_lib as apidef
from neutron_lib.api import extensions
class Availability_zone_filter(extensions.APIExtensionDescriptor):
api_definition = apidef