Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
8d1042c
initial nat gateway branche
tischrei Nov 12, 2019
619f3dc
added snat and dnat resource
tischrei Nov 12, 2019
d1cb7bf
dnat and snat proxy functions added
tischrei Nov 12, 2019
d47071b
first running state
tischrei Nov 15, 2019
2e6a1f3
gateway fixed
tischrei Nov 15, 2019
fd2785a
linting corrections
tischrei Nov 15, 2019
27b2a80
Minor changes, tested successfully
tischrei Nov 18, 2019
a060568
unittest nat.test_snat nat.test_dnat and nat.test_gateway added
tischrei Nov 19, 2019
e9cff78
nat changes
tischrei Dec 6, 2019
c77d7f5
pep8 issues
tischrei Dec 6, 2019
c38218f
test_proxy.py added for NAT
tischrei Dec 6, 2019
aecad15
stash status changed and proxy test added
tischrei Dec 6, 2019
6324d17
Adding osclient code for nat
vineet-pruthi Jan 29, 2020
77156ea
Fixed error and adding unit tests for osclient
vineet-pruthi Feb 3, 2020
10544b7
Minor fix in unit test
vineet-pruthi Feb 4, 2020
f057fe9
Adding functional tests for nat_gateway
vineet-pruthi Feb 19, 2020
2018922
Adding osclient code for nat
vineet-pruthi Jan 29, 2020
2b5caf0
Fixed error and adding unit tests for osclient
vineet-pruthi Feb 3, 2020
8e66a41
Minor fix in unit test
vineet-pruthi Feb 4, 2020
fa56667
Adding functional tests for nat_gateway
vineet-pruthi Feb 19, 2020
4a00fcb
Adding some more functional tests for nat
vineet-pruthi Mar 11, 2020
f66fdb7
Updated documentation for NAT
vineet-pruthi Mar 11, 2020
a605a30
Fixed nat.rst erros
vineet-pruthi Mar 11, 2020
97da295
Updated Functional Tests
vineet-pruthi Mar 12, 2020
4abec7a
Usage of project_id in list nat functions query params
vineet-pruthi Mar 16, 2020
0d022ed
Updated nat_gateway_id as keyword arg
vineet-pruthi Mar 16, 2020
253c3ee
remove python2 dependancy from tox
vineet-pruthi Mar 18, 2020
5f561c9
Updated args for show delete and update for NAT
vineet-pruthi Mar 18, 2020
5a6be53
Updated travis.yml to skip py27 and include py37
vineet-pruthi Mar 18, 2020
4b7d7f0
Fixed unit tests with updated args
vineet-pruthi Mar 18, 2020
fe0ac5d
roll back py27 in tox.ini
vineet-pruthi Mar 18, 2020
ed9c3af
Fixed errors and remove nat documentation"
vineet-pruthi Mar 19, 2020
0517d9e
Removed print
vineet-pruthi Mar 20, 2020
3fd73ff
initial nat gateway branche
tischrei Nov 12, 2019
93b54d7
added snat and dnat resource
tischrei Nov 12, 2019
8cec082
first running state
tischrei Nov 15, 2019
74d1dac
gateway fixed
tischrei Nov 15, 2019
86ee358
linting corrections
tischrei Nov 15, 2019
2b2fa0f
Minor changes, tested successfully
tischrei Nov 18, 2019
4a2cdf4
nat changes
tischrei Dec 6, 2019
69c3727
Adding osclient code for nat
vineet-pruthi Jan 29, 2020
1af0e20
Fixed error and adding unit tests for osclient
vineet-pruthi Feb 3, 2020
88b55f9
Minor fix in unit test
vineet-pruthi Feb 4, 2020
e6de105
Adding functional tests for nat_gateway
vineet-pruthi Feb 19, 2020
dabdc97
initial nat gateway branche
tischrei Nov 12, 2019
ef692f0
Adding osclient code for nat
vineet-pruthi Jan 29, 2020
2bd2d3e
Fixed error and adding unit tests for osclient
vineet-pruthi Feb 3, 2020
310b03a
Adding some more functional tests for nat
vineet-pruthi Mar 11, 2020
0ec574f
Updated documentation for NAT
vineet-pruthi Mar 11, 2020
a9329d7
Fixed nat.rst erros
vineet-pruthi Mar 11, 2020
e827fb3
Updated Functional Tests
vineet-pruthi Mar 12, 2020
3cb34ba
Usage of project_id in list nat functions query params
vineet-pruthi Mar 16, 2020
cd0402d
Updated nat_gateway_id as keyword arg
vineet-pruthi Mar 16, 2020
bfc5d25
remove python2 dependancy from tox
vineet-pruthi Mar 18, 2020
895c501
Fixed unit tests with updated args
vineet-pruthi Mar 18, 2020
b37fccb
roll back py27 in tox.ini
vineet-pruthi Mar 18, 2020
6ff8731
Fixed errors and remove nat documentation"
vineet-pruthi Mar 19, 2020
e7a3040
Removed print
vineet-pruthi Mar 20, 2020
6dcdf03
Checkout origin/master otcextensions/sdk/__init__.py
vineet-pruthi Mar 26, 2020
69035ab
Formatting Fixes and raise error if nat gateway not found
vineet-pruthi Mar 27, 2020
2fbadea
Fixed osclient Unit Tests for nat
vineet-pruthi Mar 30, 2020
79312cb
Fixed docstring for nat fakes.py
vineet-pruthi Mar 30, 2020
aa7c5bc
Updated osclient functional tests for nat
vineet-pruthi Apr 2, 2020
aff0dae
Fixes in Functional Tests
vineet-pruthi Apr 2, 2020
20ea6d8
Updated Line breaks for help
vineet-pruthi Apr 2, 2020
508502c
Added multiple delete support
vineet-pruthi Apr 3, 2020
5b791a7
Fixed resource cleanup issue
vineet-pruthi Apr 6, 2020
ff99473
checkout doc/source/cli/index.rst with origin/master
vineet-pruthi Apr 6, 2020
8d187c4
Adding NAT doc
vineet-pruthi Apr 7, 2020
90d66c1
Minor correction
vineet-pruthi Apr 7, 2020
395fd83
Updated functional Tests
vineet-pruthi Apr 13, 2020
ba97371
fix for newer Sphinx
gtema Apr 14, 2020
5e74b90
do not append project_id in the nat service
gtema Apr 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ matrix:
include:
- python: 3.6
env: TOXENV=py36
- python: 3.7
env: TOXENV=py37
- python: 3.6
env: TOXENV=pep8
install: pip install tox
Expand Down
3 changes: 2 additions & 1 deletion doc/source/sdk/proxies/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ Service Proxies
Distributed Message Service (DMS) <dms>
Domain Name Server Service (DNS) <dns>
Key Management Service (KMS) <kms>
Network Address Translation (NAT) <nat>
Object Block Storage (OBS) <obs>
Volume Backup Service (VBS) <volume_backup>
Relational Database Service RDS V1 (RDSv1) <rds_v1>
Relational Database Service RDS V3 (RDS) <rds_v3>
Volume Backup Service (VBS) <volume_backup>

