Skip to content

Commit e99722b

Browse files
authored
Add labels to create image (#48)
1 parent 2e76150 commit e99722b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

3-
## master (XX.XX.XXXX)
3+
## master
4+
* Feature: Allow specifying labels on `createImage`
45
* Feature: Allow creation of Servers with Networks
56
* Bugfix: The name of ISOs is not set on private ISOs, use the ID instead
67

src/Models/Servers/Server.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,17 @@ public function disableRescue(): APIResponse
332332
* @see https://docs.hetzner.cloud/#resources-server-actions-post-8
333333
* @param string $description
334334
* @param string $type
335+
* @param array $labels
335336
* @return APIResponse
336337
* @throws \LKDev\HetznerCloud\APIException
337338
*/
338-
public function createImage(string $description = '', string $type = 'snapshot'): APIResponse
339+
public function createImage(string $description = '', string $type = 'snapshot', array $labels = []): APIResponse
339340
{
340341
$response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/create_image'), [
341342
'json' => [
342343
'description' => $description,
343344
'type' => $type,
345+
'labels' => $labels,
344346
],
345347
]);
346348
if (! HetznerAPIClient::hasError($response)) {

0 commit comments

Comments
 (0)