diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-11-28 11:57:39 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-11-28 11:57:39 +0300 |
commit | 94c5ca71b7d1c0a47f42eea21deaedcbb3979ea7 (patch) | |
tree | c281ae85125ebf9661bce63d3b97af32a4e5bfe8 /doc/api | |
parent | 74b503639441613799e46965d4b0c83bcd6419ba (diff) | |
parent | f144cce8efbbfa364106446e5302a5007bd09e98 (diff) |
Merge branch 'tm/feature/namespace-by-id-api' into 'master'
Add new API endpoint - get a namespace by ID
Closes #40254
See merge request gitlab-org/gitlab-ce!15442
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/namespaces.md | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/doc/api/namespaces.md b/doc/api/namespaces.md index 5c0bebbaeb0..25cae5ce1f9 100644 --- a/doc/api/namespaces.md +++ b/doc/api/namespaces.md @@ -89,3 +89,55 @@ Example response: } ] ``` + +## Get namespace by ID + +Get a namespace by ID. + +``` +GET /namespaces/:id +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer/string | yes | ID or path of the namespace | + +Example request: + +```bash +curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/namespaces/2 +``` + +Example response: + +```json +{ + "id": 2, + "name": "group1", + "path": "group1", + "kind": "group", + "full_path": "group1", + "parent_id": "null", + "members_count_with_descendants": 2 +} +``` + +Example request: + +```bash +curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/namespaces/group1 +``` + +Example response: + +```json +{ + "id": 2, + "name": "group1", + "path": "group1", + "kind": "group", + "full_path": "group1", + "parent_id": "null", + "members_count_with_descendants": 2 +} +``` |