|
| 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