From af91b36146a571f77f188bda4d9ee5779ac952b6 Mon Sep 17 00:00:00 2001 From: "Jonas L." Date: Wed, 10 Dec 2025 11:34:17 +0100 Subject: [PATCH] feat: add experimental markers for storage boxes (#757) ##### SUMMARY Mark storage box support as experimental, see #756 for more details. How to: https://github.com/ansible-collections/hetzner.hcloud?tab=readme-ov-file#releasing-experimental-features --- plugins/module_utils/experimental.py | 7 +++++++ plugins/modules/storage_box.py | 7 +++++++ plugins/modules/storage_box_info.py | 7 +++++++ plugins/modules/storage_box_snapshot.py | 7 +++++++ plugins/modules/storage_box_snapshot_info.py | 7 +++++++ plugins/modules/storage_box_subaccount.py | 7 +++++++ plugins/modules/storage_box_subaccount_info.py | 7 +++++++ plugins/modules/storage_box_type_info.py | 7 +++++++ 8 files changed, 56 insertions(+) diff --git a/plugins/module_utils/experimental.py b/plugins/module_utils/experimental.py index e253e87..28a9198 100644 --- a/plugins/module_utils/experimental.py +++ b/plugins/module_utils/experimental.py @@ -32,3 +32,10 @@ def experimental_warning_function(product: str, maturity: str, url: str): module.warn(message) return fn + + +storage_box_experimental_warning = experimental_warning_function( + "Storage Box support", + "experimental", + "https://github.com/ansible-collections/hetzner.hcloud/issues/756", +) diff --git a/plugins/modules/storage_box.py b/plugins/modules/storage_box.py index 4086a08..a6f4b23 100644 --- a/plugins/modules/storage_box.py +++ b/plugins/modules/storage_box.py @@ -15,6 +15,8 @@ short_description: Create and manage Storage Boxes in Hetzner. description: - Create, update and delete Storage Boxes in Hetzner. - See the L(Storage Boxes API documentation,https://docs.hetzner.cloud/reference/hetzner#storage-boxes) for more details. + - B(Experimental:) Storage Box support is experimental, breaking changes may occur within minor releases. + See https://github.com/ansible-collections/hetzner.hcloud/issues/756 for more details. author: - Jonas Lammler (@jooola) @@ -342,6 +344,7 @@ hcloud_storage_box: from ..module_utils import storage_box from ..module_utils.client import client_resource_not_found +from ..module_utils.experimental import storage_box_experimental_warning from ..module_utils.hcloud import AnsibleHCloud, AnsibleModule from ..module_utils.vendor.hcloud import HCloudException from ..module_utils.vendor.hcloud.locations import Location @@ -359,6 +362,10 @@ class AnsibleStorageBox(AnsibleHCloud): storage_box: BoundStorageBox | None = None + def __init__(self, module: AnsibleModule): + storage_box_experimental_warning(module) + super().__init__(module) + def _prepare_result(self): if self.storage_box is not None: return storage_box.prepare_result(self.storage_box) diff --git a/plugins/modules/storage_box_info.py b/plugins/modules/storage_box_info.py index 3f331bf..54eae27 100644 --- a/plugins/modules/storage_box_info.py +++ b/plugins/modules/storage_box_info.py @@ -15,6 +15,8 @@ short_description: Gather infos about Hetzner Storage Boxes. description: - Gather infos about Hetzner Storage Boxes. - See the L(Storage Boxes API documentation,https://docs.hetzner.cloud/reference/hetzner#storage-boxes) for more details. + - B(Experimental:) Storage Box support is experimental, breaking changes may occur within minor releases. + See https://github.com/ansible-collections/hetzner.hcloud/issues/756 for more details. author: - Jonas Lammler (@jooola) @@ -184,6 +186,7 @@ hcloud_storage_box_info: from ansible.module_utils.basic import AnsibleModule from ..module_utils import storage_box +from ..module_utils.experimental import storage_box_experimental_warning from ..module_utils.hcloud import AnsibleHCloud from ..module_utils.vendor.hcloud import HCloudException from ..module_utils.vendor.hcloud.storage_boxes import ( @@ -196,6 +199,10 @@ class AnsibleStorageBox(AnsibleHCloud): storage_box: list[BoundStorageBox] | None = None + def __init__(self, module: AnsibleModule): + storage_box_experimental_warning(module) + super().__init__(module) + def _prepare_result(self): result = [] for o in self.storage_box or []: diff --git a/plugins/modules/storage_box_snapshot.py b/plugins/modules/storage_box_snapshot.py index 14123ff..b381b7c 100644 --- a/plugins/modules/storage_box_snapshot.py +++ b/plugins/modules/storage_box_snapshot.py @@ -15,6 +15,8 @@ short_description: Create and manage Storage Box Snapshots in Hetzner. description: - Create, update and delete Storage Box Snapshots in Hetzner. - See the L(Storage Box Snapshots API documentation,https://docs.hetzner.cloud/reference/hetzner#storage-box-snapshots) for more details. + - B(Experimental:) Storage Box support is experimental, breaking changes may occur within minor releases. + See https://github.com/ansible-collections/hetzner.hcloud/issues/756 for more details. author: - Jonas Lammler (@jooola) @@ -138,6 +140,7 @@ hcloud_storage_box_snapshot: """ from ..module_utils import storage_box, storage_box_snapshot +from ..module_utils.experimental import storage_box_experimental_warning from ..module_utils.hcloud import AnsibleHCloud, AnsibleModule from ..module_utils.vendor.hcloud import HCloudException from ..module_utils.vendor.hcloud.storage_boxes import ( @@ -152,6 +155,10 @@ class AnsibleStorageBoxSnapshot(AnsibleHCloud): storage_box: BoundStorageBox | None = None storage_box_snapshot: BoundStorageBoxSnapshot | None = None + def __init__(self, module: AnsibleModule): + storage_box_experimental_warning(module) + super().__init__(module) + def _prepare_result(self): if self.storage_box_snapshot is None: return {} diff --git a/plugins/modules/storage_box_snapshot_info.py b/plugins/modules/storage_box_snapshot_info.py index d52dc7c..ebf7737 100644 --- a/plugins/modules/storage_box_snapshot_info.py +++ b/plugins/modules/storage_box_snapshot_info.py @@ -15,6 +15,8 @@ short_description: Gather infos about the Hetzner Storage Box Snapshots. description: - Gather infos about available Hetzner Storage Box Snapshots. - See the L(Storage Boxes API documentation,https://docs.hetzner.cloud/reference/hetzner#storage-boxes) for more details. + - B(Experimental:) Storage Box support is experimental, breaking changes may occur within minor releases. + See https://github.com/ansible-collections/hetzner.hcloud/issues/756 for more details. author: - Jonas Lammler (@jooola) @@ -132,6 +134,7 @@ hcloud_storage_box_snapshot_info: """ from ..module_utils import storage_box, storage_box_snapshot +from ..module_utils.experimental import storage_box_experimental_warning from ..module_utils.hcloud import AnsibleHCloud, AnsibleModule from ..module_utils.vendor.hcloud import HCloudException from ..module_utils.vendor.hcloud.storage_boxes import ( @@ -146,6 +149,10 @@ class AnsibleStorageBoxSnapshotInfo(AnsibleHCloud): storage_box: BoundStorageBox | None = None storage_box_snapshots: list[BoundStorageBoxSnapshot] | None = None + def __init__(self, module: AnsibleModule): + storage_box_experimental_warning(module) + super().__init__(module) + def _prepare_result(self): result = [] diff --git a/plugins/modules/storage_box_subaccount.py b/plugins/modules/storage_box_subaccount.py index 40397f9..f737c44 100644 --- a/plugins/modules/storage_box_subaccount.py +++ b/plugins/modules/storage_box_subaccount.py @@ -15,6 +15,8 @@ short_description: Create and manage Storage Box Subaccounts in Hetzner. description: - Create, update and delete Storage Box Subaccounts in Hetzner. - See the L(Storage Box Subaccounts API documentation,https://docs.hetzner.cloud/reference/hetzner#storage-box-subaccounts) for more details. + - B(Experimental:) Storage Box support is experimental, breaking changes may occur within minor releases. + See https://github.com/ansible-collections/hetzner.hcloud/issues/756 for more details. author: - Jonas Lammler (@jooola) @@ -226,6 +228,7 @@ import string from ..module_utils import storage_box, storage_box_subaccount from ..module_utils.client import client_resource_not_found +from ..module_utils.experimental import storage_box_experimental_warning from ..module_utils.hcloud import AnsibleHCloud, AnsibleModule from ..module_utils.storage_box_subaccount import NAME_LABEL_KEY from ..module_utils.vendor.hcloud import HCloudException @@ -243,6 +246,10 @@ class AnsibleStorageBoxSubaccount(AnsibleHCloud): storage_box_subaccount: BoundStorageBoxSubaccount | None = None storage_box_subaccount_name: str | None = None + def __init__(self, module: AnsibleModule): + storage_box_experimental_warning(module) + super().__init__(module) + def _prepare_result(self): if self.storage_box_subaccount is None: return {} diff --git a/plugins/modules/storage_box_subaccount_info.py b/plugins/modules/storage_box_subaccount_info.py index 0954e3f..42a2010 100644 --- a/plugins/modules/storage_box_subaccount_info.py +++ b/plugins/modules/storage_box_subaccount_info.py @@ -15,6 +15,8 @@ short_description: Gather infos about Hetzner Storage Box Subaccounts. description: - Gather infos about Hetzner Storage Box Subaccounts. - See the L(Storage Box Subaccounts API documentation,https://docs.hetzner.cloud/reference/hetzner#storage-box-subaccounts) for more details. + - B(Experimental:) Storage Box support is experimental, breaking changes may occur within minor releases. + See https://github.com/ansible-collections/hetzner.hcloud/issues/756 for more details. author: - Jonas Lammler (@jooola) @@ -156,6 +158,7 @@ hcloud_storage_box_subaccount_info: from ansible.module_utils.basic import AnsibleModule from ..module_utils import storage_box, storage_box_subaccount +from ..module_utils.experimental import storage_box_experimental_warning from ..module_utils.hcloud import AnsibleHCloud from ..module_utils.storage_box_subaccount import NAME_LABEL_KEY from ..module_utils.vendor.hcloud import HCloudException @@ -171,6 +174,10 @@ class AnsibleStorageBoxSubaccountInfo(AnsibleHCloud): storage_box: BoundStorageBox | None = None storage_box_subaccounts: list[BoundStorageBoxSubaccount] | None = None + def __init__(self, module: AnsibleModule): + storage_box_experimental_warning(module) + super().__init__(module) + def _prepare_result(self): result = [] diff --git a/plugins/modules/storage_box_type_info.py b/plugins/modules/storage_box_type_info.py index 01964ab..f6fe885 100644 --- a/plugins/modules/storage_box_type_info.py +++ b/plugins/modules/storage_box_type_info.py @@ -14,6 +14,8 @@ short_description: Gather infos about the Hetzner Storage Box Types. description: - Gather infos about available Hetzner Storage Box Types. + - B(Experimental:) Storage Box support is experimental, breaking changes may occur within minor releases. + See https://github.com/ansible-collections/hetzner.hcloud/issues/756 for more details. author: - Jonas Lammler (@jooola) @@ -107,6 +109,7 @@ hcloud_storage_box_type_info: from ansible.module_utils.basic import AnsibleModule +from ..module_utils.experimental import storage_box_experimental_warning from ..module_utils.hcloud import AnsibleHCloud from ..module_utils.vendor.hcloud import HCloudException from ..module_utils.vendor.hcloud.storage_box_types import BoundStorageBoxType @@ -117,6 +120,10 @@ class AnsibleStorageBoxTypeInfo(AnsibleHCloud): storage_box_type: list[BoundStorageBoxType] | None = None + def __init__(self, module: AnsibleModule): + storage_box_experimental_warning(module) + super().__init__(module) + def _prepare_result(self): result = []