From 6d86f86677fec23e6fd8a69d20d787e234e0fb53 Mon Sep 17 00:00:00 2001 From: Jonas L Date: Tue, 2 Apr 2024 16:30:52 +0200 Subject: [PATCH] feat: add `include_deprecated` option when fetching images by name (#375) Allow to get a deprecated image by name. --- hcloud/images/client.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hcloud/images/client.py b/hcloud/images/client.py index d60d948..a7d41e0 100644 --- a/hcloud/images/client.py +++ b/hcloud/images/client.py @@ -325,6 +325,8 @@ def get_by_name_and_architecture( self, name: str, architecture: str, + *, + include_deprecated: bool | None = None, ) -> BoundImage | None: """Get image by name @@ -332,9 +334,15 @@ def get_by_name_and_architecture( Used to identify the image. :param architecture: str Used to identify the image. + :param include_deprecated: bool (optional) + Include deprecated images. Default: False :return: :class:`BoundImage ` """ - return self._get_first_by(name=name, architecture=[architecture]) + return self._get_first_by( + name=name, + architecture=[architecture], + include_deprecated=include_deprecated, + ) def update( self,