From 1cf7be048632d06c264975e9203e37f9a7a330db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Mon, 15 May 2023 09:40:19 +0200 Subject: [PATCH] feat(server_type): return included traffic (#212) --- plugins/doc_fragments/hcloud.py | 2 +- plugins/modules/hcloud_server_type_info.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/doc_fragments/hcloud.py b/plugins/doc_fragments/hcloud.py index d19e646..20a8ed0 100644 --- a/plugins/doc_fragments/hcloud.py +++ b/plugins/doc_fragments/hcloud.py @@ -21,7 +21,7 @@ options: default: https://api.hetzner.cloud/v1 type: str requirements: - - hcloud-python >= 1.0.0 + - hcloud-python >= 1.20.0 seealso: - name: Documentation for Hetzner Cloud API description: Complete reference for the Hetzner Cloud API. diff --git a/plugins/modules/hcloud_server_type_info.py b/plugins/modules/hcloud_server_type_info.py index a84067c..dbe59d7 100644 --- a/plugins/modules/hcloud_server_type_info.py +++ b/plugins/modules/hcloud_server_type_info.py @@ -98,6 +98,11 @@ hcloud_server_type_info: returned: always type: str sample: x86 + included_traffic: + description: Free traffic per month in bytes + returned: always + type: int + sample: 21990232555520 """ from ansible.module_utils.basic import AnsibleModule @@ -124,7 +129,8 @@ class AnsibleHcloudServerTypeInfo(Hcloud): "disk": server_type.disk, "storage_type": to_native(server_type.storage_type), "cpu_type": to_native(server_type.cpu_type), - "architecture": to_native(server_type.architecture) + "architecture": to_native(server_type.architecture), + "included_traffic": server_type.included_traffic }) return tmp