| @@ 10-44 (lines=35) @@ | ||
| 7 | use Lookyman\Rundeck\Api\Client; |
|
| 8 | use GuzzleHttp\Psr7\Request; |
|
| 9 | ||
| 10 | class Execution |
|
| 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 enable(): PromiseInterface |
|
| 29 | { |
|
| 30 | return $this->client->getConfiguration()->getGuzzle()->sendAsync( |
|
| 31 | new Request('POST', $this->client->getConfiguration()->getBaseUri() . '/system/executions/enable') |
|
| 32 | ); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return PromiseInterface |
|
| 37 | */ |
|
| 38 | public function disable(): PromiseInterface |
|
| 39 | { |
|
| 40 | return $this->client->getConfiguration()->getGuzzle()->sendAsync( |
|
| 41 | new Request('POST', $this->client->getConfiguration()->getBaseUri() . '/system/executions/disable') |
|
| 42 | ); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| @@ 10-44 (lines=35) @@ | ||
| 7 | use Lookyman\Rundeck\Api\Client; |
|
| 8 | use GuzzleHttp\Psr7\Request; |
|
| 9 | ||
| 10 | class Incomplete |
|
| 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() . '/system/logstorage/incomplete') |
|
| 32 | ); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return PromiseInterface |
|
| 37 | */ |
|
| 38 | public function resume(): PromiseInterface |
|
| 39 | { |
|
| 40 | return $this->client->getConfiguration()->getGuzzle()->sendAsync( |
|
| 41 | new Request('POST', $this->client->getConfiguration()->getBaseUri() . '/system/logstorage/incomplete/resume') |
|
| 42 | ); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||