| @@ 10-40 (lines=31) @@ | ||
| 7 | use GuzzleHttp\Psr7\Request; |
|
| 8 | use Lookyman\Rundeck\Api\Client; |
|
| 9 | ||
| 10 | class Project |
|
| 11 | { |
|
| 12 | /** |
|
| 13 | * @var Client |
|
| 14 | */ |
|
| 15 | private $client; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * @param Client $client |
|
| 19 | */ |
|
| 20 | public function __construct(Client $client) |
|
| 21 | { |
|
| 22 | $this->client = $client; |
|
| 23 | } |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @return PromiseInterface |
|
| 27 | */ |
|
| 28 | public function list(): PromiseInterface |
|
| 29 | { |
|
| 30 | return $this->client->getConfiguration()->getGuzzle()->sendAsync( |
|
| 31 | new Request('GET', $this->client->getConfiguration()->getBaseUri() . '/projects') |
|
| 32 | ); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return Job |
|
| 37 | */ |
|
| 38 | public function job(): Job |
|
| 39 | { |
|
| 40 | return new Job($this->client); |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||
| @@ 10-40 (lines=31) @@ | ||
| 7 | use Lookyman\Rundeck\Api\Client; |
|
| 8 | use GuzzleHttp\Psr7\Request; |
|
| 9 | ||
| 10 | class LogStorage |
|
| 11 | { |
|
| 12 | /** |
|
| 13 | * @var Client |
|
| 14 | */ |
|
| 15 | private $client; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * @param Client $client |
|
| 19 | */ |
|
| 20 | public function __construct(Client $client) |
|
| 21 | { |
|
| 22 | $this->client = $client; |
|
| 23 | } |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @return PromiseInterface |
|
| 27 | */ |
|
| 28 | public function info(): PromiseInterface |
|
| 29 | { |
|
| 30 | return $this->client->getConfiguration()->getGuzzle()->sendAsync( |
|
| 31 | new Request('GET', $this->client->getConfiguration()->getBaseUri() . '/system/logstorage') |
|
| 32 | ); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return Incomplete |
|
| 37 | */ |
|
| 38 | public function incomplete(): Incomplete |
|
| 39 | { |
|
| 40 | return new Incomplete($this->client); |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||