Oleksiy Petrenko | e38f5a6 | 2018-11-21 12:58:07 +0200 | [diff] [blame] | 1 | from cinderv3.common import send |
| 2 | |
| 3 | try: |
| 4 | from urllib.parse import urlencode |
| 5 | except ImportError: |
| 6 | from urllib import urlencode |
| 7 | |
Oleksandr Shyshko | 04099ea | 2018-11-22 16:02:52 +0200 | [diff] [blame] | 8 | |
Oleksiy Petrenko | e38f5a6 | 2018-11-21 12:58:07 +0200 | [diff] [blame] | 9 | @send("get") |
| 10 | def volume_list(**kwargs): |
| 11 | """ |
| 12 | Return list of cinder volumes. |
| 13 | """ |
| 14 | url = '/volumes?{}'.format(urlencode(kwargs)) |
| 15 | return url, None |
| 16 | |
| 17 | |
| 18 | @send("get") |
| 19 | def volume_list_get_details(**kwargs): |
| 20 | url = '/volumes/detail?{}'.format(urlencode(kwargs)) |
| 21 | return url, None |
| 22 | |
| 23 | |
| 24 | @send("get") |
| 25 | def volume_type_list(**kwargs): |
| 26 | """ |
| 27 | Return list of volume types |
| 28 | """ |
| 29 | url = '/types?{}'.format(urlencode(kwargs)) |
| 30 | return url, None |
Oleksandr Shyshko | 04099ea | 2018-11-22 16:02:52 +0200 | [diff] [blame] | 31 | |
| 32 | |
| 33 | @send("get") |
| 34 | def service_list(**kwargs): |
| 35 | """ |
| 36 | Return list of Cinder services. |
| 37 | """ |
| 38 | url = '/os-services?{}'.format(urlencode(kwargs)) |
| 39 | return url, None |