Module: Gitlab::Client::Runners
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/runners.rb
Overview
Defines methods related to runners.
Instance Method Summary collapse
-
#all_runners(options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Get a list of all runners in the GitLab instance (specific and shared).
-
#delete_registered_runner(token) ⇒ nil
Deletes a registed Runner.
-
#delete_runner(id) ⇒ nil
Remove a runner.
-
#group_runners(group, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
List all runners (specific and shared) available in the group as well its ancestor groups.
-
#project_disable_runner(id, runner_id) ⇒ Gitlab::ObjectifiedHash
Disable a specific runner from the project.
-
#project_enable_runner(project_id, id) ⇒ Gitlab::ObjectifiedHash
Enable an available specific runner in the project.
-
#project_runners(project_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
List all runners (specific and shared) available in the project.
-
#register_runner(token, options = {}) ⇒ Gitlab::ObjectifiedHash
Register a new Runner for the instance.
-
#runner(id) ⇒ Gitlab::ObjectifiedHash
Get details of a runner..
-
#runner_jobs(runner_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
List jobs that are being processed or were processed by specified runner.
-
#runners(options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Get a list of specific runners available to the user.
-
#update_runner(id, options = {}) ⇒ Gitlab::ObjectifiedHash
Update details of a runner.
-
#verify_auth_registered_runner(token) ⇒ nil
Validates authentication credentials for a registered Runner.
Instance Method Details
#all_runners(options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.
37 38 39 |
# File 'lib/gitlab/client/runners.rb', line 37 def all_runners( = {}) get('/runners/all', query: ) end |
#delete_registered_runner(token) ⇒ nil
Deletes a registed Runner.
194 195 196 197 |
# File 'lib/gitlab/client/runners.rb', line 194 def delete_registered_runner(token) body = { token: token } delete('/runners', body: body) end |
#delete_runner(id) ⇒ nil
Remove a runner.
82 83 84 |
# File 'lib/gitlab/client/runners.rb', line 82 def delete_runner(id) delete("/runners/#{id}") end |
#group_runners(group, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
List all runners (specific and shared) available in the group as well its ancestor groups. Shared runners are listed if at least one shared runner is defined.
162 163 164 |
# File 'lib/gitlab/client/runners.rb', line 162 def group_runners(group, = {}) get("/groups/#{url_encode group}/runners", query: ) end |
#project_disable_runner(id, runner_id) ⇒ Gitlab::ObjectifiedHash
Disable a specific runner from the project. It works only if the project isn’t the only project associated with the specified runner.
144 145 146 |
# File 'lib/gitlab/client/runners.rb', line 144 def project_disable_runner(id, runner_id) delete("/projects/#{url_encode id}/runners/#{runner_id}") end |
#project_enable_runner(project_id, id) ⇒ Gitlab::ObjectifiedHash
Enable an available specific runner in the project.
130 131 132 133 |
# File 'lib/gitlab/client/runners.rb', line 130 def project_enable_runner(project_id, id) body = { runner_id: id } post("/projects/#{url_encode project_id}/runners", body: body) end |
#project_runners(project_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
List all runners (specific and shared) available in the project. Shared runners are listed if at least one shared runner is defined and shared runners usage is enabled in the project’s settings.
117 118 119 |
# File 'lib/gitlab/client/runners.rb', line 117 def project_runners(project_id, = {}) get("/projects/#{url_encode project_id}/runners", query: ) end |
#register_runner(token, options = {}) ⇒ Gitlab::ObjectifiedHash
Register a new Runner for the instance.
182 183 184 185 |
# File 'lib/gitlab/client/runners.rb', line 182 def register_runner(token, = {}) body = { token: token }.merge() post('/runners', body: body) end |
#runner(id) ⇒ Gitlab::ObjectifiedHash
Get details of a runner..
49 50 51 |
# File 'lib/gitlab/client/runners.rb', line 49 def runner(id) get("/runners/#{id}") end |
#runner_jobs(runner_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
List jobs that are being processed or were processed by specified runner.
99 100 101 |
# File 'lib/gitlab/client/runners.rb', line 99 def runner_jobs(runner_id, = {}) get("/runners/#{url_encode runner_id}/jobs", query: ) end |
#runners(options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Get a list of specific runners available to the user.
20 21 22 |
# File 'lib/gitlab/client/runners.rb', line 20 def runners( = {}) get('/runners', query: ) end |
#update_runner(id, options = {}) ⇒ Gitlab::ObjectifiedHash
Update details of a runner.
70 71 72 |
# File 'lib/gitlab/client/runners.rb', line 70 def update_runner(id, = {}) put("/runners/#{id}", body: ) end |
#verify_auth_registered_runner(token) ⇒ nil
Validates authentication credentials for a registered Runner.
206 207 208 209 |
# File 'lib/gitlab/client/runners.rb', line 206 def verify_auth_registered_runner(token) body = { token: token } post('/runners/verify', body: body) end |