Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f05cec53
Commit
f05cec53
authored
10 years ago
by
Jeroen van Baarsen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7508 from cirosantilli/md-style-projects
Fix Md style for projects API doc.
parents
0965b188
a1d09978
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
89 deletions
+70
-89
doc/api/projects.md
doc/api/projects.md
+70
-89
No files found.
doc/api/projects.md
View file @
f05cec53
# Projects
# Projects
##
#
List projects
## List projects
Get a list of projects accessible by the authenticated user.
Get a list of projects accessible by the authenticated user.
...
@@ -10,7 +10,7 @@ GET /projects
...
@@ -10,7 +10,7 @@ GET /projects
Parameters:
Parameters:
+
`archived`
(optional) - if passed, limit by archived status
-
`archived`
(optional) - if passed, limit by archived status
```
json
```
json
[
[
...
@@ -87,8 +87,7 @@ Parameters:
...
@@ -87,8 +87,7 @@ Parameters:
]
]
```
```
### List owned projects
#### List owned projects
Get a list of projects which are owned by the authenticated user.
Get a list of projects which are owned by the authenticated user.
...
@@ -96,7 +95,7 @@ Get a list of projects which are owned by the authenticated user.
...
@@ -96,7 +95,7 @@ Get a list of projects which are owned by the authenticated user.
GET /projects/owned
GET /projects/owned
```
```
###
#
List ALL projects
### List ALL projects
Get a list of all GitLab projects (admin only).
Get a list of all GitLab projects (admin only).
...
@@ -115,7 +114,7 @@ GET /projects/:id
...
@@ -115,7 +114,7 @@ GET /projects/:id
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
```
json
```
json
{
{
...
@@ -176,7 +175,7 @@ GET /projects/:id/events
...
@@ -176,7 +175,7 @@ GET /projects/:id/events
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
```
json
```
json
[
[
...
@@ -238,7 +237,6 @@ Parameters:
...
@@ -238,7 +237,6 @@ Parameters:
]
]
```
```
### Create project
### Create project
Creates a new project owned by the authenticated user.
Creates a new project owned by the authenticated user.
...
@@ -249,17 +247,16 @@ POST /projects
...
@@ -249,17 +247,16 @@ POST /projects
Parameters:
Parameters:
+
`name`
(required) - new project name
-
`name`
(required) - new project name
+
`namespace_id`
(optional) - namespace for the new project (defaults to user)
-
`namespace_id`
(optional) - namespace for the new project (defaults to user)
+
`description`
(optional) - short project description
-
`description`
(optional) - short project description
+
`issues_enabled`
(optional)
-
`issues_enabled`
(optional)
+
`merge_requests_enabled`
(optional)
-
`merge_requests_enabled`
(optional)
+
`wiki_enabled`
(optional)
-
`wiki_enabled`
(optional)
+
`snippets_enabled`
(optional)
-
`snippets_enabled`
(optional)
+
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
+
`visibility_level`
(optional)
-
`visibility_level`
(optional)
*
`import_url`
(optional)
-
`import_url`
(optional)
### Create project for user
### Create project for user
...
@@ -271,20 +268,19 @@ POST /projects/user/:user_id
...
@@ -271,20 +268,19 @@ POST /projects/user/:user_id
Parameters:
Parameters:
+
`user_id`
(required) - user_id of owner
-
`user_id`
(required) - user_id of owner
+
`name`
(required) - new project name
-
`name`
(required) - new project name
+
`description`
(optional) - short project description
-
`description`
(optional) - short project description
+
`default_branch`
(optional) - 'master' by default
-
`default_branch`
(optional) - 'master' by default
+
`issues_enabled`
(optional)
-
`issues_enabled`
(optional)
+
`merge_requests_enabled`
(optional)
-
`merge_requests_enabled`
(optional)
+
`wiki_enabled`
(optional)
-
`wiki_enabled`
(optional)
+
`snippets_enabled`
(optional)
-
`snippets_enabled`
(optional)
+
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
+
`visibility_level`
(optional)
-
`visibility_level`
(optional)
*
`import_url`
(optional)
-
`import_url`
(optional)
### Remove project
## Remove project
Removes a project including all associated resources (issues, merge requests etc.)
Removes a project including all associated resources (issues, merge requests etc.)
...
@@ -294,8 +290,7 @@ DELETE /projects/:id
...
@@ -294,8 +290,7 @@ DELETE /projects/:id
Parameters:
Parameters:
+
`id`
(required) - The ID of a project
-
`id`
(required) - The ID of a project
## Team members
## Team members
...
@@ -309,9 +304,8 @@ GET /projects/:id/members
...
@@ -309,9 +304,8 @@ GET /projects/:id/members
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`query`
(optional) - Query string to search for members
-
`query`
(optional) - Query string to search for members
### Get project team member
### Get project team member
...
@@ -323,8 +317,8 @@ GET /projects/:id/members/:user_id
...
@@ -323,8 +317,8 @@ GET /projects/:id/members/:user_id
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`user_id`
(required) - The ID of a user
-
`user_id`
(required) - The ID of a user
```
json
```
json
{
{
...
@@ -338,7 +332,6 @@ Parameters:
...
@@ -338,7 +332,6 @@ Parameters:
}
}
```
```
### Add project team member
### Add project team member
Adds a user to a project team. This is an idempotent method and can be called multiple times
Adds a user to a project team. This is an idempotent method and can be called multiple times
...
@@ -351,10 +344,9 @@ POST /projects/:id/members
...
@@ -351,10 +344,9 @@ POST /projects/:id/members
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`user_id`
(required) - The ID of a user to add
-
`user_id`
(required) - The ID of a user to add
+
`access_level`
(required) - Project access level
-
`access_level`
(required) - Project access level
### Edit project team member
### Edit project team member
...
@@ -366,10 +358,9 @@ PUT /projects/:id/members/:user_id
...
@@ -366,10 +358,9 @@ PUT /projects/:id/members/:user_id
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`user_id`
(required) - The ID of a team member
-
`user_id`
(required) - The ID of a team member
+
`access_level`
(required) - Project access level
-
`access_level`
(required) - Project access level
### Remove project team member
### Remove project team member
...
@@ -381,15 +372,14 @@ DELETE /projects/:id/members/:user_id
...
@@ -381,15 +372,14 @@ DELETE /projects/:id/members/:user_id
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`user_id`
(required) - The ID of a team member
-
`user_id`
(required) - The ID of a team member
This method is idempotent and can be called multiple times with the same parameters.
This method is idempotent and can be called multiple times with the same parameters.
Revoking team membership for a user who is not currently a team member is considered success.
Revoking team membership for a user who is not currently a team member is considered success.
Please note that the returned JSON currently differs slightly. Thus you should not
Please note that the returned JSON currently differs slightly. Thus you should not
rely on the returned JSON structure.
rely on the returned JSON structure.
## Hooks
## Hooks
### List project hooks
### List project hooks
...
@@ -402,8 +392,7 @@ GET /projects/:id/hooks
...
@@ -402,8 +392,7 @@ GET /projects/:id/hooks
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
### Get project hook
### Get project hook
...
@@ -415,8 +404,8 @@ GET /projects/:id/hooks/:hook_id
...
@@ -415,8 +404,8 @@ GET /projects/:id/hooks/:hook_id
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`hook_id`
(required) - The ID of a project hook
-
`hook_id`
(required) - The ID of a project hook
```
json
```
json
{
{
...
@@ -430,7 +419,6 @@ Parameters:
...
@@ -430,7 +419,6 @@ Parameters:
}
}
```
```
### Add project hook
### Add project hook
Adds a hook to a specified project.
Adds a hook to a specified project.
...
@@ -441,12 +429,11 @@ POST /projects/:id/hooks
...
@@ -441,12 +429,11 @@ POST /projects/:id/hooks
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`url`
(required) - The hook URL
-
`url`
(required) - The hook URL
+
`push_events`
- Trigger hook on push events
-
`push_events`
- Trigger hook on push events
+
`issues_events`
- Trigger hook on issues events
-
`issues_events`
- Trigger hook on issues events
+
`merge_requests_events`
- Trigger hook on merge_requests events
-
`merge_requests_events`
- Trigger hook on merge_requests events
### Edit project hook
### Edit project hook
...
@@ -458,13 +445,12 @@ PUT /projects/:id/hooks/:hook_id
...
@@ -458,13 +445,12 @@ PUT /projects/:id/hooks/:hook_id
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`hook_id`
(required) - The ID of a project hook
-
`hook_id`
(required) - The ID of a project hook
+
`url`
(required) - The hook URL
-
`url`
(required) - The hook URL
+
`push_events`
- Trigger hook on push events
-
`push_events`
- Trigger hook on push events
+
`issues_events`
- Trigger hook on issues events
-
`issues_events`
- Trigger hook on issues events
+
`merge_requests_events`
- Trigger hook on merge_requests events
-
`merge_requests_events`
- Trigger hook on merge_requests events
### Delete project hook
### Delete project hook
...
@@ -477,13 +463,12 @@ DELETE /projects/:id/hooks/:hook_id
...
@@ -477,13 +463,12 @@ DELETE /projects/:id/hooks/:hook_id
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`hook_id`
(required) - The ID of hook to delete
-
`hook_id`
(required) - The ID of hook to delete
Note the JSON response differs if the hook is available or not. If the project hook
Note the JSON response differs if the hook is available or not. If the project hook
is available before it is returned in the JSON response or an empty response is returned.
is available before it is returned in the JSON response or an empty response is returned.
## Branches
## Branches
### List branches
### List branches
...
@@ -496,7 +481,7 @@ GET /projects/:id/repository/branches
...
@@ -496,7 +481,7 @@ GET /projects/:id/repository/branches
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
```
json
```
json
[
[
...
@@ -561,9 +546,8 @@ GET /projects/:id/repository/branches/:branch
...
@@ -561,9 +546,8 @@ GET /projects/:id/repository/branches/:branch
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`branch`
(required) - The name of the branch.
-
`branch`
(required) - The name of the branch.
### Protect single branch
### Protect single branch
...
@@ -575,9 +559,8 @@ PUT /projects/:id/repository/branches/:branch/protect
...
@@ -575,9 +559,8 @@ PUT /projects/:id/repository/branches/:branch/protect
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`branch`
(required) - The name of the branch.
-
`branch`
(required) - The name of the branch.
### Unprotect single branch
### Unprotect single branch
...
@@ -589,9 +572,8 @@ PUT /projects/:id/repository/branches/:branch/unprotect
...
@@ -589,9 +572,8 @@ PUT /projects/:id/repository/branches/:branch/unprotect
Parameters:
Parameters:
+
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
-
`id`
(required) - The ID or NAMESPACE/PROJECT_NAME of a project
+
`branch`
(required) - The name of the branch.
-
`branch`
(required) - The name of the branch.
## Admin fork relation
## Admin fork relation
...
@@ -605,8 +587,8 @@ POST /projects/:id/fork/:forked_from_id
...
@@ -605,8 +587,8 @@ POST /projects/:id/fork/:forked_from_id
Parameters:
Parameters:
+
`id`
(required) - The ID of the project
-
`id`
(required) - The ID of the project
+
`forked_from_id:`
(required) - The ID of the project that was forked from
-
`forked_from_id:`
(required) - The ID of the project that was forked from
### Delete an existing forked from relationship
### Delete an existing forked from relationship
...
@@ -616,8 +598,7 @@ DELETE /projects/:id/fork
...
@@ -616,8 +598,7 @@ DELETE /projects/:id/fork
Parameter:
Parameter:
+
`id`
(required) - The ID of the project
-
`id`
(required) - The ID of the project
## Search for projects by name
## Search for projects by name
...
@@ -629,6 +610,6 @@ GET /projects/search/:query
...
@@ -629,6 +610,6 @@ GET /projects/search/:query
Parameters:
Parameters:
+
query (required) - A string contained in the project name
-
query (required) - A string contained in the project name
+
per_page (optional) - number of projects to return per page
-
per_page (optional) - number of projects to return per page
+
page (optional) - the page to retrieve
-
page (optional) - the page to retrieve
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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