summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/gl_objects/users.rst36
-rw-r--r--gitlab/__init__.py1
-rw-r--r--gitlab/v4/objects.py9
-rw-r--r--tools/python_test_v4.py3
4 files changed, 49 insertions, 0 deletions
diff --git a/docs/gl_objects/users.rst b/docs/gl_objects/users.rst
index e7b15f6..fca7ca8 100644
--- a/docs/gl_objects/users.rst
+++ b/docs/gl_objects/users.rst
@@ -145,6 +145,9 @@ Revoke (delete) an impersonation token for a user:
Current User
============
+References
+----------
+
* v4 API:
+ :class:`gitlab.v4.objects.CurrentUser`
@@ -169,6 +172,9 @@ Get the current user:
GPG keys
========
+References
+----------
+
You can manipulate GPG keys for the current user and for the other users if you
are admin.
@@ -211,6 +217,9 @@ Delete an GPG gpgkey for a user:
SSH keys
========
+References
+----------
+
You can manipulate SSH keys for the current user and for the other users if you
are admin.
@@ -264,6 +273,9 @@ Delete an SSH key for a user:
Emails
======
+References
+----------
+
You can manipulate emails for the current user and for the other users if you
are admin.
@@ -313,3 +325,27 @@ Delete an email for a user:
.. literalinclude:: users.py
:start-after: # email delete
:end-before: # end email delete
+
+Users activities
+================
+
+References
+----------
+
+* v4 only
+* admin only
+
+* v4 API:
+
+ + :class:`gitlab.v4.objects.UserActivities`
+ + :class:`gitlab.v4.objects.UserActivitiesManager`
+ + :attr:`gitlab.Gitlab.user_activities`
+
+Examples
+--------
+
+Get the users activities:
+
+.. code-block:: python
+
+ activities = gl.user_activities.list(all=True, as_list=False)
diff --git a/gitlab/__init__.py b/gitlab/__init__.py
index c0f93bf..aac4837 100644
--- a/gitlab/__init__.py
+++ b/gitlab/__init__.py
@@ -125,6 +125,7 @@ class Gitlab(object):
self.teams = objects.TeamManager(self)
else:
self.dockerfiles = objects.DockerfileManager(self)
+ self.user_activities = objects.UserActivitiesManager(self)
if self._api_version == '3':
# build the "submanagers"
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index de8ec07..18e208b 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -112,6 +112,15 @@ class SidekiqManager(RESTManager):
return self.gitlab.http_get('/sidekiq/compound_metrics', **kwargs)
+class UserActivities(RESTObject):
+ _id_attr = 'username'
+
+
+class UserActivitiesManager(ListMixin, RESTManager):
+ _path = '/user/activities'
+ _obj_cls = UserActivities
+
+
class UserCustomAttribute(ObjectDeleteMixin, RESTObject):
_id_attr = 'key'
diff --git a/tools/python_test_v4.py b/tools/python_test_v4.py
index 7d769f3..cb199b7 100644
--- a/tools/python_test_v4.py
+++ b/tools/python_test_v4.py
@@ -580,3 +580,6 @@ assert(snippet.title == 'updated_title')
content = snippet.content()
assert(content == 'import gitlab')
snippet.delete()
+
+# user activities
+gl.user_activities.list()