Add role inference calls, domains
Also rework get_by_name_or_uuid method to work with multiple keys
and add get_by_name_or_uuid decorator for role assign, unassgin and check.
Change-Id: I808ce0c1aa1a7231875256ae6f22e986d78f8f00
Related-Issue: PROD-21388
diff --git a/_modules/keystonev3/domains.py b/_modules/keystonev3/domains.py
new file mode 100644
index 0000000..d594f05
--- /dev/null
+++ b/_modules/keystonev3/domains.py
@@ -0,0 +1,36 @@
+from keystonev3.common import send
+from keystonev3.arg_converter import get_by_name_or_uuid_multiple
+
+
+@send('post')
+def domain_create(name, **kwargs):
+ url = '/domains'
+ json = {
+ 'domain': kwargs,
+ }
+ json['domain']['name'] = name
+ return url, json
+
+
+@get_by_name_or_uuid_multiple([('domain', 'domain_id')])
+@send('get')
+def domain_get_details(domain_id, **kwargs):
+ url = '/domains/{}'.format(domain_id)
+ return url, None
+
+
+@get_by_name_or_uuid_multiple([('domain', 'domain_id')])
+@send('patch')
+def domain_update(domain_id, **kwargs):
+ url = '/domains/{}'.format(domain_id)
+ json = {
+ 'domain': kwargs,
+ }
+ return url, json
+
+
+@get_by_name_or_uuid_multiple([('domain', 'domain_id')])
+@send('delete')
+def domain_delete(domain_id, **kwargs):
+ url = '/domains/{}'.format(domain_id)
+ return url, None