Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/notification/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/notification/pushbullet.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zdd
l	Z	d
Zy*ddlm
Z
ddlmZmZWn#ek
r�e	j�ZeZnXeZdd
lmZmZd�Zedkr�e�nd
S(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
author: "Willy Barro (@willybarro)"
requirements: [ pushbullet.py ]
module: pushbullet
short_description: Sends notifications to Pushbullet
description:
   - This module sends push notifications via Pushbullet to channels or devices.
version_added: "2.0"
options:
    api_key:
        description:
            - Push bullet API token
        required: true
    channel:
        description:
            - The channel TAG you wish to broadcast a push notification,
              as seen on the "My Channels" > "Edit your channel" at
              Pushbullet page.
    device:
        description:
            - The device NAME you wish to send a push notification,
              as seen on the Pushbullet main page.
    push_type:
        description:
          - Thing you wish to push.
        default: note
        choices: [ "note", "link" ]
    title:
        description:
          - Title of the notification.
        required: true
    body:
        description:
          - Body of the notification, e.g. Details of the fault you're alerting.

notes:
   - Requires pushbullet.py Python package on the remote host.
     You can install it via pip with ($ pip install pushbullet.py).
     See U(https://github.com/randomchars/pushbullet.py)
sF
# Sends a push notification to a device
- pushbullet:
    api_key: "ABC123abc123ABC123abc123ABC123ab"
    device: "Chrome"
    title: "You may see this on Google Chrome"

# Sends a link to a device
- pushbullet:
    api_key: ABC123abc123ABC123abc123ABC123ab
    device: Chrome
    push_type: link
    title: Ansible Documentation
    body: https://docs.ansible.com/

# Sends a push notification to a channel
- pushbullet:
    api_key: ABC123abc123ABC123abc123ABC123ab
    channel: my-awesome-channel
    title: Broadcasting a message to the #my-awesome-channel folks

# Sends a push notification with title and body to a channel
- pushbullet:
    api_key: ABC123abc123ABC123abc123ABC123ab
    channel: my-awesome-channel
    title: ALERT! Signup service is down
    body: Error rate on signup service is over 90% for more than 2 minutes
N(t
PushBullet(tInvalidKeyErrort	PushError(t
AnsibleModuletmissing_required_libcC`sStdtdtdddtdt�dtdddd�d	tdddd�d
tddddddd
g�dtdddt�dtdddd�dtdddd��ddd	gfdt�}|jd}|jd}|jd	}|jd
}|jd}|jd}|jd}tsL|jdtd�dt�nyt	|�}d}	Wn!t
k
r�|jdd�nX|dkr�|dkr�|jdd�n|dk	r)i}
x|jD]}||
|j<q�W||
kr�|
|}	q)|jdd|dj
|
j��f�n|dk	r�i}x|jD]}
|
||
j<qEW||kru||}	q�|jdd|dj
|j��f�n|jr�|jdtdd�nyL|d
kr�|	j|||�n|	j||�|jdtdd�Wn-tk
r>}|jddt|��nX|jdd�dS(Nt
argument_spectapi_keyttypetstrtrequiredtno_logtchanneltdefaulttdevicet	push_typetnotetchoicestlinkttitletbodyturltmutually_exclusivetsupports_check_modetmsgs
pushbullet.pyt	exceptionsInvalid api_keys*You need to provide a channel or a device.s.Device '%s' not found. Available devices: '%s's', 's0Channel '%s' not found. Available channels: '%s'tchangedtOKs,An error occurred, Pushbullet's response: %ssAn unknown error has occurred(RtdicttTruetNonetparamstpushbullet_foundt	fail_jsonRtPUSHBULLET_IMP_ERRRR	tdevicestnicknametjointkeystchannelstchannel_tagt
check_modet	exit_jsontFalset	push_linkt	push_noteR
R(tmoduleRRRRRRRtpbttargettdevices_by_nicknametdtchannels_by_tagtcte((sK/usr/lib/python2.7/site-packages/ansible/modules/notification/pushbullet.pytmainjsf!	









,
,	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLESt	tracebackR%R)t
pushbulletRtpushbullet.errorsR	R
tImportErrort
format_excR2R'R$tansible.module_utils.basicRRR=t__name__(((sK/usr/lib/python2.7/site-packages/ansible/modules/notification/pushbullet.pyt<module>s&


+

	N

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]