Vyacheslav Struk | 3f529d4 | 2019-06-13 13:37:25 +0300 | [diff] [blame^] | 1 | from neutronv2.common import send |
| 2 | from neutronv2.arg_converter import get_by_name_or_uuid_multiple |
| 3 | |
| 4 | try: |
| 5 | from urllib.parse import urlencode |
| 6 | except ImportError: |
| 7 | from urllib import urlencode |
| 8 | |
| 9 | |
| 10 | @send('delete') |
| 11 | def rbac_policies_delete(id): |
| 12 | url = '/rbac-policies/{}'.format(id) |
| 13 | return url, {} |
| 14 | |
| 15 | |
| 16 | @get_by_name_or_uuid_multiple([('network', 'object_id')]) |
| 17 | @send('post') |
| 18 | def rbac_policies_create(object_id,**kwargs): |
| 19 | |
| 20 | url = '/rbac-policies' |
| 21 | kwargs.update({'object_type': 'network'}) |
| 22 | kwargs.update({'object_id': object_id}) |
| 23 | json = { |
| 24 | 'rbac_policy': kwargs, |
| 25 | } |
| 26 | |
| 27 | return url, {'json': json} |