in curator/actions/reindex.py [0:0]
def do_action(self):
"""
Execute :py:meth:`~.elasticsearch.Elasticsearch.reindex` operation with the
``request_body`` from :py:meth:`_get_request_body` and arguments
:py:attr:`refresh`, :py:attr:`requests_per_second`, :py:attr:`slices`,
:py:attr:`timeout`, :py:attr:`wait_for_active_shards`, and :py:attr:`wfc`.
"""
try:
# Loop over all sources (default will only be one)
for source, dest in self.sources():
self.loggit.info('Commencing reindex operation')
self.loggit.debug('REINDEX: %s', self.show_run_args(source, dest))
response = self.client.reindex(**self._get_reindex_args(source, dest))
self.loggit.debug('TASK ID = %s', response['task'])
if self.wfc:
wait_for_it(
self.client,
'reindex',
task_id=response['task'],
wait_interval=self.wait_interval,
max_wait=self.max_wait,
)
self._post_run_quick_check(dest, response['task'])
else:
msg = (
f'"wait_for_completion" set to {self.wfc}. Remember to check '
f"task_id \"{response['task']}\" for successful completion "
f"manually."
)
self.loggit.warning(msg)
except NoIndices as exc:
raise NoIndices(
'Source index must be list of actual indices. It must not be an empty '
'list.'
) from exc
except Exception as exc:
report_failure(exc)