Rundeck API Wrapper for PHP
, (*1)
PHP API Wrapper for Rundeck, (*2)
This package is work in progress, not all api features are currently included., (*3)
The currently tested API version of Rundeck is 20, other versions may work but they are untested., (*4)
Install
You can install the package via composer:, (*5)
composer require darthsoup/rundeck-php
Usage
Init API Wrapper
To init the API wrapper, register a HTTP adapter and create the Rundeck base class., (*6)
require_once '../vendor/autoload.php';
$adapter = new DarthSoup\Rundeck\Adapter\GuzzleHttpAdapter('<yourRundeckApiToken>');
$rundeck = new DarthSoup\Rundeck\Rundeck($adapter, 'https://<yourRundeckUrl>/api/20');
You are now ready to start., (*7)
Start a Job
Jobs are started by runJob with the Job UUID as first parameter.
You also can add a argString to include some options., (*8)
$job = $rundeck->job()->runJob('<YourJobUuid></YourJobUuid>', ['argString' => '-ArgTest1 yourstring'])
var_dump($job);
Execution Info of a Job
The Output of a Execution can returned by this command., (*9)
$execution = $rundeck->execution()->output(<ExecutionId>)
var_dump($execution);
Rundeck System Info
Get current Rundeck System Info, (*10)
$systeminfo = $rundeck->system()->info()
var_dump(systeminfo);
Support
Please open an issue in github, (*11)
License
This package is released under the MIT License. See the bundled
LICENSE file for details., (*12)