| 1 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 |
# you may not use this file except in compliance with the License. |
| 3 |
# You may obtain a copy of the License at |
| 4 |
# |
| 5 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 6 |
# |
| 7 |
# Unless required by applicable law or agreed to in writing, software |
| 8 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 9 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 10 |
# implied. |
| 11 |
# See the License for the specific language governing permissions and |
| 12 |
# limitations under the License. |
| 13 |
|
| 14 |
from neutron_lib.api.definitions import agent |
| 15 |
from neutron_lib.api import validators |
| 16 |
from neutron_lib.api.validators import availability_zone as az_validator |
| 17 |
|
| 18 |
|
| 19 |
validators.add_validator('availability_zone_hint_list', |
| 20 |
az_validator._validate_availability_zone_hints) |
| 21 |
|
| 22 |
AZ_HINTS = 'availability_zone_hints' |
| 23 |
|
| 24 |
ALIAS = 'availability_zone' |
| 25 |
IS_SHIM_EXTENSION = False |
| 26 |
IS_STANDARD_ATTR_EXTENSION = False |
| 27 |
NAME = 'Availability Zone' |
| 28 |
API_PREFIX = '' |
| 29 |
DESCRIPTION = 'The availability zone extension.' |
| 30 |
UPDATED_TIMESTAMP = '2015-01-01T10:00:00-00:00' |
| 31 |
RESOURCE_NAME = 'availability_zone' |
| 32 |
COLLECTION_NAME = RESOURCE_NAME + 's' |
| 33 |
RESOURCE_ATTRIBUTE_MAP = { |
| 34 |
COLLECTION_NAME: { |
| 35 |
'name': {'is_visible': True, 'is_filter': True}, |
| 36 |
'resource': {'is_visible': True, 'is_filter': True}, |
| 37 |
'state': {'is_visible': True, 'is_filter': True} |
| 38 |
}, |
| 39 |
agent.COLLECTION_NAME: { |
| 40 |
RESOURCE_NAME: { |
| 41 |
'allow_post': False, 'allow_put': False, 'is_filter': True, |
| 42 |
'is_visible': True} |
| 43 |
} |
| 44 |
} |
| 45 |
SUB_RESOURCE_ATTRIBUTE_MAP = {} |
| 46 |
ACTION_MAP = {} |
| 47 |
REQUIRED_EXTENSIONS = [agent.ALIAS] |
| 48 |
OPTIONAL_EXTENSIONS = [] |
| 49 |
ACTION_STATUS = {} |