| 1 |
# All rights reserved. |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 |
# not use this file except in compliance with the License. You may obtain |
| 5 |
# a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 |
# License for the specific language governing permissions and limitations |
| 13 |
# under the License. |
| 14 |
|
| 15 |
from neutron_lib.api import converters |
| 16 |
from neutron_lib.db import constants as db_const |
| 17 |
|
| 18 |
FLAVOR = 'flavor' |
| 19 |
FLAVORS = FLAVOR + 's' |
| 20 |
SERVICE_PROFILES = 'service_profiles' |
| 21 |
NEXT_PROVIDERS = 'next_providers' |
| 22 |
|
| 23 |
ALIAS = FLAVORS |
| 24 |
IS_SHIM_EXTENSION = False |
| 25 |
IS_STANDARD_ATTR_EXTENSION = False |
| 26 |
NAME = 'Neutron Service Flavors' |
| 27 |
API_PREFIX = '' |
| 28 |
DESCRIPTION = 'Flavor specification for Neutron advanced services.' |
| 29 |
UPDATED_TIMESTAMP = '2015-09-17T10:00:00-00:00' |
| 30 |
RESOURCE_ATTRIBUTE_MAP = { |
| 31 |
FLAVORS: { |
| 32 |
'id': {'allow_post': False, 'allow_put': False, |
| 33 |
'validate': {'type:uuid': None}, |
| 34 |
'is_visible': True, 'is_filter': True, |
| 35 |
'is_sort_key': True, 'primary_key': True}, |
| 36 |
'name': {'allow_post': True, 'allow_put': True, |
| 37 |
'validate': {'type:string': db_const.NAME_FIELD_SIZE}, |
| 38 |
'is_filter': True, 'is_sort_key': True, |
| 39 |
'is_visible': True, 'default': ''}, |
| 40 |
'description': {'allow_post': True, 'allow_put': True, |
| 41 |
'validate': {'type:string_or_none': |
| 42 |
db_const.LONG_DESCRIPTION_FIELD_SIZE}, |
| 43 |
'is_filter': True, 'is_sort_key': True, |
| 44 |
'is_visible': True, 'default': ''}, |
| 45 |
'service_type': {'allow_post': True, 'allow_put': False, |
| 46 |
'validate': |
| 47 |
{'type:service_plugin_type': None}, |
| 48 |
'is_filter': True, 'is_sort_key': True, |
| 49 |
'is_visible': True}, |
| 50 |
'service_profiles': {'allow_post': True, 'allow_put': True, |
| 51 |
'validate': {'type:uuid_list': None}, |
| 52 |
'is_visible': True, 'default': []}, |
| 53 |
'enabled': {'allow_post': True, 'allow_put': True, |
| 54 |
'convert_to': converters.convert_to_boolean_if_not_none, |
| 55 |
'default': True, 'is_filter': True, 'is_sort_key': True, |
| 56 |
'is_visible': True}, |
| 57 |
}, |
| 58 |
SERVICE_PROFILES: { |
| 59 |
'id': {'allow_post': False, 'allow_put': False, |
| 60 |
'validate': {'type:uuid': None}, |
| 61 |
'is_visible': True, 'is_filter': True, |
| 62 |
'is_sort_key': True, 'primary_key': True}, |
| 63 |
'description': {'allow_post': True, 'allow_put': True, |
| 64 |
'validate': {'type:string_or_none': |
| 65 |
db_const.LONG_DESCRIPTION_FIELD_SIZE}, |
| 66 |
'is_filter': True, 'is_sort_key': True, |
| 67 |
'is_visible': True, 'default': ''}, |
| 68 |
'driver': {'allow_post': True, 'allow_put': True, |
| 69 |
'validate': {'type:string': |
| 70 |
db_const.LONG_DESCRIPTION_FIELD_SIZE}, |
| 71 |
'is_visible': True, 'is_filter': True, |
| 72 |
'is_sort_key': True, 'default': ''}, |
| 73 |
'metainfo': {'allow_post': True, 'allow_put': True, |
| 74 |
'is_visible': True, 'is_sort_key': True, |
| 75 |
'default': ''}, |
| 76 |
'enabled': {'allow_post': True, 'allow_put': True, |
| 77 |
'convert_to': converters.convert_to_boolean_if_not_none, |
| 78 |
'is_filter': True, 'is_sort_key': True, |
| 79 |
'is_visible': True, 'default': True}, |
| 80 |
}, |
| 81 |
} |
| 82 |
SUB_RESOURCE_ATTRIBUTE_MAP = { |
| 83 |
NEXT_PROVIDERS: { |
| 84 |
'parent': {'collection_name': FLAVORS, |
| 85 |
'member_name': FLAVOR}, |
| 86 |
'parameters': {'provider': {'allow_post': False, |
| 87 |
'allow_put': False, |
| 88 |
'is_visible': True}, |
| 89 |
'driver': {'allow_post': False, |
| 90 |
'allow_put': False, |
| 91 |
'is_visible': True}, |
| 92 |
'metainfo': {'allow_post': False, |
| 93 |
'allow_put': False, |
| 94 |
'is_visible': True}} |
| 95 |
}, |
| 96 |
SERVICE_PROFILES: { |
| 97 |
'parent': {'collection_name': FLAVORS, |
| 98 |
'member_name': FLAVOR}, |
| 99 |
'parameters': {'id': {'allow_post': True, 'allow_put': False, |
| 100 |
'validate': {'type:uuid': None}, |
| 101 |
'is_visible': True}} |
| 102 |
} |
| 103 |
} |
| 104 |
ACTION_MAP = {} |
| 105 |
REQUIRED_EXTENSIONS = [] |
| 106 |
OPTIONAL_EXTENSIONS = [] |
| 107 |
ACTION_STATUS = {} |