| 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.api.definitions import network |
| 17 |
from neutron_lib.api.definitions import network_mtu |
| 18 |
|
| 19 |
|
| 20 |
MTU = 'mtu' |
| 21 |
|
| 22 |
# The alias of the extension. |
| 23 |
ALIAS = 'net-mtu-writable' |
| 24 |
|
| 25 |
# Whether or not this extension is simply signaling behavior to the user |
| 26 |
# or it actively modifies the attribute map. |
| 27 |
IS_SHIM_EXTENSION = False |
| 28 |
|
| 29 |
# Whether the extension is marking the adoption of standardattr model for |
| 30 |
# legacy resources, or introducing new standardattr attributes. False or |
| 31 |
# None if the standardattr model is adopted since the introduction of |
| 32 |
# resource extension. |
| 33 |
# If this is True, the alias for the extension should be prefixed with |
| 34 |
# 'standard-attr-'. |
| 35 |
IS_STANDARD_ATTR_EXTENSION = False |
| 36 |
|
| 37 |
# The name of the extension. |
| 38 |
NAME = 'Network MTU (writable)' |
| 39 |
|
| 40 |
# A prefix for API resources. An empty prefix means that the API is going |
| 41 |
# to be exposed at the v2/ level as any other core resource. |
| 42 |
API_PREFIX = '' |
| 43 |
|
| 44 |
# The description of the extension. |
| 45 |
DESCRIPTION = ( |
| 46 |
"Provides a writable MTU attribute for a network resource.") |
| 47 |
|
| 48 |
# A timestamp of when the extension was introduced. |
| 49 |
UPDATED_TIMESTAMP = "2017-07-12T00:00:00-00:00" |
| 50 |
|
| 51 |
|
| 52 |
RESOURCE_ATTRIBUTE_MAP = { |
| 53 |
network.COLLECTION_NAME: { |
| 54 |
MTU: {'allow_post': True, 'allow_put': True, 'is_visible': True, |
| 55 |
'is_filter': True, 'is_sort_key': True, |
| 56 |
'validate': {'type:non_negative': None}, 'default': 0, |
| 57 |
'convert_to': converters.convert_to_int, |
| 58 |
'enforce_policy': True}, |
| 59 |
}, |
| 60 |
} |
| 61 |
|
| 62 |
# The subresource attribute map for the extension. It adds child resources |
| 63 |
# to main extension's resource. The subresource map must have a parent and |
| 64 |
# a parameters entry. If an extension does not need such a map, None can |
| 65 |
# be specified (mandatory). |
| 66 |
SUB_RESOURCE_ATTRIBUTE_MAP = {} |
| 67 |
|
| 68 |
# The action map: it associates verbs with methods to be performed on |
| 69 |
# the API resource. |
| 70 |
ACTION_MAP = {} |
| 71 |
|
| 72 |
# The action status. |
| 73 |
ACTION_STATUS = { |
| 74 |
} |
| 75 |
|
| 76 |
# The list of required extensions. |
| 77 |
REQUIRED_EXTENSIONS = [network_mtu.ALIAS] |
| 78 |
|
| 79 |
# The list of optional extensions. |
| 80 |
OPTIONAL_EXTENSIONS = [] |