o
    Á¿iö  ã                   @   s    d dl mZ G dd„ deƒZdS )é    )ÚSearchableAPIResourcec                       s(   e Zd ZdZdZe‡ fdd„ƒZ‡  ZS )ÚInfrastructurez3
    A wrapper around Infrastructure HTTP API.
    Úsearchc                    sJ   |  dd¡ d¡}t|ƒdkr|d dkrtddƒ tt| ƒjd
i |¤ŽS )zÌ
        Search for entities in Datadog.

        :param q: a query to search for host and metrics
        :type q: string query

        :returns: Dictionary representing the API's JSON response
        ÚqÚ ú:é   r   Úhostsz8[DEPRECATION] Infrastructure.search() is deprecated for z"hosts. Use `Hosts.search` instead.N© )ÚgetÚsplitÚlenÚprintÚsuperr   Ú_search)ÚclsÚparamsÚquery©Ú	__class__r
   úN/home/ubuntu/.local/lib/python3.10/site-packages/datadog/api/infrastructure.pyr      s   
zInfrastructure.search)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_resource_nameÚclassmethodr   Ú__classcell__r
   r
   r   r   r      s
    r   N)Údatadog.api.resourcesr   r   r
   r
   r
   r   Ú<module>   s   