summaryrefslogtreecommitdiff
path: root/docs
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
parentac5defa0c09822cf2208e66218a37d3ce00ff35b (diff)
downloadgitlab-e7559bfa2ee265d7d664d7a18770b0a3e80cf999.tar.gz
feat(api): add support for Topics API
Diffstat (limited to 'docs')
-rw-r--r--docs/api-objects.rst1
-rw-r--r--docs/gl_objects/topics.rst48
2 files changed, 49 insertions, 0 deletions
diff --git a/docs/api-objects.rst b/docs/api-objects.rst
index 9c089fe..984fd4f 100644
--- a/docs/api-objects.rst
+++ b/docs/api-objects.rst
@@ -53,6 +53,7 @@ API examples
gl_objects/system_hooks
gl_objects/templates
gl_objects/todos
+ gl_objects/topics
gl_objects/users
gl_objects/variables
gl_objects/sidekiq
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)