| 1 |
# Copyright (C) 2018 AT&T |
| 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 |
|
| 16 |
from neutron_lib.api.definitions import taas as taas_api_def |
| 17 |
|
| 18 |
ALIAS = 'taas-vlan-filter' |
| 19 |
IS_SHIM_EXTENSION = False |
| 20 |
IS_STANDARD_ATTR_EXTENSION = False |
| 21 |
NAME = "VLAN filtering for Neutron Tap as a Service" |
| 22 |
DESCRIPTION = "Neutron Tap as a Service Extension for filtering VLANs." |
| 23 |
UPDATED_TIMESTAMP = "2018-01-14T10:00:00-00:00" |
| 24 |
API_PREFIX = '/taas' |
| 25 |
RESOURCE_NAME = 'tap_service' |
| 26 |
COLLECTION_NAME = 'tap_services' |
| 27 |
TAP_FLOW = 'tap_flow' |
| 28 |
TAP_FLOWS = 'tap_flows' |
| 29 |
|
| 30 |
# Regex for a comma-seperate list of integer values (VLANs) |
| 31 |
# For ex. "9,18,27-36,45-54" or "0-4095" or "9,18,27,36" |
| 32 |
RANGE_REGEX = r"^([0-9]+(-[0-9]+)?)(,([0-9]+(-[0-9]+)?))*$" |
| 33 |
|
| 34 |
RESOURCE_ATTRIBUTE_MAP = { |
| 35 |
taas_api_def.TAP_FLOWS: { |
| 36 |
'vlan_filter': {'allow_post': True, 'allow_put': False, |
| 37 |
'validate': {'type:regex_or_none': RANGE_REGEX}, |
| 38 |
'is_visible': True, 'default': None} |
| 39 |
} |
| 40 |
} |
| 41 |
SUB_RESOURCE_ATTRIBUTE_MAP = None |
| 42 |
ACTION_MAP = {} |
| 43 |
ACTION_STATUS = {} |
| 44 |
REQUIRED_EXTENSIONS = [taas_api_def.ALIAS] |
| 45 |
OPTIONAL_EXTENSIONS = [] |