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
Léo-Paul Géneau
gitlab-ce
Commits
8cdfa86b
Commit
8cdfa86b
authored
Jul 11, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3993 from bke-drewb/3599
Issue 3599: Add snippets_enabled flag to projects for API
parents
7740005b
31b06ebd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
19 deletions
+27
-19
doc/api/projects.md
doc/api/projects.md
+13
-9
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/api/projects.rb
lib/api/projects.rb
+13
-9
No files found.
doc/api/projects.md
View file @
8cdfa86b
...
@@ -53,6 +53,7 @@ GET /projects
...
@@ -53,6 +53,7 @@ GET /projects
"merge_requests_enabled"
:
true
,
"merge_requests_enabled"
:
true
,
"wall_enabled"
:
true
,
"wall_enabled"
:
true
,
"wiki_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
true
,
"created_at"
:
"2012-05-30T12:49:20Z"
,
"created_at"
:
"2012-05-30T12:49:20Z"
,
"last_activity_at"
:
"2012-05-23T08:05:02Z"
"last_activity_at"
:
"2012-05-23T08:05:02Z"
}
}
...
@@ -95,6 +96,7 @@ Parameters:
...
@@ -95,6 +96,7 @@ Parameters:
"merge_requests_enabled"
:
true
,
"merge_requests_enabled"
:
true
,
"wall_enabled"
:
true
,
"wall_enabled"
:
true
,
"wiki_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
true
,
"created_at"
:
"2012-05-30T12:49:20Z"
,
"created_at"
:
"2012-05-30T12:49:20Z"
,
"last_activity_at"
:
"2012-05-23T08:05:02Z"
"last_activity_at"
:
"2012-05-23T08:05:02Z"
}
}
...
@@ -182,10 +184,11 @@ Parameters:
...
@@ -182,10 +184,11 @@ Parameters:
+
`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) - enabled by default
+
`issues_enabled`
(optional)
+
`wall_enabled`
(optional) - enabled by default
+
`wall_enabled`
(optional)
+
`merge_requests_enabled`
(optional) - enabled by default
+
`merge_requests_enabled`
(optional)
+
`wiki_enabled`
(optional) - enabled by default
+
`wiki_enabled`
(optional)
+
`snippets_enabled`
(optional)
**Project access levels**
**Project access levels**
...
@@ -213,10 +216,11 @@ Parameters:
...
@@ -213,10 +216,11 @@ Parameters:
+
`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) - enabled by default
+
`issues_enabled`
(optional)
+
`wall_enabled`
(optional) - enabled by default
+
`wall_enabled`
(optional)
+
`merge_requests_enabled`
(optional) - enabled by default
+
`merge_requests_enabled`
(optional)
+
`wiki_enabled`
(optional) - enabled by default
+
`wiki_enabled`
(optional)
+
`snippets_enabled`
(optional)
...
...
lib/api/entities.rb
View file @
8cdfa86b
...
@@ -36,7 +36,7 @@ module API
...
@@ -36,7 +36,7 @@ module API
expose
:owner
,
using:
Entities
::
UserBasic
expose
:owner
,
using:
Entities
::
UserBasic
expose
:name
,
:name_with_namespace
expose
:name
,
:name_with_namespace
expose
:path
,
:path_with_namespace
expose
:path
,
:path_with_namespace
expose
:issues_enabled
,
:merge_requests_enabled
,
:wall_enabled
,
:wiki_enabled
,
:created_at
,
:last_activity_at
expose
:issues_enabled
,
:merge_requests_enabled
,
:wall_enabled
,
:wiki_enabled
,
:
snippets_enabled
,
:
created_at
,
:last_activity_at
expose
:namespace
expose
:namespace
expose
:forked_from_project
,
using:
Entities
::
ForkedFromProject
,
:if
=>
lambda
{
|
project
,
options
|
project
.
forked?
}
expose
:forked_from_project
,
using:
Entities
::
ForkedFromProject
,
:if
=>
lambda
{
|
project
,
options
|
project
.
forked?
}
end
end
...
...
lib/api/projects.rb
View file @
8cdfa86b
...
@@ -61,10 +61,11 @@ module API
...
@@ -61,10 +61,11 @@ module API
# name (required) - name for new project
# name (required) - name for new project
# 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) - enabled by default
# issues_enabled (optional)
# wall_enabled (optional) - enabled by default
# wall_enabled (optional)
# merge_requests_enabled (optional) - enabled by default
# merge_requests_enabled (optional)
# wiki_enabled (optional) - enabled by default
# wiki_enabled (optional)
# snippets_enabled (optional)
# namespace_id (optional) - defaults to user namespace
# namespace_id (optional) - defaults to user namespace
# Example Request
# Example Request
# POST /projects
# POST /projects
...
@@ -77,6 +78,7 @@ module API
...
@@ -77,6 +78,7 @@ module API
:wall_enabled
,
:wall_enabled
,
:merge_requests_enabled
,
:merge_requests_enabled
,
:wiki_enabled
,
:wiki_enabled
,
:snippets_enabled
,
:namespace_id
]
:namespace_id
]
@project
=
::
Projects
::
CreateContext
.
new
(
current_user
,
attrs
).
execute
@project
=
::
Projects
::
CreateContext
.
new
(
current_user
,
attrs
).
execute
if
@project
.
saved?
if
@project
.
saved?
...
@@ -96,10 +98,11 @@ module API
...
@@ -96,10 +98,11 @@ module API
# name (required) - name for new project
# name (required) - name for new project
# 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) - enabled by default
# issues_enabled (optional)
# wall_enabled (optional) - enabled by default
# wall_enabled (optional)
# merge_requests_enabled (optional) - enabled by default
# merge_requests_enabled (optional)
# wiki_enabled (optional) - enabled by default
# wiki_enabled (optional)
# snippets_enabled (optional)
# Example Request
# Example Request
# POST /projects/user/:user_id
# POST /projects/user/:user_id
post
"user/:user_id"
do
post
"user/:user_id"
do
...
@@ -111,7 +114,8 @@ module API
...
@@ -111,7 +114,8 @@ module API
:issues_enabled
,
:issues_enabled
,
:wall_enabled
,
:wall_enabled
,
:merge_requests_enabled
,
:merge_requests_enabled
,
:wiki_enabled
]
:wiki_enabled
,
:snippets_enabled
]
@project
=
::
Projects
::
CreateContext
.
new
(
user
,
attrs
).
execute
@project
=
::
Projects
::
CreateContext
.
new
(
user
,
attrs
).
execute
if
@project
.
saved?
if
@project
.
saved?
present
@project
,
with:
Entities
::
Project
present
@project
,
with:
Entities
::
Project
...
...
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