Skip to content

Commit

Permalink
feat: add include_deprecated option when fetching images by name (#375
Browse files Browse the repository at this point in the history
)

Allow to get a deprecated image by name.
  • Loading branch information
jooola authored Apr 2, 2024
1 parent b24de80 commit 6d86f86
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion hcloud/images/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,24 @@ def get_by_name_and_architecture(
self,
name: str,
architecture: str,
*,
include_deprecated: bool | None = None,
) -> BoundImage | None:
"""Get image by name
:param name: str
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 <hcloud.images.client.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,
Expand Down

0 comments on commit 6d86f86

Please sign in to comment.