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