| 1 |
# All Rights Reserved 2020 |
| 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 openstack import resource |
| 16 |
|
| 17 |
|
| 18 |
class L2gw(resource.Resource): |
| 19 |
"""L2 Gateway""" |
| 20 |
|
| 21 |
resource_key = 'l2_gateway' |
| 22 |
resources_key = 'l2_gateways' |
| 23 |
base_path = '/l2-gateways' |
| 24 |
|
| 25 |
# capabilities |
| 26 |
allow_create = True |
| 27 |
allow_fetch = True |
| 28 |
allow_commit = True |
| 29 |
allow_delete = True |
| 30 |
allow_list = True |
| 31 |
|
| 32 |
_allow_unknown_attrs_in_body = True |
| 33 |
|
| 34 |
_query_mapping = resource.QueryParameters( |
| 35 |
"sort_key", "sort_dir", |
| 36 |
'name', 'project_id' |
| 37 |
) |
| 38 |
|
| 39 |
# Properties |
| 40 |
#: The ID of the l2 gateway. |
| 41 |
id = resource.Body('id') |
| 42 |
#: The l2 gateway's name. |
| 43 |
name = resource.Body('name') |
| 44 |
#: The ID of the project that owns the l2 gateway. |
| 45 |
project_id = resource.Body('project_id', alias='tenant_id') |
| 46 |
#: Tenant_id (deprecated attribute). |
| 47 |
tenant_id = resource.Body('tenant_id', deprecated=True) |
| 48 |
#: Device name and Interface-names of l2gateway. |
| 49 |
devices = resource.Body('devices') |
| 50 |
|
| 51 |
|
| 52 |
class L2gwConnection(resource.Resource): |
| 53 |
"""L2 Gateway Connection""" |
| 54 |
|
| 55 |
resource_key = 'l2_gateway_connection' |
| 56 |
resources_key = 'l2_gateway_connections' |
| 57 |
base_path = '/l2-gateway-connections' |
| 58 |
|
| 59 |
# capabilities |
| 60 |
allow_create = True |
| 61 |
allow_fetch = True |
| 62 |
allow_commit = False |
| 63 |
allow_delete = True |
| 64 |
allow_list = True |
| 65 |
|
| 66 |
_allow_unknown_attrs_in_body = True |
| 67 |
|
| 68 |
_query_mapping = resource.QueryParameters( |
| 69 |
"sort_key", "sort_dir", |
| 70 |
'name', 'project_id' |
| 71 |
) |
| 72 |
|
| 73 |
# Properties |
| 74 |
#: The ID of the l2 gateway connection. |
| 75 |
id = resource.Body('id') |
| 76 |
#: The ID of the project that owns the l2 gateway connection. |
| 77 |
project_id = resource.Body('project_id', alias='tenant_id') |
| 78 |
#: Tenant_id (deprecated attribute). |
| 79 |
tenant_id = resource.Body('tenant_id', deprecated=True) |
| 80 |
#: The id of the Network to which the l2gw-connection is associated. |
| 81 |
network_id = resource.Body('network_id') |
| 82 |
#: The segmentation id that will be applied to the interfaces. |
| 83 |
segmentation_id = resource.Body('segmentation_id') |
| 84 |
#: The id of the L2gw to which the l2gw-connection is associated. |
| 85 |
l2gw_id = resource.Body('l2gw_id') |