|
|
# NAME
|
|
|
|
|
|
`GitLab::Namespaces` - extension for Namespaces API
|
|
|
|
|
|
See [GitLab API -- Namespaces](http://doc.gitlab.com/ce/api/namespaces.html) for details and response formats.
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
|
```{.pl}
|
|
|
use GitLab::API;
|
|
|
use GitLab::Namespaces;
|
|
|
|
|
|
my $api = GitLab::API->new(...);
|
|
|
|
|
|
# get namespaces exposed to user john.doe
|
|
|
$api->sudo("john.doe");
|
|
|
|
|
|
my $namespaces = $api->namespaces(search => "group1");
|
|
|
```
|
|
|
|
|
|
# VERSION
|
|
|
|
|
|
Implements API calls for GitLab CE `v8.10.0`.
|
|
|
Checked 2016-09-29 for GitLab CE `v8.12.1`.
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
|
|
From GitLab API: _"Usernames and groupnames fall under a special category called namespaces."_
|
|
|
|
|
|
- `namespaces()`
|
|
|
|
|
|
```{.pl}
|
|
|
$namespaces = $gitlab->namespaces();
|
|
|
$namespaces = $gitlab->namespaces(search => $what);
|
|
|
```
|
|
|
|
|
|
Returns all namespaces for currently authenticated user.
|
|
|
If an optional argument `search` is used, only those namespaces that contain the requested string are returned.
|
|
|
|
|
|
To get namespaces of user with login `$login`, you can do this:
|
|
|
|
|
|
```{.pl}
|
|
|
$gitlab->sudo($login);
|
|
|
$namespaces = $gitlab->namespaces();
|
|
|
```
|
|
|
|
|
|
Note that the authenticated user must be an administrator to use [`sudo` in GitLab::API](pod-GitLab-API.md#sudo).
|
|
|
|
|
|
Also, if the user is an administrator, the call returns **all** namespaces.
|
|
|
|
|
|
# AUTHOR
|
|
|
|
|
|
Roman Lacko <[`xlacko1@fi.muni.cz`](mailto:xlacko1@fi.muni.cz)>
|
|
|
|
|
|
# SEE ALSO
|
|
|
|
|
|
- [GitLab](pod-GitLab.md)
|
|
|
|
|
|
Wrapper around [GitLab::API](pod-GitLab-API.md) and other `GitLab::*` modules. |