1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

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
This commit is contained in:
Jonas L. 2025-12-10 11:34:17 +01:00 committed by GitHub
parent 6dd76f7bde
commit af91b36146
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 56 additions and 0 deletions

View file

@ -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",
)

View file

@ -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)

View file

@ -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 []:

View file

@ -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 {}

View file

@ -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 = []

View file

@ -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 {}

View file

@ -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 = []

View file

@ -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 = []