%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/opsgenie.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZej	e
�Zddddd�Z
ddddd�ZdS(	u�
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

i(tabsolute_importtprint_functiontunicode_literalsNuCreatec	
C@sRtjtj��\}}}}tjd|�idd6dd6dd6dd6}|dksk|dkr�tjjd��nt	dt
kr�d	j||�|d<d|d<|Std
d|d|d
|d|�\}}d|ko�dknr1tjd||�d	j||�|d<t
|d<ntj
d||�t|d<|S(u�
    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.
    uArguments values: %suuresultunameuchangesucommentu!API Key or Reason cannot be None.utestuBTest: {0} alert request will be processed using the API Key="{1}".uopsgenie.post_datatapi_keytnametreasontaction_typei�i,u;POST Request has succeeded with message: %s status code: %su6POST Request has failed with error: %s status code: %sN(tinspecttgetargvaluestcurrentframetlogtinfotNonetsaltt
exceptionstSaltInvocationErrort__opts__tTruetformatt__salt__terrortFalse(	RRRRt_tvaluestrettresponse_status_codet
response_text((s8/usr/lib/python2.7/site-packages/salt/states/opsgenie.pytcreate_alert.sB!
	






uConditions are met.uClosecC@s4|dkr!tjjd��nt||||�S(u"
    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.
    uName cannot be None.N(RR
RRR(RRRR((s8/usr/lib/python2.7/site-packages/salt/states/opsgenie.pytclose_alertzs	(t__doc__t
__future__RRRtloggingRtsalt.exceptionsR
t	getLoggert__name__R
RRR(((s8/usr/lib/python2.7/site-packages/salt/states/opsgenie.pyt<module>"sL	

Zerion Mini Shell 1.0