Skip to content

Commit 81ca562

Browse files
PrashantSunkaricaphrim007
authored andcommitted
Fixes #1317: BIGIP> Add support for lsnpool (CGNAT) (#1321)
* Fixes #1317 Problem: Add support for lsnpool(CGNAT) Analysis: Added two things: - LSN log profile collection and resource + corresponding tests - Add missing ALG profile - IPsecALG Tests: - Added functional tests for lsnpool and lsn log profile - Test results against BIGIP with 14.0.0 build cmd: py.test test_lsnpool.py --ignore=f5/ --bigip=172.27.77.41 -vs test_lsnpool.py::TestLSNPool::test_create_no_args PASSED test_lsnpool.py::TestLSNPool::test_create PASSED test_lsnpool.py::TestLSNPool::test_create_with_logProfile_without_logPub PASSED test_lsnpool.py::TestLSNPool::test_create_with_logProfile PASSED test_lsnpool.py::TestLSNPool::test_refresh PASSED test_lsnpool.py::TestLSNPool::test_update PASSED test_lsnpool.py::TestLSNPool::test_exists PASSED test_lsnpool.py::TestLSNPool::test_stats PASSED test_lsnpool.py::TestLSNPool::test_create_with_nondefault_mode PASSED test_lsnpool.py::TestLSNPool::test_create_with_invalid_mode PASSED test_lsnpool.py::TestLSNPool::test_create_with_member PASSED test_lsnpool.py::TestLSNPool::test_virtual_with_pool PASSED test_lsnpool.py::TestLSNPool::test_collection PASSED test_lsnpool.py::TestLSNPoolLogProfile::test_create_no_args PASSED test_lsnpool.py::TestLSNPoolLogProfile::test_create PASSED test_lsnpool.py::TestLSNPoolLogProfile::test_update PASSED test_lsnpool.py::TestLSNPoolLogProfile::test_exists PASSED * Issues: Fixes #1317 Problem: Fixing CI pipeline failures Analysis: Added following things: - Fixed test cases failures on 11.5.4 - Fixed the flake8 issues - Added unit tests Tests: -Ran functional and unit tests against 11.5.4, 11.6.1, 12.0.0, 14.0.0 * Fixes #1317 Problem: 11.6.0 : Fixing CI pipeline failures Analysis: - LSN pool Stats functional test is fixed - 'Flake8 f5' failures are addressed - Syntax error corrected. Tests: -Ran functional and unit tests against 11.6.0. Tests passing now. * Fixes #1317 Problem: Fixing flake8 failures in python3 Analysis: - cmd: sed -i sed 's/\r$//' <file_name> - Ref: [H903] Use only UNIX style newlines (``n``), not Windows style (``rn``) Tests: -Ran functional and unit tests. * Fixes #1317 Problem: Addressing review comments Analysis: - Addressing review comments Tests: - Ran functional and unit tests. - Ran flake8 f5
1 parent 3d54d93 commit 81ca562

6 files changed

Lines changed: 495 additions & 3 deletions

File tree

f5/bigip/tm/ltm/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# coding=utf-8
1+
# coding=utf-8
22
#
33
# Copyright 2015-2016 F5 Networks Inc.
44
#
@@ -33,6 +33,8 @@
3333
from f5.bigip.tm.ltm.data_group import Data_Group
3434
from f5.bigip.tm.ltm.default_node_monitor import Default_Node_Monitor
3535
from f5.bigip.tm.ltm.ifile import Ifiles
36+
from f5.bigip.tm.ltm.lsn_pools import LSN_Log_Profiles
37+
from f5.bigip.tm.ltm.lsn_pools import LSN_Pools
3638
from f5.bigip.tm.ltm.monitor import Monitor
3739
from f5.bigip.tm.ltm.nat import Nats
3840
from f5.bigip.tm.ltm.node import Nodes
@@ -58,6 +60,8 @@ def __init__(self, tm):
5860
Data_Group,
5961
Default_Node_Monitor,
6062
Ifiles,
63+
LSN_Log_Profiles,
64+
LSN_Pools,
6165
Monitor,
6266
Nats,
6367
Nodes,