.. _service-proxies:

Expand Down
34 changes: 34 additions & 0 deletions doc/source/sdk/proxies/nat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
NAT API
=======

.. automodule:: otcextensions.sdk.nat.v2._proxy

The Network Address Translation Class
-------------------------------------

The nat high-level interface is available through the ``nat``
member of a :class:`~openstack.connection.Connection` object. The
``nat`` member will only be added if the
``otcextensions.sdk.register_otc_extensions(conn)`` method is called.

Gateway Operations
^^^^^^^^^^^^^^^^^^

.. autoclass:: otcextensions.sdk.nat.v2._proxy.Proxy
:noindex:
:members: gateways, find_gateway,
create_gateway, update_gateway, delete_gateway

SNAT Rule Operations
^^^^^^^^^^^^^^^^^^^^

.. autoclass:: otcextensions.sdk.nat.v2._proxy.Proxy
:noindex:
:members: snat_rules, get_snat_rule, create_snat_rule, delete_snat_rule

DNAT Rule Operations
^^^^^^^^^^^^^^^^^^^^

.. autoclass:: otcextensions.sdk.nat.v2._proxy.Proxy
:noindex:
:members: dnat_rules, get_dnat_rule, create_dnat_rule, delete_dnat_rule
1 change: 1 addition & 0 deletions doc/source/sdk/resources/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Open Telekom Cloud Resources
Distributed Message Service (DMS) <dms/index>
Domain Name Service (DNS) <dns/index>
Key Management Service (KMS) <kms/index>
Network Address Translation (NAT) <nat/index>
Object Block Storage (OBS) <obs/index>
Relational Database Service (RDS) <rds/index>

