diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-02-24 09:23:19 +0100 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-03-03 10:29:37 +0100 |
commit | b795e3a069ec3d6fdfb5fc5942310166de349cd9 (patch) | |
tree | bea0b9710e628ab1e26fc48fcf6204869592a716 /lib/api/v3/deployments.rb | |
parent | 93ed053359f7ece17c97f7c3d15f79821159a522 (diff) | |
download | gitlab-ce-zj-api-rename-v2.tar.gz |
Update tests to passzj-api-rename-v2
Diffstat (limited to 'lib/api/v3/deployments.rb')
-rw-r--r-- | lib/api/v3/deployments.rb | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/lib/api/v3/deployments.rb b/lib/api/v3/deployments.rb index c5feb49b22f..81673ae8814 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 RESTfull 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 Entities::Deployment - 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 Entities::Deployment + end + params do + use :pagination + end + get ':id/deployments' do + authorize! :read_deployment, user_project - present paginate(user_project.deployments), with: Entities::Deployment - end + present paginate(user_project.deployments), with: Entities::Deployment + end - desc 'Gets a specific deployment' do - detail 'This feature was introduced in GitLab 8.11.' - success Entities::Deployment - 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 Entities::Deployment + 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: Entities::Deployment + present deployment, with: Entities::Deployment + end end end end |