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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
6c32fc56
Commit
6c32fc56
authored
Dec 28, 2016
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grapify the license API
parent
cf046802
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
lib/api/license.rb
lib/api/license.rb
+9
-13
No files found.
lib/api/license.rb
View file @
6c32fc56
...
@@ -3,26 +3,22 @@ module API
...
@@ -3,26 +3,22 @@ module API
before
{
authenticated_as_admin!
}
before
{
authenticated_as_admin!
}
resource
:license
do
resource
:license
do
# Get information on the currently active license
desc
'Get information on the currently active license'
do
#
success
Entities
::
License
# Example request:
end
# GET /license
get
do
get
do
license
=
::
License
.
current
license
=
::
License
.
current
present
license
,
with:
Entities
::
License
present
license
,
with:
Entities
::
License
end
end
# Add a new license
desc
'Add a new license'
do
#
success
Entities
::
License
# Parameters:
end
# license (required) - The license text
params
do
#
requires
:license
,
type:
String
,
desc:
'The license text'
# Example request:
end
# POST /license
post
do
post
do
required_attributes!
[
:license
]
license
=
::
License
.
new
(
data:
params
[
:license
])
license
=
::
License
.
new
(
data:
params
[
:license
])
if
license
.
save
if
license
.
save
present
license
,
with:
Entities
::
License
present
license
,
with:
Entities
::
License
...
...
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