2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
24 AUDIT_SEARCH_DATE_FORMAT,
25 AUDIT_SEARCH_DATE_TIME_ZONE
26 } from './NetworkConstants.js';
28 export function getTableDateQueryString(requestObject) {
31 'startDate': requestObject.dateRange.startDate.format(
32 AUDIT_SEARCH_DATE_FORMAT),
33 'endDate': requestObject.dateRange.endDate.format(
34 AUDIT_SEARCH_DATE_FORMAT),
35 'time_zone': requestObject.dateRange.startDate.format(
36 AUDIT_SEARCH_DATE_TIME_ZONE),
39 'from': requestObject.startIndex,
40 'size': requestObject.resultCount
46 export function getTSUIElasticSearchQueryString(query) {
47 // Create the query request
48 let posFirstEqualSign = query.indexOf('=');
49 let newQuery = query.substring(posFirstEqualSign + 1); // remove the first
51 //'attrName=attrValue'
52 newQuery = newQuery.replace(/\,[^\=]+\=/gi, ' '); // remove all ', attrName='
53 newQuery = newQuery.trim(); // remove whitespace at both ends, if any
60 export function getSeverityVisualizationQueryString(requestObject) {
63 'startDate': requestObject.dateRange.startDate.format(
64 AUDIT_SEARCH_DATE_FORMAT),
65 'endDate': requestObject.dateRange.endDate.format(
66 AUDIT_SEARCH_DATE_FORMAT),
67 'time_zone': requestObject.dateRange.startDate.format(
68 AUDIT_SEARCH_DATE_TIME_ZONE),
71 'groupByField': 'severity'
77 export function getStatusVisualizationQueryString(requestObject) {
80 'startDate': requestObject.dateRange.startDate.format(
81 AUDIT_SEARCH_DATE_FORMAT),
82 'endDate': requestObject.dateRange.endDate.format(
83 AUDIT_SEARCH_DATE_FORMAT),
84 'time_zone': requestObject.dateRange.startDate.format(
85 AUDIT_SEARCH_DATE_TIME_ZONE),
88 'groupByField': 'category'
94 export function getEntityTypeVisualizationQueryString(requestObject) {
97 'startDate': requestObject.dateRange.startDate.format(
98 AUDIT_SEARCH_DATE_FORMAT),
99 'endDate': requestObject.dateRange.endDate.format(
100 AUDIT_SEARCH_DATE_FORMAT),
101 'time_zone': requestObject.dateRange.startDate.format(
102 AUDIT_SEARCH_DATE_TIME_ZONE),
105 'groupByField': 'entityType'
111 export function getDateVisualizationQueryString(requestObject) {
114 'startDate': requestObject.dateRange.startDate.format(
115 AUDIT_SEARCH_DATE_FORMAT),
116 'endDate': requestObject.dateRange.endDate.format(
117 AUDIT_SEARCH_DATE_FORMAT),
118 'time_zone': requestObject.dateRange.startDate.format(
119 AUDIT_SEARCH_DATE_TIME_ZONE),
121 'type': 'dateHistogram'
127 export function getVnfOrchStatusQueryString(requestObject) {
129 'hashId': requestObject,
130 'groupby': 'orchestration-status'
133 export function getVnfProvStatusQueryString(requestObject) {
135 'hashId': requestObject,
136 'groupby': 'prov-status'
139 export function getVnfCountQueryString(requestObject) {
141 'hashId': requestObject