Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Roman Lacko
gitlab_api
Commits
e1e3910f
Commit
e1e3910f
authored
Sep 30, 2016
by
Roman Lacko
Browse files
Update GitLab-Projects.md
parent
a5e1ca51
Changes
1
Hide whitespace changes
Inline
Side-by-side
pod/GitLab-Projects.md
View file @
e1e3910f
# NAME
GitLab::Projects - implements projects API calls
`
GitLab::Projects
`
- implements projects API calls
See
[
GitLab API -- Projects
](
http://doc.gitlab.com/ce/api/projects.html
)
for details and
response formats.
...
...
@@ -14,158 +14,200 @@ Checked 2016-09-29 for GitLab CE `v8.12.1`.
## Notation
Please see the documentation for the
[
GitLab::Users
](
https://metacpan.org/pod/
GitLab
::
Users
)
module.
Please see the documentation for the
[
`
GitLab::Users
`
](
GitLab
-
Users
.md
)
module.
Note that not all optional arguments are listed.
Please refer to the official documentation for the full list.
## Project listing
-
projects()
-
`
projects()
`
$gitlab->projects([...]);
```{.pl}
$gitlab->projects([...]);
```
Returns a list of projects accessible to the authenticated user.
-
projects
\
_
owned()
-
`
projects_owned()
`
$gitlab->projects_owned([...]);
```{.pl}
$gitlab->projects_owned([...]);
```
Returns a list of projects owned by the authenticated user.
-
projects
\
_
starred()
-
`
projects_starred()
`
$gitlab->projects_starred([...]);
```{.pl}
$gitlab->projects_starred([...]);
```
Returns a list of projects starred by the authenticated user.
-
projects
\
_
all()
-
`
projects_all()
`
$gitlab->projects_all([...]);
```{.pl}
$gitlab->projects_all([...]);
```
Returns all projects.
**This method is available only for administrators.**
-
project
\
_
by
\
_
id()
-
`
project_by_id()
`
$gitlab->project_by_id( :id );
```{.pl}
$gitlab->project_by_id( :id );
```
Returns the project with the given ID, which can be either a number or a string `"namespace/project_name"`.
-
project
\
_
events()
-
`
project_events()
`
$gitlab->project_events( :id );
```{.pl}
$gitlab->project_events( :id );
```
Returns the list of events for the given project.
-
projects
\
_
search()
-
`
projects_search()
`
$gitlab->projects_serach( :query, [...] );
```{.pl}
$gitlab->projects_serach( :query, [...] );
```
Search for projects by name which are accessible to the authenticated user.
## Create, edit and delete projects
-
project
\
_
create()
-
`
project_create()
`
$gitlab->project_create( :name, [...] );
```{.pl}
$gitlab->project_create( :name, [...] );
```
Creates a new project in the authenticated user's namespace.
Other namespaces can be specified by the optional `namespace_id` parameter if the user can access it.
-
project
\
_
create
\
_
for
\
_
user()
-
`
project_create_for_user()
`
$gitlab->project_create_for_user( :uid, :name );
```{.pl}
$gitlab->project_create_for_user( :uid, :name );
```
Creates a new project for the user with the given `uid`.
**This method is available only for administrators.**
-
project
\
_
edit()
-
`
project_edit()
`
$gitlab->project_edit( :id, [...] );
```{.pl}
$gitlab->project_edit( :id, [...] );
```
Edits the project.
Takes the same arguments as [project
\
_create](
https://metacpan.org/pod/
project_create), except they are all optional.
Takes the same arguments as [
`
project_create
`
](
#
project_create), except they are all optional.
-
project
\
_
fork()
-
`
project_fork()
`
$gitlab->project_fork( :id, [:namespace ] );
```{.pl}
$gitlab->project_fork( :id, [:namespace ] );
```
Forks the project to the authenticated user's namespace or the namespace specified by the `namespace` as an id or path.
-
project
\
_
star()
-
`
project_star()
`
$gitlab->project_star( :id );
```{.pl}
$gitlab->project_star( :id );
```
Stars a given project.
Returns `304 Not Modified` if already stared.
-
project
\
_
unstar()
-
`
project_unstar()
`
$gitlab->project_unstar( :id );
```{.pl}
$gitlab->project_unstar( :id );
```
Unstars a given project.
Returns `304 Not Modified` if not stared.
-
project
\
_
archive()
-
`
project_archive()
`
$gitlab->project_archive( :id );
```{.pl}
$gitlab->project_archive( :id );
```
Archives the given project.
The user must be either an administrator or the owner of the project.
-
project
\
_
unarchive()
-
`
project_unarchive()
`
$gitlab->project_unarchive( :id );
```{.pl}
$gitlab->project_unarchive( :id );
```
Unarchives the given project.
The user must be either an administrator or the owner of the project.
-
project
\
_
delete()
-
`
project_delete()
`
$gitlab->project_delete( :id );
```{.pl}
$gitlab->project_delete( :id );
```
Deletes the project with the given `id`.
## Uploads
-
project
\
_
upload
\
_
file()
-
`
project_upload_file()
`
**NOT SUPPORTED YET**
## Project Members
See
[
GitLab::Members
](
https://metacpan.org/pod/
GitLab
::
Members
)
package.
See
[
`
GitLab::Members
`
](
GitLab
-
Members
.md
)
package.
## Hooks
-
project
\
_
hooks()
-
`
project_hooks()
`
$gitlab->project_hooks( :id );
```{.pl}
$gitlab->project_hooks( :id );
```
Get a list of project hooks.
-
project
\
_
get
\
_
hook()
-
`
project_get_hook()
`
$gitlab->project_get_hook( :id, :hook_id )
```{.pl}
$gitlab->project_get_hook( :id, :hook_id )
```
Get a specific hook for a project.
-
project
\
_
add
\
_
hook()
-
`
project_add_hook()
`
$gitlab->project_add_hook( :id, :url, [...]);
```{.pl}
$gitlab->project_add_hook( :id, :url, [...]);
```
Adds a hook to a specified project.
-
project
\
_
edit
\
_
hook()
-
`
project_edit_hook()
`
$gitlab->project_edit_hook( :id, :hook_id, [...]);
```{.pl}
$gitlab->project_edit_hook( :id, :hook_id, [...]);
```
Edits a hook for a specified project.
-
project
\
_
delete
\
_
hook()
-
`
project_delete_hook()
`
$gitlab->project_delete_hook( :id, :hook_id );
```{.pl}
$gitlab->project_delete_hook( :id, :hook_id );
```
Removes a hook from a project.
This is an idempotent method and can be called multiple times.
...
...
@@ -175,29 +217,34 @@ See [GitLab::Members](https://metacpan.org/pod/GitLab::Members) package.
## Branches
See
[
GitLab::Branches
](
https://metacpan.org/pod/
GitLab
::
Branches
)
module.
See
[
`
GitLab::Branches
`
](
GitLab
-
Branches
.md
)
module.
## Miscellaneous
-
project
\_
create
\_
forked
\_
relationship()
**The following methods are available only for admins.**
$gitlab->project_create_forked_relationship( :id :forked_from_id );
-
`project_create_forked_relationship()`
```{.pl}
$gitlab->project_create_forked_relationship( :id :forked_from_id );
```
Create a _forked from_ relation between existing projects.
**Available only for admins.**
-
project
\
_
delete
\
_
forked
\
_
relationship()
-
`
project_delete_forked_relationship()
`
$gitlab->project_delete_forked_relationship( :id );
```{.pl}
$gitlab->project_delete_forked_relationship( :id );
```
Delete an existing _forked from_ relationship.
# AUTHOR
Roman Lacko
<[xlacko1@fi.muni.cz](
https://metacpan.org/pod/
xlacko1@fi.muni.cz)>
Roman Lacko
<[
`
xlacko1@fi.muni.cz
`
](
mailto:
xlacko1@fi.muni.cz)>
# SEE ALSO
-
[
GitLab
](
https://metacpan.org/pod/
GitLab
)
-
[
`
GitLab
`
](
GitLab
.md
)
Wrapper around [GitLab::API](
https://metacpan.org/pod/
GitLab
::
API) and other `GitLab::*` modules.
Wrapper around [
`
GitLab::API
`
](GitLab
-
API
.md
) and other `GitLab::*` modules.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment