Oleksiy Petrenko | e03e2c7 | 2018-08-10 13:24:32 +0300 | [diff] [blame] | 1 | from keystonev3.common import send |
| 2 | from keystonev3.arg_converter import get_by_name_or_uuid_multiple |
| 3 | |
| 4 | |
| 5 | @send('post') |
| 6 | def domain_create(name, **kwargs): |
| 7 | url = '/domains' |
| 8 | json = { |
| 9 | 'domain': kwargs, |
| 10 | } |
| 11 | json['domain']['name'] = name |
| 12 | return url, json |
| 13 | |
| 14 | |
| 15 | @get_by_name_or_uuid_multiple([('domain', 'domain_id')]) |
| 16 | @send('get') |
| 17 | def domain_get_details(domain_id, **kwargs): |
| 18 | url = '/domains/{}'.format(domain_id) |
| 19 | return url, None |
| 20 | |
| 21 | |
| 22 | @get_by_name_or_uuid_multiple([('domain', 'domain_id')]) |
| 23 | @send('patch') |
| 24 | def domain_update(domain_id, **kwargs): |
| 25 | url = '/domains/{}'.format(domain_id) |
| 26 | json = { |
| 27 | 'domain': kwargs, |
| 28 | } |
| 29 | return url, json |
| 30 | |
| 31 | |
| 32 | @get_by_name_or_uuid_multiple([('domain', 'domain_id')]) |
| 33 | @send('delete') |
| 34 | def domain_delete(domain_id, **kwargs): |
| 35 | url = '/domains/{}'.format(domain_id) |
| 36 | return url, None |