blob: 9bb71f24dad96fd96844e6db44e5a02a4855112a [file] [log] [blame]
kairat_kushaev5c8626d2018-06-09 18:15:15 +04001try:
2 import os_client_config
3 REQUIREMENTS_MET = True
4except ImportError:
5 REQUIREMENTS_MET = False
kairat_kushaev5c8626d2018-06-09 18:15:15 +04006
Oleksiy Petrenkoe38f5a62018-11-21 12:58:07 +02007from cinderv3 import lists
8from cinderv3 import volumes
9from cinderv3 import volume_types
10from cinderv3 import volume_actions
kairat_kushaev5c8626d2018-06-09 18:15:15 +040011
Oleksiy Petrenkoe38f5a62018-11-21 12:58:07 +020012volume_list = lists.volume_list
13volume_list_get_details = lists.volume_list_get_details
14volume_create = volumes.volume_create
15volume_get_details = volumes.volume_get_details
16volume_update = volumes.volume_update
17volume_delete = volumes.volume_delete
18volume_metadata_create = volumes.volume_metadata_create
19volume_metadata_show = volumes.volume_metadata_show
20volume_metadata_update = volumes.volume_metadata_update
21volume_metadata_show_key = volumes.volume_metadata_show_key
22volume_metadata_delete = volumes.volume_metadata_delete
23volume_metadata_update_key = volumes.volume_metadata_update_key
24volume_type_list = lists.volume_type_list
25volume_type_get_details = volume_types.volume_type_get_details
26volume_type_create = volume_types.volume_type_create
27volume_type_delete = volume_types.volume_type_delete
28keys_volume_type_get = volume_types.keys_volume_type_get
29keys_volume_type_set = volume_types.keys_volume_type_set
30image_upload_volume = volume_actions.image_upload_volume
kairat_kushaev5c8626d2018-06-09 18:15:15 +040031
Oleksiy Petrenkoe38f5a62018-11-21 12:58:07 +020032__all__ = ('volume_list', 'volume_create', 'volume_delete',
33 'volume_get_details', 'volume_list_get_details', 'volume_update',
34 'volume_metadata_create', 'volume_metadata_delete',
35 'volume_metadata_show', 'volume_metadata_show_key',
36 'volume_metadata_update', 'volume_metadata_update_key',
37 'volume_type_list', 'volume_type_get_details',
kairat_kushaev5c8626d2018-06-09 18:15:15 +040038 'volume_type_create', 'keys_volume_type_get',
Oleksiy Petrenkoe38f5a62018-11-21 12:58:07 +020039 'keys_volume_type_set', 'volume_type_delete',
40 'image_upload_volume',)
kairat_kushaev5c8626d2018-06-09 18:15:15 +040041
42
43def __virtual__():
44 if REQUIREMENTS_MET:
45 return 'cinderv3'
46 else:
47 return False, ("The cinderv3 execution module cannot be loaded: "
48 "os_client_config are unavailable.")