summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2018-01-01 15:44:47 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2018-01-01 15:44:47 +0100
commitfa520242b878d25e37aacfcb0d838c58d3a4b271 (patch)
tree2d63086ba96dd02765359591beab77960bf3e844 /docs
parentf5850d950a77b1d985fdc3d1639e2627468d3548 (diff)
downloadgitlab-fa520242b878d25e37aacfcb0d838c58d3a4b271.tar.gz
Add support for project and group custom variables
implements parts of #367
Diffstat (limited to 'docs')
-rw-r--r--docs/gl_objects/groups.rst35
-rw-r--r--docs/gl_objects/projects.rst35
-rw-r--r--docs/gl_objects/users.py18
-rw-r--r--docs/gl_objects/users.rst26
4 files changed, 80 insertions, 34 deletions
diff --git a/docs/gl_objects/groups.rst b/docs/gl_objects/groups.rst
index 9006ceb..9b5edb0 100644
--- a/docs/gl_objects/groups.rst
+++ b/docs/gl_objects/groups.rst
@@ -91,6 +91,41 @@ List the subgroups for a group::
subgroups = group.subgroups.list()
+Group custom attributes
+=======================
+
+Reference
+---------
+
+* v4 API:
+
+ + :class:`gitlab.v4.objects.GroupCustomAttribute`
+ + :class:`gitlab.v4.objects.GroupCustomAttributeManager`
+ + :attr:`gitlab.v4.objects.Group.customattributes`
+
+* GitLab API: https://docs.gitlab.com/ce/api/custom_attributes.html
+
+Examples
+--------
+
+List custom attributes for a group::
+
+ attrs = group.customattributes.list()
+
+Get a custom attribute for a group::
+
+ attr = group.customattributes.get(attr_key)
+
+Set (create or update) a custom attribute for a group::
+
+ attr = group.customattributes.set(attr_key, attr_value)
+
+Delete a custom attribute for a group::
+
+ attr.delete()
+ # or
+ group.customattributes.delete(attr_key)
+
Group members
=============
diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst
index aaf0699..b7c5d78 100644
--- a/docs/gl_objects/projects.rst
+++ b/docs/gl_objects/projects.rst
@@ -172,6 +172,41 @@ Get a list of users for the repository:
:start-after: # users list
:end-before: # end users list
+Project custom attributes
+=========================
+
+Reference
+---------
+
+* v4 API:
+
+ + :class:`gitlab.v4.objects.ProjectCustomAttribute`
+ + :class:`gitlab.v4.objects.ProjectCustomAttributeManager`
+ + :attr:`gitlab.v4.objects.Project.customattributes`
+
+* GitLab API: https://docs.gitlab.com/ce/api/custom_attributes.html
+
+Examples
+--------
+
+List custom attributes for a project::
+
+ attrs = project.customattributes.list()
+
+Get a custom attribute for a project::
+
+ attr = project.customattributes.get(attr_key)
+
+Set (create or update) a custom attribute for a project::
+
+ attr = project.customattributes.set(attr_key, attr_value)
+
+Delete a custom attribute for a project::
+
+ attr.delete()
+ # or
+ project.customattributes.delete(attr_key)
+
Project files
=============
diff --git a/docs/gl_objects/users.py b/docs/gl_objects/users.py
index e452217..842e35d 100644
--- a/docs/gl_objects/users.py
+++ b/docs/gl_objects/users.py
@@ -98,24 +98,6 @@ gl.auth()
current_user = gl.user
# end currentuser get
-# ca list
-attrs = user.customeattributes.list()
-# end ca list
-
-# ca get
-attr = user.customeattributes.get(attr_key)
-# end ca get
-
-# ca set
-attr = user.customeattributes.set(attr_key, attr_value)
-# end ca set
-
-# ca delete
-attr.delete()
-# or
-user.customeattributes.delete(attr_key)
-# end ca delete
-
# it list
i_t = user.impersonationtokens.list(state='active')
i_t = user.impersonationtokens.list(state='inactive')
diff --git a/docs/gl_objects/users.rst b/docs/gl_objects/users.rst
index e520c9b..e57daf6 100644
--- a/docs/gl_objects/users.rst
+++ b/docs/gl_objects/users.rst
@@ -89,29 +89,23 @@ References
Examples
--------
-List custom attributes for a user:
+List custom attributes for a user::
-.. literalinclude:: users.py
- :start-after: # ca list
- :end-before: # end ca list
+ attrs = user.customattributes.list()
-Get a custom attribute for a user:
+Get a custom attribute for a user::
-.. literalinclude:: users.py
- :start-after: # ca get
- :end-before: # end ca get
+ attr = user.customattributes.get(attr_key)
-Set (create or update) a custom attribute for a user:
+Set (create or update) a custom attribute for a user::
-.. literalinclude:: users.py
- :start-after: # ca set
- :end-before: # end ca set
+ attr = user.customattributes.set(attr_key, attr_value)
-Delete a custom attribute for a user:
+Delete a custom attribute for a user::
-.. literalinclude:: users.py
- :start-after: # ca list
- :end-before: # end ca list
+ attr.delete()
+ # or
+ user.customattributes.delete(attr_key)
User impersonation tokens
=========================