metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From merrimanr <...@git.apache.org>
Subject [GitHub] metron pull request #620: Metron-988: UI for viewing alerts generated by Met...
Date Mon, 10 Jul 2017 20:50:03 GMT
Github user merrimanr commented on a diff in the pull request:

    https://github.com/apache/metron/pull/620#discussion_r126532937
  
    --- Diff: metron-interface/metron-alerts/src/app/service/data-source.ts ---
    @@ -0,0 +1,62 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +import {Observable} from 'rxjs/Rx';
    +import {Injectable} from '@angular/core';
    +import {Http} from '@angular/http';
    +
    +import {Alert} from '../model/alert';
    +import {ColumnMetadata} from '../model/column-metadata';
    +import {ColumnNames} from '../model/column-names';
    +import {TableMetadata} from '../model/table-metadata';
    +import {SaveSearch} from '../model/save-search';
    +import {AlertsSearchResponse} from '../model/alerts-search-response';
    +import {SearchRequest} from '../model/search-request';
    +
    +@Injectable()
    +export abstract class DataSource {
    +  defaultHeaders: {'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest'};
    +
    +  constructor(protected http: Http) {}
    +
    +  // Calls to fetch alerts
    +  abstract getAlerts(searchRequest: SearchRequest): Observable<AlertsSearchResponse>
    +  abstract getAlert(index: string, type: string, alertId: string): Observable<Alert>
    +  abstract updateAlertState(request: any): Observable<{}>
    +
    +  // Calls to fetch default alert table column names and all the field names across all
indexes
    +  abstract getDefaultAlertTableColumnNames(): Observable<ColumnMetadata[]>
    +  abstract getAllFieldNames(): Observable<ColumnMetadata[]>
    +
    +  // Calls to rename field names and to fetch the renamed field names
    +  abstract getAlertTableColumnNames(): Observable<ColumnNames[]>
    +  abstract saveAlertTableColumnNames(columns: ColumnNames[]): Observable<{}>
    +
    +  // Calls to fetch and save alerts table settings like refresh interval, page size,
default selected table column names
    +  abstract getAlertTableSettings(): Observable<TableMetadata>
    --- End diff --
    
    This function (and others in this class) really have nothing to do with a search engine
or Elasticsearch.  I think would make sense to move these to a different abstract class.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message