summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNisha Yadav <ynisha11@gmail.com>2016-06-21 18:19:45 +0530
committerSteve Martinelli <s.martinelli@gmail.com>2016-06-21 14:03:32 +0000
commitb993413443b0973ae9ec511c4cf796448a0cb903 (patch)
treee3273a3fc6e34824e8a791d341707e50e95e10c7
parent15a93d8bfba6e24185e0105b234e5c8db6e5a6ec (diff)
downloadpython-keystoneclient-b993413443b0973ae9ec511c4cf796448a0cb903.tar.gz
Improve docs for v3 groups
In preparation to add client functional tests for v3 groups, this change proposes to detail the method docs, because the tests need to be based on them. Change-Id: I12722effee092eed00841215e8f1e9ea2d323628
-rw-r--r--keystoneclient/v3/groups.py54
1 files changed, 50 insertions, 4 deletions
diff --git a/keystoneclient/v3/groups.py b/keystoneclient/v3/groups.py
index 654ec34..e718168 100644
--- a/keystoneclient/v3/groups.py
+++ b/keystoneclient/v3/groups.py
@@ -56,6 +56,19 @@ class GroupManager(base.CrudManager):
@positional(1, enforcement=positional.WARN)
def create(self, name, domain=None, description=None, **kwargs):
+ """Create a group.
+
+ :param str name: the name of the group.
+ :param domain: the domain of the group.
+ :type domain: str or :class:`keystoneclient.v3.domains.Domain`
+ :param str description: a description of the group.
+ :param kwargs: any other attribute provided will be passed to the
+ server.
+
+ :returns: the created group returned from server.
+ :rtype: :class:`keystoneclient.v3.groups.Group`
+
+ """
return super(GroupManager, self).create(
name=name,
domain_id=base.getid(domain),
@@ -66,11 +79,15 @@ class GroupManager(base.CrudManager):
def list(self, user=None, domain=None, **kwargs):
"""List groups.
- If domain or user is provided, then filter groups with
- that attribute.
+ :param user: the user of the groups to be filtered on.
+ :type user: str or :class:`keystoneclient.v3.users.User`
+ :param domain: the domain of the groups to be filtered on.
+ :type domain: str or :class:`keystoneclient.v3.domains.Domain`
+ :param kwargs: any other attribute provided will filter groups on.
+
+ :returns: a list of groups.
+ :rtype: list of :class:`keystoneclient.v3.groups.Group`.
- If ``**kwargs`` are provided, then filter groups with
- attributes matching ``**kwargs``.
"""
if user:
base_url = '/users/%s' % base.getid(user)
@@ -82,11 +99,32 @@ class GroupManager(base.CrudManager):
**kwargs)
def get(self, group):
+ """Retrieve a group.
+
+ :param group: the group to be retrieved from the server.
+ :type group: str or :class:`keystoneclient.v3.groups.Group`
+
+ :returns: the specified group returned from server.
+ :rtype: :class:`keystoneclient.v3.groups.Group`
+
+ """
return super(GroupManager, self).get(
group_id=base.getid(group))
@positional(enforcement=positional.WARN)
def update(self, group, name=None, description=None, **kwargs):
+ """Update a group.
+
+ :param group: the group to be updated on the server.
+ :type group: str or :class:`keystoneclient.v3.groups.Group`
+ :param str name: the new name of the group.
+ :param str description: the new description of the group.
+ :param kwargs: any other attribute provided will be passed to server.
+
+ :returns: the updated group returned from server.
+ :rtype: :class:`keystoneclient.v3.groups.Group`
+
+ """
return super(GroupManager, self).update(
group_id=base.getid(group),
name=name,
@@ -94,5 +132,13 @@ class GroupManager(base.CrudManager):
**kwargs)
def delete(self, group):
+ """Delete a group.
+
+ :param group: the group to be deleted on the server.
+ :type group: str or :class:`keystoneclient.v3.groups.Group`
+
+ :returns: 204 No Content.
+
+ """
return super(GroupManager, self).delete(
group_id=base.getid(group))