示例#1
0
    def test_restore_snapshot(self):
        c = SnapshotClient()
        body = """
        '{
           "indices": "index_1,index_2",
           "ignore_unavailable": "true",
           "include_global_state": false,
           "rename_pattern": "index_(.+)",
           "rename_replacement": "restored_index_$1"
        }

        """
        h_cb = partial(self.handle_cb, **{'codes': [400, 404]})
        c.restore_snapshot('test', 'test', body, callback=h_cb)
        self.wait()
    def test_restore_snapshot(self):
        c = SnapshotClient()
        body = """
        '{
           "indices": "index_1,index_2",
           "ignore_unavailable": "true",
           "include_global_state": false,
           "rename_pattern": "index_(.+)",
           "rename_replacement": "restored_index_$1"
        }

        """
        h_cb = partial(
            self.handle_cb,
            **{'codes':[400, 404]}
        )
        c.restore_snapshot('test', 'test', body, callback=h_cb)
        self.wait()