File tree 4 files changed +28
-16
lines changed
4 files changed +28
-16
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
this package and not the cluster API. See the changelog of the [ cluster API] ( https://cluster-api.cyberfusion.nl/redoc#section/Changelog )
7
7
for detailed information.
8
8
9
+ ## [ 1.84.0]
10
+
11
+ ### Added
12
+
13
+ - Return task collection on virtual host delete.
14
+
9
15
## [ 1.83.0]
10
16
11
17
### Added
Original file line number Diff line number Diff line change 2
2
3
3
Client for the [ Cyberfusion Cluster API] ( https://cluster-api.cyberfusion.nl/ ) .
4
4
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.
6
6
7
7
## Support
8
8
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class Client implements ClientContract
20
20
{
21
21
private const CONNECT_TIMEOUT = 60 ;
22
22
private const TIMEOUT = 180 ;
23
- private const VERSION = '1.83 .0 ' ;
23
+ private const VERSION = '1.84 .0 ' ;
24
24
private const USER_AGENT = 'cyberfusion-cluster-api-client/ ' . self ::VERSION ;
25
25
26
26
private Configuration $ configuration ;
Original file line number Diff line number Diff line change @@ -178,30 +178,36 @@ public function update(VirtualHost $virtualHost): Response
178
178
179
179
/**
180
180
* @param int $id
181
+ * @param string|null $callbackUrl
181
182
* @return Response
182
183
* @throws RequestException
183
184
*/
184
- public function delete (int $ id ): Response
185
+ public function delete (int $ id, string $ callbackUrl = null ): Response
185
186
{
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
+ );
197
194
198
195
$ request = (new Request ())
199
196
->setMethod (Request::METHOD_DELETE )
200
- ->setUrl (sprintf ( ' virtual-hosts/%d ' , $ id ) );
197
+ ->setUrl ($ url );
201
198
202
- return $ this
199
+ $ response = $ this
203
200
->client
204
201
->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
+ ]);
205
211
}
206
212
207
213
/**
You can’t perform that action at this time.
0 commit comments