def update_settings(self, cluster_name, body=None):
    if (body is None):
        body = current_app.config.get('HQ_CLUSTER_SETTINGS')
    current_settings = self.get_settings(cluster_name)
    new_settings = {'doc_id': current_app.config.get('HQ_CLUSTER_SETTINGS')['doc_id'], 'index_name': current_app.config.get('HQ_CLUSTER_SETTINGS')['index_name'], 'version': 1, 'doc_type': current_app.config.get('HQ_CLUSTER_SETTINGS')['doc_type'], 'store_metrics': body.get('store_metrics', current_settings.get('store_metrics')), 'websocket_interval': body.get('websocket_interval', current_settings.get('websocket_interval')), 'historic_poll_interval': body.get('historic_poll_interval', current_settings.get('historic_poll_interval')), 'historic_days_to_store': body.get('historic_days_to_store', current_settings.get('historic_days_to_store')), 'show_dot_indices': body.get('show_dot_indices', current_settings.get('show_dot_indices'))}
    connection = ConnectionService().get_connection(cluster_name)
    connection.update(index=current_app.config.get('HQ_CLUSTER_SETTINGS')['index_name'], doc_type=current_app.config.get('HQ_CLUSTER_SETTINGS')['doc_type'], id=current_app.config.get('HQ_CLUSTER_SETTINGS')['doc_id'], body={'doc': new_settings}, refresh=True)
    self.get_settings.invalidate(self, cluster_name)
    return new_settings
def update_settings(self, cluster_name, body=None):
    if (body is None):
        body = current_app.config.get('HQ_CLUSTER_SETTINGS')
    current_settings = self.get_settings(cluster_name)
    new_settings = {'doc_id': current_app.config.get('HQ_CLUSTER_SETTINGS')['doc_id'], 'index_name': current_app.config.get('HQ_CLUSTER_SETTINGS')['index_name'], 'version': 1, 'doc_type': current_app.config.get('HQ_CLUSTER_SETTINGS')['doc_type'], 'store_metrics': body.get('store_metrics', current_settings.get('store_metrics')), 'websocket_interval': body.get('websocket_interval', current_settings.get('websocket_interval')), 'historic_poll_interval': body.get('historic_poll_interval', current_settings.get('historic_poll_interval')), 'historic_days_to_store': body.get('historic_days_to_store', current_settings.get('historic_days_to_store')), 'show_dot_indices': body.get('show_dot_indices', current_settings.get('show_dot_indices'))}
    connection = ConnectionService().get_connection(cluster_name)
    connection.update(index=current_app.config.get('HQ_CLUSTER_SETTINGS')['index_name'], doc_type=current_app.config.get('HQ_CLUSTER_SETTINGS')['doc_type'], id=current_app.config.get('HQ_CLUSTER_SETTINGS')['doc_id'], body={'doc': new_settings}, refresh=True)
    self.get_settings.invalidate(self, cluster_name)
    return new_settings