(self, sketch)
return HTTP_STATUS_CODE_OK
Unarchives a sketch by opening up all indices and removing labels.

        Args:
            sketch: Instance of timesketch.models.sketch.Sketch
Unarchives a sketch by opening up all indices and removing labels.
Unarchives a sketch by opening up all indices and removing labels .
def _unarchive_sketch(self, sketch):
        """Unarchives a sketch by opening up all indices and removing labels.

        Args:
            sketch: Instance of timesketch.models.sketch.Sketch
        """
        if sketch.get_status.status != 'archived':
            abort(
                HTTP_STATUS_CODE_BAD_REQUEST,
                'Unable to unarchive a sketch that wasn\'t already archived '
                '(sketch: {0:d})'.format(sketch.id))

        sketch.set_status(status='ready')

        indexes_to_open = []
        for timeline in sketch.timelines:
            if timeline.get_status.status != 'archived':
                continue
            timeline.set_status(status='ready')
            search_index = timeline.searchindex
            search_index.set_status(status='ready')
            indexes_to_open.append(search_index.index_name)

        # TODO (kiddi): Move this to lib/datastores/opensearch.py.
        if indexes_to_open:
            try:
                self.datastore.client.indices.open(','.join(indexes_to_open))
            except opensearchpy.NotFoundError:
                logger.error('Unable to open index, not found: {0:s}'.format(
                    ','.join(indexes_to_open)))

        return HTTP_STATUS_CODE_OK
def _unarchive_sketch ( self , sketch ) : if sketch . get_status . status != 'archived' : abort ( HTTP_STATUS_CODE_BAD_REQUEST , 'Unable to unarchive a sketch that wasn\'t already archived ' '(sketch: {0:d})' . format ( sketch . id ) ) sketch . set_status ( status = 'ready' ) indexes_to_open = [ ] for timeline in sketch . timelines : if timeline . get_status . status != 'archived' : continue timeline . set_status ( status = 'ready' ) search_index = timeline . searchindex search_index . set_status ( status = 'ready' ) indexes_to_open . append ( search_index . index_name ) # TODO (kiddi): Move this to lib/datastores/opensearch.py. if indexes_to_open : try : self . datastore . client . indices . open ( ',' . join ( indexes_to_open ) ) except opensearchpy . NotFoundError : logger . error ( 'Unable to open index, not found: {0:s}' . format ( ',' . join ( indexes_to_open ) ) ) return HTTP_STATUS_CODE_OK