| 1 |
# Copyright (c) 2024 Red Hat, Inc. |
| 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 |
from neutron_lib.api import converters |
| 15 |
from neutron_lib.api.definitions import network |
| 16 |
from neutron_lib import constants |
| 17 |
|
| 18 |
ALIAS = 'qinq' |
| 19 |
IS_SHIM_EXTENSION = False |
| 20 |
IS_STANDARD_ATTR_EXTENSION = False |
| 21 |
NAME = "QinQ networks" |
| 22 |
DESCRIPTION = ( |
| 23 |
"Expose network 'qinq' attribute in the API. " |
| 24 |
"This allows to configure network to allow vlan in vlan " |
| 25 |
"configuration using 0x8a88 ethertype (QinQ)." |
| 26 |
) |
| 27 |
UPDATED_TIMESTAMP = "2024-12-02T10:00:00-00:00" |
| 28 |
RESOURCE_NAME = network.RESOURCE_NAME |
| 29 |
COLLECTION_NAME = network.COLLECTION_NAME |
| 30 |
QINQ_FIELD = 'qinq' |
| 31 |
RESOURCE_ATTRIBUTE_MAP = { |
| 32 |
COLLECTION_NAME: { |
| 33 |
QINQ_FIELD: { |
| 34 |
'allow_post': True, |
| 35 |
'allow_put': False, |
| 36 |
'convert_to': converters.convert_to_boolean, |
| 37 |
'default': constants.ATTR_NOT_SPECIFIED, |
| 38 |
'is_visible': True, |
| 39 |
'is_filter': True, |
| 40 |
'validate': {'type:boolean': None} |
| 41 |
} |
| 42 |
}, |
| 43 |
} |
| 44 |
SUB_RESOURCE_ATTRIBUTE_MAP = None |
| 45 |
ACTION_MAP = {} |
| 46 |
ACTION_STATUS = {} |
| 47 |
REQUIRED_EXTENSIONS = [] |
| 48 |
OPTIONAL_EXTENSIONS = [] |