Oleksiy Petrenko | a5eb060 | 2018-07-26 15:12:25 +0300 | [diff] [blame^] | 1 | from ironicv1.common import send |
| 2 | try: |
| 3 | from urllib.parse import urlencode |
| 4 | except ImportError: |
| 5 | from urllib import urlencode |
| 6 | |
| 7 | |
| 8 | @send('get') |
| 9 | def chassis_list_details(**kwargs): |
| 10 | url = '/chassis/detail?{}'.format(urlencode(kwargs)) |
| 11 | return url, {} |
| 12 | |
| 13 | |
| 14 | @send('get') |
| 15 | def chassis_get_details(chassis_id, **kwargs): |
| 16 | url = '/chassis/{}?{}'.format(chassis_id, urlencode(kwargs)) |
| 17 | return url, {} |
| 18 | |
| 19 | |
| 20 | @send('patch') |
| 21 | def chassis_update(chassis_id, properties, **kwargs): |
| 22 | url = '/chassis/{}'.format(chassis_id) |
| 23 | return url, {'json': properties} |
| 24 | |
| 25 | |
| 26 | @send('delete') |
| 27 | def chassis_delete(chassis_id, **kwargs): |
| 28 | url = '/chassis/{}'.format(chassis_id) |
| 29 | return url, {} |
| 30 | |
| 31 | |
| 32 | @send('post') |
| 33 | def chassis_create(chassis, **kwargs): |
| 34 | url = '/chassis' |
| 35 | return url, {'json': chassis} |
| 36 | |
| 37 | |
| 38 | @send('get') |
| 39 | def chassis_list(**kwargs): |
| 40 | url = '/chassis?{}'.format(urlencode(kwargs)) |
| 41 | return url, {} |