mirror of
https://github.com/ansible-collections/hetzner.hcloud
synced 2024-11-10 06:34:13 +00:00
feat: add created
field to server and server_info modules (#381)
##### SUMMARY Add missing "created" field to ansible result based on documentation https://docs.hetzner.cloud/#servers-get-all-servers ``` created string required Point in time when the Resource was created (in ISO-8601 format) ``` ##### ISSUE TYPE - Feature Pull Request ##### COMPONENT NAME hcloud_server_info hcloud_server Co-authored-by: Pawel Urbanek <pawel.urbanek@medvc.eu>
This commit is contained in:
parent
084e04d576
commit
c3e4c0ea0a
3 changed files with 15 additions and 0 deletions
3
changelogs/fragments/add_created_to_server_info.yaml
Normal file
3
changelogs/fragments/add_created_to_server_info.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
minor_changes:
|
||||
- hcloud_server_info - Add `created` field
|
||||
- hcloud_server - Add `created` field
|
|
@ -252,6 +252,11 @@ hcloud_server:
|
|||
returned: always
|
||||
type: str
|
||||
sample: my-server
|
||||
created:
|
||||
description: Point in time when the Server was created (in ISO-8601 format)
|
||||
returned: always
|
||||
type: str
|
||||
sample: "2023-11-06T13:36:56+00:00"
|
||||
status:
|
||||
description: Status of the server
|
||||
returned: always
|
||||
|
@ -366,6 +371,7 @@ class AnsibleHCloudServer(AnsibleHCloud):
|
|||
return {
|
||||
"id": to_native(self.hcloud_server.id),
|
||||
"name": to_native(self.hcloud_server.name),
|
||||
"created": to_native(self.hcloud_server.created.isoformat()),
|
||||
"ipv4_address": ipv4_address,
|
||||
"ipv6": ipv6,
|
||||
"private_networks": [to_native(net.network.name) for net in self.hcloud_server.private_net],
|
||||
|
|
|
@ -62,6 +62,11 @@ hcloud_server_info:
|
|||
returned: always
|
||||
type: str
|
||||
sample: my-server
|
||||
created:
|
||||
description: Point in time when the Server was created (in ISO-8601 format)
|
||||
returned: always
|
||||
type: str
|
||||
sample: "2023-11-06T13:36:56+00:00"
|
||||
status:
|
||||
description: Status of the server
|
||||
returned: always
|
||||
|
@ -167,6 +172,7 @@ class AnsibleHCloudServerInfo(AnsibleHCloud):
|
|||
{
|
||||
"id": to_native(server.id),
|
||||
"name": to_native(server.name),
|
||||
"created": to_native(server.created.isoformat()),
|
||||
"ipv4_address": ipv4_address,
|
||||
"ipv6": ipv6,
|
||||
"private_networks": [to_native(net.network.name) for net in server.private_net],
|
||||
|
|
Loading…
Reference in a new issue