Improve cinderv3 module and states
Add states and modules for volumes
and unify volume_type states and modules
Change-Id: I23cc715df696c828e7f7b53d5c4c85b146d93417
Closes-Issue: PROD-25036 (PROD:25036)
diff --git a/_modules/cinderv3/volume_actions.py b/_modules/cinderv3/volume_actions.py
new file mode 100644
index 0000000..35697c6
--- /dev/null
+++ b/_modules/cinderv3/volume_actions.py
@@ -0,0 +1,20 @@
+from cinderv3.common import send
+from cinderv3.arg_converter import get_by_name_or_uuid_multiple
+
+try:
+ from urllib.parse import urlencode
+except ImportError:
+ from urllib import urlencode
+
+
+@get_by_name_or_uuid_multiple([('volume', 'volume_id')])
+@send('post')
+def image_upload_volume(volume_id, image_name, **kwargs):
+ url = '/volumes/{}/action'.format(volume_id)
+ json = {
+ 'os-volume_upload_image': {
+ 'image_name': image_name,
+ }
+ }
+ json['os-volume_upload_image'].update(kwargs)
+ return url, json