Skip to content
Snippets Groups Projects
Commit 2f040916 authored by Robert Speicher's avatar Robert Speicher
Browse files

Move `api/v3/deployments` to the correct namespace

parent 34f3d899
No related branches found
No related tags found
No related merge requests found
module API
# Deployments RESTfull API endpoints
# Deployments RESTful API endpoints
class Deployments < Grape::API
include PaginationParams
 
Loading
Loading
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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment