| 1 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 2 |
# not use this file except in compliance with the License. You may obtain |
| 3 |
# 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, WITHOUT |
| 9 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 10 |
# License for the specific language governing permissions and limitations |
| 11 |
# under the License. |
| 12 |
|
| 13 |
from neutron_lib.api import converters |
| 14 |
from neutron_lib.api.definitions import network |
| 15 |
|
| 16 |
|
| 17 |
PROJECT_DEFAULT = 'project_default' |
| 18 |
|
| 19 |
# The alias of the extension. |
| 20 |
ALIAS = 'project-default-networks' |
| 21 |
|
| 22 |
# Whether or not this extension is simply signaling behavior to the user |
| 23 |
# or it actively modifies the attribute map. |
| 24 |
IS_SHIM_EXTENSION = False |
| 25 |
|
| 26 |
# Whether the extension is marking the adoption of standardattr model for |
| 27 |
# legacy resources, or introducing new standardattr attributes. False or |
| 28 |
# None if the standardattr model is adopted since the introduction of |
| 29 |
# resource extension. |
| 30 |
# If this is True, the alias for the extension should be prefixed with |
| 31 |
# 'standard-attr-'. |
| 32 |
IS_STANDARD_ATTR_EXTENSION = False |
| 33 |
|
| 34 |
# The name of the extension. |
| 35 |
NAME = 'Default network for project' |
| 36 |
|
| 37 |
# The description of the extension. |
| 38 |
DESCRIPTION = "Support specifying networks as default networks for projects" |
| 39 |
|
| 40 |
# A timestamp of when the extension was introduced. |
| 41 |
UPDATED_TIMESTAMP = "2018-07-03T10:00:00-00:00" |
| 42 |
|
| 43 |
# The name of the resource introduced or being extended. |
| 44 |
RESOURCE_NAME = network.RESOURCE_NAME |
| 45 |
|
| 46 |
# The plural for the resource introduced or being extended. |
| 47 |
COLLECTION_NAME = network.COLLECTION_NAME |
| 48 |
|
| 49 |
# The resource attribute map for the extension. |
| 50 |
RESOURCE_ATTRIBUTE_MAP = { |
| 51 |
COLLECTION_NAME: { |
| 52 |
PROJECT_DEFAULT: { |
| 53 |
'allow_post': True, 'allow_put': True, |
| 54 |
'default': False, |
| 55 |
'convert_to': converters.convert_to_boolean, |
| 56 |
'is_visible': True |
| 57 |
} |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
# The subresource attribute map for the extension. |
| 62 |
SUB_RESOURCE_ATTRIBUTE_MAP = { |
| 63 |
} |
| 64 |
|
| 65 |
# The action map. |
| 66 |
ACTION_MAP = { |
| 67 |
} |
| 68 |
|
| 69 |
# The action status. |
| 70 |
ACTION_STATUS = { |
| 71 |
} |
| 72 |
|
| 73 |
# The list of required extensions. |
| 74 |
REQUIRED_EXTENSIONS = [ |
| 75 |
] |
| 76 |
|
| 77 |
# The list of optional extensions. |
| 78 |
OPTIONAL_EXTENSIONS = [ |
| 79 |
] |