# Path: duct/protocol/elasticsearch.py
# class ElasticSearch(object):
#     def __init__(self, url='http://localhost:9200', user=None, password=None,
#                  index='duct-%Y.%m.%d'):
#     def _get_index(self):
#     def _request(self, path, data=None, method='GET'):
#     def _gen_id(self):
#     def stats(self):
#     def node_stats(self):
#     def insertIndex(self, index_type, data):
#     def bulkIndex(self, data):
# 
# Path: duct/objects.py
# class Output(object):
#     """Output parent class
# 
#     Outputs can inherit this object which provides a construct
#     for a working output
# 
#     :param config: Dictionary config for this queue (usually read from the
#              yaml configuration)
#     :param duct: A DuctService object for interacting with the queue manager
#     """
#     def __init__(self, config, duct):
#         self.config = config
#         self.duct = duct
#         self.events = []
#         self.maxsize = 0
# 
#     def createClient(self):
#         """Deferred which sets up the output
#         """
#         pass
# 
#     def eventsReceived(self, events):
#         """Receives a list of events and queues them
# 
#         Arguments:
#         events -- list of `duct.objects.Event`
#         """
#         # Make sure queue isn't oversized
#         if self.maxsize > 0:
#             if (self.maxsize < 1) or (len(self.events) < self.maxsize):
#                 self.events.extend(events)
#         else:
#             self.events.extend(events)
# 
#     def stop(self):
#         """Called when the service shuts down
#         """
#         pass


import datetime
from twisted.internet import defer, task
from twisted.python import log
from duct.protocol import elasticsearch
from duct.objects import Output

.. moduleauthor:: Colin Alston <colin@imcol.in>
"""





class ElasticSearch(Output):
    """ElasticSearch HTTP API output

    **Configuration arguments:**

    :param url: Elasticsearch URL (default: http://localhost:9200)
    :type url: str
    :param maxsize: Maximum queue backlog size (default: 250000, 0 disables)
    :type maxsize: int
    :param maxrate: Maximum rate of documents added to index (default: 100)
    :type maxrate: int
    :param interval: Queue check interval in seconds (default: 1.0)
    :type interval: int
    :param user: Optional basic auth username
    :type user: str
    :param password: Optional basic auth password
    :type password: str
    :param index: Index name format to store documents in Elastic
                  (default: duct-%Y.%m.%d)
    :type index: str
    """
    def __init__(self, *a):

# Path: duct/protocol/elasticsearch.py
# class ElasticSearch(object):
#     def __init__(self, url='http://localhost:9200', user=None, password=None,
#                  index='duct-%Y.%m.%d'):
#     def _get_index(self):
#     def _request(self, path, data=None, method='GET'):
#     def _gen_id(self):
#     def stats(self):
#     def node_stats(self):
#     def insertIndex(self, index_type, data):
#     def bulkIndex(self, data):
# 
# Path: duct/objects.py
# class Output(object):
#     """Output parent class
# 
#     Outputs can inherit this object which provides a construct
#     for a working output
# 
#     :param config: Dictionary config for this queue (usually read from the
#              yaml configuration)
#     :param duct: A DuctService object for interacting with the queue manager
#     """
#     def __init__(self, config, duct):
#         self.config = config
#         self.duct = duct
#         self.events = []
#         self.maxsize = 0
# 
#     def createClient(self):
#         """Deferred which sets up the output
#         """
#         pass
# 
#     def eventsReceived(self, events):
#         """Receives a list of events and queues them
# 
#         Arguments:
#         events -- list of `duct.objects.Event`
#         """
#         # Make sure queue isn't oversized
#         if self.maxsize > 0:
#             if (self.maxsize < 1) or (len(self.events) < self.maxsize):
#                 self.events.extend(events)
#         else:
#             self.events.extend(events)
# 
#     def stop(self):
#         """Called when the service shuts down
#         """
#         pass


# Path: duct/outputs/elasticsearch.py
import datetime
from twisted.internet import defer, task
from twisted.python import log
from duct.protocol import elasticsearch
from duct.objects import Output


.. moduleauthor:: Colin Alston <colin@imcol.in>
"""





class ElasticSearch(Output):
    """ElasticSearch HTTP API output

    **Configuration arguments:**

    :param url: Elasticsearch URL (default: http://localhost:9200)
    :type url: str
    :param maxsize: Maximum queue backlog size (default: 250000, 0 disables)
    :type maxsize: int
    :param maxrate: Maximum rate of documents added to index (default: 100)
    :type maxrate: int
    :param interval: Queue check interval in seconds (default: 1.0)
    :type interval: int
    :param user: Optional basic auth username
    :type user: str
    :param password: Optional basic auth password
    :type password: str
    :param index: Index name format to store documents in Elastic
                  (default: duct-%Y.%m.%d)
    :type index: str
    """
    def __init__(self, *a):

        Output.__init__(self, *a)