summaryrefslogtreecommitdiff
path: root/docs/gl_objects
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-12-11 13:18:49 +0100
committerJohn Villalovos <john@sodarock.com>2021-12-11 10:25:08 -0800
commite7559bfa2ee265d7d664d7a18770b0a3e80cf999 (patch)
tree70b0193d60a06d2d1cd364c2425c87c4029dc72d /docs/gl_objects
parentac5defa0c09822cf2208e66218a37d3ce00ff35b (diff)
downloadgitlab-e7559bfa2ee265d7d664d7a18770b0a3e80cf999.tar.gz
feat(api): add support for Topics API
Diffstat (limited to 'docs/gl_objects')
-rw-r--r--docs/gl_objects/topics.rst48
1 files changed, 48 insertions, 0 deletions
diff --git a/docs/gl_objects/topics.rst b/docs/gl_objects/topics.rst
new file mode 100644
index 0000000..0ca46d7
--- /dev/null
+++ b/docs/gl_objects/topics.rst
@@ -0,0 +1,48 @@
+########
+Topics
+########
+
+Topics can be used to categorize projects and find similar new projects.
+
+Reference
+---------
+
+* v4 API:
+
+ + :class:`gitlab.v4.objects.Topic`
+ + :class:`gitlab.v4.objects.TopicManager`
+ + :attr:`gitlab.Gitlab.topics`
+
+* GitLab API: https://docs.gitlab.com/ce/api/topics.html
+
+This endpoint requires admin access for creating, updating and deleting objects.
+
+Examples
+--------
+
+List project topics on the GitLab instance::
+
+ topics = gl.topics.list()
+
+Get a specific topic by its ID::
+
+ topic = gl.topics.get(topic_id)
+
+Create a new topic::
+
+ topic = gl.topics.create({"name": "my-topic"})
+
+Update a topic::
+
+ topic.description = "My new topic"
+ topic.save()
+
+ # or
+ gl.topics.update(topic_id, {"description": "My new topic"})
+
+Delete a topic::
+
+ topic.delete()
+
+ # or
+ gl.topics.delete(topic_id)