Expand Down
9 changes: 9 additions & 0 deletions doc/source/sdk/resources/nat/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
NAT Resources
=============

.. toctree::
:maxdepth: 1

v2/gateway
v2/snat
v2/dnat
13 changes: 13 additions & 0 deletions doc/source/sdk/resources/nat/v2/dnat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
otcextensions.sdk.nat.v2.dnat
=============================

.. automodule:: otcextensions.sdk.nat.v2.dnat

The DNAT Rule Class
--------------------

The ``Dnat`` class inherits from
:class:`~otcextensions.sdk.sdk_resource.Resource`.

.. autoclass:: otcextensions.sdk.nat.v2.dnat.Dnat
:members:
13 changes: 13 additions & 0 deletions doc/source/sdk/resources/nat/v2/gateway.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
otcextensions.sdk.nat.v2.gateway
================================

.. automodule:: otcextensions.sdk.nat.v2.gateway

The NAT Gateway Class
----------------------

The ``Gateway`` class inherits from
:class:`~otcextensions.sdk.sdk_resource.Resource`.

.. autoclass:: otcextensions.sdk.nat.v2.gateway.Gateway
:members:
13 changes: 13 additions & 0 deletions doc/source/sdk/resources/nat/v2/snat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
otcextensions.sdk.nat.v2.snat
=============================

.. automodule:: otcextensions.sdk.nat.v2.snat

The SNAT Rule Class
--------------------

The ``Snat`` class inherits from
:class:`~otcextensions.sdk.sdk_resource.Resource`.

.. autoclass:: otcextensions.sdk.nat.v2.snat.Snat
:members:
Empty file.
53 changes: 53 additions & 0 deletions otcextensions/osclient/nat/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
import logging

from osc_lib import utils

from otcextensions import sdk
from otcextensions.i18n import _

LOG = logging.getLogger(__name__)

DEFAULT_API_VERSION = '2'
API_VERSION_OPTION = 'os_nat_api_version'
API_NAME = "nat"
API_VERSIONS = {
"2": "openstack.connection.Connection"
}


def make_client(instance):
"""Returns a rds proxy"""

conn = instance.sdk_connection

if getattr(conn, 'nat', None) is None:
LOG.debug('OTC extensions are not registered. Do that now')
sdk.register_otc_extensions(conn)

LOG.debug('NAT client initialized using OpenStack OTC SDK: %s',
conn.nat)
return conn.nat


def build_option_parser(parser):
"""Hook to add global options"""
parser.add_argument(
'--os-nat-api-version',
metavar='<nat-api-version>',
default=utils.env('OS_NAT_API_VERSION'),
help=_("NAT API version, default=%s "
"(Env: OS_NAT_API_VERSION)") % DEFAULT_API_VERSION
)
return parser
Empty file.
Loading