steffenbrand / bamboo-api-client
There is no license information available for the latest version (v1.3.0) of this package.
Bamboo API Client
v1.3.0
2017-12-22 14:20 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^6.4
README
PHP client for Bamboo API (6.1.1)
Limitations
Currently only supports the following methods:
/rest/api/latest/result/{key}
(getLatestResultByKey)/rest/api/latest/plan
(getPlanList)
How to install
composer require steffenbrand/bamboo-api-client
How to use
getLatestResultByKey
try { $client = new BambooClient( 'http://bamboo.dev', 'user', 'pass' ); $result = $client->getLatestResultByKey('MYPLAN-KEY'); $result->getNumber(); $result->getState(); $result->getLink()->getHref(); $result->getPlan()->getKey(); $result->getPlan()->getName(); $result->getPlan()->getShortKey(); $result->getPlan()->getShortName(); $result->getPlan()->getLink()->getHref(); } catch (BambooRequestException $e) { // Request might fail } catch (\RuntimeException $e) { // Something could go wrong during runtime }
getPlanList
try { $client = new BambooClient( 'http://bamboo.dev', 'user', 'pass' ); $result = $client->getPlanList(); if (count($result) > 0) { foreach ($result as $plan) { $plan->getKey(); $plan->getName(); $plan->getShortKey(); $plan->getShortName(); $plan->getLink()->getHref(); } } } catch (BambooRequestException $e) { // Request might fail } catch (\RuntimeException $e) { // Something could go wrong during runtime }