Пример #1
0
 def test_get_field_mapping(self):
     c = IndicesClient()
     h_cb = partial(
         self.handle_cb,
         **{'codes':[400, 403, 404]}
     )
     c.get_field_mapping('test', index='test', callback=h_cb)
     self.wait()
Пример #2
0
 def test_delete_index(self):
     c = IndicesClient()
     h_cb = partial(
         self.handle_cb,
         **{'codes':[400, 403, 404]}
     )
     c.delete_index('test', callback=h_cb)
     self.wait()
Пример #3
0
 def test_index_exists_type(self):
     c = IndicesClient()
     h_cb = partial(
         self.handle_cb,
         **{'codes':[400, 403, 404]}
     )
     c.index_exists_type('test', 'type', callback=h_cb)
     self.wait()
Пример #4
0
 def test_snapshot_index(self):
     c = IndicesClient()
     h_cb = partial(
         self.handle_cb,
         **{'codes':[400, 403, 404]}
     )
     c.snapshot_index(callback=h_cb)
     self.wait()
Пример #5
0
 def test_refresh_index(self):
     c = IndicesClient()
     h_cb = partial(
         self.handle_cb,
         **{'codes':[400, 403, 404]}
     )
     c.refresh_index(index='test', callback=h_cb)
     self.wait()
Пример #6
0
 def test_get_template(self):
     c = IndicesClient()
     h_cb = partial(
         self.handle_cb,
         **{'codes':[400, 403, 404]}
     )
     c.get_template(name='test', callback=h_cb)
     self.wait()
Пример #7
0
 def test_get_aliases(self):
     c = IndicesClient()
     h_cb = partial(
         self.handle_cb,
         **{'codes':[400, 403, 404]}
     )
     c.get_aliases(index='test', callback=h_cb)
     self.wait()
Пример #8
0
    def test_put_settings(self):
        c = IndicesClient()
        body = """
        {
            "index" : {
                "number_of_replicas" : 1
            }
        }

        """
        c.put_settings(body, callback=self.handle_cb)
        self.wait()
Пример #9
0
    def test_put_alias(self):
        c = IndicesClient()
        h_cb = partial(
            self.handle_cb,
            **{'codes':[400, 403, 404]}
        )
        body = """
        {
            "actions" : [
                { "add" : { "index" : "test1", "alias" : "alias1" } }
            ]
        }

        """
        c.put_alias('test', 'test', body, callback=h_cb)
        self.wait()
Пример #10
0
    def test_put_mapping(self):
        c = IndicesClient()
        h_cb = partial(
            self.handle_cb,
            **{'codes':[400, 403, 404]}
        )
        body = """
        {
            "tweet" : {
                "properties" : {
                    "message" : {"type" : "string", "store" : true }
                }
            }
        }

        """
        c.put_mapping('test', body, callback=h_cb)
        self.wait()
Пример #11
0
    def test_put_template(self):
        c = IndicesClient()
        body = """
        {
            "template" : "te*",
            "settings" : {
                "number_of_shards" : 1
            },
            "mappings" : {
                "type1" : {
                    "_source" : { "enabled" : false }
                }
            }
        }

        """
        c.put_template('test', body, callback=self.handle_cb)
        self.wait()
Пример #12
0
    def test_put_warmer(self):
        c = IndicesClient()
        body = """
        {
            "query" : {
                "match_all" : {}
            },
            "aggs" : {
                "aggs_1" : {
                    "terms" : {
                        "field" : "field"
                    }
                }
            }
        }

        """
        c.put_warmer("test", body, callback=self.handle_cb)
        self.wait()
Пример #13
0
    def test_create_index(self):
        c = IndicesClient()
        h_cb = partial(
            self.handle_cb,
            **{'codes':[400, 403, 404]}
        )
        body = """
        {
            "settings" : {
                "index" : {
                    "number_of_shards" : 3,
                    "number_of_replicas" : 2
                }
            }
        }

        """
        c.create_index('test', body, callback=h_cb)
        self.wait()
Пример #14
0
 def test_get_warmer(self):
     c = IndicesClient()
     c.get_warmer(callback=self.handle_cb)
     self.wait()
Пример #15
0
 def test_get_settings(self):
     c = IndicesClient()
     c.get_settings(callback=self.handle_cb)
     self.wait()
Пример #16
0
 def test_recovery(self):
     c = IndicesClient()
     c.recovery(callback=self.handle_cb)
     self.wait()
Пример #17
0
 def test_clear_cache(self):
     c = IndicesClient()
     c.clear_cache(callback=self.handle_cb)
     self.wait()
Пример #18
0
 def test_validate_query(self):
     c = IndicesClient()
     c.validate_query(callback=self.handle_cb)
     self.wait()
Пример #19
0
 def test_optimize(self):
     c = IndicesClient()
     c.optimize(callback=self.handle_cb)
     self.wait()
Пример #20
0
 def test_segments(self):
     c = IndicesClient()
     c.segments(callback=self.handle_cb)
     self.wait()