summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-03-06 12:19:15 -0500
committerRobert Speicher <rspeicher@gmail.com>2017-03-06 12:21:04 -0500
commit2f040916a1efb2c04a82d3e9936f0bcfe35ea7f6 (patch)
treec349b8824216cf88a2d413a83378f6a1a13cc7ef
parent34f3d8999a10b14edd0a440cac7b40d11589b54c (diff)
downloadgitlab-ce-2f040916a1efb2c04a82d3e9936f0bcfe35ea7f6.tar.gz
Move `api/v3/deployments` to the correct namespace
-rw-r--r--lib/api/deployments.rb2
-rw-r--r--lib/api/v3/deployments.rb58
2 files changed, 31 insertions, 29 deletions
diff --git a/lib/api/deployments.rb b/lib/api/deployments.rb
index c5feb49b22f..2f1ad12c38c 100644
--- a/lib/api/deployments.rb
+++ b/lib/api/deployments.rb
@@ -1,5 +1,5 @@
module API
- # Deployments RESTfull API endpoints
+ # Deployments RESTful API endpoints
class Deployments < Grape::API
include PaginationParams
diff --git a/lib/api/v3/deployments.rb b/lib/api/v3/deployments.rb
index 545485fac0a..95114ad1fe1 100644
--- a/lib/api/v3/deployments.rb
+++ b/lib/api/v3/deployments.rb
@@ -1,40 +1,42 @@
module API
- # Deployments RESTfull API endpoints
- class Deployments < Grape::API
- include PaginationParams
+ module V3
+ # Deployments RESTful API endpoints
+ class Deployments < Grape::API
+ include PaginationParams
- before { authenticate! }
+ before { authenticate! }
- params do
- requires :id, type: String, desc: 'The project ID'
- end
- resource :projects do
- desc 'Get all deployments of the project' do
- detail 'This feature was introduced in GitLab 8.11.'
- success ::API::V3::Deployments
- end
params do
- use :pagination
+ requires :id, type: String, desc: 'The project ID'
end
- get ':id/deployments' do
- authorize! :read_deployment, user_project
+ resource :projects do
+ desc 'Get all deployments of the project' do
+ detail 'This feature was introduced in GitLab 8.11.'
+ success ::API::V3::Deployments
+ end
+ params do
+ use :pagination
+ end
+ get ':id/deployments' do
+ authorize! :read_deployment, user_project
- present paginate(user_project.deployments), with: ::API::V3::Deployments
- end
+ present paginate(user_project.deployments), with: ::API::V3::Deployments
+ end
- desc 'Gets a specific deployment' do
- detail 'This feature was introduced in GitLab 8.11.'
- success ::API::V3::Deployments
- end
- params do
- requires :deployment_id, type: Integer, desc: 'The deployment ID'
- end
- get ':id/deployments/:deployment_id' do
- authorize! :read_deployment, user_project
+ desc 'Gets a specific deployment' do
+ detail 'This feature was introduced in GitLab 8.11.'
+ success ::API::V3::Deployments
+ end
+ params do
+ requires :deployment_id, type: Integer, desc: 'The deployment ID'
+ end
+ get ':id/deployments/:deployment_id' do
+ authorize! :read_deployment, user_project
- deployment = user_project.deployments.find(params[:deployment_id])
+ deployment = user_project.deployments.find(params[:deployment_id])
- present deployment, with: ::API::V3::Deployments
+ present deployment, with: ::API::V3::Deployments
+ end
end
end
end