mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
feat: add deprecation field to hcloud_iso_info (#357)
##### SUMMARY See these changelog entries for the announcement: - https://docs.hetzner.cloud/changelog#2023-10-12-deprecation-info-for-isos - https://docs.hetzner.cloud/changelog#2023-10-12-field-deprecated-on-isos-is-now-deprecated ##### ISSUE TYPE - Feature Pull Request ##### COMPONENT NAME hcloud_iso_info
This commit is contained in:
parent
11ffbd9d43
commit
76ef636f07
3 changed files with 34 additions and 1 deletions
|
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- hcloud_iso_info - Add deprecation field
|
||||||
|
|
@ -90,10 +90,33 @@ hcloud_iso_info:
|
||||||
description: >
|
description: >
|
||||||
ISO 8601 timestamp of deprecation, None if ISO is still available.
|
ISO 8601 timestamp of deprecation, None if ISO is still available.
|
||||||
After the deprecation time it will no longer be possible to attach the
|
After the deprecation time it will no longer be possible to attach the
|
||||||
ISO to servers.
|
ISO to servers. This field is deprecated. Use `deprecation` instead.
|
||||||
returned: always
|
returned: always
|
||||||
type: str
|
type: str
|
||||||
sample: "2024-12-01T00:00:00+00:00"
|
sample: "2024-12-01T00:00:00+00:00"
|
||||||
|
deprecation:
|
||||||
|
description: >
|
||||||
|
Describes if, when & how the resources was deprecated. If this field is
|
||||||
|
set to None the resource is not deprecated. If it has a value, it is
|
||||||
|
considered deprecated.
|
||||||
|
returned: if the resource is deprecated
|
||||||
|
type: dict
|
||||||
|
contains:
|
||||||
|
announced:
|
||||||
|
description: Date of when the deprecation was announced.
|
||||||
|
returned: always
|
||||||
|
type: str
|
||||||
|
sample: "2021-11-01T00:00:00+00:00"
|
||||||
|
unavailable_after:
|
||||||
|
description: >
|
||||||
|
After the time in this field, the resource will not be available
|
||||||
|
from the general listing endpoint of the resource type, and it can
|
||||||
|
not be used in new resources. For example, if this is an image,
|
||||||
|
you can not create new servers with this image after the mentioned
|
||||||
|
date.
|
||||||
|
returned: always
|
||||||
|
type: str
|
||||||
|
sample: "2021-12-01T00:00:00+00:00"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
@ -126,6 +149,12 @@ class AnsibleHCloudIsoInfo(AnsibleHCloud):
|
||||||
"type": iso_info.type,
|
"type": iso_info.type,
|
||||||
"architecture": iso_info.architecture,
|
"architecture": iso_info.architecture,
|
||||||
"deprecated": iso_info.deprecated,
|
"deprecated": iso_info.deprecated,
|
||||||
|
"deprecation": {
|
||||||
|
"announced": iso_info.deprecation.announced.isoformat(),
|
||||||
|
"unavailable_after": iso_info.deprecation.unavailable_after.isoformat(),
|
||||||
|
}
|
||||||
|
if iso_info.deprecation is not None
|
||||||
|
else None,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@
|
||||||
- result.hcloud_iso_info[0].name == "{{ hcloud_iso_name }}"
|
- result.hcloud_iso_info[0].name == "{{ hcloud_iso_name }}"
|
||||||
- result.hcloud_iso_info[0].architecture == "{{ hcloud_iso_architecture }}"
|
- result.hcloud_iso_info[0].architecture == "{{ hcloud_iso_architecture }}"
|
||||||
- result.hcloud_iso_info[0].type == "{{ hcloud_iso_type }}"
|
- result.hcloud_iso_info[0].type == "{{ hcloud_iso_type }}"
|
||||||
|
- result.hcloud_iso_info[0].deprecated is none
|
||||||
|
- result.hcloud_iso_info[0].deprecation is none
|
||||||
|
|
||||||
- name: Gather hcloud_iso_info with wrong id
|
- name: Gather hcloud_iso_info with wrong id
|
||||||
hetzner.hcloud.hcloud_iso_info:
|
hetzner.hcloud.hcloud_iso_info:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue