Ë
    ÇVhõ  ã                   óz   — d dl mZmZmZ eZdZdZdZd dl	m
Z
 d dlmZmZmZ d dlmZ d„ Zd	„ Zed
k(  r e«        yy)é    )Úabsolute_importÚdivisionÚprint_functiona¦  
---
module: proxysql_info
author: "Markus Bergholz (@markuman)"
short_description: Gathers information about proxysql server
description:
   - Gathers information about proxysql server.
   - Caution. The number of tables that returns, depends on the underlying proyxsql server version.
version_added: '1.2.0'
extends_documentation_fragment:
  - community.proxysql.proxysql.connectivity
notes:
  - Supports C(check_mode).
z†
- name: Receive information about proxysql setup
  community.proxysql.proxysql_info:
    login_user: admin
    login_password: admin
aÉ  
stdout:
    description: The number of tables that returns, depends on the underlying proyxsql server version.
    returned: Always
    type: dict
    sample:
        changed: false
        failed: false
        version:
            description: Version of proxysql.
            sample:
                full: 2.1.1-40-g1c2b7e4
                major: 2
                minor: 1
                release: 1
                suffix: 40
            type: dict
            returned: Always
        tables:
            description: List of tables that exist in the requested proxysql version.
            sample:
                - global_variables
                - mysql_aws_aurora_hostgroups
                - mysql_collations
                - mysql_firewall_whitelist_rules
                - mysql_firewall_whitelist_sqli_fingerprints
                - mysql_firewall_whitelist_users
                - mysql_galera_hostgroups
                - mysql_group_replication_hostgroups
                - mysql_query_rules
                - mysql_query_rules_fast_routing
                - mysql_replication_hostgroups
                - mysql_servers
                - mysql_users
                - proxysql_servers
                - restapi_routes
                - runtime_checksums_values
                - runtime_global_variables
                - runtime_mysql_aws_aurora_hostgroups
                - runtime_mysql_firewall_whitelist_rules
                - runtime_mysql_firewall_whitelist_sqli_fingerprints
                - runtime_mysql_firewall_whitelist_users
                - runtime_mysql_galera_hostgroups
                - runtime_mysql_group_replication_hostgroups
                - runtime_mysql_query_rules
                - runtime_mysql_query_rules_fast_routing
                - runtime_mysql_replication_hostgroups
                - runtime_mysql_servers
                - runtime_mysql_users
                - runtime_proxysql_servers
                - runtime_restapi_routes
                - runtime_scheduler
                - scheduler
            type: list
            returned: Always
        global_variables:
            description: Global variables of requested proxysql.
            type: dict
            returned: Always
)ÚAnsibleModule)Úmysql_connectÚmysql_driverÚproxysql_common_argument_spec)Ú	to_nativec                 óò  — t        «       }t        «       }| j                  d«       | j                  «       D ]"  }|j	                  |j                  d«      «       Œ$ ||d<   |j                  d«      D ]ƒ  }| j                  dj                  |¬«      «       d|v rIt        «       ||<   | j                  «       D ](  }|j                  d«      ||   |j                  d«      <   Œ* Œq| j                  «       ||<   Œ… |S )Nzshow tablesÚtableszselect * from {table})ÚtableÚglobal_variablesÚvariable_valueÚvariable_name)ÚdictÚlistÚexecuteÚfetchallÚappendÚgetÚformat)ÚcursorÚresultr   r   Úitems        út/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/proxysql/plugins/modules/proxysql_info.pyÚ
get_tablesr   i   sé   € Ü‹V€FÜ‹V€Fà
‡NN=Ô!à—‘Ó"ò +ˆØ‰e—i‘i Ó)Õ*ð+à€Fˆ8Ñà—‘˜HÓ%ò 	.ˆØ‰Ð.×5Ñ5¸EÐ5ÓBÔCà Ñ&Ü ›FˆF5‰MØŸ™Ó)ò VØ;?¿8¹8ÐDTÓ;Uu‘˜dŸh™h Ó7Ò8ñVð #ŸO™OÓ-ˆF5ŠMð	.ð €Mó    c                  óv  — t        dt        «       ¬«      } | j                  d   }| j                  d   }| j                  d   }d }	 t        | |||d¬«      \  }}}t        |«      }|d
<    | j                  di |¤Ž y # t        j
                  $ r(}| j                  dt        |«      z  ¬	«       Y d }~ŒYd }~ww xY w)NT)Úsupports_check_modeÚargument_specÚ
login_userÚlogin_passwordÚconfig_fileÚ
DictCursor)Úcursor_classz.unable to connect to ProxySQL Admin Module: %s)ÚmsgÚversion© )
r   r	   Úparamsr   r   ÚErrorÚ	fail_jsonr
   r   Ú	exit_json)	Úmoduler!   r"   r#   r   Údb_connr'   Úer   s	            r   Úmainr0      sÑ   € ÜØ Ü3Ó5ô€Fð
 —‘˜|Ñ,€JØ—]‘]Ð#3Ñ4€NØ—-‘- Ñ.€Kà€Fð	^Ü#0ØØØØØ%ô$
Ñ ˆ˜ô ˜Ó€Fà€Fˆ9Ñà€F×ÑÑvÓøô ×Ñò ^Ø×ÑÐMÔPYÐZ[ÓP\Ñ\Ð×]Ñ]ûð^ús   ÁA= Á=B8ÂB3Â3B8Ú__main__N)Ú
__future__r   r   r   ÚtypeÚ__metaclass__ÚDOCUMENTATIONÚEXAMPLESÚRETURNÚansible.module_utils.basicr   ÚAansible_collections.community.proxysql.plugins.module_utils.mysqlr   r   r	   Úansible.module_utils._textr
   r   r0   Ú__name__r(   r   r   ú<module>r<      s[   ð÷ AÑ @Ø€ð€ð€ð;
€õz 5÷ñ õ
 1òò0ð: ˆzÒÙ…Fð r   