%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/opsgenie.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	ZdZ
eje�Z
ddddd�ZdS(u
Module for sending data to OpsGenie

.. versionadded:: 2018.3.0

:configuration: This module can be used in Reactor System for
    posting data to OpsGenie as a remote-execution function.

    For example:

    .. code-block:: yaml

        opsgenie_event_poster:
          local.opsgenie.post_data:
            - tgt: 'salt-minion'
            - kwarg:
                name: event.reactor
                api_key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
                reason: {{ data['data']['reason'] }}
                action_type: Create
i(tabsolute_importtprint_functiontunicode_literalsNu"https://api.opsgenie.com/v2/alertsuOpsGenie Execution Modulec
C@s�|d"ks|d"kr-tjjd��nt�}||d<||d<td|d<td|d<td|d<td	|d	<td
|d
<td|d<td|d
<td|d<td|d<td|d<td|d<td|d<td|d<tjd|�tjd|t�|dkrqt	j
dtdtjjj
|�didd6d|d6�}nKt	j
dtd |d!dtjjj
|�didd6d|d6�}|j|jfS(#u�
    Post data to OpsGenie. It's designed for Salt's Event Reactor.

    After configuring the sls reaction file as shown above, you can trigger the
    module with your designated tag (og-tag in this case).

    CLI Example:

    .. code-block:: bash

        salt-call event.send 'og-tag' '{"reason" : "Overheating CPU!"}'

    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.

    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.

    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
        this case.
    u!API Key or Reason cannot be None.ualiasumessageu	cpu_modelucpuModelucpuarchucpuArchufqdnuhostuidukernelu
kernelreleaseu
kernelReleaseumasteruosusaltpathusaltPathusaltversionusaltVersionuusernameuuuiduBelow data will be posted:
%suAPI Key: %s 	 API Endpoint: %suCreateturltdatatheadersuapplication/jsonuContent-Typeu	GenieKey u
Authorizationu/u/close?identifierType=aliasN(tNonetsaltt
exceptionstSaltInvocationErrortdictt
__grains__tlogtdebugtAPI_ENDPOINTtrequeststposttutilstjsontdumpststatus_codettext(tapi_keytnametreasontaction_typeRtresponse((s9/usr/lib/python2.7/site-packages/salt/modules/opsgenie.pyt	post_data%sB"		

	
	
(t__doc__t
__future__RRRtloggingRtsalt.exceptionsRtsalt.utils.jsonRt	getLoggert__name__RRR(((s9/usr/lib/python2.7/site-packages/salt/modules/opsgenie.pyt<module>s	

Zerion Mini Shell 1.0