Skip to content

Commit 779bb19

Browse files
authored
Merge pull request #28 from CyberfusionNL/1.84.0
Version 1.84.0
2 parents 97abb25 + 68a6d87 commit 779bb19

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
this package and not the cluster API. See the changelog of the [cluster API](https://cluster-api.cyberfusion.nl/redoc#section/Changelog)
77
for detailed information.
88

9+
## [1.84.0]
10+
11+
### Added
12+
13+
- Return task collection on virtual host delete.
14+
915
## [1.83.0]
1016

1117
### Added

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Client for the [Cyberfusion Cluster API](https://cluster-api.cyberfusion.nl/).
44

5-
This client was built for and tested on the **1.158** version of the API.
5+
This client was built for and tested on the **1.159.1** version of the API.
66

77
## Support
88

src/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Client implements ClientContract
2020
{
2121
private const CONNECT_TIMEOUT = 60;
2222
private const TIMEOUT = 180;
23-
private const VERSION = '1.83.0';
23+
private const VERSION = '1.84.0';
2424
private const USER_AGENT = 'cyberfusion-cluster-api-client/' . self::VERSION;
2525

2626
private Configuration $configuration;

src/Endpoints/VirtualHosts.php

+20-14
Original file line numberDiff line numberDiff line change
@@ -178,30 +178,36 @@ public function update(VirtualHost $virtualHost): Response
178178

179179
/**
180180
* @param int $id
181+
* @param string|null $callbackUrl
181182
* @return Response
182183
* @throws RequestException
183184
*/
184-
public function delete(int $id): Response
185+
public function delete(int $id, string $callbackUrl = null): Response
185186
{
186-
// Log the affected cluster by retrieving the model first
187-
$result = $this->get($id);
188-
if ($result->isSuccess()) {
189-
$clusterId = $result
190-
->getData('virtualHost')
191-
->getClusterId();
192-
193-
$this
194-
->client
195-
->addAffectedCluster($clusterId);
196-
}
187+
$url = Str::optionalQueryParameters(
188+
sprintf(
189+
'virtual-hosts/%d',
190+
$id,
191+
),
192+
['callback_url' => $callbackUrl]
193+
);
197194

198195
$request = (new Request())
199196
->setMethod(Request::METHOD_DELETE)
200-
->setUrl(sprintf('virtual-hosts/%d', $id));
197+
->setUrl($url);
201198

202-
return $this
199+
$response = $this
203200
->client
204201
->request($request);
202+
if (!$response->isSuccess()) {
203+
return $response;
204+
}
205+
206+
$taskCollection = (new TaskCollection())->fromArray($response->getData());
207+
208+
return $response->setData([
209+
'taskCollection' => $taskCollection,
210+
]);
205211
}
206212

207213
/**

0 commit comments

Comments
 (0)