Ë
    ÇVh?  ã                  ó‚   — d dl mZ dZdZdZd dlmZ ddlmZ ddl	m
Z
 dd	lmZ  G d
„ de«      Zd„ Zedk(  r e«        yy)é    )Úannotationsa*  
---
module: location_info

short_description: Gather infos about your Hetzner Cloud locations.


description:
    - Gather infos about your Hetzner Cloud locations.

author:
    - Lukas Kaemmerling (@LKaemmerling)

options:
    id:
        description:
            - The ID of the location you want to get.
            - The module will fail if the provided ID is invalid.
        type: int
    name:
        description:
            - The name of the location you want to get.
        type: str
extends_documentation_fragment:
- hetzner.hcloud.hcloud

z”
- name: Gather hcloud location infos
  hetzner.hcloud.location_info:
  register: output

- name: Print the gathered infos
  debug:
    var: output
ae  
hcloud_location_info:
    description: The location infos as list
    returned: always
    type: complex
    contains:
        id:
            description: Numeric identifier of the location
            returned: always
            type: int
            sample: 1937415
        name:
            description: Name of the location
            returned: always
            type: str
            sample: fsn1
        description:
            description: Detail description of the location
            returned: always
            type: str
            sample: Falkenstein DC Park 1
        country:
            description: Country code of the location
            returned: always
            type: str
            sample: DE
        city:
            description: City of the location
            returned: always
            type: str
            sample: Falkenstein
)ÚAnsibleModuleé   )ÚAnsibleHCloud)ÚHCloudException)ÚBoundLocationc                  óH   ‡ — e Zd ZU dZdZded<   d„ Zd„ Zeˆ fd„«       Z	ˆ xZ
S )ÚAnsibleHCloudLocationInfoÚhcloud_location_infoNzlist[BoundLocation] | Nonec           	     óÖ   — g }| j                   D ]W  }|€Œ|j                  t        |j                  «      |j                  |j
                  |j                  |j                  dœ«       ŒY |S )N)ÚidÚnameÚdescriptionÚcityÚcountry)r   ÚappendÚstrr   r   r   r   r   )ÚselfÚtmpÚlocations      úp/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/hetzner/hcloud/plugins/modules/location_info.pyÚ_prepare_resultz)AnsibleHCloudLocationInfo._prepare_result\   si   € Øˆà×1Ñ1ò 	ˆHØÐØàJ‰Jä˜hŸk™kÓ*Ø$ŸM™MØ#+×#7Ñ#7Ø$ŸM™MØ'×/Ñ/ñõð		ð ˆ
ó    c                óv  — 	 | j                   j                  j                  d«      O| j                  j                  j                  | j                   j                  j                  d«      «      g| _        y | j                   j                  j                  d«      O| j                  j                  j                  | j                   j                  j                  d«      «      g| _        y | j                  j                  j                  «       | _        y # t        $ r}| j                  |«       Y d }~y d }~ww xY w)Nr   r   )ÚmoduleÚparamsÚgetÚclientÚ	locationsÚ	get_by_idr   Úget_by_nameÚget_allr   Úfail_json_hcloud)r   Ú	exceptions     r   Úget_locationsz'AnsibleHCloudLocationInfo.get_locationsn   så   € ð		-Ø{‰{×!Ñ!×%Ñ% dÓ+Ð7Ø-1¯[©[×-BÑ-B×-LÑ-LÈTÏ[É[×M_ÑM_×McÑMcÐdhÓMiÓ-jÐ,kÕ)Ø—‘×#Ñ#×'Ñ'¨Ó/Ð;Ø-1¯[©[×-BÑ-B×-NÑ-NÈtÏ{É{×OaÑOa×OeÑOeÐflÓOmÓ-nÐ,oÕ)à,0¯K©K×,AÑ,A×,IÑ,IÓ,KÕ)øäò 	-Ø×!Ñ! )×,Ñ,ûð	-ús%   ‚A3D Á6A3D Ã*)D Ä	D8ÄD3Ä3D8c           	     óV   •— t        t        dddiddidœt        ‰|   «       ¤Žd¬«      S )NÚtypeÚintr   )r   r   T)Úargument_specÚsupports_check_mode© )r   ÚdictÚsuperÚbase_module_arguments)ÚclsÚ	__class__s    €r   Údefine_modulez'AnsibleHCloudLocationInfo.define_modulez   sB   ø€ äÜð Ø˜E?Ø˜e_ñô ‘'Ñ/Ó1ñð
 !%ô
ð 	
r   )Ú__name__Ú
__module__Ú__qualname__Ú	representr   Ú__annotations__r   r%   Úclassmethodr1   Ú__classcell__)r0   s   @r   r
   r
   W   s2   ø… Ø&€Ià7;ÐÐ4Ó;òò$
-ð ó
ó ô
r   r
   c                 ó´   — t         j                  «       } t        | «      }|j                  «        |j                  «       }d|d   i} | j                  di |¤Ž y )Nr   r+   )r
   r1   r%   Ú
get_resultÚ	exit_json)r   ÚhcloudÚresultÚansible_infos       r   Úmainr?   †   sW   € Ü&×4Ñ4Ó6€FÜ& vÓ.€Fà
×ÑÔØ×ÑÓ €Fà*¨FÐ3IÑ,JÐK€LØ€F×ÑÑ$|Ó$r   Ú__main__N)Ú
__future__r   ÚDOCUMENTATIONÚEXAMPLESÚRETURNÚansible.module_utils.basicr   Úmodule_utils.hcloudr   Úmodule_utils.vendor.hcloudr   Ú$module_utils.vendor.hcloud.locationsr   r
   r?   r2   r+   r   r   ú<module>rI      sT   ðõ #ð€ð8€ð
€õB 5å /Ý 8Ý @ô,
 ô ,
ò^%ð ˆzÒÙ…Fð r   