Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steffenbrand/bamboo-api-client
PHP client for Bamboo API
https://github.com/steffenbrand/bamboo-api-client
bamboo bamboo-api webservice-client
Last synced: 11 days ago
JSON representation
PHP client for Bamboo API
- Host: GitHub
- URL: https://github.com/steffenbrand/bamboo-api-client
- Owner: steffenbrand
- License: unlicense
- Created: 2017-10-19T11:37:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-02T07:57:49.000Z (about 7 years ago)
- Last Synced: 2024-12-06T15:51:49.663Z (about 2 months ago)
- Topics: bamboo, bamboo-api, webservice-client
- Language: PHP
- Homepage: https://github.com/steffenbrand/bamboo-api-client
- Size: 30.3 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Bamboo API Client
PHP client for Bamboo API (6.1.1)* [Bamboo API Client on Packagist](https://packagist.org/packages/steffenbrand/bamboo-api-client)
* [Bamboo API Client on GitHub](https://github.com/steffenbrand/bamboo-api-client)## 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
```php
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
```php
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
}
```