Skip to content

Commit 3882277

Browse files
authored
Merge pull request #688 from wojtek0806/'ltm_auth'
Adding LTM Auth endpoint
2 parents 8c50cfa + be887a3 commit 3882277

4 files changed

Lines changed: 786 additions & 0 deletions

File tree

f5/bigip/tm/ltm/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030

3131
from f5.bigip.resource import OrganizingCollection
32+
from f5.bigip.tm.ltm.auth import Auth
3233
from f5.bigip.tm.ltm.data_group import Data_Group
3334
from f5.bigip.tm.ltm.ifile import Ifiles
3435
from f5.bigip.tm.ltm.monitor import Monitor
@@ -52,6 +53,7 @@ class Ltm(OrganizingCollection):
5253
def __init__(self, tm):
5354
super(Ltm, self).__init__(tm)
5455
self._meta_data['allowed_lazy_attributes'] = [
56+
Auth,
5557
Data_Group,
5658
Ifiles,
5759
Monitor,

f5/bigip/tm/ltm/auth.py

Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
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+
"""BIG-IP® LTM auth submodule.
18+
19+
REST URI
20+
``http://localhost/mgmt/tm/ltm/auth/``
21+
22+
GUI Path
23+
``Local Traffic --> Profiles --> Authentication``
24+
25+
REST Kind
26+
``tm:ltm:auth:*``
27+
"""
28+
from f5.bigip.mixins import UnsupportedMethod
29+
from f5.bigip.resource import Collection
30+
from f5.bigip.resource import OrganizingCollection
31+
from f5.bigip.resource import Resource
32+
33+
34+
class Auth(OrganizingCollection):
35+
"""BIG-IP® LTM Authentication organizing collection."""
36+
def __init__(self, ltm):
37+
super(Auth, self).__init__(ltm)
38+
self._meta_data['allowed_lazy_attributes'] = [
39+
Crldp_Servers,
40+
Kerberos_Delegations,
41+
Ldaps,
42+
Ocsp_Responders,
43+
Profiles,
44+
Radius_s,
45+
Radius_Servers,
46+
Ssl_Cc_Ldaps,
47+
Ssl_Crldps,
48+
Ssl_Ocsps,
49+
Tacacs_s
50+
]
51+
52+
53+
class Crldp_Servers(Collection):
54+
"""BIG-IP® LTM Auth Crldp Server collection"""
55+
def __init__(self, ltm):
56+
super(Crldp_Servers, self).__init__(ltm)
57+
self._meta_data['allowed_lazy_attributes'] = [Crldp_Server]
58+
self._meta_data['attribute_registry'] =\
59+
{'tm:ltm:auth:crldp-server:crldp-serverstate': Crldp_Server}
60+
61+
62+
class Crldp_Server(Resource):
63+
def __init__(self, crldp_servers):
64+
"""BIG-IP® LTM Auth Crldp Server resource"""
65+
super(Crldp_Server, self).__init__(crldp_servers)
66+
self._meta_data['required_json_kind'] =\
67+
'tm:ltm:auth:crldp-server:crldp-serverstate'
68+
self._meta_data['required_creation_parameters'].update(('host',))
69+
70+
71+
class Kerberos_Delegations(Collection):
72+
"""BIG-IP® LTM Auth Kerberos Delegation collection"""
73+
def __init__(self, ltm):
74+
super(Kerberos_Delegations, self).__init__(ltm)
75+
self._meta_data['allowed_lazy_attributes'] = [Kerberos_Delegation]
76+
self._meta_data['attribute_registry'] =\
77+
{'tm:ltm:auth:kerberos-delegation:kerberos-delegationstate':
78+
Kerberos_Delegation}
79+
80+
81+
class Kerberos_Delegation(Resource):
82+
"""BIG-IP® LTM Auth Kerberos Delegation resource"""
83+
def __init__(self, kerberos_delegations):
84+
super(Kerberos_Delegation, self).__init__(kerberos_delegations)
85+
self._meta_data['required_json_kind'] =\
86+
'tm:ltm:auth:kerberos-delegation:kerberos-delegationstate'
87+
self._meta_data['required_creation_parameters'].update(
88+
('serverPrincipal', 'clientPrincipal',))
89+
90+
91+
class Ldaps(Collection):
92+
"""BIG-IP® LTM Auth Ldap collection"""
93+
def __init__(self, ltm):
94+
super(Ldaps, self).__init__(ltm)
95+
self._meta_data['allowed_lazy_attributes'] = [Ldap]
96+
self._meta_data['attribute_registry'] =\
97+
{'tm:ltm:auth:ldap:ldapstate': Ldap}
98+
99+
100+
class Ldap(Resource):
101+
"""BIG-IP® LTM Auth Ldap resource"""
102+
def __init__(self, ldaps):
103+
super(Ldap, self).__init__(ldaps)
104+
self._meta_data['required_json_kind'] =\
105+
'tm:ltm:auth:ldap:ldapstate'
106+
self._meta_data['required_creation_parameters'].update(('servers',))
107+
108+
109+
class Ocsp_Responders(Collection):
110+
"""BIG-IP® LTM Auth Ocsp Responder collection"""
111+
def __init__(self, ltm):
112+
super(Ocsp_Responders, self).__init__(ltm)
113+
self._meta_data['allowed_lazy_attributes'] = [Ocsp_Responder]
114+
self._meta_data['attribute_registry'] =\
115+
{'tm:ltm:auth:ocsp-responder:ocsp-responderstate': Ocsp_Responder}
116+
117+
118+
class Ocsp_Responder(Resource):
119+
"""BIG-IP® LTM Auth Ocsp Responder resource"""
120+
def __init__(self, ocsp_responders):
121+
super(Ocsp_Responder, self).__init__(ocsp_responders)
122+
self._meta_data['required_json_kind'] =\
123+
'tm:ltm:auth:ocsp-responder:ocsp-responderstate'
124+
125+
126+
class Profiles(Collection):
127+
"""BIG-IP® LTM Auth Profile collection"""
128+
def __init__(self, ltm):
129+
super(Profiles, self).__init__(ltm)
130+
self._meta_data['allowed_lazy_attributes'] = [Profile]
131+
self._meta_data['attribute_registry'] =\
132+
{'tm:ltm:auth:profile:profilestate': Profile}
133+
134+
135+
class Profile(Resource):
136+
"""BIG-IP® LTM Auth Profile resource"""
137+
def __init__(self, profiles):
138+
super(Profile, self).__init__(profiles)
139+
self._meta_data['required_json_kind'] =\
140+
'tm:ltm:auth:profile:profilestate'
141+
self._meta_data['required_creation_parameters'].update(
142+
('defaultsFrom', 'configuration',))
143+
144+
def update(self, **kwargs):
145+
'''Update is not supported for LTM Auth Profiles
146+
147+
:raises: UnsupportedOperation
148+
'''
149+
raise UnsupportedMethod(
150+
"%s does not support the modify method" % self.__class__.__name__
151+
)
152+
153+
154+
class Radius_s(Collection):
155+
"""BIG-IP® LTM Auth Radius collection"""
156+
def __init__(self, ltm):
157+
super(Radius_s, self).__init__(ltm)
158+
self._meta_data['allowed_lazy_attributes'] = [Radius]
159+
self._meta_data['attribute_registry'] =\
160+
{'tm:ltm:auth:radius:radiusstate': Radius}
161+
162+
163+
class Radius(Resource):
164+
"""BIG-IP® LTM Auth Radius resource"""
165+
def __init__(self, radius_s):
166+
super(Radius, self).__init__(radius_s)
167+
self._meta_data['required_json_kind'] =\
168+
'tm:ltm:auth:radius:radiusstate'
169+
170+
171+
class Radius_Servers(Collection):
172+
"""BIG-IP® LTM Auth Radius Server collection"""
173+
def __init__(self, ltm):
174+
super(Radius_Servers, self).__init__(ltm)
175+
self._meta_data['allowed_lazy_attributes'] = [Radius_Server]
176+
self._meta_data['attribute_registry'] =\
177+
{'tm:ltm:auth:radius-server:radius-serverstate': Radius_Server}
178+
179+
180+
class Radius_Server(Resource):
181+
"""BIG-IP® LTM Auth Radius Server resource"""
182+
def __init__(self, radius_server_s):
183+
super(Radius_Server, self).__init__(radius_server_s)
184+
self._meta_data['required_json_kind'] =\
185+
'tm:ltm:auth:radius-server:radius-serverstate'
186+
self._meta_data['required_creation_parameters'].update(
187+
('secret', 'server',))
188+
189+
190+
class Ssl_Cc_Ldaps(Collection):
191+
"""BIG-IP® LTM Auth SSL CC LDAP collection"""
192+
def __init__(self, ltm):
193+
super(Ssl_Cc_Ldaps, self).__init__(ltm)
194+
self._meta_data['allowed_lazy_attributes'] = [Ssl_Cc_Ldap]
195+
self._meta_data['attribute_registry'] =\
196+
{'tm:ltm:auth:ssl-cc-ldap:ssl-cc-ldapstate': Ssl_Cc_Ldap}
197+
198+
199+
class Ssl_Cc_Ldap(Resource):
200+
"""BIG-IP® LTM Auth SSL CC LDAP resource"""
201+
def __init__(self, ssl_cc_ldaps):
202+
super(Ssl_Cc_Ldap, self).__init__(ssl_cc_ldaps)
203+
self._meta_data['required_json_kind'] =\
204+
'tm:ltm:auth:ssl-cc-ldap:ssl-cc-ldapstate'
205+
self._meta_data['required_creation_parameters'].update(
206+
('servers', 'userKey',))
207+
208+
209+
class Ssl_Crldps(Collection):
210+
"""BIG-IP® LTM Auth SSL CLRDP collection"""
211+
def __init__(self, ltm):
212+
super(Ssl_Crldps, self).__init__(ltm)
213+
self._meta_data['allowed_lazy_attributes'] = [Ssl_Crldp]
214+
self._meta_data['attribute_registry'] =\
215+
{'tm:ltm:auth:ssl-crldp:ssl-crldpstate': Ssl_Crldp}
216+
217+
218+
class Ssl_Crldp(Resource):
219+
"""BIG-IP® LTM Auth SSL CLRDP resource"""
220+
def __init__(self, ssl_crldps):
221+
super(Ssl_Crldp, self).__init__(ssl_crldps)
222+
self._meta_data['required_json_kind'] =\
223+
'tm:ltm:auth:ssl-crldp:ssl-crldpstate'
224+
225+
226+
class Ssl_Ocsps(Collection):
227+
"""BIG-IP® LTM Auth SSL OCSP collection"""
228+
def __init__(self, ltm):
229+
super(Ssl_Ocsps, self).__init__(ltm)
230+
self._meta_data['allowed_lazy_attributes'] = [Ssl_Ocsp]
231+
self._meta_data['attribute_registry'] =\
232+
{'tm:ltm:auth:ssl-ocsp:ssl-ocspstate': Ssl_Ocsp}
233+
234+
235+
class Ssl_Ocsp(Resource):
236+
"""BIG-IP® LTM Auth SSL OCSP resource"""
237+
def __init__(self, ssl_ocsps):
238+
super(Ssl_Ocsp, self).__init__(ssl_ocsps)
239+
self._meta_data['required_json_kind'] =\
240+
'tm:ltm:auth:ssl-ocsp:ssl-ocspstate'
241+
242+
243+
class Tacacs_s(Collection):
244+
"""BIG-IP® LTM Auth TACACS+ Server collection"""
245+
def __init__(self, ltm):
246+
super(Tacacs_s, self).__init__(ltm)
247+
self._meta_data['allowed_lazy_attributes'] = [Tacacs]
248+
self._meta_data['attribute_registry'] =\
249+
{'tm:ltm:auth:tacacs:tacacsstate': Tacacs}
250+
251+
252+
class Tacacs(Resource):
253+
"""BIG-IP® LTM Auth TACACS+ Server resource"""
254+
def __init__(self, tacacs_s):
255+
super(Tacacs, self).__init__(tacacs_s)
256+
self._meta_data['required_json_kind'] =\
257+
'tm:ltm:auth:tacacs:tacacsstate'
258+
self._meta_data['required_creation_parameters'].update(
259+
('secret', 'server',))

0 commit comments

Comments
 (0)