
    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: edit_threshold
version_added: "1.0.0"
author:
    - WangBaoshan (@ieisystem)
short_description: Set threshold information
description:
   - Set threshold information on ieisystem Server.
notes:
   - Does not support C(check_mode).
options:
    name:
        description:
            - Sensor name.
        type: str
        required: true
    lnr:
        description:
            - Lower non recoverable threshold, should be integer.
        type: int
    lc:
        description:
            - Lower critical threshold, should be integer.
        type: int
    lnc:
        description:
            - Lower non critical threshold, should be integer.
        type: int
    unc:
        description:
            - Up non critical threshold, should be integer.
        type: int
    uc:
        description:
            - Up critical threshold, should be integer.
        type: int
    unr:
        description:
            - Up non recoverable threshold, should be integer.
        type: int
extends_documentation_fragment:
    - ieisystem.inmanage.inmanage
a}  
- name: Threshold test
  hosts: inmanage
  connection: local
  gather_facts: false
  vars:
    inmanage:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "Set threshold information"
    ieisystem.inmanage.edit_threshold:
      name: "GPU1_Temp"
      uc: 94
      unc: 92
      provider: "{{ inmanage }}"
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)inmanage_argument_specget_connectionc                   *    e Zd Zd Zd Zd Zd Zd Zy)	Thresholdc                 ^    || _         d | _        | j                          t               | _        y )N)specmoduleinit_moduledictresults)selfargument_specs     u/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/ieisystem/inmanage/plugins/modules/edit_threshold.py__init__zThreshold.__init__a   s%    !	v    c                 <    t        | j                  d      | _        y)zInit module objectF)r   supports_check_modeN)r   r   r   r   s    r   r   zThreshold.init_moduleg   s     $))@r   c                     d| j                   j                  d<   t        | j                         | _        | j                  d   dk(  rd| j                  d<   y y )Nsetthreshold
subcommandStateSuccessTchanged)r   paramsr   r   r   s    r   run_commandzThreshold.run_commandm   sJ    +9<(%dkk2<< I-&*DLL# .r   c                 P     | j                   j                  di | j                   y)zShow resultN )r   	exit_jsonr   r   s    r   show_resultzThreshold.show_results   s    --r   c                 D    | j                          | j                          y)WorkerN)r    r$   r   s    r   workzThreshold.workw   s    r   N)__name__
__module____qualname__r   r   r    r$   r'   r"   r   r   r
   r
   `   s    @+.r   r
   c                  "   t        t        dd      t        dd      t        dd      t        dd      t        dd      t        dd      t        dd            } | j                  t               t        |       }|j	                          y )NstrT)typerequiredintF)namelnrlclncuncucunr)r   updater   r
   r'   )r   threshoold_objs     r   mainr9   }   sy    ut,ee,UU+ee,ee,UU+ee,M /0}-Nr   __main__N)
__future__r   r   r   r-   __metaclass__DOCUMENTATIONEXAMPLESRETURNansible.module_utils.basicr   Dansible_collections.ieisystem.inmanage.plugins.module_utils.inmanager   r   objectr
   r9   r(   r"   r   r   <module>rC      sV    C B+Z*
 5 y : zF r   