Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/modules/notification/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/modules/notification/rabbitmq_publish.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	yddl
Z
eZWne
k
r�eZnXddlmZdd
lmZmZddlmZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�	
---
module: rabbitmq_publish
short_description: Publish a message to a RabbitMQ queue.
version_added: "2.8"
description:
   - Publish a message on a RabbitMQ queue using a blocking connection.
options:
  url:
    description:
      - An URL connection string to connect to the RabbitMQ server.
      - I(url) and I(host)/I(port)/I(user)/I(pass)/I(vhost) are mutually exclusive, use either or but not both.
  proto:
    description:
      - The protocol to use.
    choices: [amqps, amqp]
  host:
    description:
      - The RabbitMQ server hostname or IP.
  port:
    description:
      - The RabbitMQ server port.
  username:
    description:
      - The RabbitMQ username.
  password:
    description:
      - The RabbitMQ password.
  vhost:
    description:
      - The virtual host to target.
      - If default vhost is required, use C('%2F').
  queue:
    description:
      - The queue to publish a message to.  If no queue is specified, RabbitMQ will return a random queue name.
  exchange:
    description:
      - The exchange to publish a message to.
  routing_key:
    description:
      - The routing key.
  body:
    description:
      - The body of the message.
      - A C(body) cannot be provided if a C(src) is specified.
  src:
    description:
      - A file to upload to the queue.  Automatic mime type detection is attempted if content_type is not defined (left as default).
      - A C(src) cannot be provided if a C(body) is specified.
      - The filename is added to the headers of the posted message to RabbitMQ. Key being the C(filename), value is the filename.
    aliases: ['file']
  content_type:
    description:
      - The content type of the body.
    default: text/plain
  durable:
    description:
      - Set the queue to be durable.
    default: False
    type: bool
  exclusive:
    description:
      - Set the queue to be exclusive.
    default: False
    type: bool
  auto_delete:
    description:
      - Set the queue to auto delete.
    default: False
    type: bool
  headers:
    description:
      - A dictionary of headers to post with the message.
    default: {}
    type: dict


requirements: [ pika ]
notes:
  - This module requires the pika python library U(https://pika.readthedocs.io/).
  - Pika is a pure-Python implementation of the AMQP 0-9-1 protocol that tries to stay fairly independent of the underlying network support library.
  - This plugin is tested against RabbitMQ. Other AMQP 0.9.1 protocol based servers may work but not tested/guaranteed.
author: "John Imison (@Im0)"
s�
- name: Publish a message to a queue with headers
  rabbitmq_publish:
    url: "amqp://guest:[email protected]:5672/%2F"
    queue: 'test'
    body: "Hello world from ansible module rabbitmq_publish"
    content_type: "text/plain"
    headers:
      myHeader: myHeaderValue


- name: Publish a file to a queue
  rabbitmq_publish:
    url: "amqp://guest:[email protected]:5672/%2F"
    queue: 'images'
    file: 'path/to/logo.gif'

- name: RabbitMQ auto generated queue
  rabbitmq_publish:
    url: "amqp://guest:[email protected]:5672/%2F"
    body: "Hello world random queue from ansible module rabbitmq_publish"
    content_type: "text/plain"
s
result:
  description:
    - Contains the status I(msg), content type I(content_type) and the queue name I(queue).
  returned: success
  type: dict
  sample: |
    'result': { 'content_type': 'text/plain', 'msg': 'Successfully published to queue test', 'queue': 'test' }
N(t
AnsibleModule(t	to_nativetto_text(tRabbitClientcC`s�tj�}|jdtdddd�dtdddt�dtdddt�d	td
dgdddt�d
tdddd�dtdtdd�dtdtdd�dtdtdd�dtdidd��	td|ddd	ggdt�}t|�}|j�r]|j�|jdt	did|j
d6|j
d6|jd
6�n'|j�|jdtdd|j
�dS(Ntexchangettypetstrtdefaultttrouting_keytrequiredtbodytsrctaliasestfiletpathtcontent_types
text/plaintdurabletboolt	exclusivetauto_deletetheaderstdictt
argument_spectmutually_exclusivetsupports_check_modetchangedtresults"Successfully published to queue %stmsgtqueues#Unsuccessful publishing to queue %s(
Rtrabbitmq_argument_spectupdateRtFalseRt
basic_publishtclose_connectiont	exit_jsontTrueR%Rt	fail_json(Rtmoduletrabbitmq((sQ/usr/lib/python2.7/site-packages/ansible/modules/notification/rabbitmq_publish.pytmain�s.		
 

t__main__(t
__future__RRRR
t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtpikaR,tHAS_PIKAtImportErrorR(tansible.module_utils.basicRtansible.module_utils._textR	R
tansible.module_utils.rabbitmqRR0t__name__(((sQ/usr/lib/python2.7/site-packages/ansible/modules/notification/rabbitmq_publish.pyt<module>s$


V



	

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