|
| 1 | +# coding=utf-8 |
| 2 | +# |
| 3 | +# Copyright 2017 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® auth module |
| 19 | +
|
| 20 | +REST URI |
| 21 | + ``http://localhost/mgmt/tm/auth/remote-role`` |
| 22 | +
|
| 23 | +GUI Path |
| 24 | + ``System --> Users --> Remote Role Groups`` |
| 25 | +
|
| 26 | +REST Kind |
| 27 | + ``tm:auth:remote-role:*`` |
| 28 | +""" |
| 29 | + |
| 30 | +from f5.bigip.resource import Collection |
| 31 | +from f5.bigip.resource import Resource |
| 32 | +from f5.bigip.resource import UnnamedResource |
| 33 | +from f5.sdk_exception import UnsupportedOperation |
| 34 | + |
| 35 | + |
| 36 | +class Remote_Role(UnnamedResource): |
| 37 | + """BIG-IP® auth remote role resource""" |
| 38 | + def __init__(self, auth): |
| 39 | + super(Remote_Role, self).__init__(auth) |
| 40 | + self._meta_data['allowed_lazy_attributes'] = [Role_Infos] |
| 41 | + self._meta_data['required_json_kind'] = \ |
| 42 | + 'tm:auth:remote-role:remote-rolestate' |
| 43 | + self._meta_data['attribute_registry'] = \ |
| 44 | + {'tm:auth:remote-role:role-info:role-infocollectionstate': Role_Infos} |
| 45 | + |
| 46 | + |
| 47 | +class Role_Infos(Collection): |
| 48 | + """BIG-IP® remote role role-info collection""" |
| 49 | + def __init__(self, auth): |
| 50 | + super(Role_Infos, self).__init__(auth) |
| 51 | + self._meta_data['allowed_lazy_attributes'] = [Role_Info] |
| 52 | + self._meta_data['required_json_kind'] = \ |
| 53 | + 'tm:auth:remote-role:role-info:role-infocollectionstate' |
| 54 | + self._meta_data['attribute_registry'] = \ |
| 55 | + {'tm:auth:remote-role:role-info:role-infostate': Role_Info} |
| 56 | + |
| 57 | + |
| 58 | +class Role_Info(Resource): |
| 59 | + """BIG-IP® remote role role-info resource""" |
| 60 | + def __init__(self, role_infos): |
| 61 | + super(Role_Info, self).__init__(role_infos) |
| 62 | + self._meta_data['required_json_kind'] = \ |
| 63 | + 'tm:auth:remote-role:role-info:role-infostate' |
| 64 | + |
| 65 | + def update(self, **kwargs): |
| 66 | + '''Update is not supported for Auth Remote Role - Role Info Objects |
| 67 | +
|
| 68 | + :raises: UnsupportedOperation |
| 69 | + ''' |
| 70 | + raise UnsupportedOperation( |
| 71 | + "%s does not support update, use modify instead" % self.__class__.__name__ |
| 72 | + ) |
0 commit comments