Skip to content

Commit ce498e2

Browse files
Added disable runner and enable runner methods (#621)
Co-authored-by: Graham Campbell <[email protected]>
1 parent 64e336b commit ce498e2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/Api/Projects.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,29 @@ public function triggerPipeline($project_id, string $ref, string $token, array $
298298
]);
299299
}
300300

301+
/**
302+
* @param int $project_id
303+
* @param int $runner_id
304+
* @return mixed
305+
*/
306+
public function disableRunner(int $project_id, int $runner_id)
307+
{
308+
return $this->delete('projects/'.self::encodePath($project_id).'/runners/'.self::encodePath($runner_id));
309+
}
310+
311+
/**
312+
* @param int $project_id
313+
* @param int $runner_id
314+
* @return mixed
315+
*/
316+
public function enableRunner(int $project_id, int $runner_id)
317+
{
318+
$parameters = [
319+
'runner_id' => $runner_id
320+
];
321+
return $this->post('projects/'.self::encodePath($project_id).'/runners', $parameters);
322+
}
323+
301324
/**
302325
* @param int|string $project_id
303326
* @param array $parameters {

0 commit comments

Comments
 (0)