Skip to content

Commit 6d86f86

Browse files
authored
feat: add include_deprecated option when fetching images by name (#375)
Allow to get a deprecated image by name.
1 parent b24de80 commit 6d86f86

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

hcloud/images/client.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,16 +325,24 @@ def get_by_name_and_architecture(
325325
self,
326326
name: str,
327327
architecture: str,
328+
*,
329+
include_deprecated: bool | None = None,
328330
) -> BoundImage | None:
329331
"""Get image by name
330332
331333
:param name: str
332334
Used to identify the image.
333335
:param architecture: str
334336
Used to identify the image.
337+
:param include_deprecated: bool (optional)
338+
Include deprecated images. Default: False
335339
:return: :class:`BoundImage <hcloud.images.client.BoundImage>`
336340
"""
337-
return self._get_first_by(name=name, architecture=[architecture])
341+
return self._get_first_by(
342+
name=name,
343+
architecture=[architecture],
344+
include_deprecated=include_deprecated,
345+
)
338346

339347
def update(
340348
self,

0 commit comments

Comments
 (0)