Introduce separate module,state to work with v3 only
This patch introduce new keystonev3 module and state that uses
os_client_config library for authenticaion and raw client to send
requests directly to API.
Since v3 resource structure/resource relation are completely different
we introduce new pillar keystone:client:resources:v3 which will contain
all resources we manage via v3 client.
The module,state implements basic functionality to manage:
* users
* projects
* services
* endpoints
* roles
Other resources will be added in separate patches when needed.
Bootstrap of keystone is done via bootstrap script in server.sls in
Queens as admin token is removed.
Related-Prod: PROD-19148
Change-Id: I10a7cf720955437e3757a1c9699e4a60e1327ba3
diff --git a/_modules/keystonev3/endpoints.py b/_modules/keystonev3/endpoints.py
new file mode 100644
index 0000000..4230ad3
--- /dev/null
+++ b/_modules/keystonev3/endpoints.py
@@ -0,0 +1,42 @@
+from keystonev3.common import send
+
+try:
+ from urllib.parse import urlencode
+except ImportError:
+ from urllib import urlencode
+
+
+@send('get')
+def endpoint_get_details(endpoint_id, **kwargs):
+ url = '/endpoints/{}?{}'.format(endpoint_id, urlencode(kwargs))
+ return url, None
+
+
+@send('patch')
+def endpoint_update(endpoint_id, **kwargs):
+ url = '/endpoints/{}'.format(endpoint_id)
+ json = {
+ 'endpoint': kwargs,
+ }
+ return url, json
+
+
+@send('delete')
+def endpoint_delete(endpoint_id, **kwargs):
+ url = '/endpoints/{}'.format(endpoint_id)
+ return url, None
+
+
+@send('get')
+def endpoint_list(**kwargs):
+ url = '/endpoints?{}'.format(urlencode(kwargs))
+ return url, None
+
+
+@send('post')
+def endpoint_create(**kwargs):
+ url = '/endpoints'
+ json = {
+ 'endpoint': kwargs,
+ }
+ return url, json