summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2016-01-29 16:11:48 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2016-02-19 13:18:46 +0100
commit8c37f0ff3093995566f7f24788f8362f481b56b6 (patch)
tree27cea64837cfe10ca217a939b6f913a50373ab19 /lib
parentd42ced44d9f2ddeae5a76d60273a59d7253ca2b2 (diff)
downloadgitlab-ce-8c37f0ff3093995566f7f24788f8362f481b56b6.tar.gz
Add missing methods documentation; fix rubocop reported violation
Diffstat (limited to 'lib')
-rw-r--r--lib/api/runners.rb37
1 files changed, 36 insertions, 1 deletions
diff --git a/lib/api/runners.rb b/lib/api/runners.rb
index 87b37c05397..b7294258c7d 100644
--- a/lib/api/runners.rb
+++ b/lib/api/runners.rb
@@ -20,6 +20,12 @@ module API
present paginate(runners), with: Entities::Runner
end
+ # Get runner's details
+ #
+ # Parameters:
+ # id (required) - The ID of ther runner
+ # Example Request:
+ # GET /runners/:id
get ':id' do
runner = get_runner(params[:id])
can_show_runner?(runner) unless current_user.is_admin?
@@ -27,6 +33,15 @@ module API
present runner, with: Entities::RunnerDetails
end
+ # Update runner's details
+ #
+ # Parameters:
+ # id (required) - The ID of ther runner
+ # description (optional) - Runner's description
+ # active (optional) - Runner's status
+ # tag_list (optional) - Array of tags for runner
+ # Example Request:
+ # PUT /runners/:id
put ':id' do
runner = get_runner(params[:id])
can_update_runner?(runner) unless current_user.is_admin?
@@ -39,6 +54,12 @@ module API
end
end
+ # Remove runner
+ #
+ # Parameters:
+ # id (required) - The ID of ther runner
+ # Example Request:
+ # DELETE /runners/:id
delete ':id' do
runner = get_runner(params[:id])
can_delete_runner?(runner)
@@ -60,6 +81,13 @@ module API
present paginate(runners), with: Entities::Runner
end
+ # Enable runner for project
+ #
+ # Parameters:
+ # id (required) - The ID of the project
+ # runner_id (required) - The ID of the runner
+ # Example Request:
+ # PUT /projects/:id/runners/:runner_id
put ':id/runners/:runner_id' do
runner = get_runner(params[:runner_id])
can_enable_runner?(runner)
@@ -68,6 +96,13 @@ module API
present runner, with: Entities::Runner
end
+ # Disable project's runner
+ #
+ # Parameters:
+ # id (required) - The ID of the project
+ # runner_id (required) - The ID of the runner
+ # Example Request:
+ # DELETE /projects/:id/runners/:runner_id
delete ':id/runners/:runner_id' do
runner_project = user_project.runner_projects.find_by(runner_id: params[:runner_id])
not_found!('Runner') unless runner_project
@@ -125,7 +160,7 @@ module API
def user_can_access_runner?(runner)
runner.projects.inject(false) do |final, project|
- final ||= abilities.allowed?(current_user, :admin_project, project)
+ final || abilities.allowed?(current_user, :admin_project, project)
end
end
end