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:
urbanekpj 2023-11-06 17:10:54 +01:00 committed by GitHub
parent 084e04d576
commit c3e4c0ea0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,3 @@
minor_changes:
- hcloud_server_info - Add `created` field
- hcloud_server - Add `created` field

View file

@ -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],

View file

@ -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],