module Gitlab::Client::Runners

def all_runners(options = {})

Returns:
  • (Array) -

Options Hash: (**options)
  • :tag_list(optional) (String) -- List of the runners tags (separated by comma)
  • :status(optional) (String) -- The status of runners to show, one of: active, paused, online, offline
  • :type(optional) (String) -- The type of runners to show, one of: instance_type, group_type, project_type

Parameters:
  • options (Hash) -- A customizable set of options.

Other tags:
    See: https://docs.gitlab.com/ce/api/runners.html#list-all-runners -
def all_runners(options = {})
  get('/runners/all', query: options)
end

def create_group_runner(group, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - Response against runner registration

Parameters:
  • options (Hash) -- A customizable set of options.
  • group(required) (String) -- Group ID.
def create_group_runner(group, options = {})
  create_runner({ runner_type: 'group_type', group_id: group }.merge(options))
end

def create_instance_runner(options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - Response against runner registration

Parameters:
  • options (Hash) -- A customizable set of options.
  • group(required) (String) -- Project ID.
def create_instance_runner(options = {})
  create_runner({ runner_type: 'instance_type' }.merge(options))
end

def create_project_runner(project, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - Response against runner registration

Parameters:
  • options (Hash) -- A customizable set of options.
  • project(required) (String) -- Project ID.
def create_project_runner(project, options = {})
  create_runner({ runner_type: 'project_type', project_id: project }.merge(options))
end

def create_runner(options)

Returns:
  • (Gitlab::ObjectifiedHash) - Response against runner registration {"id": 1, "token": foo "token_expires_at": null}

Options Hash: (**options)
  • :maintenance_note(optional) (String) -- Free-form maintenance notes for the runner (1024 characters).
  • :maximum_timeout(optional) (Integer) -- Maximum timeout set when this Runner will handle the job.
  • :access_level(optional) (String) -- Access level of the runner; not_protected or ref_protected.
  • :tag_list(optional) (Array) -- List of Runner tags.
  • :run_untagged(optional) (Boolean) -- Whether the Runner should handle untagged jobs.
  • :locked(optional) (Boolean) -- Whether the Runner should be locked for current project.
  • :paused(optional) (Boolean) -- Whether the Runner ignores new jobs.
  • :info(optional) (Hash) -- Runner metadata.
  • :description(optional) (String) -- Runner description.

Parameters:
  • options(required) (Hash) -- A customizable set of options.
def create_runner(options)
  post('/user/runners', body: options)
end

def delete_registered_runner(token)

Returns:
  • (nil) - This API call returns an empty response body.

Parameters:
  • token (String) -- Runner authentication token.
def delete_registered_runner(token)
  body = { token: token }
  delete('/runners', body: body)
end

def delete_runner(id)

Returns:
  • (nil) - This API call returns an empty response body.

Parameters:
  • id (Integer, String) -- The ID of a runner

Other tags:
    See: https://docs.gitlab.com/ce/api/runners.html#remove-a-runner -
def delete_runner(id)
  delete("/runners/#{id}")
end

def group_runners(group, options = {})

Returns:
  • (Array) -

Options Hash: (**options)
  • :tag_list(optional) (String) -- List of the runners tags (separated by comma)
  • :status(optional) (String) -- The status of runners to show, one of: active, paused, online, offline
  • :type(optional) (String) -- The type of runners to show, one of: instance_type, group_type, project_type

Parameters:
  • options (Hash) -- A customizable set of options.
  • id (Integer, String) -- The ID or name of a project.

Other tags:
    See: https://docs.gitlab.com/ee/api/runners.html#list-groups-runners -
def group_runners(group, options = {})
  get("/groups/#{url_encode group}/runners", query: options)
end

def project_disable_runner(id, runner_id)

Returns:
  • (Gitlab::ObjectifiedHash) -

Parameters:
  • runner_id (Integer, String) -- The ID of a runner.
  • id (Integer, String) -- The ID or name of a project.

Other tags:
    See: https://docs.gitlab.com/ce/api/runners.html#disable-a-runner-from-project -
def project_disable_runner(id, runner_id)
  delete("/projects/#{url_encode id}/runners/#{runner_id}")
end

def project_enable_runner(project_id, id)

Returns:
  • (Gitlab::ObjectifiedHash) -

Parameters:
  • id (Integer, String) -- The ID of a runner.
  • id (Integer, String) -- The ID or name of a project.

Other tags:
    See: https://docs.gitlab.com/ce/api/runners.html#enable-a-runner-in-project -
def project_enable_runner(project_id, id)
  body = { runner_id: id }
  post("/projects/#{url_encode project_id}/runners", body: body)
end

def project_runners(project_id, options = {})

Returns:
  • (Array) -

Options Hash: (**options)
  • :tag_list(optional) (String) -- List of the runners tags (separated by comma)
  • :status(optional) (String) -- The status of runners to show, one of: active, paused, online, offline
  • :type(optional) (String) -- The type of runners to show, one of: instance_type, group_type, project_type

Parameters:
  • options (Hash) -- A customizable set of options.
  • id (Integer, String) -- The ID or name of a project.

Other tags:
    See: https://docs.gitlab.com/ce/api/runners.html#list-projects-runners -
def project_runners(project_id, options = {})
  get("/projects/#{url_encode project_id}/runners", query: options)
end

def register_runner(token, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - Response against runner registration

Options Hash: (**options)
  • :maximum_timeout(optional) (Integer) -- Maximum timeout set when this Runner will handle the job.
  • :tag_list(optional) (Array) -- List of Runner tags.
  • :run_untagged(optional) (Boolean) -- Whether the Runner should handle untagged jobs.
  • :locked(optional) (Boolean) -- Whether the Runner should be locked for current project.
  • :active(optional) (Boolean) -- Whether the Runner is active.
  • :info(optional) (Hash) -- Runner metadata.
  • :description(optional) (String) -- Runner description.

Parameters:
  • options (Hash) -- A customizable set of options.
  • token(required) (String) -- Registration token.
def register_runner(token, options = {})
  body = { token: token }.merge(options)
  post('/runners', body: body)
end

def runner(id)

Returns:
  • (Gitlab::ObjectifiedHash) -

Parameters:
  • id (Integer, String) -- The ID of a runner

Other tags:
    See: https://docs.gitlab.com/ce/api/runners.html#get-runners-details -
def runner(id)
  get("/runners/#{id}")
end

def runner_jobs(runner_id, options = {})

Returns:
  • (Array) -

Options Hash: (**options)
  • :sort(optional) (String) -- Sort jobs in asc or desc order (default: desc)
  • :order_by(optional) (String) -- Order jobs by id.
  • :status(optional) (String) -- Status of the job; one of: running, success, failed, canceled

Parameters:
  • options (Hash) -- A customizable set of options.
  • id (Integer) -- The ID of a runner.
def runner_jobs(runner_id, options = {})
  get("/runners/#{url_encode runner_id}/jobs", query: options)
end

def runners(options = {})

Returns:
  • (Array) -

Options Hash: (**options)
  • :tag_list(optional) (String) -- List of the runners tags (separated by comma)
  • :status(optional) (String) -- The status of runners to show, one of: active, paused, online, offline
  • :type(optional) (String) -- The type of runners to show, one of: instance_type, group_type, project_type

Parameters:
  • options (Hash) -- A customizable set of options.

Other tags:
    See: https://docs.gitlab.com/ce/api/runners.html#list-owned-runners -
def runners(options = {})
  get('/runners', query: options)
end

def update_runner(id, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) -

Options Hash: (**options)
  • :maximum_timeout(optional) (Integer) -- Maximum timeout set when this runner will handle the job
  • :access_level(optional) (String) -- The access_level of the runner; not_protected or ref_protected
  • :locked(optional) (Boolean) -- Flag indicating the runner is locked
  • :run_untagged(optional) (Boolean) -- Flag indicating the runner can execute untagged jobs
  • :tag_list(optional) (String) -- The list of tags for a runner; put array of tags, that should be finally assigned to a runner(separated by comma)
  • :active(optional) (Boolean) -- The state of a runner; can be set to true or false
  • :description(optional) (String) -- The description of a runner

Parameters:
  • options (Hash) -- A customizable set of options.
  • id (Integer, String) -- The ID of a runner

Other tags:
    See: https://docs.gitlab.com/ce/api/runners.html#update-runners-details -
def update_runner(id, options = {})
  put("/runners/#{id}", body: options)
end

def verify_auth_registered_runner(token)

Returns:
  • (nil) - This API call returns an empty response body.

Parameters:
  • token (String) -- Runner authentication token.
def verify_auth_registered_runner(token)
  body = { token: token }
  post('/runners/verify', body: body)
end