proxy find identity

Change-Id: I608de2cc9c1ec1bfe68f6a5ce185bf36348e04a8
This commit is contained in:
Terry Howe
2015-05-18 09:15:27 -06:00
parent 839c9e3c30
commit e9c9a6fbec
2 changed files with 61 additions and 0 deletions

View File

@@ -46,6 +46,11 @@ class Proxy(proxy.BaseProxy):
self._delete(role.Role, value, ignore_missing)
def find_role(self, name_or_id):
"""Find a single role
:param name_or_id: The name or ID of a role.
:returns: One :class:`~openstack.compute.v2.role.Role` or None
"""
return role.Role.find(self.session, name_or_id)
def get_role(self, value):
@@ -109,6 +114,11 @@ class Proxy(proxy.BaseProxy):
self._delete(tenant.Tenant, value, ignore_missing)
def find_tenant(self, name_or_id):
"""Find a single tenant
:param name_or_id: The name or ID of a tenant.
:returns: One :class:`~openstack.compute.v2.tenant.Tenant` or None
"""
return tenant.Tenant.find(self.session, name_or_id)
def get_tenant(self, value):
@@ -172,6 +182,11 @@ class Proxy(proxy.BaseProxy):
self._delete(user.User, value, ignore_missing)
def find_user(self, name_or_id):
"""Find a single user
:param name_or_id: The name or ID of a user.
:returns: One :class:`~openstack.compute.v2.user.User` or None
"""
return user.User.find(self.session, name_or_id)
def get_user(self, value):

View File

@@ -52,6 +52,12 @@ class Proxy(proxy.BaseProxy):
self._delete(credential.Credential, value, ignore_missing)
def find_credential(self, name_or_id):
"""Find a single credential
:param name_or_id: The name or ID of a credential.
:returns: One :class:`~openstack.compute.v2.credential.Credential`
or None
"""
return credential.Credential.find(self.session, name_or_id)
def get_credential(self, value):
@@ -117,6 +123,11 @@ class Proxy(proxy.BaseProxy):
self._delete(domain.Domain, value, ignore_missing)
def find_domain(self, name_or_id):
"""Find a single domain
:param name_or_id: The name or ID of a domain.
:returns: One :class:`~openstack.compute.v2.domain.Domain` or None
"""
return domain.Domain.find(self.session, name_or_id)
def get_domain(self, value):
@@ -180,6 +191,11 @@ class Proxy(proxy.BaseProxy):
self._delete(endpoint.Endpoint, value, ignore_missing)
def find_endpoint(self, name_or_id):
"""Find a single endpoint
:param name_or_id: The name or ID of a endpoint.
:returns: One :class:`~openstack.compute.v2.endpoint.Endpoint` or None
"""
return endpoint.Endpoint.find(self.session, name_or_id)
def get_endpoint(self, value):
@@ -245,6 +261,11 @@ class Proxy(proxy.BaseProxy):
self._delete(group.Group, value, ignore_missing)
def find_group(self, name_or_id):
"""Find a single group
:param name_or_id: The name or ID of a group.
:returns: One :class:`~openstack.compute.v2.group.Group` or None
"""
return group.Group.find(self.session, name_or_id)
def get_group(self, value):
@@ -309,6 +330,11 @@ class Proxy(proxy.BaseProxy):
self._delete(policy.Policy, value, ignore_missing)
def find_policy(self, name_or_id):
"""Find a single policy
:param name_or_id: The name or ID of a policy.
:returns: One :class:`~openstack.compute.v2.policy.Policy` or None
"""
return policy.Policy.find(self.session, name_or_id)
def get_policy(self, value):
@@ -372,6 +398,11 @@ class Proxy(proxy.BaseProxy):
self._delete(project.Project, value, ignore_missing)
def find_project(self, name_or_id):
"""Find a single project
:param name_or_id: The name or ID of a project.
:returns: One :class:`~openstack.compute.v2.project.Project` or None
"""
return project.Project.find(self.session, name_or_id)
def get_project(self, value):
@@ -435,6 +466,11 @@ class Proxy(proxy.BaseProxy):
self._delete(service.Service, value, ignore_missing)
def find_service(self, name_or_id):
"""Find a single service
:param name_or_id: The name or ID of a service.
:returns: One :class:`~openstack.compute.v2.service.Service` or None
"""
return service.Service.find(self.session, name_or_id)
def get_service(self, value):
@@ -498,6 +534,11 @@ class Proxy(proxy.BaseProxy):
self._delete(user.User, value, ignore_missing)
def find_user(self, name_or_id):
"""Find a single user
:param name_or_id: The name or ID of a user.
:returns: One :class:`~openstack.compute.v2.user.User` or None
"""
return user.User.find(self.session, name_or_id)
def get_user(self, value):
@@ -549,6 +590,11 @@ class Proxy(proxy.BaseProxy):
self._delete(trust.Trust, value, ignore_missing)
def find_trust(self, name_or_id):
"""Find a single trust
:param name_or_id: The name or ID of a trust.
:returns: One :class:`~openstack.compute.v2.trust.Trust` or None
"""
return trust.Trust.find(self.session, name_or_id)
def get_trust(self, value):