File tree 1 file changed +33
-7
lines changed
1 file changed +33
-7
lines changed Original file line number Diff line number Diff line change 1
1
# Namespaces
2
2
3
+ Usernames and groupnames fall under a special category called namespaces.
4
+
5
+ For users and groups supported API calls see the [ users] ( users.md ) and
6
+ [ groups] ( groups.md ) documentation respectively.
7
+
8
+ [ Pagination] ( README.md#pagination ) is used.
9
+
3
10
## List namespaces
4
11
5
- Get a list of namespaces. (As user: my namespaces, as admin: all namespaces)
12
+ Get a list of the namespaces of the authenticated user. If the user is an
13
+ administrator, a list of all namespaces in the GitLab instance is shown.
6
14
7
15
```
8
16
GET /namespaces
9
17
```
10
18
19
+ Example request:
20
+
21
+ ``` bash
22
+ curl -H " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/namespaces
23
+ ```
24
+
25
+ Example response:
26
+
11
27
``` json
12
28
[
13
29
{
@@ -23,22 +39,32 @@ GET /namespaces
23
39
]
24
40
```
25
41
26
- You can search for namespaces by name or path, see below.
27
-
28
42
## Search for namespace
29
43
30
- Get all namespaces that match your string in their name or path.
44
+ Get all namespaces that match a string in their name or path.
31
45
32
46
```
33
47
GET /namespaces?search=foobar
34
48
```
35
49
50
+ | Attribute | Type | Required | Description |
51
+ | --------- | ---- | -------- | ----------- |
52
+ | ` search ` | string | no | Returns a list of namespaces the user is authorized to see based on the search criteria |
53
+
54
+ Example request:
55
+
56
+ ``` bash
57
+ curl -H " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/namespaces? search=twitter
58
+ ```
59
+
60
+ Example response:
61
+
36
62
``` json
37
63
[
38
64
{
39
- "id" : 1 ,
40
- "path" : " user1 " ,
41
- "kind" : " user "
65
+ "id" : 4 ,
66
+ "path" : " twitter " ,
67
+ "kind" : " group "
42
68
}
43
69
]
44
70
```
You can’t perform that action at this time.
0 commit comments