|
| 1 | +# coding=utf-8 |
| 2 | +# |
| 3 | +# Copyright 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 | + |
| 18 | +"""BIG-IP® system host-info module |
| 19 | +
|
| 20 | +REST URI |
| 21 | + ``http://localhost/mgmt/tm/sys/service`` |
| 22 | +
|
| 23 | +GUI Path |
| 24 | + N/A |
| 25 | +
|
| 26 | +REST Kind |
| 27 | + ``tm:sys:service:*`` |
| 28 | +""" |
| 29 | + |
| 30 | +from f5.bigip.mixins import CommandExecutionMixin |
| 31 | +from f5.bigip.resource import OrganizingCollection |
| 32 | +from f5.bigip.resource import UnnamedResource |
| 33 | +from f5.sdk_exception import UnsupportedMethod |
| 34 | + |
| 35 | + |
| 36 | +class Service(OrganizingCollection): |
| 37 | + def __init__(self, sys): |
| 38 | + super(Service, self).__init__(sys) |
| 39 | + self._meta_data['allowed_lazy_attributes'] = [Tmm] |
| 40 | + |
| 41 | + |
| 42 | +class Tmm(UnnamedResource, |
| 43 | + CommandExecutionMixin): |
| 44 | + """BIG-IP® system tmm service |
| 45 | +
|
| 46 | + .. note:: |
| 47 | + This is an unnamed resource so it has not ~Partition~Name pattern |
| 48 | + at the end of its URI. |
| 49 | + """ |
| 50 | + def __init__(self, service): |
| 51 | + super(Tmm, self).__init__(service) |
| 52 | + self._meta_data['allowed_commands'].append('restart') |
| 53 | + self._meta_data['minimum_version'] = '13.0.0' |
| 54 | + self._meta_data['required_json_kind'] =\ |
| 55 | + 'tm:sys:service:servicestate' |
| 56 | + |
| 57 | + def update(self, **kwargs): |
| 58 | + """Update is not supported |
| 59 | +
|
| 60 | + :raises: UnsupportedMethod |
| 61 | + """ |
| 62 | + raise UnsupportedMethod( |
| 63 | + "%s does not support the update method" % self.__class__.__name__ |
| 64 | + ) |
| 65 | + |
| 66 | + def modify(self, **kwargs): |
| 67 | + """Update is not supported |
| 68 | +
|
| 69 | + :raises: UnsupportedMethod |
| 70 | + """ |
| 71 | + raise UnsupportedMethod( |
| 72 | + "%s does not support the modify method" % self.__class__.__name__ |
| 73 | + ) |
0 commit comments