summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-06-02 19:06:01 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-06-09 16:00:24 +0800
commit1c302d566b45c83c0c768354b40e86ea0446dfe6 (patch)
treea21beadb296b127495fb0f7b19ec290af840f00d /lib
parent0eeb4bed497e5f6ba2af558869803432bee65f74 (diff)
downloadgitlab-ce-1c302d566b45c83c0c768354b40e86ea0446dfe6.tar.gz
WIP, try to add views for locked runners
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb1
-rw-r--r--lib/api/runners.rb2
-rw-r--r--lib/ci/api/runners.rb3
3 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 50d69274b2e..16eeca8c8ac 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -413,6 +413,7 @@ module API
class RunnerDetails < Runner
expose :tag_list
expose :run_untagged
+ expose :locked
expose :version, :revision, :platform, :architecture
expose :contacted_at
expose :token, if: lambda { |runner, options| options[:current_user].is_admin? || !runner.is_shared? }
diff --git a/lib/api/runners.rb b/lib/api/runners.rb
index 4faba9dc87b..2d09b6193d9 100644
--- a/lib/api/runners.rb
+++ b/lib/api/runners.rb
@@ -49,7 +49,7 @@ module API
runner = get_runner(params[:id])
authenticate_update_runner!(runner)
- attrs = attributes_for_keys [:description, :active, :tag_list, :run_untagged]
+ attrs = attributes_for_keys [:description, :active, :tag_list, :run_untagged, :locked]
if runner.update(attrs)
present runner, with: Entities::RunnerDetails, current_user: current_user
else
diff --git a/lib/ci/api/runners.rb b/lib/ci/api/runners.rb
index 0c41f22c7c5..b4b7261fa3b 100644
--- a/lib/ci/api/runners.rb
+++ b/lib/ci/api/runners.rb
@@ -29,7 +29,8 @@ module Ci
required_attributes! [:token]
attributes = { description: params[:description],
- tag_list: params[:tag_list] }
+ tag_list: params[:tag_list],
+ locked: !!params[:locked] }
unless params[:run_untagged].nil?
attributes[:run_untagged] = params[:run_untagged]