mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
feat: add support for Hetzner API
This commit is contained in:
parent
89778ba26d
commit
1a00770244
2 changed files with 16 additions and 4 deletions
|
|
@ -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
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -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]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue