2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
19 from neutron.api import extensions
20 from neutron.extensions import availability_zone as az_ext
23 EXTENDED_ATTRIBUTES_2_0 = {
25 az_ext.AVAILABILITY_ZONES: {'allow_post': False, 'allow_put': False,
28 'allow_post': True, 'allow_put': False, 'is_visible': True,
29 'validate': {'type:availability_zone_hints': None},
34 class Router_availability_zone(extensions.ExtensionDescriptor):
35 """Router availability zone extension."""
39 return "Router Availability Zone"
43 return "router_availability_zone"
46 def get_description(cls):
47 return "Availability zone support for router."
51 return "2015-01-01T10:00:00-00:00"
53 def get_required_extensions(self):
54 return ["router", "availability_zone"]
56 def get_extended_resources(self, version):
58 return EXTENDED_ATTRIBUTES_2_0
63 @six.add_metaclass(abc.ABCMeta)
64 class RouterAvailabilityZonePluginBase(object):
67 def get_router_availability_zones(self, router):
68 """Return availability zones which a router belongs to."""