Esempio n. 1
0
    def run(self, params={}):
        url = urljoin(self.connection.url, "_node/hot_threads")
        human = params.get("human", False)
        threads = params.get("threads", 3)
        ignore_idle_threads = params.get("ignore_idle_threads", True)
        params = {
            "human": human,
            "threads": threads,
            "ignore_idle_threads": ignore_idle_threads
        }
        r = requests.get(url, params=params)
        if human:
            return {"response": utils.serialize(r.content, human=True)}

        return {"response": utils.serialize(r.json())}
    def run(self, params={}):
        url = urljoin(self.connection.url, '_node/hot_threads')
        human = params.get('human', False)
        threads = params.get('threads', 3)
        ignore_idle_threads = params.get('ignore_idle_threads', True)
        params = {
            'human': human,
            'threads': threads,
            'ignore_idle_threads': ignore_idle_threads
        }
        r = requests.get(url, params=params)
        if human:
            return {'response': utils.serialize(r.content, human=True)}

        return {'response': utils.serialize(r.json())}
Esempio n. 3
0
    def run(self, params={}):
        url = urljoin(self.connection.url, "/_node")
        types = params.get("types")
        if types:
            error_types = utils.check_types(self.TYPES, types)
            if error_types:
                self.logger.error("Logstash: Node Info: invalid types %s",
                                  ",".join(error_types))
                raise Exception("Logstash: Node: Invalid types", types)

        r = requests.get(url, params=params)
        return {"response": utils.serialize(r.json())}
    def run(self, params={}):
        url = urljoin(self.connection.url, '/_node/stats')
        types = params.get('types')
        if types:
            error_types = utils.check_types(self.TYPES, types)
            if error_types:
                self.logger.error('Logstash: Node Stats: invalid types %s',
                                  ','.join(types))
                raise Exception("Logstash: Node Stats: Invalid types", types)

        r = requests.get(url, params=params)
        return {'response': utils.serialize(r.json())}
Esempio n. 5
0
 def run(self, params={}):
     url = urljoin(self.connection.url, "/_node/plugins")
     r = requests.get(url)
     return {"response": utils.serialize(r.json())}
 def run(self, params={}):
     r = requests.get(self.connection.url)
     return {'response': utils.serialize(r.json())}