| 1 |
# Copyright 2013 VMware, Inc. |
| 2 |
# All rights reserved. |
| 3 |
# |
| 4 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 |
# not use this file except in compliance with the License. You may obtain |
| 6 |
# a copy of the License at |
| 7 |
# |
| 8 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 |
# License for the specific language governing permissions and limitations |
| 14 |
# under the License. |
| 15 |
|
| 16 |
import copy |
| 17 |
import typing |
| 18 |
|
| 19 |
from neutron_lib.api import converters |
| 20 |
from neutron_lib.api.definitions import l3 |
| 21 |
|
| 22 |
|
| 23 |
ALIAS = 'ext-gw-mode' |
| 24 |
IS_SHIM_EXTENSION = False |
| 25 |
IS_STANDARD_ATTR_EXTENSION = False |
| 26 |
NAME = 'Neutron L3 Configurable external gateway mode' |
| 27 |
API_PREFIX = '' |
| 28 |
DESCRIPTION = ('Extension of the router abstraction for specifying whether ' |
| 29 |
'SNAT should occur on the external gateway') |
| 30 |
UPDATED_TIMESTAMP = '2013-03-28T10:00:00-00:00' |
| 31 |
RESOURCE_NAME = l3.ROUTER |
| 32 |
COLLECTION_NAME = l3.ROUTERS |
| 33 |
|
| 34 |
routers: dict[str, typing.Any] = copy.deepcopy( |
| 35 |
l3.RESOURCE_ATTRIBUTE_MAP[COLLECTION_NAME] |
| 36 |
) |
| 37 |
routers[l3.EXTERNAL_GW_INFO]['validate']['type:dict_or_nodata'][ |
| 38 |
'enable_snat'] = { |
| 39 |
'type:boolean': None, |
| 40 |
'required': False, |
| 41 |
'convert_to': converters.convert_to_boolean |
| 42 |
} |
| 43 |
RESOURCE_ATTRIBUTE_MAP = { |
| 44 |
COLLECTION_NAME: routers |
| 45 |
} |
| 46 |
|
| 47 |
SUB_RESOURCE_ATTRIBUTE_MAP = {} |
| 48 |
ACTION_MAP = {} |
| 49 |
REQUIRED_EXTENSIONS = [l3.ALIAS] |
| 50 |
OPTIONAL_EXTENSIONS = [] |
| 51 |
ACTION_STATUS = {} |