blob: 1f929b2859b78d14285f5df315de66146111563f [file] [log] [blame]
Vasyl Saienko4eda4f22018-04-26 19:30:39 +03001try:
2 import os_client_config # noqa
3 from keystoneauth1 import exceptions as ka_exceptions # noqa
4 REQUIREMENTS_MET = True
5except ImportError:
6 REQUIREMENTS_MET = False
7
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +03008from keystonev3 import lists
Vasyl Saienko4eda4f22018-04-26 19:30:39 +03009from keystonev3 import endpoints
10from keystonev3 import roles
11from keystonev3 import services
12from keystonev3 import projects
13from keystonev3 import users
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030014from keystonev3 import domains
15from keystonev3 import regions
16from keystonev3 import groups
17
18
19domain_list = lists.domain_list
20domain_create = domains.domain_create
21domain_update = domains.domain_update
22domain_get_details = domains.domain_get_details
23domain_delete = domains.domain_delete
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030024
25endpoint_get_details = endpoints.endpoint_get_details
26endpoint_update = endpoints.endpoint_update
27endpoint_delete = endpoints.endpoint_delete
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030028endpoint_list = lists.endpoint_list
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030029endpoint_create = endpoints.endpoint_create
30
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030031role_assignment_list = lists.role_assignment_list
32role_assign_for_user_on_project = roles.role_assign_for_user_on_project
33role_assign_for_user_on_domain = roles.role_assign_for_user_on_domain
34role_unassign_for_user_on_project = roles.role_unassign_for_user_on_project
35role_unassign_for_user_on_domain = roles.role_unassign_for_user_on_domain
36role_assign_check_for_user_on_project = roles.\
37 role_assign_check_for_user_on_project
38role_assign_check_for_user_on_domain = roles.\
39 role_assign_check_for_user_on_domain
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030040role_get_details = roles.role_get_details
41role_update = roles.role_update
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030042role_list = lists.role_list
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030043role_create = roles.role_create
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030044role_delete = roles.role_delete
45
46role_inference_rule_list = lists.role_inference_rule_list
47role_inference_rule_for_role_list = roles.role_inference_rule_for_role_list
48role_inference_rule_create = roles.role_inference_rule_create
49role_inference_rule_get = roles.role_inference_rule_get
50role_inference_rule_confirm = roles.role_inference_rule_confirm
51role_inference_rule_delete = roles.role_inference_rule_delete
52
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030053
54service_get_details = services.service_get_details
55service_update = services.service_update
56service_delete = services.service_delete
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030057service_list = lists.service_list
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030058service_create = services.service_create
59
60project_get_details = projects.project_get_details
61project_update = projects.project_update
62project_delete = projects.project_delete
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030063project_list = lists.project_list
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030064project_create = projects.project_create
65
66user_get_details = users.user_get_details
67user_update = users.user_update
68user_delete = users.user_delete
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030069user_list = lists.user_list
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030070user_create = users.user_create
71
72
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030073region_list = lists.region_list
74region_create = regions.region_create
75region_get_details = regions.region_get_details
76region_update = regions.region_update
77region_delete = regions.region_delete
78
79group_list = lists.group_list
80group_create = groups.group_create
81group_get_details = groups.group_get_details
82group_update = groups.group_update
83group_delete = groups.group_delete
84group_user_list = groups.group_user_list
85group_user_add = groups.group_user_add
86group_user_check = groups.group_user_check
87group_user_remove = groups.group_user_remove
88
89
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030090__all__ = (
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030091 'domain_list',
92 'domain_create',
93 'domain_get_details',
94 'domain_update',
95 'domain_delete',
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030096 'endpoint_get_details',
97 'endpoint_update',
98 'endpoint_delete',
99 'endpoint_list',
100 'endpoint_create',
101 'role_assignment_list',
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +0300102 'role_assign_for_user_on_project',
103 'role_assign_for_user_on_domain',
104 'role_assign_check_for_user_on_domain',
105 'role_assign_check_for_user_on_project',
106 'role_unassign_for_user_on_domain',
107 'role_unassign_for_user_on_project',
Vasyl Saienko4eda4f22018-04-26 19:30:39 +0300108 'role_get_details',
109 'role_update',
110 'role_delete',
111 'role_list',
112 'role_create',
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +0300113 'role_inference_rule_confirm',
114 'role_inference_rule_create',
115 'role_inference_rule_delete',
116 'role_inference_rule_for_role_list',
117 'role_inference_rule_get',
118 'role_inference_rule_list',
Vasyl Saienko4eda4f22018-04-26 19:30:39 +0300119 'service_get_details',
120 'service_update',
121 'service_delete',
122 'service_list',
123 'service_create',
124 'project_get_details',
125 'project_update',
126 'project_delete',
127 'project_list',
128 'project_create',
129 'user_get_details',
130 'user_update',
131 'user_delete',
132 'user_list',
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +0300133 'user_create',
134 'region_create',
135 'region_delete',
136 'region_get_details',
137 'region_list',
138 'region_update',
139 'group_list',
140 'group_create',
141 'group_delete',
142 'group_get_details',
143 'group_update',
144 'group_user_add',
145 'group_user_check',
146 'group_user_list',
147 'group_user_remove',
Vasyl Saienko4eda4f22018-04-26 19:30:39 +0300148)
149
150
151def __virtual__():
152 """Only load keystonev3 if requirements are available."""
153 if REQUIREMENTS_MET:
154 return 'keystonev3'
155 else:
156 return False, ("The keystonev3 execution module cannot be loaded: "
157 "os_client_config or keystoneauth are unavailable.")