darthsoup / rundeck-php
rundeck php api
Requires
- php: >=7.0.0
Requires (Dev)
- guzzlehttp/guzzle: ~6.0
- mockery/mockery: ~0.9
- phpunit/phpunit: ~6.0
Suggests
- guzzlehttp/guzzle: useable with guzzle 5 or 6
This package is auto-updated.
Last update: 2024-11-07 04:25:32 UTC
README
PHP API Wrapper for Rundeck
This package is work in progress, not all api features are currently included.
The currently tested API version of Rundeck is 20
, other versions may work but they are untested.
Install
You can install the package via composer:
composer require darthsoup/rundeck-php
Usage
Init API Wrapper
To init the API wrapper, register a HTTP adapter and create the Rundeck base class.
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.
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.
$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.
$execution = $rundeck->execution()->output(<ExecutionId>) var_dump($execution);
Rundeck System Info
Get current Rundeck System Info
$systeminfo = $rundeck->system()->info() var_dump(systeminfo);
Support
Please open an issue in github
License
This package is released under the MIT License. See the bundled LICENSE file for details.