|
| 1 | +# coding=utf-8 |
| 2 | +# |
| 3 | +# Copyright 2021 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®) cipher module. |
| 19 | +
|
| 20 | +REST URI |
| 21 | + ``http://localhost/mgmt/tm/ltm/cipher`` |
| 22 | +
|
| 23 | +GUI Path |
| 24 | + ``Local Traffic --> Ciphers`` |
| 25 | +
|
| 26 | +REST Kind |
| 27 | + ``tm:ltm:cipher:*`` |
| 28 | +""" |
| 29 | + |
| 30 | +from f5.bigip.resource import Collection |
| 31 | +from f5.bigip.resource import OrganizingCollection |
| 32 | +from f5.bigip.resource import Resource |
| 33 | + |
| 34 | + |
| 35 | +class Cipher(OrganizingCollection): |
| 36 | + """BIG-IP® LTM cipher collection""" |
| 37 | + def __init__(self, ltm): |
| 38 | + super(Cipher, self).__init__(ltm) |
| 39 | + self._meta_data['allowed_lazy_attributes'] = [ |
| 40 | + Rules, |
| 41 | + Groups |
| 42 | + ] |
| 43 | + |
| 44 | + |
| 45 | +class Rules(Collection): |
| 46 | + """BIG-IP® cipher rule sub-collection""" |
| 47 | + def __init__(self, cipher): |
| 48 | + super(Rules, self).__init__(cipher) |
| 49 | + self._meta_data['allowed_lazy_attributes'] = [Rule] |
| 50 | + self._meta_data['attribute_registry'] =\ |
| 51 | + {'tm:ltm:cipher:rule:rulestate': Rule} |
| 52 | + |
| 53 | + |
| 54 | +class Rule(Resource): |
| 55 | + """BIG-IP® cipher rule sub-collection resource""" |
| 56 | + def __init__(self, rule_s): |
| 57 | + super(Rule, self).__init__(rule_s) |
| 58 | + self._meta_data['required_creation_parameters'].update(('partition',)) |
| 59 | + self._meta_data['required_json_kind'] =\ |
| 60 | + 'tm:ltm:cipher:rule:rulestate' |
| 61 | + |
| 62 | + |
| 63 | +class Groups(Collection): |
| 64 | + """BIG-IP® cipher group sub-collection""" |
| 65 | + def __init__(self, cipher): |
| 66 | + super(Groups, self).__init__(cipher) |
| 67 | + self._meta_data['allowed_lazy_attributes'] = [Group] |
| 68 | + self._meta_data['attribute_registry'] =\ |
| 69 | + {'tm:ltm:cipher:group:groupstate': Group} |
| 70 | + |
| 71 | + |
| 72 | +class Group(Resource): |
| 73 | + """BIG-IP® cipher group sub-collection resource""" |
| 74 | + def __init__(self, group_s): |
| 75 | + super(Group, self).__init__(group_s) |
| 76 | + self._meta_data['required_creation_parameters'].update(('partition',)) |
| 77 | + self._meta_data['required_json_kind'] =\ |
| 78 | + 'tm:ltm:cipher:group:groupstate' |
0 commit comments