blob: 021d535ce5a7bf0be5d5535a512bb7fb83e0b64a [file] [log] [blame]
Vyacheslav Struk3f529d42019-06-13 13:37:25 +03001from neutronv2.common import send
2from neutronv2.arg_converter import get_by_name_or_uuid_multiple
3
4try:
5 from urllib.parse import urlencode
6except ImportError:
7 from urllib import urlencode
8
9
10@send('delete')
11def 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')
18def 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}