403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/opsgenie.cpython-310.pyc
o

;jX�@s@dZddlZddlZddlZe�e�Zd
dd�Z	ddd	�Z	dS)a�
Create/Close an alert in OpsGenie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2018.3.0

This state is useful for creating or closing alerts in OpsGenie
during state runs.

.. code-block:: yaml

    used_space:
      disk.status:
        - name: /
        - maximum: 79%
        - minimum: 20%

    opsgenie_create_action_sender:
      opsgenie.create_alert:
        - api_key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
        - reason: 'Disk capacity is out of designated range.'
        - name: disk.status
        - onfail:
          - disk: used_space

    opsgenie_close_action_sender:
      opsgenie.close_alert:
        - api_key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
        - name: disk.status
        - require:
          - disk: used_space

�N�Createc	Cs�t�t���\}}}}t�d|�ddddd�}|dus |dur&tj�d��tddur:d�	||�|d	<d|d
<|St
d||||d�\}}d
|krPdkrgnnt�d||�d�	||�|d	<d|d
<|St�d||�d|d
<|S)a�
    Create an alert in OpsGenie. Example usage with Salt's requisites and other
    global state arguments could be found above.

    Required Parameters:

    api_key
        It's the API Key you've copied while adding integration in OpsGenie.

    reason
        It will be used as alert's default message in OpsGenie.

    Optional Parameters:

    name
        It will be used as alert's alias. If you want to use the close
        functionality you must provide name field for both states like
        in above case.

    action_type
        OpsGenie supports the default values Create/Close for action_type.
        You can customize this field with OpsGenie's custom actions for
        other purposes like adding notes or acknowledging alerts.
    zArguments values: %s�)�result�nameZchanges�commentNz!API Key or Reason cannot be None.�testTz@Test: {} alert request will be processed using the API Key="{}".rrzopsgenie.post_data)�api_keyr�reason�action_type��i,z;POST Request has succeeded with message: %s status code: %sz6POST Request has failed with error: %s status code: %sF)�inspectZgetargvalues�currentframe�log�info�salt�
exceptions�SaltInvocationErrorZ__opts__�formatZ__salt__�error)	rrr	r
�_�values�retZresponse_status_codeZ
response_text�r�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/opsgenie.py�create_alert+sD��
����	��r�Conditions are met.�ClosecCs"|dur
tj�d��t||||�S)a"
    Close an alert in OpsGenie. It's a wrapper function for create_alert.
    Example usage with Salt's requisites and other global state arguments
    could be found above.

    Required Parameters:

    name
        It will be used as alert's alias. If you want to use the close
        functionality you must provide name field for both states like
        in above case.

    Optional Parameters:

    api_key
        It's the API Key you've copied while adding integration in OpsGenie.

    reason
        It will be used as alert's default message in OpsGenie.

    action_type
        OpsGenie supports the default values Create/Close for action_type.
        You can customize this field with OpsGenie's custom actions for
        other purposes like adding notes or acknowledging alerts.
    NzName cannot be None.)rrrr)rrr	r
rrr�close_alerttsr)NNNr)NNrr)
�__doc__r�loggingZsalt.exceptionsr�	getLogger�__name__rrrrrrr�<module>s"

J�

Youez - 2016 - github.com/yon3zu
LinuXploit