summaryrefslogtreecommitdiff
path: root/keystoneclient/v3/auth.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-11-22 23:02:47 +0000
committerGerrit Code Review <review@openstack.org>2021-11-22 23:02:47 +0000
commit100253d52e0c62dffffddb6f046ad660a9bce1a9 (patch)
treeff020d25e8c9562976418ff556ef03faffe42dcd /keystoneclient/v3/auth.py
parenta45e39c1d9621dd4d85037817babde4522073ffb (diff)
parent56c7b502c0162733c54663ef33de23928c31046f (diff)
downloadpython-keystoneclient-100253d52e0c62dffffddb6f046ad660a9bce1a9.tar.gz
Merge "Add access to /v3/auth/systems"4.4.0
Diffstat (limited to 'keystoneclient/v3/auth.py')
-rw-r--r--keystoneclient/v3/auth.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/keystoneclient/v3/auth.py b/keystoneclient/v3/auth.py
index 6b8d6e9..4d85e24 100644
--- a/keystoneclient/v3/auth.py
+++ b/keystoneclient/v3/auth.py
@@ -16,10 +16,12 @@ from keystoneauth1 import plugin
from keystoneclient import base
from keystoneclient.v3 import domains
from keystoneclient.v3 import projects
+from keystoneclient.v3 import system
Domain = domains.Domain
Project = projects.Project
+System = system.System
class AuthManager(base.Manager):
@@ -31,6 +33,7 @@ class AuthManager(base.Manager):
_PROJECTS_URL = '/auth/projects'
_DOMAINS_URL = '/auth/domains'
+ _SYSTEM_URL = '/auth/system'
def projects(self):
"""List projects that the specified token can be rescoped to.
@@ -67,3 +70,23 @@ class AuthManager(base.Manager):
'domains',
obj_class=Domain,
endpoint_filter=endpoint_filter)
+
+ def systems(self):
+ """List Systems that the specified token can be rescoped to.
+
+ At the moment this is either empty or "all".
+
+ :returns: a list of systems.
+ :rtype: list of :class:`keystoneclient.v3.systems.System`.
+
+ """
+ try:
+ return self._list(self._SYSTEM_URL,
+ 'system',
+ obj_class=System)
+ except exceptions.EndpointNotFound:
+ endpoint_filter = {'interface': plugin.AUTH_INTERFACE}
+ return self._list(self._SYSTEM_URL,
+ 'system',
+ obj_class=System,
+ endpoint_filter=endpoint_filter)