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) ⇒ Gitlab::ObjectifiedHash
Remove a runner.
-
#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) ⇒ 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>
Gets a list of Jobs for a 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.
31 32 33 |
# File 'lib/gitlab/client/runners.rb', line 31 def all_runners( = {}) get('/runners/all', query: ) end |
#delete_registered_runner(token) ⇒ nil
Deletes a registed Runner.
156 157 158 159 |
# File 'lib/gitlab/client/runners.rb', line 156 def delete_registered_runner(token) body = { token: token } delete('/runners', body: body) end |
#delete_runner(id) ⇒ Gitlab::ObjectifiedHash
Remove a runner.
72 73 74 |
# File 'lib/gitlab/client/runners.rb', line 72 def delete_runner(id) delete("/runners/#{id}") 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.
124 125 126 |
# File 'lib/gitlab/client/runners.rb', line 124 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.
110 111 112 113 |
# File 'lib/gitlab/client/runners.rb', line 110 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) ⇒ 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.
97 98 99 |
# File 'lib/gitlab/client/runners.rb', line 97 def project_runners(project_id) get("/projects/#{url_encode project_id}/runners") end |
#register_runner(token, options = {}) ⇒ Gitlab::ObjectifiedHash
Register a new Runner for the instance.
144 145 146 147 |
# File 'lib/gitlab/client/runners.rb', line 144 def register_runner(token, = {}) body = { token: token }.merge() post('/runners', body: body) end |
#runner(id) ⇒ Gitlab::ObjectifiedHash
Get details of a runner..
43 44 45 |
# File 'lib/gitlab/client/runners.rb', line 43 def runner(id) get("/runners/#{id}") end |
#runner_jobs(runner_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of Jobs for a Runner
85 86 87 |
# File 'lib/gitlab/client/runners.rb', line 85 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.
18 19 20 |
# File 'lib/gitlab/client/runners.rb', line 18 def runners( = {}) get('/runners', query: ) end |
#update_runner(id, options = {}) ⇒ Gitlab::ObjectifiedHash
Update details of a runner.
60 61 62 |
# File 'lib/gitlab/client/runners.rb', line 60 def update_runner(id, = {}) put("/runners/#{id}", query: ) end |
#verify_auth_registered_runner(token) ⇒ nil
Validates authentication credentials for a registered Runner.
168 169 170 171 |
# File 'lib/gitlab/client/runners.rb', line 168 def verify_auth_registered_runner(token) body = { token: token } post('/runners/verify', body: body) end |