1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-05 16:41:52 +00:00

feat: add support for Hetzner API (#743)

##### SUMMARY

Add support the Hetzner API. Users can override the Hetzner API
endpoint.
This commit is contained in:
Jonas L. 2025-11-18 15:04:19 +01:00 committed by jo
parent e8d641be04
commit 55352c45fe
No known key found for this signature in database
GPG key ID: B2FEC9B22722B984
2 changed files with 16 additions and 4 deletions

View file

@ -84,6 +84,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
@ -144,6 +145,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]: