Commit 021f96f9 authored by Roman Lacko's avatar Roman Lacko
Browse files

add GitLab::Runners to implement GitLab Runners API calls

parent 3bdfda2d
......@@ -13,6 +13,7 @@ use GitLab::Groups;
use GitLab::Members;
use GitLab::Namespaces;
use GitLab::Projects;
use GitLab::Runners;
use GitLab::Users;
use Try::Tiny;
package GitLab::Runners;
use utf8;
use strict;
use warnings;
use vars qw($VERSION);
use GitLab::API;
use Log::Any qw($log);
our $VERSION = v10.4.1;
my $requests = {
user_runners => {
method => "GET",
path => "/runners",
query => [qw(
paginated => 1,
runners => {
method => "GET",
path => "/runners/all",
query => [qw(
paginated => 1,
runner_by_id => {
method => "GET",
path => "/runners/<rid>",
runner_update => {
method => "PUT",
path => "/runners/<rid>",
optional => [qw(
runner_delete => {
method => "DELETE",
path => "/runners/<rid>",
runner_jobs => {
method => "GET",
path => "/runners/<rid>/jobs",
query => [qw(
paginated => 1,
project_runners => {
method => "GET",
path => "/projects/<proj_id>/runners",
paginated => 1,
project_runner_enable => {
method => "POST",
path => "/projects<proj_id>/runners",
required => [qw(
paginated => 1,
project_runner_disable => {
method => "DELETE",
path => "/projects/<proj_id>/runners/<rid>",
sub import {
$log->debug("initializing " . __PACKAGE__);
while (my ($name, $tmpl) = each(%$requests)) {
$tmpl->{name} = $name unless exists $tmpl->{name};
=head1 NAME
GitLab::Runners - implements runners API calls.
See L<GitLab API -- Projects|> for details and
response formats.
=head1 VERSION
Implements API calls for GitLab CE C<v10.3.3>.
=head2 Notation
Please see the documentation for the L<GitLab::Users> module.
Note that not all optional arguments are listed.
Please refer to the official documentation for the full list.
=head2 List runners
=item L<user_runners()|>
Get a list of B<specific> runners available to the user.
The optional C<scope> parameter can be one of C<active>, C<paused>, C<online>.
=item L<runners()|>
Get a list of all runners in the GitLab instance.
I<This is available only to administrators.>
=item L<runner_by_id()|>
Get details of a runner.
=item L<runner_update()|>
$gitlab->runner_update(:rid, [:description], [:tag_list], ...);
Update details of a runner.
=item L<runner_delete()|>
Remove a runner.
=item L<runner_jobs()|>
$gitlab->runner_jobs(:rid, [:status]);
List jobs that are being processed or were processed by specified Runner..
=item L<project_runners()|>
List all runners available to the project.
Shared runners are listed if at least one shared runner is defined
B<and> shared runners usage is enabled in the project's settings.
=item L<project_runner_enable()|>
$gitlab->project_runner_enable(:proj_id, :rid);
Enable an available B<specific> runner in the project.
=item L<project_runner_disable()|>
$gitlab->project_runner_disable(:proj_id, :rid);
Disable a specific runner from the project.
It works only if the project isn't the only project associated with
the specified runner. If so, an error is returned.
Use the L</runner_delete()> call instead.
=head1 AUTHOR
Roman Lacko <L<>>
=head1 SEE ALSO
=item L<GitLab>
Wrapper around L<GitLab::API> and other C<GitLab::*> modules.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment