def clean(self, timeout=60):
        self.refresh()
        
        tds = self['maxTotalDataSizeMB']
        ftp = self['frozenTimePeriodInSecs']
        was_disabled_initially = self.disabled
        try:
            if (not was_disabled_initially and \
                self.service.splunk_version < (5,)):
                # Need to disable the index first on Splunk 4.x,
                # but it doesn't work to disable it on 5.0.
                self.disable()
            self.update(maxTotalDataSizeMB=1, frozenTimePeriodInSecs=1)
            self.roll_hot_buckets()

            # Wait until event count goes to 0.
            start = datetime.now()
            diff = timedelta(seconds=timeout)
            while self.content.totalEventCount != '0' and datetime.now() < start+diff:
                sleep(1)
                self.refresh()
            
            if self.content.totalEventCount != '0':
                raise OperationError, "Cleaning index %s took longer than %s seconds; timing out." %\
                                      (self.name, timeout)
        finally:
            # Restore original values
            self.update(maxTotalDataSizeMB=tds, frozenTimePeriodInSecs=ftp)
            if (not was_disabled_initially and \
                self.service.splunk_version < (5,)):
                # Re-enable the index if it was originally enabled and we messed with it.
                self.enable()

        return self
Deletes the contents of the index.
dataset/ETHPy150Open hvandenb/splunk-elasticsearch/search-elasticsearch/bin/splunklib/client.py/Index.clean