module Gitlab::Client::Runners

Defines methods related to runners. @see docs.gitlab.com/ce/api/runners.html

Public Instance Methods

all_runners(options = {}) click to toggle source

Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges. @see docs.gitlab.com/ce/api/runners.html#list-all-runners

@example

Gitlab.all_runners

@param [Hash] options A customizable set of options. @option options [String] :scope The scope of runners to show, one of: specific, shared, active, paused, online; showing all runners if none provided @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/runners.rb, line 30
def all_runners(options = {})
  get("/runners/all", query: options)
end
delete_runner(id) click to toggle source

Remove a runner. @see docs.gitlab.com/ce/api/runners.html#remove-a-runner

@example

Gitlab.delete_runner(42)

@param [Integer, String] id The ID of a runner @return <Gitlab::ObjectifiedHash>

# File lib/gitlab/client/runners.rb, line 71
def delete_runner(id)
  delete("/runners/#{id}")
end
project_disable_runner(id, runner_id) click to toggle source

Disable a specific runner from the project. It works only if the project isn't the only project associated with the specified runner. @see docs.gitlab.com/ce/api/runners.html#disable-a-runner-from-project

@example

Gitlab.project_disable_runner(2, 42)

@param [Integer, String] id The ID of a project. @param [Integer, String] runner_id The ID of a runner. @return <Gitlab::ObjectifiedHash>

# File lib/gitlab/client/runners.rb, line 110
def project_disable_runner(id, runner_id)
  delete("/projects/#{id}/runners/#{runner_id}")
end
project_enable_runner(project_id, id) click to toggle source

Enable an available specific runner in the project. @see docs.gitlab.com/ce/api/runners.html#enable-a-runner-in-project

@example

Gitlab.project_enable_runner(2, 42)

@param [Integer, String] id The ID of a project. @param [Integer, String] id The ID of a runner. @return <Gitlab::ObjectifiedHash>

# File lib/gitlab/client/runners.rb, line 96
def project_enable_runner(project_id, id)
  body = { runner_id: id }
  post("/projects/#{project_id}/runners", body: body)
end
project_runners(project_id) click to toggle source

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. @see docs.gitlab.com/ce/api/runners.html#list-projects-runners

@example

Gitlab.project_runners(42)

@param [Integer, String] id The ID of a project. @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/runners.rb, line 83
def project_runners(project_id)
  get("/projects/#{project_id}/runners")
end
runner(id) click to toggle source

Get details of a runner.. @see docs.gitlab.com/ce/api/runners.html#get-runners-details

@example

Gitlab.runner(42)

@param [Integer, String] id The ID of a runner @return <Gitlab::ObjectifiedHash>

# File lib/gitlab/client/runners.rb, line 42
def runner(id)
  get("/runners/#{id}")
end
runners(options = {}) click to toggle source

Get a list of specific runners available to the user. @see docs.gitlab.com/ce/api/runners.html#list-owned-runners

@example

Gitlab.runners
Gitlab.runners(:active)
Gitlab.runners(:paused)

@param [Hash] options A customizable set of options. @option options [String] :scope The scope of specific runners to show, one of: active, paused, online; showing all runners if none provided @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/runners.rb, line 17
def runners(options = {})
  get("/runners", query: options)
end
update_runner(id, options={}) click to toggle source

Update details of a runner. @see docs.gitlab.com/ce/api/runners.html#update-runners-details

@example

Gitlab.update_runner(42, { description: 'Awesome runner' })
Gitlab.update_runner(42, { active: false })
Gitlab.update_runner(42, { tag_list: [ 'awesome', 'runner' ] })

@param [Integer, String] id The ID of a runner @param [Hash] options A customizable set of options. @option options [String] :active The state of a runner; can be set to true or false. @option options [String] :tag_list The list of tags for a runner; put array of tags, that should be finally assigned to a runner @return <Gitlab::ObjectifiedHash>

# File lib/gitlab/client/runners.rb, line 59
def update_runner(id, options={})
  put("/runners/#{id}", query: options)
end