diff --git a/plugins/doc_fragments/hcloud.py b/plugins/doc_fragments/hcloud.py index eee4a9c..70bbd3c 100644 --- a/plugins/doc_fragments/hcloud.py +++ b/plugins/doc_fragments/hcloud.py @@ -10,24 +10,30 @@ class ModuleDocFragment: options: api_token: description: - - The API Token for the Hetzner Cloud. + - The token for the Hetzner Cloud API. - You can also set this option by using the C(HCLOUD_TOKEN) environment variable. required: True type: str api_endpoint: description: - - The API Endpoint for the Hetzner Cloud. + - The endpoint for the Hetzner Cloud API. - You can also set this option by using the C(HCLOUD_ENDPOINT) environment variable. default: https://api.hetzner.cloud/v1 type: str aliases: [endpoint] + api_endpoint_hetzner: + description: + - The endpoint for the Hetzner API. + - You can also set this option by using the C(HETZNER_ENDPOINT) environment variable. + default: https://api.hetzner.com/v1 + type: str requirements: - python-dateutil >= 2.7.5 - requests >=2.20 seealso: - - name: Documentation for Hetzner Cloud API - description: Complete reference for the Hetzner Cloud API. + - name: Documentation for Hetzner APIs + description: Complete reference for the Hetzner APIs. link: https://docs.hetzner.cloud """ diff --git a/plugins/module_utils/hcloud.py b/plugins/module_utils/hcloud.py index bc3b7ce..dc9d652 100644 --- a/plugins/module_utils/hcloud.py +++ b/plugins/module_utils/hcloud.py @@ -103,6 +103,7 @@ class AnsibleHCloud: self.client = Client( token=self.module.params["api_token"], api_endpoint=self.module.params["api_endpoint"], + api_endpoint_hetzner=self.module.params["api_endpoint_hetzner"], application_name="ansible-module", application_version=version, # Total waiting time before timeout is > 117.0 @@ -163,6 +164,11 @@ class AnsibleHCloud: "default": "https://api.hetzner.cloud/v1", "aliases": ["endpoint"], }, + "api_endpoint_hetzner": { + "type": "str", + "fallback": (env_fallback, ["HETZNER_ENDPOINT"]), + "default": "https://api.hetzner.com/v1", + }, } def _prepare_result(self) -> dict[str, Any]: