Unverified Commit 81680efa authored by Georg Weiss's avatar Georg Weiss Committed by GitHub
Browse files

Merge pull request #2369 from ControlSystemStudio/alarm_logger_fix

Alarm Logger fixes
parents 951f124d 85dc7c41
Pipeline #119829 passed with stage
in 11 minutes and 53 seconds
......@@ -291,7 +291,7 @@ public class ElasticClientHelper {
exists = client.indices().existsIndexTemplate(ExistsIndexTemplateRequest.of(i -> i.name(ALARM_CONFIG_TEMPLATE))).value();
if (!exists) {
try (InputStream is = ElasticClientHelper.class.getResourceAsStream("/alarms_cmd_template.json")) {
try (InputStream is = ElasticClientHelper.class.getResourceAsStream("/alarms_config_template.json")) {
PutIndexTemplateRequest templateRequest = new PutIndexTemplateRequest.Builder()
.name(ALARM_CONFIG_TEMPLATE)
.indexPatterns(Arrays.asList(ALARM_CONFIG_TEMPLATE_PATTERN))
......
......@@ -2,20 +2,11 @@ package org.phoebus.alarm.logging.rest;
import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.elasticsearch._types.ElasticsearchVersionInfo;
import co.elastic.clients.elasticsearch._types.FieldSort;
import co.elastic.clients.elasticsearch._types.SortOptions;
import co.elastic.clients.elasticsearch._types.SortOrder;
import co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery;
import co.elastic.clients.elasticsearch._types.query_dsl.Query;
import co.elastic.clients.elasticsearch.core.InfoResponse;
import co.elastic.clients.elasticsearch.core.SearchRequest;
import co.elastic.clients.elasticsearch.core.SearchResponse;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.phoebus.alarm.logging.AlarmLoggingService;
import org.phoebus.alarm.logging.ElasticClientHelper;
import org.phoebus.applications.alarm.messages.AlarmStateMessage;
import org.phoebus.framework.preferences.PreferencesReader;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -24,8 +15,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
......@@ -34,20 +23,18 @@ import java.util.logging.Level;
import java.util.logging.Logger;
/**
* A REST service for quering the alarm message history
* A REST service for querying the alarm message history
*
* @author Kunal Shroff
*/
@RestController
@RequestMapping("/alarm-history")
public class SearchController {
static final Logger logger = Logger.getLogger(SearchController.class.getName());
private final PreferencesReader prefs = new PreferencesReader(AlarmLoggingService.class, "/application.properties");
private static final ObjectMapper objectMapper = new ObjectMapper();
/**
*
* @return Information about the alarm logging service
*/
@GetMapping
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment