Skip to content

Commit 97f63f9

Browse files
committed
added data-group skeleton and updated init
1 parent 9f5c086 commit 97f63f9

2 files changed

Lines changed: 61 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.data_group import Data_Groups
3233
from f5.bigip.tm.ltm.monitor import Monitor
3334
from f5.bigip.tm.ltm.nat import Nats
3435
from f5.bigip.tm.ltm.node import Nodes
@@ -49,6 +50,7 @@ class Ltm(OrganizingCollection):
4950
def __init__(self, tm):
5051
super(Ltm, self).__init__(tm)
5152
self._meta_data['allowed_lazy_attributes'] = [
53+
Data_Groups,
5254
Monitor,
5355
Nats,
5456
Nodes,

f5/bigip/tm/ltm/data_group.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 data-group submodule.
18+
19+
REST URI
20+
``http://localhost/mgmt/tm/ltm/data-group/``
21+
22+
GUI Path
23+
``Local Traffic --> iRules --> Data Group List``
24+
25+
REST Kind
26+
``tm:ltm:data-group*``
27+
"""
28+
29+
from f5.bigip.resource import OrganizingCollection
30+
from f5.bigip.resource import Collection
31+
from f5.bigip.resource import Resource
32+
33+
34+
class Data_Groups(OrganizingCollection):
35+
def __init__(self, ltm):
36+
super(Data_Groups, self).__init__(ltm)
37+
self._meta_data['allowed_lazy_attributes'] = [
38+
Internals,
39+
Internal
40+
]
41+
42+
43+
class Internals(Collection):
44+
def __init__(self, data_groups):
45+
super(Internals, self).__init__(data_groups)
46+
self._meta_data['allowed_lazy_attributes'] = [Internal]
47+
self._meta_data['required_json_kind'] = u'tm:ltm:data-group:internal:internalcollectionstate'
48+
self._meta_data['attribute_registry'] = {u'tm:ltm:data-group:internal:internalstate': Internal}
49+
self._meta_data['uri'] = self._meta_data['uri'].replace('_', '-')
50+
51+
52+
class Internal(Resource):
53+
def __init__(self, internals):
54+
super(Internal, self).__init__(internals)
55+
self._meta_data['required_json_kind'] = u'tm:ltm:data-group:internal:internalstate'
56+
self._meta_data['required_creation_parameters'].create('name', 'type', 'records')
57+
58+
59+

0 commit comments

Comments
 (0)