summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Grégoire <valentin.gregoire@gmail.com>2020-09-16 21:31:23 +0200
committerValentin Grégoire <valentin.gregoire@gmail.com>2020-09-16 21:31:23 +0200
commit7565bf059b240c9fffaf6959ee168a12d0fedd77 (patch)
tree618417b87186a3581b9cb8e3241fbfce507708bc
parent9baa90535b5a8096600f9aec96e528f4d2ac7d74 (diff)
downloadgitlab-7565bf059b240c9fffaf6959ee168a12d0fedd77.tar.gz
chore: added docs for search scopes constants
-rw-r--r--docs/gl_objects/search.rst40
-rw-r--r--gitlab/const.py1
2 files changed, 40 insertions, 1 deletions
diff --git a/docs/gl_objects/search.rst b/docs/gl_objects/search.rst
index 750bbe0..e7ba5d7 100644
--- a/docs/gl_objects/search.rst
+++ b/docs/gl_objects/search.rst
@@ -4,7 +4,45 @@ Search API
You can search for resources at the top level, in a project or in a group.
Searches are based on a scope (issues, merge requests, and so on) and a search
-string.
+string. The following constants are provided to represent the possible scopes:
+
+
+* global scopes:
+
+ + ``gitlab.SEARCH_SCOPE_GLOBAL_PROJECTS``: ``projects``
+ + ``gitlab.SEARCH_SCOPE_GLOBAL_ISSUES``: ``issues``
+ + ``gitlab.SEARCH_SCOPE_GLOBAL_MERGE_REQUESTS``: ``merge_requests``
+ + ``gitlab.SEARCH_SCOPE_GLOBAL_MILESTONES``: ``milestones``
+ + ``gitlab.SEARCH_SCOPE_GLOBAL_SNIPPET_TITLES``: ``snippet_titles``
+ + ``gitlab.SEARCH_SCOPE_GLOBAL_WIKI_BLOBS``: ``wiki_blobs``
+ + ``gitlab.SEARCH_SCOPE_GLOBAL_COMMITS``: ``commits``
+ + ``gitlab.SEARCH_SCOPE_GLOBAL_BLOBS``: ``blobs``
+ + ``gitlab.SEARCH_SCOPE_GLOBAL_USERS``: ``users``
+
+
+* group scopes:
+
+ + ``gitlab.SEARCH_SCOPE_GROUP_PROJECTS``: ``projects``
+ + ``gitlab.SEARCH_SCOPE_GROUP_ISSUES``: ``issues``
+ + ``gitlab.SEARCH_SCOPE_GROUP_MERGE_REQUESTS``: ``merge_requests``
+ + ``gitlab.SEARCH_SCOPE_GROUP_MILESTONES``: ``milestones``
+ + ``gitlab.SEARCH_SCOPE_GROUP_WIKI_BLOBS``: ``wiki_blobs``
+ + ``gitlab.SEARCH_SCOPE_GROUP_COMMITS``: ``commits``
+ + ``gitlab.SEARCH_SCOPE_GROUP_BLOBS``: ``blobs``
+ + ``gitlab.SEARCH_SCOPE_GROUP_USERS``: ``users``
+
+
+* project scopes:
+
+ + ``gitlab.SEARCH_SCOPE_PROJECT_ISSUES``: ``issues``
+ + ``gitlab.SEARCH_SCOPE_PROJECT_MERGE_REQUESTS``: ``merge_requests``
+ + ``gitlab.SEARCH_SCOPE_PROJECT_MILESTONES``: ``milestones``
+ + ``gitlab.SEARCH_SCOPE_PROJECT_NOTES``: ``notes``
+ + ``gitlab.SEARCH_SCOPE_PROJECT_WIKI_BLOBS``: ``wiki_blobs``
+ + ``gitlab.SEARCH_SCOPE_PROJECT_COMMITS``: ``commits``
+ + ``gitlab.SEARCH_SCOPE_PROJECT_BLOBS``: ``blobs``
+ + ``gitlab.SEARCH_SCOPE_PROJECT_USERS``: ``users``
+
Reference
---------
diff --git a/gitlab/const.py b/gitlab/const.py
index 069f0bf..1abad86 100644
--- a/gitlab/const.py
+++ b/gitlab/const.py
@@ -34,6 +34,7 @@ NOTIFICATION_LEVEL_GLOBAL = "global"
NOTIFICATION_LEVEL_MENTION = "mention"
NOTIFICATION_LEVEL_CUSTOM = "custom"
+# Search scopes
_SEARCH_SCOPE_PROJECTS = "projects"
_SEARCH_SCOPE_ISSUES = "issues"
_SEARCH_SCOPE_MERGE_REQUESTS = "merge_requests"