-
Notifications
You must be signed in to change notification settings - Fork 135
/
fdb.py
85 lines (69 loc) · 2.87 KB
/
fdb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# coding=utf-8
#
# Copyright 2016 F5 Networks Inc.
#
# 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.
#
"""Directory: net module: fdb.
REST URI
``https://localhost/mgmt/tm/net/fdb``
GUI Path
``XXX``
REST Kind
``tm:net:fdb:*``
"""
from f5.bigip.resource import Collection
from f5.bigip.resource import OrganizingCollection
from f5.bigip.resource import Resource
class Fdb(OrganizingCollection):
"""BIG-IP® FDB collection."""
def __init__(self, net):
super(Fdb, self).__init__(net)
self._meta_data['allowed_lazy_attributes'] = [Tunnels]
# self._meta_data['icontrol_version'] = '11.5.0'
class Tunnel(Resource):
"""BIG-IP® Tunnel resource."""
def __init__(self, Tunnels):
super(Tunnel, self).__init__(Tunnels)
self._meta_data['required_json_kind'] = "tm:net:fdb:tunnel:tunnelstate"
self._meta_data['attribute_registry'] = {
'tm:net:fdb:tunnel:records:recordscollectionstate': Records_s}
# Setting this here to be explicit, even though it is set via
# the super call from its containing object.
# self._meta_data['icontrol_version'] = '11.5.0'
class Tunnels(Collection):
"""BIG-IP® Tunnels collection."""
def __init__(self, fdb):
super(Tunnels, self).__init__(fdb)
self._meta_data['allowed_lazy_attributes'] = [Tunnel]
self._meta_data['attribute_registry'] =\
{'tm:net:fdb:tunnel:tunnelstate': Tunnel}
# Setting this here to be explicit, even though it is set via
# the super call from its containing object.
# self._meta_data['icontrol_version'] = '11.5.0'
class Records_s(Collection):
"""BIG-IP® Tunnel records collection."""
def __init__(self, tunnel):
super(Records_s, self).__init__(tunnel)
self._meta_data['allowed_lazy_attributes'] = [Records]
self._meta_data['required_json_kind'] =\
'tm:net:fdb:tunnel:records:recordscollectionstate'
self._meta_data['attribute_registry'] =\
{'tm:net:fdb:tunnel:records:recordsstate': Records}
class Records(Resource):
"""BIG-IP® LTM pool members sub-collection resource"""
def __init__(self, records_s):
super(Records, self).__init__(records_s)
self._meta_data['required_json_kind'] =\
'tm:net:fdb:tunnel:records:recordsstate'
self._meta_data['required_creation_parameters'].update(('name',))