summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-04 15:59:17 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-04 15:59:17 +0000
commitb9219469f759f387a35bec39c3dc59477793ef1b (patch)
treec6f97d7545fd6d44d041b3192974e325dee01854 /doc/api
parent1d945945bb66871dcebefef5824740c823fd7b09 (diff)
parent67992b9be6fc19ef4cc06de48995d1ee9617049a (diff)
downloadgitlab-ce-b9219469f759f387a35bec39c3dc59477793ef1b.tar.gz
Merge branch 'make-namespaces-api-available-to-all-users' into 'master'
Make namespace API available to all users ### What does this MR do? This MR makes it possible for a user to query namespaces to which he/she has access. Also, it adds documentation for the existing API. ### Why was this MR needed? Even though the `groups` API exists, it might still be useful to have an endpoint that tells the namespace type (e.g. `user` vs. `group`), especially if a user has access to a number of different projects. ### What are the relevant issue numbers? Closes https://github.com/gitlabhq/gitlabhq/issues/9328 See merge request !708
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/README.md1
-rw-r--r--doc/api/namespaces.md44
2 files changed, 45 insertions, 0 deletions
diff --git a/doc/api/README.md b/doc/api/README.md
index f6757b0a6aa..ca58c184543 100644
--- a/doc/api/README.md
+++ b/doc/api/README.md
@@ -19,6 +19,7 @@
- [Deploy Keys](deploy_keys.md)
- [System Hooks](system_hooks.md)
- [Groups](groups.md)
+- [Namespaces](namespaces.md)
## Clients
diff --git a/doc/api/namespaces.md b/doc/api/namespaces.md
new file mode 100644
index 00000000000..7b3238441f6
--- /dev/null
+++ b/doc/api/namespaces.md
@@ -0,0 +1,44 @@
+# Namespaces
+
+## List namespaces
+
+Get a list of namespaces. (As user: my namespaces, as admin: all namespaces)
+
+```
+GET /namespaces
+```
+
+```json
+[
+ {
+ "id": 1,
+ "path": "user1",
+ "kind": "user"
+ },
+ {
+ "id": 2,
+ "path": "group1",
+ "kind": "group"
+ }
+]
+```
+
+You can search for namespaces by name or path, see below.
+
+## Search for namespace
+
+Get all namespaces that match your string in their name or path.
+
+```
+GET /namespaces?search=foobar
+```
+
+```json
+[
+ {
+ "id": 1,
+ "path": "user1",
+ "kind": "user"
+ }
+]
+```