f5/bigip/tm/ltm/lsn_pools.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# coding=utf-8
2+
#
3+
# Copyright 2014-2016 F5 Networks Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
"""BIG-IP® Local Traffic Manager™ (LTM®) LSN pool module.
19+
20+
REST URI
21+
``http://localhost/mgmt/tm/ltm/lsn-pool``
22+
``http://localhost/mgmt/tm/ltm/lsn-log-profile``
23+
24+
GUI Path
25+
``Carrier Grade NAT --> LSN Pools``
26+
``Carrier Grade NAT --> Logging Profiles --> LSN``
27+
28+
REST Kind
29+
``tm:ltm:lsn-pool:*``
30+
``tm:ltm:lsn-log-profile:*``
31+
"""
32+
33+
34+
from f5.bigip.resource import Collection
35+
from f5.bigip.resource import Resource
36+
37+
38+
class LSN_Pools(Collection):
39+
"""BIG-IP® LTM LSN pool collection"""
40+
def __init__(self, ltm):
41+
super(LSN_Pools, self).__init__(ltm)
42+
self._meta_data['allowed_lazy_attributes'] = [LSN_Pool]
43+
self._meta_data['attribute_registry'] =\
44+
{'tm:ltm:lsn-pool:lsn-poolstate': LSN_Pool}
45+
46+
47+
class LSN_Pool(Resource):
48+
"""BIG-IP® LTM LSN pool resource"""
49+
def __init__(self, lsnpool_s):
50+
super(LSN_Pool, self).__init__(lsnpool_s)
51+
self._meta_data['required_json_kind'] = 'tm:ltm:lsn-pool:lsn-poolstate'
52+
self._meta_data['allowed_lazy_attributes'] = [LSN_Log_Profile]
53+
self._meta_data['attribute_registry'] = {
54+
'tm:ltm:lsn-log-profile:lsn-log-profilestate': LSN_Log_Profile}
55+
56+
57+
class LSN_Log_Profiles(Collection):
58+
"""BIG-IP® LTM LSN pool log profile collection"""
59+
def __init__(self, profile):
60+
super(LSN_Log_Profiles, self).__init__(profile)
61+
self._meta_data['allowed_lazy_attributes'] = [LSN_Log_Profile]
62+
self._meta_data['required_json_kind'] = (
63+
'tm:ltm:lsn-log-profile:lsn-log-profilecollectionstate')
64+
self._meta_data['attribute_registry'] = \
65+
{'tm:ltm:lsn-log-profile:lsn-log-profilestate': LSN_Log_Profile}
66+
self._meta_data['minimum_version'] = '11.6.0'
67+
68+
69+
class LSN_Log_Profile(Resource):
70+
"""BIG-IP® LTM LSN pool log profile resource"""
71+
def __init__(self, LSNLogProfile_s):
72+
super(LSN_Log_Profile, self).__init__(LSNLogProfile_s)
73+
self._meta_data['required_json_kind'] = (
74+
'tm:ltm:lsn-log-profile:lsn-log-profilestate')

f5/bigip/tm/ltm/profile.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def __init__(self, ltm):
6060
Icaps,
6161
Iiops,
6262
Ipothers,
63+
Ipsecalgs,
6364
Mblbs,
6465
Mssqls,
6566
Ntlms,
@@ -545,6 +546,24 @@ def __init__(self, Ipothers):
545546
'tm:ltm:profile:ipother:ipotherstate'
546547

547548

549+
class Ipsecalgs(Collection):
550+
"""BIG-IP® IPsecALG profile collection."""
551+
def __init__(self, profile):
552+
super(Ipsecalgs, self).__init__(profile)
553+
self._meta_data['allowed_lazy_attributes'] = [Ipsecalg]
554+
self._meta_data['attribute_registry'] = \
555+
{'tm:ltm:profile:ipsecalg:ipsecalgstate': Ipsecalg}
556+
self._meta_data['minimum_version'] = '13.0.0'
557+
558+
559+
class Ipsecalg(Resource):
560+
"""BIG-IP® IPsecALG resource."""
561+
def __init__(self, Ipsecalgs):
562+
super(Ipsecalg, self).__init__(Ipsecalgs)
563+
self._meta_data['required_json_kind'] = \
564+
'tm:ltm:profile:ipsecalg:ipsecalgstate'
565+
566+
548567
class Mblbs(Collection):
549568
"""BIG-IP® Mblb profile collection."""
550569
def __init__(self, profile):

0 commit comments

Comments
 (0)