diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-04 15:59:17 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-04 15:59:17 +0000 |
commit | b9219469f759f387a35bec39c3dc59477793ef1b (patch) | |
tree | c6f97d7545fd6d44d041b3192974e325dee01854 /doc | |
parent | 1d945945bb66871dcebefef5824740c823fd7b09 (diff) | |
parent | 67992b9be6fc19ef4cc06de48995d1ee9617049a (diff) | |
download | gitlab-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')
-rw-r--r-- | doc/api/README.md | 1 | ||||
-rw-r--r-- | doc/api/namespaces.md | 44 |
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" + } +] +``` |