
    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  G d de      Zd	 Zed
k(  r e        yy)    )absolute_importdivisionprint_functiona  
---
module: collect_blackbox
version_added: "1.0.0"
author:
    - WangBaoshan (@ieisystem)
short_description: Collect blackbox log
description:
   - Collect blackbox log on kaytus Server.
notes:
   - Does not support C(check_mode).
options:
    file_url:
        description:
            - File download path.
        required: true
        type: str
extends_documentation_fragment:
    - kaytus.ksmanage.ksmanage
ap  
- name: Collect blackbox test
  hosts: ksmanage
  connection: local
  gather_facts: false
  vars:
    ksmanage:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "Collect blackbox log"
    kaytus.ksmanage.collect_blackbox:
      file_url: "/home/wbs/wbs.log"
      provider: "{{ ksmanage }}"

a1  
message:
    description: Messages returned after module execution.
    returned: always
    type: str
state:
    description: Status after module execution.
    returned: always
    type: str
changed:
    description: Check to see if a change was made on the device.
    returned: always
    type: bool
)AnsibleModule)ksmanage_argument_specget_connectionc                   *    e Zd Zd Zd Zd Zd Zd Zy)Blackboxc                 ^    || _         d | _        | j                          t               | _        y )N)specmoduleinit_moduledictresults)selfargument_specs     t/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/kaytus/ksmanage/plugins/modules/collect_blackbox.py__init__zBlackbox.__init__H   s%    !	v    c                 <    t        | j                  d      | _        y)zInit module objectF)r   supports_check_modeN)r   r   r   r   s    r   r   zBlackbox.init_moduleN   s     $))@r   c                 j    d| j                   j                  d<   t        | j                         | _        y )Ncollectblackbox
subcommand)r   paramsr   r   r   s    r   run_commandzBlackbox.run_commandT   s&    +<<(%dkk2r   c                 P     | j                   j                  di | j                   y)zShow resultN )r   	exit_jsonr   r   s    r   show_resultzBlackbox.show_resultX   s    --r   c                 D    | j                          | j                          y)WorkerN)r   r!   r   s    r   workzBlackbox.work\   s    r   N)__name__
__module____qualname__r   r   r   r!   r$   r   r   r   r
   r
   G   s    @3.r   r
   c                      t        t        dd            } | j                  t               t        |       }|j	                          y )NstrT)typerequired)file_url)r   updater   r
   r$   )r   log_objs     r   mainr/   b   s:    540M /0}%GLLNr   __main__N)
__future__r   r   r   r*   __metaclass__DOCUMENTATIONEXAMPLESRETURNansible.module_utils.basicr   Aansible_collections.kaytus.ksmanage.plugins.module_utils.ksmanager   r   objectr
   r/   r%   r   r   r   <module>r9      sU    C B*(
 5 vv 6 zF r   