Skip to content

Commit f2d4639

Browse files
adding natgw v3 proxy (#594)
adding natgw v3 proxy Reviewed-by: Anton Sidelnikov
1 parent e38c238 commit f2d4639

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

otcextensions/sdk/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@
267267
'nat': {
268268
'service_type': 'nat',
269269
},
270+
'natv3': {
271+
'service_type': 'natv3',
272+
'endpoint_service_type': 'natv3'
273+
},
270274
'obs': {
271275
'service_type': 'obs',
272276
'require_ak': True,

otcextensions/sdk/natv3/__init__.py

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
2+
# not use this file except in compliance with the License. You may obtain
3+
# a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10+
# License for the specific language governing permissions and limitations
11+
# under the License.
12+
13+
from openstack import service_description
14+
15+
from otcextensions.sdk.natv3.v3 import _proxy
16+
17+
18+
class Natv3Service(service_description.ServiceDescription):
19+
"""The Private Nat Gateway service."""
20+
21+
supported_versions = {
22+
'3': _proxy.Proxy
23+
}

otcextensions/sdk/natv3/v3/__init__.py

Whitespace-only changes.

otcextensions/sdk/natv3/v3/_proxy.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
2+
# not use this file except in compliance with the License. You may obtain
3+
# a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10+
# License for the specific language governing permissions and limitations
11+
# under the License.
12+
from openstack import proxy
13+
14+
from otcextensions.common.utils import extract_url_parts
15+
16+
17+
class Proxy(proxy.Proxy):
18+
19+
skip_discovery = True
20+
21+
def _extract_name(self, url, service_type=None, project_id=None):
22+
return extract_url_parts(url, project_id)

0 commit comments

Comments
 (0)