def command_on_indices(self, command, working_list):
        """Invoke command which acts on indices and perform an api call.
        """
        kwargs = self.command_kwargs(command)
        method = 'open_indices' if command == 'open' else command

        # List is too big and it will be proceeded in chunks.
        if len(api.utils.to_csv(working_list)) > 3072:
            logger.warn('Very large list of indices.  Breaking it up into smaller chunks.')
            success = True
            for indices in chunk_index_list(working_list):
                if not self._call_api(method, indices, **kwargs):
                    success = False
            return success
        else:
            return self._call_api(method, working_list, **kwargs)
dataset/ETHPy150Open StackStorm/st2contrib/packs/elasticsearch/actions/lib/curator_invoke.py/CuratorInvoke.command_on_indices/original