aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Dockerfile20
-rw-r--r--LICENSE.txt6
-rw-r--r--README.md50
-rw-r--r--data-formats/VES-4.27.2-dataformat.json1165
-rw-r--r--data-formats/ves-dmaap-config.json130
-rw-r--r--docker-compose.yml8
-rw-r--r--dpo/blueprint/blueprint_ves.yaml17
-rwxr-xr-xdpo/data-formats/VES-4.27.2-dataformat.json1383
-rw-r--r--dpo/data-formats/VES-5.28.3-dataformat.json (renamed from data-formats/VES-5.28.3-dataformat.json)31
-rwxr-xr-x[-rw-r--r--]dpo/data-formats/VES-5.28.4-dataformat.json (renamed from data-formats/VES-5.28.4-dataformat.json)314
-rw-r--r--dpo/data-formats/healthcheck-docker-config.json (renamed from data-formats/healthcheck-docker-config.json)0
-rw-r--r--dpo/data-formats/ves-dmaap-config.json149
-rw-r--r--dpo/data-formats/ves-response.json (renamed from data-formats/ves-response.json)0
-rw-r--r--dpo/spec/vescollector-componentspec.json460
-rw-r--r--dpo/tosca_model/schema.yaml17
-rw-r--r--dpo/tosca_model/template.yaml17
-rw-r--r--dpo/tosca_model/translate.yaml17
-rwxr-xr-x[-rw-r--r--]etc/CommonEventFormat_27.2.json2759
-rw-r--r--etc/CommonEventFormat_28.3.json1514
-rwxr-xr-x[-rw-r--r--]etc/CommonEventFormat_28.4.1.json (renamed from etc/CommonEventFormat_28.4.json)4002
-rwxr-xr-xetc/CommonEventFormat_Vendors_v25.json1331
-rwxr-xr-xetc/CommonEventFormat_Vendors_v26.0.json1612
-rw-r--r--etc/DmaapConfig.json56
-rw-r--r--etc/ExceptionConfig.json42
-rwxr-xr-x[-rw-r--r--]etc/collector.properties146
-rw-r--r--etc/eventTransform.json17
-rw-r--r--etc/log4j.xml51
-rw-r--r--etc/logrotate.conf7
-rwxr-xr-xmvn-phase-lib.sh296
-rwxr-xr-xmvn-phase-script.sh203
-rw-r--r--pom.xml802
-rw-r--r--settings.xml21
-rw-r--r--src/assembly/dep.xml159
-rw-r--r--src/main/java/org/onap/dcae/ApplicationSettings.java176
-rw-r--r--src/main/java/org/onap/dcae/CLIUtils.java60
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/AnyNode.java113
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/CommonStartup.java514
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/ConfigProcessors.java1068
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/CustomExceptionLoader.java128
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/DmaapPropertyReader.java213
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/Event.java (renamed from src/test/java/org/onap/dcae/vestest/TestDmaapPropertyReader.java)48
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/EventProcessor.java365
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/EventPublisher.java180
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/Processor.java33
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/VESLogger.java242
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPConfigurationParser.java107
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPEventPublisher.java99
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersBuilder.java62
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersCache.java124
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/event/publishing/EventPublisher.java38
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/event/publishing/PublisherConfig.java98
-rw-r--r--src/main/java/org/onap/dcae/commonFunction/event/publishing/VavrUtils.java51
-rw-r--r--src/main/java/org/onap/dcae/controller/FetchDynamicConfig.java308
-rw-r--r--src/main/java/org/onap/dcae/controller/LoadDynamicConfig.java178
-rw-r--r--src/main/java/org/onap/dcae/restapi/ApiException.java70
-rw-r--r--src/main/java/org/onap/dcae/restapi/RestfulCollectorServlet.java288
-rw-r--r--src/main/java/org/onap/dcae/restapi/endpoints/EventReceipt.java525
-rw-r--r--src/main/resources/seclogger.yaml19
-rw-r--r--src/main/scripts/VESConfigPoller.sh125
-rw-r--r--src/main/scripts/VESrestfulCollector.sh275
-rw-r--r--src/main/scripts/VESrestfulCollector_Status.sh41
-rw-r--r--src/main/scripts/docker-entry.sh107
-rw-r--r--src/main/scripts/logger.sh58
-rw-r--r--src/main/scripts/reconfigure.sh18
-rw-r--r--src/main/scripts/run-dcae-controller-ves-collector-daemon.sh39
-rw-r--r--src/main/scripts/run-dcae-controller-ves-collector-interactive.sh39
-rw-r--r--src/test/java/org/onap/dcae/ApplicationSettingsTest.java417
-rw-r--r--src/test/java/org/onap/dcae/commonFunction/ApiExceptionTest.java59
-rw-r--r--src/test/java/org/onap/dcae/commonFunction/CommonStartupTest.java127
-rw-r--r--src/test/java/org/onap/dcae/commonFunction/ConfigProcessorAdapterTest.java66
-rw-r--r--src/test/java/org/onap/dcae/commonFunction/EventProcessorTest.java90
-rw-r--r--src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPConfigurationParserTest.java114
-rw-r--r--src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPEventPublisherTest.java89
-rw-r--r--src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersCacheTest.java126
-rw-r--r--src/test/java/org/onap/dcae/vestest/AnyNodeTest.java63
-rw-r--r--src/test/java/org/onap/dcae/vestest/EventTransformTest.java181
-rw-r--r--src/test/java/org/onap/dcae/vestest/InputJsonValidation.java151
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestCommonStartup.java171
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestConfigProcessor.java309
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java72
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestDefaultConfiguration.java (renamed from src/test/java/org/onap/dcae/vestest/VesCollectorJunitTestRunner.java)52
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestEventProcessor.java104
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestEventReceipt.java46
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestFetchConfig.java81
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestJsonSchemaValidation.java57
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestLoadDynamicConfig.java82
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestSchemaValidation.java136
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestVESLogger.java75
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestingUtilities.java93
-rw-r--r--src/test/java/org/onap/dcae/vestest/VesCollectorJunitTest.java95
-rw-r--r--src/test/resources/controller-config.json17
-rw-r--r--src/test/resources/controller-config_dmaap_ip.json239
-rw-r--r--src/test/resources/controller-config_singleline_ip.json1
-rw-r--r--src/test/resources/testDmaapConfig_ip.json (renamed from src/test/resources/testDmaapConfig.json)0
-rw-r--r--src/test/resources/testFullDmaapConfig_gen2.json24
-rw-r--r--src/test/resources/testParseDMaaPCredentialsGen2.json21
-rw-r--r--src/test/resources/testParseDMaaPCredentialsLegacy.json26
-rw-r--r--src/test/resources/testParseDMaaPGen2.json12
-rw-r--r--src/test/resources/testParseDMaaPLegacy.json21
-rw-r--r--src/test/resources/test_anynode_class.json9
-rw-r--r--src/test/resources/test_collector_ip_op.properties16
-rw-r--r--src/test/resources/testcollector.properties89
-rw-r--r--swagger_vescollector.yaml19
-rw-r--r--version.properties4
104 files changed, 15442 insertions, 10523 deletions
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index c7f7c2e2..00000000
--- a/Dockerfile
+++ /dev/null
@@ -1,20 +0,0 @@
-FROM ubuntu:16.04
-#FROM dcae-alpine:8-jre-tini
-
-MAINTAINER vv770d@att.com
-
-WORKDIR /opt/app/VESCollector
-
-ENV HOME /opt/app/VESCollector
-ENV JAVA_HOME /usr
-
-RUN apt-get update && apt-get install -y \
- curl \
- vim \
- openjdk-8-jdk
-
-COPY opt /opt
-
-EXPOSE 8080
-
-CMD [ "/opt/app/docker-entry.sh" ]
diff --git a/LICENSE.txt b/LICENSE.txt
index 69d5fc1d..9536f0bb 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,11 +1,11 @@
/*
* ============LICENSE_START==========================================
* ===================================================================
-* Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+* Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
-* under the Apache License, Version 2.0 (the “License”);
+* under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -20,7 +20,7 @@
*
*
* Unless otherwise specified, all documentation contained herein is licensed
-* under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+* under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
diff --git a/README.md b/README.md
index 6dc31611..b7bbdb83 100644
--- a/README.md
+++ b/README.md
@@ -17,13 +17,57 @@ git clone ssh://vv770d@gerrit.onap.org:29418/dcaegen2/collectors/ves
mvn clean install
```
-### Docker Image
+### Running Locally
+Build the image (it will go into your local docker repository)
```
-git clone ssh://vv770d@gerrit.onap.org:29418/dcaegen2/collectors/ves
-mvn clean deploy
+mvn clean package
+```
+
+Run the image using docker-compose.yml
+```
+docker-compose up
```
+### Environment variables in Docker Container
+Most of the configuration of how VESCollector should be started and managed is done through environment variables.
+Some of them are set during the image build process and some of them are defined manually or by
+a particular deployment system.
+
+Variables set manually / coming from deployment system:
+- COLLECTOR_IP
+- DMAAPHOST - should contain an address to DMaaP, so that event publishing can work
+- CBSPOLLTIMER - it should be put in here if we want to automatically fetch configuration from CBS.
+- CONSUL_HOST - used with conjunction with CBSPOLLTIMER, should be a host address (without port! e.g http://my-ip-or-host) where Consul service lies
+- CONFIG_BINDING_SERVICE - used with conjunction with CBSPOLLTIMER, should be a name of CBS as it is registered in Consul
+- HOSTNAME - used with conjunction with CBSPOLLTIMER, should be a name of VESCollector application as it is registered in CBS catalog
+
+### Docker file system layout
+The main directory where all code resides in docker container
+looks like this and is located in /opt/app/VESCollector
+```
+<host>:/opt/app/VESCollector# ls
+Dockerfile bin etc lib logs specs tomcat.8080
+```
+- bin contains sh scripts (path here is denoted by env var $SCRIPTS_PATH)
+- etc contains various application configuration, most notably it reflects 'etc' directory from repository
+- lib contains all libraries that are pulled into the app during maven build
+- logs contains all application logs, especially collector.log file which is a main log file denoted by $MAIN_LOG_FILE variable
+- specs contains json schemas specs for ves-collector
+
+## Managing application in Docker container
+Scripts directory contain .sh scripts that are used to start & stop & configure the VESCollector application
+inside the docker image.
+These scripts are packaged inside the docker image by a mvn assembly & docker plugins.
+
+## How the application starts inside container
+General flow goes like this
+- Docker image is build, and it points docker-entry.sh as the entrypoint.
+- Docker-entry point, depending on the deployment type,
+configures a bunch of things and starts the application in a separate process
+and loops indefinitely to hold the docker container process.
+
+### Release images
For R1 - image/version pushed to nexus3
```
nexus3.onap.org:10003/snapshots/onap/org.onap.dcaegen2.collectors.ves.vescollector 1.1
diff --git a/data-formats/VES-4.27.2-dataformat.json b/data-formats/VES-4.27.2-dataformat.json
deleted file mode 100644
index 1a98c548..00000000
--- a/data-formats/VES-4.27.2-dataformat.json
+++ /dev/null
@@ -1,1165 +0,0 @@
-{
- "self": {
- "name": "VES_specification",
- "version": "4.27.2",
- "description": "VES spec from v4.1 and 27.2 spec"
-
- },
- "dataformatversion": "1.0.0",
- "jsonschema":
- {
- "$schema": "http://json-schema.org/draft-04/schema#",
-
- "definitions": {
- "attCopyrightNotice": {
- "description": "Copyright (c) <2017>, AT&T Intellectual Property. All rights reserved. Licensed under the Apache License, Version 2.0 (the License)",
- "type": "object",
- "properties": {
- "useAndRedistribution": {
- "description": "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",
- "type": "string"
- },
- "licenseLink": "http://www.apache.org/licenses/LICENSE-2.0",
- "condition1": {
- "description": "Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an AS IS BASIS,",
- "type": "string"
- },
- "condition2": {
- "description": "Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.",
- "type": "string"
- },
- "condition3": {
- "description": "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
- "type": "string"
- },
- "condition4": {
- "description": "See the License for the specific language governing permissions and limitations under the License.",
- "type": "string"
- },
- "Trademarks": {
- "description": "ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property.",
- "type": "string"
- }
- }
- },
- "codecsInUse": {
- "description": "number of times an identified codec was used over the measurementInterval",
- "type": "object",
- "properties": {
- "codecIdentifier": { "type": "string" },
- "numberInUse": { "type": "number" }
- },
- "required": [ "codecIdentifier", "numberInUse" ]
- },
- "command": {
- "description": "command from an event collector toward an event source",
- "type": "object",
- "properties": {
- "commandType": {
- "type": "string",
- "enum": [
- "heartbeatIntervalChange",
- "measurementIntervalChange",
- "provideThrottlingState",
- "throttlingSpecification"
- ]
- },
- "eventDomainThrottleSpecification": { "$ref": "#/definitions/eventDomainThrottleSpecification" },
- "measurementInterval": { "type": "number" }
- },
- "required": [ "commandType" ]
- },
- "commandList": {
- "description": "array of commands from an event collector toward an event source",
- "type": "array",
- "items": {
- "$ref": "#/definitions/commandListEntry"
- },
- "minItems": 0
- },
- "commandListEntry": {
- "description": "reference to a command object",
- "type": "object",
- "properties": {
- "command": {"$ref": "#/definitions/command"}
- },
- "required": [ "command" ]
- },
- "commonEventHeader": {
- "description": "fields common to all events",
- "type": "object",
- "properties": {
- "domain": {
- "description": "the eventing domain associated with the event",
- "type": "string",
- "enum": [
- "fault",
- "heartbeat",
- "measurementsForVfScaling",
- "mobileFlow",
- "other",
- "stateChange",
- "syslog",
- "thresholdCrossingAlert"
- ]
- },
- "eventId": {
- "description": "event key that is unique to the event source",
- "type": "string"
- },
- "eventType": {
- "description": "unique event topic name",
- "type": "string"
- },
- "functionalRole": {
- "description": "function of the event source e.g., eNodeB, MME, PCRF",
- "type": "string"
- },
- "internalHeaderFields": { "$ref": "#/definitions/internalHeaderFields" },
- "lastEpochMicrosec": {
- "description": "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
- "type": "number"
- },
- "priority": {
- "description": "processing priority",
- "type": "string",
- "enum": [
- "High",
- "Medium",
- "Normal",
- "Low"
- ]
- },
- "reportingEntityId": {
- "description": "UUID identifying the entity reporting the event, for example an OAM VM; must be populated by the ATT enrichment process",
- "type": "string"
- },
- "reportingEntityName": {
- "description": "name of the entity reporting the event, for example, an OAM VM",
- "type": "string"
- },
- "sequence": {
- "description": "ordering of events communicated by an event source instance or 0 if not needed",
- "type": "integer"
- },
- "sourceId": {
- "description": "UUID identifying the entity experiencing the event issue; must be populated by the ATT enrichment process",
- "type": "string"
- },
- "sourceName": {
- "description": "name of the entity experiencing the event issue",
- "type": "string"
- },
- "startEpochMicrosec": {
- "description": "the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
- "type": "number"
- },
- "version": {
- "description": "version of the event header",
- "type": "number"
- }
- },
- "required": [ "domain", "eventId", "functionalRole", "lastEpochMicrosec",
- "priority", "reportingEntityName", "sequence",
- "sourceName", "startEpochMicrosec" ]
- },
- "counter": {
- "description": "performance counter",
- "type": "object",
- "properties": {
- "criticality": { "type": "string", "enum": [ "CRIT", "MAJ" ] },
- "name": { "type": "string" },
- "thresholdCrossed": { "type": "string" },
- "value": { "type": "string"}
- },
- "required": [ "criticality", "name", "thresholdCrossed", "value" ]
- },
- "cpuUsage": {
- "description": "percent usage of an identified CPU",
- "type": "object",
- "properties": {
- "cpuIdentifier": { "type": "string" },
- "percentUsage": { "type": "number" }
- },
- "required": [ "cpuIdentifier", "percentUsage" ]
- },
- "errors": {
- "description": "receive and transmit errors for the measurements domain",
- "type": "object",
- "properties": {
- "receiveDiscards": { "type": "number" },
- "receiveErrors": { "type": "number" },
- "transmitDiscards": { "type": "number" },
- "transmitErrors": { "type": "number" }
- },
- "required": [ "receiveDiscards", "receiveErrors", "transmitDiscards", "transmitErrors" ]
- },
- "event": {
- "description": "the root level of the common event format",
- "type": "object",
- "properties": {
- "commonEventHeader": { "$ref": "#/definitions/commonEventHeader" },
- "faultFields": { "$ref": "#/definitions/faultFields" },
- "measurementsForVfScalingFields": { "$ref": "#/definitions/measurementsForVfScalingFields" },
- "mobileFlowFields": { "$ref": "#/definitions/mobileFlowFields" },
- "otherFields": { "$ref": "#/definitions/otherFields" },
- "stateChangeFields": { "$ref": "#/definitions/stateChangeFields" },
- "syslogFields": { "$ref": "#/definitions/syslogFields" },
- "thresholdCrossingAlertFields": { "$ref": "#/definitions/thresholdCrossingAlertFields" }
- },
- "required": [ "commonEventHeader" ]
- },
- "eventDomainThrottleSpecification": {
- "description": "specification of what information to suppress within an event domain",
- "type": "object",
- "properties": {
- "eventDomain": {
- "description": "Event domain enum from the commonEventHeader domain field",
- "type": "string"
- },
- "suppressedFieldNames": {
- "description": "List of optional field names in the event block that should not be sent to the Event Listener",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "suppressedNvPairsList": {
- "description": "Optional list of specific NvPairsNames to suppress within a given Name-Value Field",
- "type": "array",
- "items": {
- "$ref": "#/definitions/suppressedNvPairs"
- }
- }
- },
- "required": [ "eventDomain" ]
- },
- "eventDomainThrottleSpecificationList": {
- "description": "array of eventDomainThrottleSpecifications",
- "type": "array",
- "items": {
- "$ref": "#/definitions/eventDomainThrottleSpecification"
- },
- "minItems": 0
- },
- "eventList": {
- "description": "array of events",
- "type": "array",
- "items": {
- "$ref": "#/definitions/event"
- }
- },
- "eventThrottlingState": {
- "description": "reports the throttling in force at the event source",
- "type": "object",
- "properties": {
- "eventThrottlingMode": {
- "description": "Mode the event manager is in",
- "type": "string",
- "enum": [
- "normal",
- "throttled"
- ]
- },
- "eventDomainThrottleSpecificationList": { "$ref": "#/definitions/eventDomainThrottleSpecificationList" }
- },
- "required": [ "eventThrottlingMode" ]
- },
- "faultFields": {
- "description": "fields specific to fault events",
- "type": "object",
- "properties": {
- "alarmAdditionalInformation": {
- "description": "additional alarm information",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "alarmCondition": {
- "description": "alarm condition reported by the device",
- "type": "string"
- },
- "alarmInterfaceA": {
- "description": "card, port, channel or interface name of the device generating the alarm",
- "type": "string"
- },
- "eventSeverity": {
- "description": "event severity or priority",
- "type": "string",
- "enum": [
- "CRITICAL",
- "MAJOR",
- "MINOR",
- "WARNING",
- "NORMAL"
- ]
- },
- "eventSourceType": {
- "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
- "type": "string"
- },
- "faultFieldsVersion": {
- "description": "version of the faultFields block",
- "type": "number"
- },
- "specificProblem": {
- "description": "short description of the alarm or problem",
- "type": "string"
- },
- "vfStatus": {
- "description": "virtual function status enumeration",
- "type": "string",
- "enum": [
- "Active",
- "Idle",
- "Preparing to terminate",
- "Ready to terminate",
- "Requesting termination"
- ]
- }
- },
- "required": [ "alarmCondition", "eventSeverity",
- "eventSourceType", "specificProblem", "vfStatus" ]
- },
- "featuresInUse": {
- "description": "number of times an identified feature was used over the measurementInterval",
- "type": "object",
- "properties": {
- "featureIdentifier": { "type": "string" },
- "featureUtilization": { "type": "number" }
- },
- "required": [ "featureIdentifier", "featureUtilization" ]
- },
- "field": {
- "description": "name value pair",
- "type": "object",
- "properties": {
- "name": { "type": "string" },
- "value": { "type": "string" }
- },
- "required": [ "name", "value" ]
- },
- "filesystemUsage": {
- "description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second",
- "type": "object",
- "properties": {
- "blockConfigured": { "type": "number" },
- "blockIops": { "type": "number" },
- "blockUsed": { "type": "number" },
- "ephemeralConfigured": { "type": "number" },
- "ephemeralIops": { "type": "number" },
- "ephemeralUsed": { "type": "number" },
- "filesystemName": { "type": "string" }
- },
- "required": [ "blockConfigured", "blockIops", "blockUsed", "ephemeralConfigured",
- "ephemeralIops", "ephemeralUsed", "filesystemName" ]
- },
- "gtpPerFlowMetrics": {
- "description": "Mobility GTP Protocol per flow metrics",
- "type": "object",
- "properties": {
- "avgBitErrorRate": {
- "description": "average bit error rate",
- "type": "number"
- },
- "avgPacketDelayVariation": {
- "description": "Average packet delay variation or jitter in milliseconds for received packets: Average difference between the packet timestamp and time received for all pairs of consecutive packets",
- "type": "number"
- },
- "avgPacketLatency": {
- "description": "average delivery latency",
- "type": "number"
- },
- "avgReceiveThroughput": {
- "description": "average receive throughput",
- "type": "number"
- },
- "avgTransmitThroughput": {
- "description": "average transmit throughput",
- "type": "number"
- },
- "durConnectionFailedStatus": {
- "description": "duration of failed state in milliseconds, computed as the cumulative time between a failed echo request and the next following successful error request, over this reporting interval",
- "type": "number"
- },
- "durTunnelFailedStatus": {
- "description": "Duration of errored state, computed as the cumulative time between a tunnel error indicator and the next following non-errored indicator, over this reporting interval",
- "type": "number"
- },
- "flowActivatedBy": {
- "description": "Endpoint activating the flow",
- "type": "string"
- },
- "flowActivationEpoch": {
- "description": "Time the connection is activated in the flow (connection) being reported on, or transmission time of the first packet if activation time is not available",
- "type": "number"
- },
- "flowActivationMicrosec": {
- "description": "Integer microseconds for the start of the flow connection",
- "type": "number"
- },
- "flowActivationTime": {
- "description": "time the connection is activated in the flow being reported on, or transmission time of the first packet if activation time is not available; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "flowDeactivatedBy": {
- "description": "Endpoint deactivating the flow",
- "type": "string"
- },
- "flowDeactivationEpoch": {
- "description": "Time for the start of the flow connection, in integer UTC epoch time aka UNIX time",
- "type": "number"
- },
- "flowDeactivationMicrosec": {
- "description": "Integer microseconds for the start of the flow connection",
- "type": "number"
- },
- "flowDeactivationTime": {
- "description": "Transmission time of the first packet in the flow connection being reported on; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "flowStatus": {
- "description": "connection status at reporting time as a working / inactive / failed indicator value",
- "type": "string"
- },
- "gtpConnectionStatus": {
- "description": "Current connection state at reporting time",
- "type": "string"
- },
- "gtpTunnelStatus": {
- "description": "Current tunnel state at reporting time",
- "type": "string"
- },
- "ipTosCountList": {
- "description": "array of key: value pairs where the keys are drawn from the IP Type-of-Service identifiers which range from '0' to '255', and the values are the count of packets that had those ToS identifiers in the flow",
- "type": "array",
- "items": {
- "type": "array",
- "items": [
- { "type": "string" },
- { "type": "number" }
- ]
- }
- },
- "ipTosList": {
- "description": "Array of unique IP Type-of-Service values observed in the flow where values range from '0' to '255'",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "largePacketRtt": {
- "description": "large packet round trip time",
- "type": "number"
- },
- "largePacketThreshold": {
- "description": "large packet threshold being applied",
- "type": "number"
- },
- "maxPacketDelayVariation": {
- "description": "Maximum packet delay variation or jitter in milliseconds for received packets: Maximum of the difference between the packet timestamp and time received for all pairs of consecutive packets",
- "type": "number"
- },
- "maxReceiveBitRate": {
- "description": "maximum receive bit rate",
- "type": "number"
- },
- "maxTransmitBitRate": {
- "description": "maximum transmit bit rate",
- "type": "number"
- },
- "mobileQciCosCountList": {
- "description": "array of key: value pairs where the keys are drawn from LTE QCI or UMTS class of service strings, and the values are the count of packets that had those strings in the flow",
- "type": "array",
- "items": {
- "type": "array",
- "items": [
- { "type": "string" },
- { "type": "number" }
- ]
- }
- },
- "mobileQciCosList": {
- "description": "Array of unique LTE QCI or UMTS class-of-service values observed in the flow",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "numActivationFailures": {
- "description": "Number of failed activation requests, as observed by the reporting node",
- "type": "number"
- },
- "numBitErrors": {
- "description": "number of errored bits",
- "type": "number"
- },
- "numBytesReceived": {
- "description": "number of bytes received, including retransmissions",
- "type": "number"
- },
- "numBytesTransmitted": {
- "description": "number of bytes transmitted, including retransmissions",
- "type": "number"
- },
- "numDroppedPackets": {
- "description": "number of received packets dropped due to errors per virtual interface",
- "type": "number"
- },
- "numGtpEchoFailures": {
- "description": "Number of Echo request path failures where failed paths are defined in 3GPP TS 29.281 sec 7.2.1 and 3GPP TS 29.060 sec. 11.2",
- "type": "number"
- },
- "numGtpTunnelErrors": {
- "description": "Number of tunnel error indications where errors are defined in 3GPP TS 29.281 sec 7.3.1 and 3GPP TS 29.060 sec. 11.1",
- "type": "number"
- },
- "numHttpErrors": {
- "description": "Http error count",
- "type": "number"
- },
- "numL7BytesReceived": {
- "description": "number of tunneled layer 7 bytes received, including retransmissions",
- "type": "number"
- },
- "numL7BytesTransmitted": {
- "description": "number of tunneled layer 7 bytes transmitted, excluding retransmissions",
- "type": "number"
- },
- "numLostPackets": {
- "description": "number of lost packets",
- "type": "number"
- },
- "numOutOfOrderPackets": {
- "description": "number of out-of-order packets",
- "type": "number"
- },
- "numPacketErrors": {
- "description": "number of errored packets",
- "type": "number"
- },
- "numPacketsReceivedExclRetrans": {
- "description": "number of packets received, excluding retransmission",
- "type": "number"
- },
- "numPacketsReceivedInclRetrans": {
- "description": "number of packets received, including retransmission",
- "type": "number"
- },
- "numPacketsTransmittedInclRetrans": {
- "description": "number of packets transmitted, including retransmissions",
- "type": "number"
- },
- "numRetries": {
- "description": "number of packet retries",
- "type": "number"
- },
- "numTimeouts": {
- "description": "number of packet timeouts",
- "type": "number"
- },
- "numTunneledL7BytesReceived": {
- "description": "number of tunneled layer 7 bytes received, excluding retransmissions",
- "type": "number"
- },
- "roundTripTime": {
- "description": "round trip time",
- "type": "number"
- },
- "tcpFlagCountList": {
- "description": "array of key: value pairs where the keys are drawn from TCP Flags and the values are the count of packets that had that TCP Flag in the flow",
- "type": "array",
- "items": {
- "type": "array",
- "items": [
- { "type": "string" },
- { "type": "number" }
- ]
- }
- },
- "tcpFlagList": {
- "description": "Array of unique TCP Flags observed in the flow",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "timeToFirstByte": {
- "description": "Time in milliseconds between the connection activation and first byte received",
- "type": "number"
- }
- },
- "required": [ "avgBitErrorRate", "avgPacketDelayVariation", "avgPacketLatency",
- "avgReceiveThroughput", "avgTransmitThroughput",
- "flowActivationEpoch", "flowActivationMicrosec",
- "flowDeactivationEpoch", "flowDeactivationMicrosec",
- "flowDeactivationTime", "flowStatus",
- "maxPacketDelayVariation", "numActivationFailures",
- "numBitErrors", "numBytesReceived", "numBytesTransmitted",
- "numDroppedPackets", "numL7BytesReceived",
- "numL7BytesTransmitted", "numLostPackets",
- "numOutOfOrderPackets", "numPacketErrors",
- "numPacketsReceivedExclRetrans",
- "numPacketsReceivedInclRetrans",
- "numPacketsTransmittedInclRetrans",
- "numRetries", "numTimeouts", "numTunneledL7BytesReceived",
- "roundTripTime", "timeToFirstByte"
- ]
- },
- "internalHeaderFields": {
- "description": "enrichment fields for internal VES Event Listener service use only, not supplied by event sources",
- "type": "object"
- },
- "latencyBucketMeasure": {
- "description": "number of counts falling within a defined latency bucket",
- "type": "object",
- "properties": {
- "countsInTheBucket": { "type": "number" },
- "highEndOfLatencyBucket": { "type": "number" },
- "lowEndOfLatencyBucket": { "type": "number" }
- },
- "required": [ "countsInTheBucket" ]
- },
- "measurementGroup": {
- "description": "measurement group",
- "type": "object",
- "properties": {
- "name": { "type": "string" },
- "measurements": {
- "description": "array of name value pair measurements",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- }
- },
- "required": [ "name", "measurements" ]
- },
- "measurementsForVfScalingFields": {
- "description": "measurementsForVfScaling fields",
- "type": "object",
- "properties": {
- "additionalMeasurements": {
- "description": "additional measurement fields",
- "type": "array",
- "items": {
- "$ref": "#/definitions/measurementGroup"
- }
- },
- "aggregateCpuUsage": {
- "description": "aggregate CPU usage of the VM on which the VNFC reporting the event is running",
- "type": "number"
- },
- "codecUsageArray": {
- "description": "array of codecs in use",
- "type": "array",
- "items": {
- "$ref": "#/definitions/codecsInUse"
- }
- },
- "concurrentSessions": {
- "description": "peak concurrent sessions for the VM or VNF over the measurementInterval",
- "type": "number"
- },
- "configuredEntities": {
- "description": "over the measurementInterval, peak total number of: users, subscribers, devices, adjacencies, etc., for the VM, or subscribers, devices, etc., for the VNF",
- "type": "number"
- },
- "cpuUsageArray": {
- "description": "usage of an array of CPUs",
- "type": "array",
- "items": {
- "$ref": "#/definitions/cpuUsage"
- }
- },
- "errors": { "$ref": "#/definitions/errors" },
- "featureUsageArray": {
- "description": "array of features in use",
- "type": "array",
- "items": {
- "$ref": "#/definitions/featuresInUse"
- }
- },
- "filesystemUsageArray": {
- "description": "filesystem usage of the VM on which the VNFC reporting the event is running",
- "type": "array",
- "items": {
- "$ref": "#/definitions/filesystemUsage"
- }
- },
- "latencyDistribution": {
- "description": "array of integers representing counts of requests whose latency in milliseconds falls within per-VNF configured ranges",
- "type": "array",
- "items": {
- "$ref": "#/definitions/latencyBucketMeasure"
- }
- },
- "meanRequestLatency": {
- "description": "mean seconds required to respond to each request for the VM on which the VNFC reporting the event is running",
- "type": "number"
- },
- "measurementInterval": {
- "description": "interval over which measurements are being reported in seconds",
- "type": "number"
- },
- "measurementsForVfScalingVersion": {
- "description": "version of the measurementsForVfScaling block",
- "type": "number"
- },
- "memoryConfigured": {
- "description": "memory in MB configured in the VM on which the VNFC reporting the event is running",
- "type": "number"
- },
- "memoryUsed": {
- "description": "memory usage in MB of the VM on which the VNFC reporting the event is running",
- "type": "number"
- },
- "numberOfMediaPortsInUse": {
- "description": "number of media ports in use",
- "type": "number"
- },
- "requestRate": {
- "description": "peak rate of service requests per second to the VNF over the measurementInterval",
- "type": "number"
- },
- "vnfcScalingMetric": {
- "description": "represents busy-ness of the VNF from 0 to 100 as reported by the VNFC",
- "type": "number"
- },
- "vNicUsageArray": {
- "description": "usage of an array of virtual network interface cards",
- "type": "array",
- "items": {
- "$ref": "#/definitions/vNicUsage"
- }
- }
- },
- "required": [ "measurementInterval" ]
- },
- "mobileFlowFields": {
- "description": "mobileFlow fields",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional mobileFlow fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "applicationType": {
- "description": "Application type inferred",
- "type": "string"
- },
- "appProtocolType": {
- "description": "application protocol",
- "type": "string"
- },
- "appProtocolVersion": {
- "description": "application protocol version",
- "type": "string"
- },
- "cid": {
- "description": "cell id",
- "type": "string"
- },
- "connectionType": {
- "description": "Abbreviation referencing a 3GPP reference point e.g., S1-U, S11, etc",
- "type": "string"
- },
- "ecgi": {
- "description": "Evolved Cell Global Id",
- "type": "string"
- },
- "flowDirection": {
- "description": "Flow direction, indicating if the reporting node is the source of the flow or destination for the flow",
- "type": "string"
- },
- "gtpPerFlowMetrics": { "$ref": "#/definitions/gtpPerFlowMetrics" },
- "gtpProtocolType": {
- "description": "GTP protocol",
- "type": "string"
- },
- "gtpVersion": {
- "description": "GTP protocol version",
- "type": "string"
- },
- "httpHeader": {
- "description": "HTTP request header, if the flow connects to a node referenced by HTTP",
- "type": "string"
- },
- "imei": {
- "description": "IMEI for the subscriber UE used in this flow, if the flow connects to a mobile device",
- "type": "string"
- },
- "imsi": {
- "description": "IMSI for the subscriber UE used in this flow, if the flow connects to a mobile device",
- "type": "string"
- },
- "ipProtocolType": {
- "description": "IP protocol type e.g., TCP, UDP, RTP...",
- "type": "string"
- },
- "ipVersion": {
- "description": "IP protocol version e.g., IPv4, IPv6",
- "type": "string"
- },
- "lac": {
- "description": "location area code",
- "type": "string"
- },
- "mcc": {
- "description": "mobile country code",
- "type": "string"
- },
- "mnc": {
- "description": "mobile network code",
- "type": "string"
- },
- "mobileFlowFieldsVersion": {
- "description": "version of the mobileFlowFields block",
- "type": "number"
- },
- "msisdn": {
- "description": "MSISDN for the subscriber UE used in this flow, as an integer, if the flow connects to a mobile device",
- "type": "string"
- },
- "otherEndpointIpAddress": {
- "description": "IP address for the other endpoint, as used for the flow being reported on",
- "type": "string"
- },
- "otherEndpointPort": {
- "description": "IP Port for the reporting entity, as used for the flow being reported on",
- "type": "number"
- },
- "otherFunctionalRole": {
- "description": "Functional role of the other endpoint for the flow being reported on e.g., MME, S-GW, P-GW, PCRF...",
- "type": "string"
- },
- "rac": {
- "description": "routing area code",
- "type": "string"
- },
- "radioAccessTechnology": {
- "description": "Radio Access Technology e.g., 2G, 3G, LTE",
- "type": "string"
- },
- "reportingEndpointIpAddr": {
- "description": "IP address for the reporting entity, as used for the flow being reported on",
- "type": "string"
- },
- "reportingEndpointPort": {
- "description": "IP port for the reporting entity, as used for the flow being reported on",
- "type": "number"
- },
- "sac": {
- "description": "service area code",
- "type": "string"
- },
- "samplingAlgorithm": {
- "description": "Integer identifier for the sampling algorithm or rule being applied in calculating the flow metrics if metrics are calculated based on a sample of packets, or 0 if no sampling is applied",
- "type": "number"
- },
- "tac": {
- "description": "transport area code",
- "type": "string"
- },
- "tunnelId": {
- "description": "tunnel identifier",
- "type": "string"
- },
- "vlanId": {
- "description": "VLAN identifier used by this flow",
- "type": "string"
- }
- },
- "required": [ "flowDirection", "gtpPerFlowMetrics", "ipProtocolType",
- "ipVersion", "otherEndpointIpAddress", "otherEndpointPort",
- "reportingEndpointIpAddr", "reportingEndpointPort" ]
- },
- "otherFields": {
- "description": "additional fields not reported elsewhere",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "requestError": {
- "description": "standard request error data structure",
- "type": "object",
- "properties": {
- "messageId": {
- "description": "Unique message identifier of the format ABCnnnn where ABC is either SVC for Service Exceptions or POL for Policy Exception",
- "type": "string"
- },
- "text": {
- "description": "Message text, with replacement variables marked with %n, where n is an index into the list of <variables> elements, starting at 1",
- "type": "string"
- },
- "url": {
- "description": "Hyperlink to a detailed error resource e.g., an HTML page for browser user agents",
- "type": "string"
- },
- "variables": {
- "description": "List of zero or more strings that represent the contents of the variables used by the message text",
- "type": "string"
- }
- },
- "required": [ "messageId", "text" ]
- },
- "stateChangeFields": {
- "description": "stateChange fields",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional stateChange fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "newState": {
- "description": "new state of the entity",
- "type": "string",
- "enum": [
- "inService",
- "maintenance",
- "outOfService"
- ]
- },
- "oldState": {
- "description": "previous state of the entity",
- "type": "string",
- "enum": [
- "inService",
- "maintenance",
- "outOfService"
- ]
- },
- "stateChangeFieldsVersion": {
- "description": "version of the stateChangeFields block",
- "type": "number"
- },
- "stateInterface": {
- "description": "card or port name of the entity that changed state",
- "type": "string"
- }
- },
- "required": [ "newState", "oldState", "stateInterface" ]
- },
- "suppressedNvPairs": {
- "description": "List of specific NvPairsNames to suppress within a given Name-Value Field for event Throttling",
- "type": "object",
- "properties": {
- "nvPairFieldName": {
- "description": "Name of the field within which are the nvpair names to suppress",
- "type": "string"
- },
- "suppressedNvPairNames": {
- "description": "Array of nvpair names to suppress within the nvpairFieldName",
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "required": [ "nvPairFieldName", "suppressedNvPairNames" ]
- },
- "syslogFields": {
- "description": "sysLog fields",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional syslog fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "eventSourceHost": {
- "description": "hostname of the device",
- "type": "string"
- },
- "eventSourceType": {
- "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
- "type": "string"
- },
- "syslogFacility": {
- "description": "numeric code from 0 to 23 for facility--see table in documentation",
- "type": "number"
- },
- "syslogFieldsVersion": {
- "description": "version of the syslogFields block",
- "type": "number"
- },
- "syslogMsg": {
- "description": "syslog message",
- "type": "string"
- },
- "syslogPri": {
- "description": "0-192 combined severity and facility",
- "type": "number"
- },
- "syslogProc": {
- "description": "identifies the application that originated the message",
- "type": "string"
- },
- "syslogProcId": {
- "description": "a change in the value of this field indicates a discontinuity in syslog reporting",
- "type": "number"
- },
- "syslogSData": {
- "description": "syslog structured data consisting of a structured data Id followed by a set of key value pairs",
- "type": "string"
- },
- "syslogSdId": {
- "description": "0-32 char in format name@number for example ourSDID@32473",
- "type": "string"
- },
- "syslogSev": {
- "description": "numerical Code for severity derived from syslogPri as remaider of syslogPri / 8",
- "type": "string"
- },
- "syslogTag": {
- "description": "msgId indicating the type of message such as TCPOUT or TCPIN; NILVALUE should be used when no other value can be provided",
- "type": "string"
- },
- "syslogVer": {
- "description": "IANA assigned version of the syslog protocol specification - typically 1",
- "type": "number"
- }
- },
- "required": [ "eventSourceType", "syslogMsg", "syslogTag" ]
- },
- "thresholdCrossingAlertFields": {
- "description": "fields specific to threshold crossing alert events",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional threshold crossing alert fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "additionalParameters": {
- "description": "performance counters",
- "type": "array",
- "items": {
- "$ref": "#/definitions/counter"
- }
- },
- "alertAction": {
- "description": "Event action",
- "type": "string",
- "enum": [
- "CLEAR",
- "CONT",
- "SET"
- ]
- },
- "alertDescription": {
- "description": "Unique short alert description such as IF-SHUB-ERRDROP",
- "type": "string"
- },
- "alertType": {
- "description": "Event type",
- "type": "string",
- "enum": [
- "CARD-ANOMALY",
- "ELEMENT-ANOMALY",
- "INTERFACE-ANOMALY",
- "SERVICE-ANOMALY"
- ]
- },
- "alertValue": {
- "description": "Calculated API value (if applicable)",
- "type": "string"
- },
- "associatedAlertIdList": {
- "description": "List of eventIds associated with the event being reported",
- "type": "array",
- "items": { "type": "string" }
- },
- "collectionTimestamp": {
- "description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "dataCollector": {
- "description": "Specific performance collector instance used",
- "type": "string"
- },
- "elementType": {
- "description": "type of network element - internal ATT field",
- "type": "string"
- },
- "eventSeverity": {
- "description": "event severity or priority",
- "type": "string",
- "enum": [
- "CRITICAL",
- "MAJOR",
- "MINOR",
- "WARNING",
- "NORMAL"
- ]
- },
- "eventStartTimestamp": {
- "description": "Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "interfaceName": {
- "description": "Physical or logical port or card (if applicable)",
- "type": "string"
- },
- "networkService": {
- "description": "network name - internal ATT field",
- "type": "string"
- },
- "possibleRootCause": {
- "description": "Reserved for future use",
- "type": "string"
- },
- "thresholdCrossingFieldsVersion": {
- "description": "version of the thresholdCrossingAlertFields block",
- "type": "number"
- }
- },
- "required": [
- "additionalParameters",
- "alertAction",
- "alertDescription",
- "alertType",
- "collectionTimestamp",
- "eventSeverity",
- "eventStartTimestamp"
- ]
- },
- "vNicUsage": {
- "description": "usage of identified virtual network interface card",
- "type": "object",
- "properties": {
- "broadcastPacketsIn": { "type": "number" },
- "broadcastPacketsOut": { "type": "number" },
- "bytesIn": { "type": "number" },
- "bytesOut": { "type": "number" },
- "multicastPacketsIn": { "type": "number" },
- "multicastPacketsOut": { "type": "number" },
- "packetsIn": { "type": "number" },
- "packetsOut": { "type": "number" },
- "unicastPacketsIn": { "type": "number" },
- "unicastPacketsOut": { "type": "number" },
- "vNicIdentifier": { "type": "string" }
- },
- "required": [ "bytesIn", "bytesOut", "packetsIn", "packetsOut", "vNicIdentifier"]
- }
- },
- "title": "Event Listener",
- "type": "object",
- "properties": {
- "event": {"$ref": "#/definitions/event"}
- }
- }
-
-} \ No newline at end of file
diff --git a/data-formats/ves-dmaap-config.json b/data-formats/ves-dmaap-config.json
deleted file mode 100644
index 847b7c7e..00000000
--- a/data-formats/ves-dmaap-config.json
+++ /dev/null
@@ -1,130 +0,0 @@
-{
- "sec_measurement": {
- "type": "message_router",
- "aaf_username": "aafid",
- "aaf_password": "pwd",
- "dmaap_info": {
- "client_role": "com.att.dcae.member",
- "client_id": "111111",
- "location": "mtl5",
- "topic_url": "https://dmaap-mr-hostname:3905/events/com.att.dcae.dmaap.FTL2.SEC-MEASUREMENT-OUTPUT"
- }
- },
- "sec_fault": {
- "type": "message_router",
- "aaf_username": "aafid",
- "aaf_password": "pwd",
- "dmaap_info": {
- "client_role": "com.att.dcae.member",
- "client_id": "222222",
- "location": "mtl5",
- "topic_url": "https://dmaap-mr-hostname:3905/events/com.att.dcae.dmaap.FTL2.SEC-FAULT-OUTPUT"
- }
- },
-
- "sec_syslog": {
- "type": "message_router",
- "aaf_username": "aafid",
- "aaf_password": "pwd",
- "dmaap_info": {
- "client_role": "com.att.dcae.member",
- "client_id": "111111",
- "location": "mtl5",
- "topic_url": "https://dmaap-mr-hostname:3905/events/com.att.dcae.dmaap.FTL2.SEC-SYSLOG-OUTPUT"
- }
- },
- "sec_statechange": {
- "type": "message_router",
- "aaf_username": "aafid",
- "aaf_password": "pwd",
- "dmaap_info": {
- "client_role": "com.att.dcae.member",
- "client_id": "222222",
- "location": "mtl5",
- "topic_url": "https://dmaap-mr-hostname:3905/events/com.att.dcae.dmaap.FTL2.SEC-STATECHANGE-OUTPUT"
- }
- },
-
- "sec_thresholdCrossingAlert": {
- "type": "message_router",
- "aaf_username": "aafid",
- "aaf_password": "pwd",
- "dmaap_info": {
- "client_role": "com.att.dcae.member",
- "client_id": "111111",
- "location": "mtl5",
- "topic_url": "https://dmaap-mr-hostname:3905/events/com.att.dcae.dmaap.FTL2.SEC-TCA-OUTPUT"
- }
- },
- "sec_heartbeat": {
- "type": "message_router",
- "aaf_username": "aafid",
- "aaf_password": "pwd",
- "dmaap_info": {
- "client_role": "com.att.dcae.member",
- "client_id": "222222",
- "location": "mtl5",
- "topic_url": "https://dmaap-mr-hostname:3905/events/com.att.dcae.dmaap.FTL2.SEC-HEARTBEAT-OUTPUT"
- }
- },
-
- "sec_other": {
- "type": "message_router",
- "aaf_username": "aafid",
- "aaf_password": "pwd",
- "dmaap_info": {
- "client_role": "com.att.dcae.member",
- "client_id": "111111",
- "location": "mtl5",
- "topic_url": "https://dmaap-mr-hostname:3905/events/com.att.dcae.dmaap.FTL2.SEC-OTHER-OUTPUT"
- }
- },
- "sec_mobileflow": {
- "type": "message_router",
- "aaf_username": "aafid",
- "aaf_password": "pwd",
- "dmaap_info": {
- "client_role": "com.att.dcae.member",
- "client_id": "222222",
- "location": "mtl5",
- "topic_url": "https://dmaap-mr-hostname:3905/events/com.att.dcae.dmaap.FTL2.SEC-MOBILEFLOW-OUTPUT"
- }
- },
- "ves_sipsignaling": {
- "type": "message_router",
- "aaf_username": "aafid",
- "aaf_password": "pwd",
- "dmaap_info": {
- "client_role": "com.att.dcae.member",
- "client_id": "222222",
- "location": "mtl5",
- "topic_url": "https://dmaap-mr-hostname:3905/events/com.att.dcae.dmaap.FTL2.SEC-MOBILEFLOW-OUTPUT"
- }
- },
- "ves_voicequality": {
- "type": "message_router",
- "aaf_username": "aafid",
- "aaf_password": "pwd",
- "dmaap_info": {
- "client_role": "com.att.dcae.member",
- "client_id": "222222",
- "location": "mtl5",
- "topic_url": "https://dmaap-mr-hostname:3905/events/com.att.dcae.dmaap.FTL2.SEC-MOBILEFLOW-OUTPUT"
- }
- },
- "sec_fault_unsecure": {
- "type": "message_router",
- "dmaap_info": {
- "location": "mtl5",
- "topic_url": "http://uebsb91kcdc.it.att.com:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
- }
- },
- "sec_measurement_unsecure": {
- "type": "message_router",
- "dmaap_info": {
- "location": "mtl5",
- "topic_url": "http://uebsb91kcdc.it.att.com:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
- }
- }
-
-}
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 00000000..1d7484bb
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,8 @@
+version: '3'
+services:
+ ves:
+ container_name: ves
+ image: onap/org.onap.dcaegen2.collectors.ves.vescollector:latest
+ ports:
+ - "8080:8080"
+ - "8443:8443"
diff --git a/dpo/blueprint/blueprint_ves.yaml b/dpo/blueprint/blueprint_ves.yaml
index 4012ea7e..3bf50f70 100644
--- a/dpo/blueprint/blueprint_ves.yaml
+++ b/dpo/blueprint/blueprint_ves.yaml
@@ -1,3 +1,20 @@
+# ================================================================================
+# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed 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.
+# ============LICENSE_END=========================================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
tosca_definitions_version: cloudify_dsl_1_3
description: >
diff --git a/dpo/data-formats/VES-4.27.2-dataformat.json b/dpo/data-formats/VES-4.27.2-dataformat.json
new file mode 100755
index 00000000..7e57906c
--- /dev/null
+++ b/dpo/data-formats/VES-4.27.2-dataformat.json
@@ -0,0 +1,1383 @@
+{
+ "self": {
+ "name": "VES_specification",
+ "version": "4.27.2",
+ "description": "VES spec from v4.1 and 27.2 spec"
+ },
+ "dataformatversion": "1.0.0",
+ "jsonschema": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "definitions": {
+ "schemaLicenseAndCopyrightNotice": {
+ "description": "Copyright (c) 2017, AT&T Intellectual Property. All rights reserved",
+ "type": "object",
+ "properties": {
+ "apacheLicense2.0": {
+ "description": "Licensed 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:",
+ "type": "string"
+ },
+ "licenseUrl": {
+ "description": "http://www.apache.org/licenses/LICENSE-2.0",
+ "type": "string"
+ },
+ "asIsClause": {
+ "description": "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.",
+ "type": "string"
+ },
+ "permissionsAndLimitations": {
+ "description": "See the License for the specific language governing permissions and limitations under the License.",
+ "type": "string"
+ }
+ }
+ },
+ "codecsInUse": {
+ "description": "number of times an identified codec was used over the measurementInterval",
+ "type": "object",
+ "properties": {
+ "codecIdentifier": {
+ "type": "string"
+ },
+ "numberInUse": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "codecIdentifier",
+ "numberInUse"
+ ]
+ },
+ "command": {
+ "description": "command from an event collector toward an event source",
+ "type": "object",
+ "properties": {
+ "commandType": {
+ "type": "string",
+ "enum": [
+ "heartbeatIntervalChange",
+ "measurementIntervalChange",
+ "provideThrottlingState",
+ "throttlingSpecification"
+ ]
+ },
+ "eventDomainThrottleSpecification": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "measurementInterval": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "commandType"
+ ]
+ },
+ "commandList": {
+ "description": "array of commands from an event collector toward an event source",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/commandListEntry"
+ },
+ "minItems": 0
+ },
+ "commandListEntry": {
+ "description": "reference to a command object",
+ "type": "object",
+ "properties": {
+ "command": {
+ "$ref": "#/definitions/command"
+ }
+ },
+ "required": [
+ "command"
+ ]
+ },
+ "commonEventHeader": {
+ "description": "fields common to all events",
+ "type": "object",
+ "properties": {
+ "domain": {
+ "description": "the eventing domain associated with the event",
+ "type": "string",
+ "enum": [
+ "fault",
+ "heartbeat",
+ "measurementsForVfScaling",
+ "mobileFlow",
+ "other",
+ "stateChange",
+ "syslog",
+ "thresholdCrossingAlert"
+ ]
+ },
+ "eventId": {
+ "description": "event key that is unique to the event source",
+ "type": "string"
+ },
+ "eventType": {
+ "description": "unique event topic name",
+ "type": "string"
+ },
+ "functionalRole": {
+ "description": "function of the event source e.g., eNodeB, MME, PCRF",
+ "type": "string"
+ },
+ "internalHeaderFields": {
+ "$ref": "#/definitions/internalHeaderFields"
+ },
+ "lastEpochMicrosec": {
+ "description": "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "priority": {
+ "description": "processing priority",
+ "type": "string",
+ "enum": [
+ "High",
+ "Medium",
+ "Normal",
+ "Low"
+ ]
+ },
+ "reportingEntityId": {
+ "description": "UUID identifying the entity reporting the event, for example an OAM VM; must be populated by the ATT enrichment process",
+ "type": "string"
+ },
+ "reportingEntityName": {
+ "description": "name of the entity reporting the event, for example, an OAM VM",
+ "type": "string"
+ },
+ "sequence": {
+ "description": "ordering of events communicated by an event source instance or 0 if not needed",
+ "type": "integer"
+ },
+ "sourceId": {
+ "description": "UUID identifying the entity experiencing the event issue; must be populated by the ATT enrichment process",
+ "type": "string"
+ },
+ "sourceName": {
+ "description": "name of the entity experiencing the event issue",
+ "type": "string"
+ },
+ "startEpochMicrosec": {
+ "description": "the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "version": {
+ "description": "version of the event header",
+ "type": "number"
+ }
+ },
+ "required": [
+ "domain",
+ "eventId",
+ "functionalRole",
+ "lastEpochMicrosec",
+ "priority",
+ "reportingEntityName",
+ "sequence",
+ "sourceName",
+ "startEpochMicrosec"
+ ]
+ },
+ "counter": {
+ "description": "performance counter",
+ "type": "object",
+ "properties": {
+ "criticality": {
+ "type": "string",
+ "enum": [
+ "CRIT",
+ "MAJ"
+ ]
+ },
+ "name": {
+ "type": "string"
+ },
+ "thresholdCrossed": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "criticality",
+ "name",
+ "thresholdCrossed",
+ "value"
+ ]
+ },
+ "cpuUsage": {
+ "description": "percent usage of an identified CPU",
+ "type": "object",
+ "properties": {
+ "cpuIdentifier": {
+ "type": "string"
+ },
+ "percentUsage": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "cpuIdentifier",
+ "percentUsage"
+ ]
+ },
+ "errors": {
+ "description": "receive and transmit errors for the measurements domain",
+ "type": "object",
+ "properties": {
+ "receiveDiscards": {
+ "type": "number"
+ },
+ "receiveErrors": {
+ "type": "number"
+ },
+ "transmitDiscards": {
+ "type": "number"
+ },
+ "transmitErrors": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "receiveDiscards",
+ "receiveErrors",
+ "transmitDiscards",
+ "transmitErrors"
+ ]
+ },
+ "event": {
+ "description": "the root level of the common event format",
+ "type": "object",
+ "properties": {
+ "commonEventHeader": {
+ "$ref": "#/definitions/commonEventHeader"
+ },
+ "faultFields": {
+ "$ref": "#/definitions/faultFields"
+ },
+ "measurementsForVfScalingFields": {
+ "$ref": "#/definitions/measurementsForVfScalingFields"
+ },
+ "mobileFlowFields": {
+ "$ref": "#/definitions/mobileFlowFields"
+ },
+ "otherFields": {
+ "$ref": "#/definitions/otherFields"
+ },
+ "stateChangeFields": {
+ "$ref": "#/definitions/stateChangeFields"
+ },
+ "syslogFields": {
+ "$ref": "#/definitions/syslogFields"
+ },
+ "thresholdCrossingAlertFields": {
+ "$ref": "#/definitions/thresholdCrossingAlertFields"
+ }
+ },
+ "required": [
+ "commonEventHeader"
+ ]
+ },
+ "eventDomainThrottleSpecification": {
+ "description": "specification of what information to suppress within an event domain",
+ "type": "object",
+ "properties": {
+ "eventDomain": {
+ "description": "Event domain enum from the commonEventHeader domain field",
+ "type": "string"
+ },
+ "suppressedFieldNames": {
+ "description": "List of optional field names in the event block that should not be sent to the Event Listener",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "suppressedNvPairsList": {
+ "description": "Optional list of specific NvPairsNames to suppress within a given Name-Value Field",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/suppressedNvPairs"
+ }
+ }
+ },
+ "required": [
+ "eventDomain"
+ ]
+ },
+ "eventDomainThrottleSpecificationList": {
+ "description": "array of eventDomainThrottleSpecifications",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "minItems": 0
+ },
+ "eventList": {
+ "description": "array of events",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/event"
+ }
+ },
+ "eventThrottlingState": {
+ "description": "reports the throttling in force at the event source",
+ "type": "object",
+ "properties": {
+ "eventThrottlingMode": {
+ "description": "Mode the event manager is in",
+ "type": "string",
+ "enum": [
+ "normal",
+ "throttled"
+ ]
+ },
+ "eventDomainThrottleSpecificationList": {
+ "$ref": "#/definitions/eventDomainThrottleSpecificationList"
+ }
+ },
+ "required": [
+ "eventThrottlingMode"
+ ]
+ },
+ "faultFields": {
+ "description": "fields specific to fault events",
+ "type": "object",
+ "properties": {
+ "alarmAdditionalInformation": {
+ "description": "additional alarm information",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "alarmCondition": {
+ "description": "alarm condition reported by the device",
+ "type": "string"
+ },
+ "alarmInterfaceA": {
+ "description": "card, port, channel or interface name of the device generating the alarm",
+ "type": "string"
+ },
+ "eventSeverity": {
+ "description": "event severity or priority",
+ "type": "string",
+ "enum": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
+ },
+ "eventSourceType": {
+ "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
+ "type": "string"
+ },
+ "faultFieldsVersion": {
+ "description": "version of the faultFields block",
+ "type": "number"
+ },
+ "specificProblem": {
+ "description": "short description of the alarm or problem",
+ "type": "string"
+ },
+ "vfStatus": {
+ "description": "virtual function status enumeration",
+ "type": "string",
+ "enum": [
+ "Active",
+ "Idle",
+ "Preparing to terminate",
+ "Ready to terminate",
+ "Requesting termination"
+ ]
+ }
+ },
+ "required": [
+ "alarmCondition",
+ "eventSeverity",
+ "eventSourceType",
+ "specificProblem",
+ "vfStatus"
+ ]
+ },
+ "featuresInUse": {
+ "description": "number of times an identified feature was used over the measurementInterval",
+ "type": "object",
+ "properties": {
+ "featureIdentifier": {
+ "type": "string"
+ },
+ "featureUtilization": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "featureIdentifier",
+ "featureUtilization"
+ ]
+ },
+ "field": {
+ "description": "name value pair",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "value"
+ ]
+ },
+ "filesystemUsage": {
+ "description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second",
+ "type": "object",
+ "properties": {
+ "blockConfigured": {
+ "type": "number"
+ },
+ "blockIops": {
+ "type": "number"
+ },
+ "blockUsed": {
+ "type": "number"
+ },
+ "ephemeralConfigured": {
+ "type": "number"
+ },
+ "ephemeralIops": {
+ "type": "number"
+ },
+ "ephemeralUsed": {
+ "type": "number"
+ },
+ "filesystemName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "blockConfigured",
+ "blockIops",
+ "blockUsed",
+ "ephemeralConfigured",
+ "ephemeralIops",
+ "ephemeralUsed",
+ "filesystemName"
+ ]
+ },
+ "gtpPerFlowMetrics": {
+ "description": "Mobility GTP Protocol per flow metrics",
+ "type": "object",
+ "properties": {
+ "avgBitErrorRate": {
+ "description": "average bit error rate",
+ "type": "number"
+ },
+ "avgPacketDelayVariation": {
+ "description": "Average packet delay variation or jitter in milliseconds for received packets: Average difference between the packet timestamp and time received for all pairs of consecutive packets",
+ "type": "number"
+ },
+ "avgPacketLatency": {
+ "description": "average delivery latency",
+ "type": "number"
+ },
+ "avgReceiveThroughput": {
+ "description": "average receive throughput",
+ "type": "number"
+ },
+ "avgTransmitThroughput": {
+ "description": "average transmit throughput",
+ "type": "number"
+ },
+ "durConnectionFailedStatus": {
+ "description": "duration of failed state in milliseconds, computed as the cumulative time between a failed echo request and the next following successful error request, over this reporting interval",
+ "type": "number"
+ },
+ "durTunnelFailedStatus": {
+ "description": "Duration of errored state, computed as the cumulative time between a tunnel error indicator and the next following non-errored indicator, over this reporting interval",
+ "type": "number"
+ },
+ "flowActivatedBy": {
+ "description": "Endpoint activating the flow",
+ "type": "string"
+ },
+ "flowActivationEpoch": {
+ "description": "Time the connection is activated in the flow (connection) being reported on, or transmission time of the first packet if activation time is not available",
+ "type": "number"
+ },
+ "flowActivationMicrosec": {
+ "description": "Integer microseconds for the start of the flow connection",
+ "type": "number"
+ },
+ "flowActivationTime": {
+ "description": "time the connection is activated in the flow being reported on, or transmission time of the first packet if activation time is not available; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "flowDeactivatedBy": {
+ "description": "Endpoint deactivating the flow",
+ "type": "string"
+ },
+ "flowDeactivationEpoch": {
+ "description": "Time for the start of the flow connection, in integer UTC epoch time aka UNIX time",
+ "type": "number"
+ },
+ "flowDeactivationMicrosec": {
+ "description": "Integer microseconds for the start of the flow connection",
+ "type": "number"
+ },
+ "flowDeactivationTime": {
+ "description": "Transmission time of the first packet in the flow connection being reported on; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "flowStatus": {
+ "description": "connection status at reporting time as a working / inactive / failed indicator value",
+ "type": "string"
+ },
+ "gtpConnectionStatus": {
+ "description": "Current connection state at reporting time",
+ "type": "string"
+ },
+ "gtpTunnelStatus": {
+ "description": "Current tunnel state at reporting time",
+ "type": "string"
+ },
+ "ipTosCountList": {
+ "description": "array of key: value pairs where the keys are drawn from the IP Type-of-Service identifiers which range from '0' to '255', and the values are the count of packets that had those ToS identifiers in the flow",
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "ipTosList": {
+ "description": "Array of unique IP Type-of-Service values observed in the flow where values range from '0' to '255'",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "largePacketRtt": {
+ "description": "large packet round trip time",
+ "type": "number"
+ },
+ "largePacketThreshold": {
+ "description": "large packet threshold being applied",
+ "type": "number"
+ },
+ "maxPacketDelayVariation": {
+ "description": "Maximum packet delay variation or jitter in milliseconds for received packets: Maximum of the difference between the packet timestamp and time received for all pairs of consecutive packets",
+ "type": "number"
+ },
+ "maxReceiveBitRate": {
+ "description": "maximum receive bit rate",
+ "type": "number"
+ },
+ "maxTransmitBitRate": {
+ "description": "maximum transmit bit rate",
+ "type": "number"
+ },
+ "mobileQciCosCountList": {
+ "description": "array of key: value pairs where the keys are drawn from LTE QCI or UMTS class of service strings, and the values are the count of packets that had those strings in the flow",
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "mobileQciCosList": {
+ "description": "Array of unique LTE QCI or UMTS class-of-service values observed in the flow",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "numActivationFailures": {
+ "description": "Number of failed activation requests, as observed by the reporting node",
+ "type": "number"
+ },
+ "numBitErrors": {
+ "description": "number of errored bits",
+ "type": "number"
+ },
+ "numBytesReceived": {
+ "description": "number of bytes received, including retransmissions",
+ "type": "number"
+ },
+ "numBytesTransmitted": {
+ "description": "number of bytes transmitted, including retransmissions",
+ "type": "number"
+ },
+ "numDroppedPackets": {
+ "description": "number of received packets dropped due to errors per virtual interface",
+ "type": "number"
+ },
+ "numGtpEchoFailures": {
+ "description": "Number of Echo request path failures where failed paths are defined in 3GPP TS 29.281 sec 7.2.1 and 3GPP TS 29.060 sec. 11.2",
+ "type": "number"
+ },
+ "numGtpTunnelErrors": {
+ "description": "Number of tunnel error indications where errors are defined in 3GPP TS 29.281 sec 7.3.1 and 3GPP TS 29.060 sec. 11.1",
+ "type": "number"
+ },
+ "numHttpErrors": {
+ "description": "Http error count",
+ "type": "number"
+ },
+ "numL7BytesReceived": {
+ "description": "number of tunneled layer 7 bytes received, including retransmissions",
+ "type": "number"
+ },
+ "numL7BytesTransmitted": {
+ "description": "number of tunneled layer 7 bytes transmitted, excluding retransmissions",
+ "type": "number"
+ },
+ "numLostPackets": {
+ "description": "number of lost packets",
+ "type": "number"
+ },
+ "numOutOfOrderPackets": {
+ "description": "number of out-of-order packets",
+ "type": "number"
+ },
+ "numPacketErrors": {
+ "description": "number of errored packets",
+ "type": "number"
+ },
+ "numPacketsReceivedExclRetrans": {
+ "description": "number of packets received, excluding retransmission",
+ "type": "number"
+ },
+ "numPacketsReceivedInclRetrans": {
+ "description": "number of packets received, including retransmission",
+ "type": "number"
+ },
+ "numPacketsTransmittedInclRetrans": {
+ "description": "number of packets transmitted, including retransmissions",
+ "type": "number"
+ },
+ "numRetries": {
+ "description": "number of packet retries",
+ "type": "number"
+ },
+ "numTimeouts": {
+ "description": "number of packet timeouts",
+ "type": "number"
+ },
+ "numTunneledL7BytesReceived": {
+ "description": "number of tunneled layer 7 bytes received, excluding retransmissions",
+ "type": "number"
+ },
+ "roundTripTime": {
+ "description": "round trip time",
+ "type": "number"
+ },
+ "tcpFlagCountList": {
+ "description": "array of key: value pairs where the keys are drawn from TCP Flags and the values are the count of packets that had that TCP Flag in the flow",
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "tcpFlagList": {
+ "description": "Array of unique TCP Flags observed in the flow",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "timeToFirstByte": {
+ "description": "Time in milliseconds between the connection activation and first byte received",
+ "type": "number"
+ }
+ },
+ "required": [
+ "avgBitErrorRate",
+ "avgPacketDelayVariation",
+ "avgPacketLatency",
+ "avgReceiveThroughput",
+ "avgTransmitThroughput",
+ "flowActivationEpoch",
+ "flowActivationMicrosec",
+ "flowDeactivationEpoch",
+ "flowDeactivationMicrosec",
+ "flowDeactivationTime",
+ "flowStatus",
+ "maxPacketDelayVariation",
+ "numActivationFailures",
+ "numBitErrors",
+ "numBytesReceived",
+ "numBytesTransmitted",
+ "numDroppedPackets",
+ "numL7BytesReceived",
+ "numL7BytesTransmitted",
+ "numLostPackets",
+ "numOutOfOrderPackets",
+ "numPacketErrors",
+ "numPacketsReceivedExclRetrans",
+ "numPacketsReceivedInclRetrans",
+ "numPacketsTransmittedInclRetrans",
+ "numRetries",
+ "numTimeouts",
+ "numTunneledL7BytesReceived",
+ "roundTripTime",
+ "timeToFirstByte"
+ ]
+ },
+ "internalHeaderFields": {
+ "description": "enrichment fields for internal VES Event Listener service use only, not supplied by event sources",
+ "type": "object"
+ },
+ "latencyBucketMeasure": {
+ "description": "number of counts falling within a defined latency bucket",
+ "type": "object",
+ "properties": {
+ "countsInTheBucket": {
+ "type": "number"
+ },
+ "highEndOfLatencyBucket": {
+ "type": "number"
+ },
+ "lowEndOfLatencyBucket": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "countsInTheBucket"
+ ]
+ },
+ "measurementGroup": {
+ "description": "measurement group",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "measurements": {
+ "description": "array of name value pair measurements",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ }
+ },
+ "required": [
+ "name",
+ "measurements"
+ ]
+ },
+ "measurementsForVfScalingFields": {
+ "description": "measurementsForVfScaling fields",
+ "type": "object",
+ "properties": {
+ "additionalMeasurements": {
+ "description": "additional measurement fields",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/measurementGroup"
+ }
+ },
+ "aggregateCpuUsage": {
+ "description": "aggregate CPU usage of the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "codecUsageArray": {
+ "description": "array of codecs in use",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/codecsInUse"
+ }
+ },
+ "concurrentSessions": {
+ "description": "peak concurrent sessions for the VM or VNF over the measurementInterval",
+ "type": "number"
+ },
+ "configuredEntities": {
+ "description": "over the measurementInterval, peak total number of: users, subscribers, devices, adjacencies, etc., for the VM, or subscribers, devices, etc., for the VNF",
+ "type": "number"
+ },
+ "cpuUsageArray": {
+ "description": "usage of an array of CPUs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/cpuUsage"
+ }
+ },
+ "errors": {
+ "$ref": "#/definitions/errors"
+ },
+ "featureUsageArray": {
+ "description": "array of features in use",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/featuresInUse"
+ }
+ },
+ "filesystemUsageArray": {
+ "description": "filesystem usage of the VM on which the VNFC reporting the event is running",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/filesystemUsage"
+ }
+ },
+ "latencyDistribution": {
+ "description": "array of integers representing counts of requests whose latency in milliseconds falls within per-VNF configured ranges",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/latencyBucketMeasure"
+ }
+ },
+ "meanRequestLatency": {
+ "description": "mean seconds required to respond to each request for the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "measurementInterval": {
+ "description": "interval over which measurements are being reported in seconds",
+ "type": "number"
+ },
+ "measurementsForVfScalingVersion": {
+ "description": "version of the measurementsForVfScaling block",
+ "type": "number"
+ },
+ "memoryConfigured": {
+ "description": "memory in MB configured in the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "memoryUsed": {
+ "description": "memory usage in MB of the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "numberOfMediaPortsInUse": {
+ "description": "number of media ports in use",
+ "type": "number"
+ },
+ "requestRate": {
+ "description": "peak rate of service requests per second to the VNF over the measurementInterval",
+ "type": "number"
+ },
+ "vnfcScalingMetric": {
+ "description": "represents busy-ness of the VNF from 0 to 100 as reported by the VNFC",
+ "type": "number"
+ },
+ "vNicUsageArray": {
+ "description": "usage of an array of virtual network interface cards",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/vNicUsage"
+ }
+ }
+ },
+ "required": [
+ "measurementInterval"
+ ]
+ },
+ "mobileFlowFields": {
+ "description": "mobileFlow fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional mobileFlow fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "applicationType": {
+ "description": "Application type inferred",
+ "type": "string"
+ },
+ "appProtocolType": {
+ "description": "application protocol",
+ "type": "string"
+ },
+ "appProtocolVersion": {
+ "description": "application protocol version",
+ "type": "string"
+ },
+ "cid": {
+ "description": "cell id",
+ "type": "string"
+ },
+ "connectionType": {
+ "description": "Abbreviation referencing a 3GPP reference point e.g., S1-U, S11, etc",
+ "type": "string"
+ },
+ "ecgi": {
+ "description": "Evolved Cell Global Id",
+ "type": "string"
+ },
+ "flowDirection": {
+ "description": "Flow direction, indicating if the reporting node is the source of the flow or destination for the flow",
+ "type": "string"
+ },
+ "gtpPerFlowMetrics": {
+ "$ref": "#/definitions/gtpPerFlowMetrics"
+ },
+ "gtpProtocolType": {
+ "description": "GTP protocol",
+ "type": "string"
+ },
+ "gtpVersion": {
+ "description": "GTP protocol version",
+ "type": "string"
+ },
+ "httpHeader": {
+ "description": "HTTP request header, if the flow connects to a node referenced by HTTP",
+ "type": "string"
+ },
+ "imei": {
+ "description": "IMEI for the subscriber UE used in this flow, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "imsi": {
+ "description": "IMSI for the subscriber UE used in this flow, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "ipProtocolType": {
+ "description": "IP protocol type e.g., TCP, UDP, RTP...",
+ "type": "string"
+ },
+ "ipVersion": {
+ "description": "IP protocol version e.g., IPv4, IPv6",
+ "type": "string"
+ },
+ "lac": {
+ "description": "location area code",
+ "type": "string"
+ },
+ "mcc": {
+ "description": "mobile country code",
+ "type": "string"
+ },
+ "mnc": {
+ "description": "mobile network code",
+ "type": "string"
+ },
+ "mobileFlowFieldsVersion": {
+ "description": "version of the mobileFlowFields block",
+ "type": "number"
+ },
+ "msisdn": {
+ "description": "MSISDN for the subscriber UE used in this flow, as an integer, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "otherEndpointIpAddress": {
+ "description": "IP address for the other endpoint, as used for the flow being reported on",
+ "type": "string"
+ },
+ "otherEndpointPort": {
+ "description": "IP Port for the reporting entity, as used for the flow being reported on",
+ "type": "number"
+ },
+ "otherFunctionalRole": {
+ "description": "Functional role of the other endpoint for the flow being reported on e.g., MME, S-GW, P-GW, PCRF...",
+ "type": "string"
+ },
+ "rac": {
+ "description": "routing area code",
+ "type": "string"
+ },
+ "radioAccessTechnology": {
+ "description": "Radio Access Technology e.g., 2G, 3G, LTE",
+ "type": "string"
+ },
+ "reportingEndpointIpAddr": {
+ "description": "IP address for the reporting entity, as used for the flow being reported on",
+ "type": "string"
+ },
+ "reportingEndpointPort": {
+ "description": "IP port for the reporting entity, as used for the flow being reported on",
+ "type": "number"
+ },
+ "sac": {
+ "description": "service area code",
+ "type": "string"
+ },
+ "samplingAlgorithm": {
+ "description": "Integer identifier for the sampling algorithm or rule being applied in calculating the flow metrics if metrics are calculated based on a sample of packets, or 0 if no sampling is applied",
+ "type": "number"
+ },
+ "tac": {
+ "description": "transport area code",
+ "type": "string"
+ },
+ "tunnelId": {
+ "description": "tunnel identifier",
+ "type": "string"
+ },
+ "vlanId": {
+ "description": "VLAN identifier used by this flow",
+ "type": "string"
+ }
+ },
+ "required": [
+ "flowDirection",
+ "gtpPerFlowMetrics",
+ "ipProtocolType",
+ "ipVersion",
+ "otherEndpointIpAddress",
+ "otherEndpointPort",
+ "reportingEndpointIpAddr",
+ "reportingEndpointPort"
+ ]
+ },
+ "otherFields": {
+ "description": "additional fields not reported elsewhere",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "requestError": {
+ "description": "standard request error data structure",
+ "type": "object",
+ "properties": {
+ "messageId": {
+ "description": "Unique message identifier of the format ABCnnnn where ABC is either SVC for Service Exceptions or POL for Policy Exception",
+ "type": "string"
+ },
+ "text": {
+ "description": "Message text, with replacement variables marked with %n, where n is an index into the list of <variables> elements, starting at 1",
+ "type": "string"
+ },
+ "url": {
+ "description": "Hyperlink to a detailed error resource e.g., an HTML page for browser user agents",
+ "type": "string"
+ },
+ "variables": {
+ "description": "List of zero or more strings that represent the contents of the variables used by the message text",
+ "type": "string"
+ }
+ },
+ "required": [
+ "messageId",
+ "text"
+ ]
+ },
+ "stateChangeFields": {
+ "description": "stateChange fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional stateChange fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "newState": {
+ "description": "new state of the entity",
+ "type": "string",
+ "enum": [
+ "inService",
+ "maintenance",
+ "outOfService"
+ ]
+ },
+ "oldState": {
+ "description": "previous state of the entity",
+ "type": "string",
+ "enum": [
+ "inService",
+ "maintenance",
+ "outOfService"
+ ]
+ },
+ "stateChangeFieldsVersion": {
+ "description": "version of the stateChangeFields block",
+ "type": "number"
+ },
+ "stateInterface": {
+ "description": "card or port name of the entity that changed state",
+ "type": "string"
+ }
+ },
+ "required": [
+ "newState",
+ "oldState",
+ "stateInterface"
+ ]
+ },
+ "suppressedNvPairs": {
+ "description": "List of specific NvPairsNames to suppress within a given Name-Value Field for event Throttling",
+ "type": "object",
+ "properties": {
+ "nvPairFieldName": {
+ "description": "Name of the field within which are the nvpair names to suppress",
+ "type": "string"
+ },
+ "suppressedNvPairNames": {
+ "description": "Array of nvpair names to suppress within the nvpairFieldName",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "nvPairFieldName",
+ "suppressedNvPairNames"
+ ]
+ },
+ "syslogFields": {
+ "description": "sysLog fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional syslog fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "eventSourceHost": {
+ "description": "hostname of the device",
+ "type": "string"
+ },
+ "eventSourceType": {
+ "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
+ "type": "string"
+ },
+ "syslogFacility": {
+ "description": "numeric code from 0 to 23 for facility--see table in documentation",
+ "type": "number"
+ },
+ "syslogFieldsVersion": {
+ "description": "version of the syslogFields block",
+ "type": "number"
+ },
+ "syslogMsg": {
+ "description": "syslog message",
+ "type": "string"
+ },
+ "syslogPri": {
+ "description": "0-192 combined severity and facility",
+ "type": "number"
+ },
+ "syslogProc": {
+ "description": "identifies the application that originated the message",
+ "type": "string"
+ },
+ "syslogProcId": {
+ "description": "a change in the value of this field indicates a discontinuity in syslog reporting",
+ "type": "number"
+ },
+ "syslogSData": {
+ "description": "syslog structured data consisting of a structured data Id followed by a set of key value pairs",
+ "type": "string"
+ },
+ "syslogSdId": {
+ "description": "0-32 char in format name@number for example ourSDID@32473",
+ "type": "string"
+ },
+ "syslogSev": {
+ "description": "numerical Code for severity derived from syslogPri as remaider of syslogPri / 8",
+ "type": "string"
+ },
+ "syslogTag": {
+ "description": "msgId indicating the type of message such as TCPOUT or TCPIN; NILVALUE should be used when no other value can be provided",
+ "type": "string"
+ },
+ "syslogVer": {
+ "description": "IANA assigned version of the syslog protocol specification - typically 1",
+ "type": "number"
+ }
+ },
+ "required": [
+ "eventSourceType",
+ "syslogMsg",
+ "syslogTag"
+ ]
+ },
+ "thresholdCrossingAlertFields": {
+ "description": "fields specific to threshold crossing alert events",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional threshold crossing alert fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "additionalParameters": {
+ "description": "performance counters",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/counter"
+ }
+ },
+ "alertAction": {
+ "description": "Event action",
+ "type": "string",
+ "enum": [
+ "CLEAR",
+ "CONT",
+ "SET"
+ ]
+ },
+ "alertDescription": {
+ "description": "Unique short alert description such as IF-SHUB-ERRDROP",
+ "type": "string"
+ },
+ "alertType": {
+ "description": "Event type",
+ "type": "string",
+ "enum": [
+ "CARD-ANOMALY",
+ "ELEMENT-ANOMALY",
+ "INTERFACE-ANOMALY",
+ "SERVICE-ANOMALY"
+ ]
+ },
+ "alertValue": {
+ "description": "Calculated API value (if applicable)",
+ "type": "string"
+ },
+ "associatedAlertIdList": {
+ "description": "List of eventIds associated with the event being reported",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "collectionTimestamp": {
+ "description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "dataCollector": {
+ "description": "Specific performance collector instance used",
+ "type": "string"
+ },
+ "elementType": {
+ "description": "type of network element - internal ATT field",
+ "type": "string"
+ },
+ "eventSeverity": {
+ "description": "event severity or priority",
+ "type": "string",
+ "enum": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
+ },
+ "eventStartTimestamp": {
+ "description": "Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "interfaceName": {
+ "description": "Physical or logical port or card (if applicable)",
+ "type": "string"
+ },
+ "networkService": {
+ "description": "network name - internal ATT field",
+ "type": "string"
+ },
+ "possibleRootCause": {
+ "description": "Reserved for future use",
+ "type": "string"
+ },
+ "thresholdCrossingFieldsVersion": {
+ "description": "version of the thresholdCrossingAlertFields block",
+ "type": "number"
+ }
+ },
+ "required": [
+ "additionalParameters",
+ "alertAction",
+ "alertDescription",
+ "alertType",
+ "collectionTimestamp",
+ "eventSeverity",
+ "eventStartTimestamp"
+ ]
+ },
+ "vNicUsage": {
+ "description": "usage of identified virtual network interface card",
+ "type": "object",
+ "properties": {
+ "broadcastPacketsIn": {
+ "type": "number"
+ },
+ "broadcastPacketsOut": {
+ "type": "number"
+ },
+ "bytesIn": {
+ "type": "number"
+ },
+ "bytesOut": {
+ "type": "number"
+ },
+ "multicastPacketsIn": {
+ "type": "number"
+ },
+ "multicastPacketsOut": {
+ "type": "number"
+ },
+ "packetsIn": {
+ "type": "number"
+ },
+ "packetsOut": {
+ "type": "number"
+ },
+ "unicastPacketsIn": {
+ "type": "number"
+ },
+ "unicastPacketsOut": {
+ "type": "number"
+ },
+ "vNicIdentifier": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "bytesIn",
+ "bytesOut",
+ "packetsIn",
+ "packetsOut",
+ "vNicIdentifier"
+ ]
+ }
+ },
+ "title": "Event Listener",
+ "type": "object",
+ "properties": {
+ "event": {
+ "$ref": "#/definitions/event"
+ }
+ },
+ "eventList": {
+ "$ref": "#/definitions/eventList"
+ }
+ }
+} \ No newline at end of file
diff --git a/data-formats/VES-5.28.3-dataformat.json b/dpo/data-formats/VES-5.28.3-dataformat.json
index b62b8b0a..ea2290ff 100644
--- a/data-formats/VES-5.28.3-dataformat.json
+++ b/dpo/data-formats/VES-5.28.3-dataformat.json
@@ -8,37 +8,28 @@
"jsonschema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
- "attCopyrightNotice": {
- "description": "Copyright (c) <2017>, AT&T Intellectual Property. All rights reserved. Licensed under the Apache License, Version 2.0 (the License)",
+ "schemaLicenseAndCopyrightNotice": {
+ "description": "Copyright (c) 2017, AT&T Intellectual Property. All rights reserved",
"type": "object",
"properties": {
- "useAndRedistribution": {
- "description": "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",
+ "apacheLicense2.0": {
+ "description": "Licensed 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:",
"type": "string"
},
- "licenseLink": "http://www.apache.org/licenses/LICENSE-2.0",
- "condition1": {
- "description": "Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an AS IS BASIS,",
+ "licenseUrl": {
+ "description": "http://www.apache.org/licenses/LICENSE-2.0",
"type": "string"
},
- "condition2": {
- "description": "Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.",
+ "asIsClause": {
+ "description": "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.",
"type": "string"
},
- "condition3": {
- "description": "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
- "type": "string"
- },
- "condition4": {
+ "permissionsAndLimitations": {
"description": "See the License for the specific language governing permissions and limitations under the License.",
"type": "string"
- },
- "Trademarks": {
- "description": "ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property.",
- "type": "string"
}
- }
- },
+ }
+ },
"codecsInUse": {
"description": "number of times an identified codec was used over the measurementInterval",
"type": "object",
diff --git a/data-formats/VES-5.28.4-dataformat.json b/dpo/data-formats/VES-5.28.4-dataformat.json
index 386b5e67..cce6dea9 100644..100755
--- a/data-formats/VES-5.28.4-dataformat.json
+++ b/dpo/data-formats/VES-5.28.4-dataformat.json
@@ -2,7 +2,7 @@
"self": {
"name": "VES_specification",
"version": "5.28.4",
- "description": "VES spec for 5.4"
+ "description": "VES spec for 5.4.1"
},
"dataformatversion": "1.0.0",
"jsonschema": {
@@ -17,7 +17,6 @@
"$ref": "#/definitions/eventList"
}
},
-
"definitions": {
"schemaHeaderBlock": {
"description": "schema date, version, author and associated API",
@@ -41,41 +40,28 @@
}
}
},
- "attCopyrightNotice": {
- "description": "Copyright (c) <2017>, AT&T Intellectual Property. All rights reserved. Licensed under the Apache License, Version 2.0 (the License)",
- "type": "object",
- "properties": {
- "useAndRedistribution": {
- "description": "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",
- "type": "string"
- },
- "licenseLink": {
- "description": "http://www.apache.org/licenses/LICENSE-2.0",
- "type":"string"
- },
- "condition1": {
- "description": "Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an AS IS BASIS,",
- "type": "string"
- },
- "condition2": {
- "description": "Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.",
- "type": "string"
- },
- "condition3": {
- "description": "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
- "type": "string"
- },
- "condition4": {
- "description": "See the License for the specific language governing permissions and limitations under the License.",
- "type": "string"
- },
- "Trademarks": {
- "description": "ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property.",
- "type": "string"
- }
+ "schemaLicenseAndCopyrightNotice": {
+ "description": "Copyright (c) 2017, AT&T Intellectual Property. All rights reserved",
+ "type": "object",
+ "properties": {
+ "apacheLicense2.0": {
+ "description": "Licensed 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:",
+ "type": "string"
+ },
+ "licenseUrl": {
+ "description": "http://www.apache.org/licenses/LICENSE-2.0",
+ "type": "string"
+ },
+ "asIsClause": {
+ "description": "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.",
+ "type": "string"
+ },
+ "permissionsAndLimitations": {
+ "description": "See the License for the specific language governing permissions and limitations under the License.",
+ "type": "string"
}
- },
-
+ }
+ },
"codecsInUse": {
"description": "number of times an identified codec was used over the measurementInterval",
"type": "object",
@@ -87,7 +73,10 @@
"type": "integer"
}
},
- "required": ["codecIdentifier", "numberInUse"]
+ "required": [
+ "codecIdentifier",
+ "numberInUse"
+ ]
},
"command": {
"description": "command from an event collector toward an event source",
@@ -112,7 +101,9 @@
"type": "integer"
}
},
- "required": ["commandType"]
+ "required": [
+ "commandType"
+ ]
},
"commandList": {
"description": "array of commands from an event collector toward an event source",
@@ -208,9 +199,17 @@
"type": "number"
}
},
- "required": ["domain", "eventId", "eventName", "lastEpochMicrosec",
- "priority", "reportingEntityName", "sequence", "sourceName",
- "startEpochMicrosec", "version"
+ "required": [
+ "domain",
+ "eventId",
+ "eventName",
+ "lastEpochMicrosec",
+ "priority",
+ "reportingEntityName",
+ "sequence",
+ "sourceName",
+ "startEpochMicrosec",
+ "version"
]
},
"counter": {
@@ -219,7 +218,10 @@
"properties": {
"criticality": {
"type": "string",
- "enum": ["CRIT", "MAJ"]
+ "enum": [
+ "CRIT",
+ "MAJ"
+ ]
},
"name": {
"type": "string"
@@ -231,7 +233,12 @@
"type": "string"
}
},
- "required": ["criticality", "name", "thresholdCrossed", "value"]
+ "required": [
+ "criticality",
+ "name",
+ "thresholdCrossed",
+ "value"
+ ]
},
"cpuUsage": {
"description": "usage of an identified CPU",
@@ -278,7 +285,10 @@
"type": "number"
}
},
- "required": ["cpuIdentifier", "percentUsage"]
+ "required": [
+ "cpuIdentifier",
+ "percentUsage"
+ ]
},
"diskUsage": {
"description": "usage of an identified disk",
@@ -449,7 +459,9 @@
"type": "number"
}
},
- "required": ["diskIdentifier"]
+ "required": [
+ "diskIdentifier"
+ ]
},
"endOfCallVqmSummaries": {
"description": "provides end of call voice quality metrics",
@@ -462,7 +474,10 @@
"endpointDescription": {
"description": "Either Caller or Callee",
"type": "string",
- "enum": ["Caller", "Callee"]
+ "enum": [
+ "Caller",
+ "Callee"
+ ]
},
"endpointJitter": {
"description": "",
@@ -541,7 +556,10 @@
"type": "number"
}
},
- "required": ["adjacencyName", "endpointDescription"]
+ "required": [
+ "adjacencyName",
+ "endpointDescription"
+ ]
},
"event": {
"description": "the root level of the common event format",
@@ -581,7 +599,9 @@
"$ref": "#/definitions/voiceQualityFields"
}
},
- "required": ["commonEventHeader"]
+ "required": [
+ "commonEventHeader"
+ ]
},
"eventDomainThrottleSpecification": {
"description": "specification of what information to suppress within an event domain",
@@ -606,7 +626,9 @@
}
}
},
- "required": ["eventDomain"]
+ "required": [
+ "eventDomain"
+ ]
},
"eventDomainThrottleSpecificationList": {
"description": "array of eventDomainThrottleSpecifications",
@@ -639,7 +661,9 @@
"$ref": "#/definitions/eventDomainThrottleSpecificationList"
}
},
- "required": ["eventThrottlingMode"]
+ "required": [
+ "eventThrottlingMode"
+ ]
},
"faultFields": {
"description": "fields specific to fault events",
@@ -699,8 +723,13 @@
]
}
},
- "required": ["alarmCondition", "eventSeverity", "eventSourceType",
- "faultFieldsVersion", "specificProblem", "vfStatus"
+ "required": [
+ "alarmCondition",
+ "eventSeverity",
+ "eventSourceType",
+ "faultFieldsVersion",
+ "specificProblem",
+ "vfStatus"
]
},
"featuresInUse": {
@@ -714,7 +743,10 @@
"type": "integer"
}
},
- "required": ["featureIdentifier", "featureUtilization"]
+ "required": [
+ "featureIdentifier",
+ "featureUtilization"
+ ]
},
"field": {
"description": "name value pair",
@@ -727,7 +759,10 @@
"type": "string"
}
},
- "required": ["name", "value"]
+ "required": [
+ "name",
+ "value"
+ ]
},
"filesystemUsage": {
"description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second",
@@ -755,8 +790,14 @@
"type": "string"
}
},
- "required": ["blockConfigured", "blockIops", "blockUsed", "ephemeralConfigured",
- "ephemeralIops", "ephemeralUsed", "filesystemName"
+ "required": [
+ "blockConfigured",
+ "blockIops",
+ "blockUsed",
+ "ephemeralConfigured",
+ "ephemeralIops",
+ "ephemeralUsed",
+ "filesystemName"
]
},
"gtpPerFlowMetrics": {
@@ -840,7 +881,8 @@
"type": "array",
"items": {
"type": "array",
- "items": [{
+ "items": [
+ {
"type": "string"
},
{
@@ -881,7 +923,8 @@
"type": "array",
"items": {
"type": "array",
- "items": [{
+ "items": [
+ {
"type": "string"
},
{
@@ -982,7 +1025,8 @@
"type": "array",
"items": {
"type": "array",
- "items": [{
+ "items": [
+ {
"type": "string"
},
{
@@ -1003,21 +1047,37 @@
"type": "number"
}
},
- "required": ["avgBitErrorRate", "avgPacketDelayVariation", "avgPacketLatency",
- "avgReceiveThroughput", "avgTransmitThroughput",
- "flowActivationEpoch", "flowActivationMicrosec",
- "flowDeactivationEpoch", "flowDeactivationMicrosec",
- "flowDeactivationTime", "flowStatus",
- "maxPacketDelayVariation", "numActivationFailures",
- "numBitErrors", "numBytesReceived", "numBytesTransmitted",
- "numDroppedPackets", "numL7BytesReceived",
- "numL7BytesTransmitted", "numLostPackets",
- "numOutOfOrderPackets", "numPacketErrors",
+ "required": [
+ "avgBitErrorRate",
+ "avgPacketDelayVariation",
+ "avgPacketLatency",
+ "avgReceiveThroughput",
+ "avgTransmitThroughput",
+ "flowActivationEpoch",
+ "flowActivationMicrosec",
+ "flowDeactivationEpoch",
+ "flowDeactivationMicrosec",
+ "flowDeactivationTime",
+ "flowStatus",
+ "maxPacketDelayVariation",
+ "numActivationFailures",
+ "numBitErrors",
+ "numBytesReceived",
+ "numBytesTransmitted",
+ "numDroppedPackets",
+ "numL7BytesReceived",
+ "numL7BytesTransmitted",
+ "numLostPackets",
+ "numOutOfOrderPackets",
+ "numPacketErrors",
"numPacketsReceivedExclRetrans",
"numPacketsReceivedInclRetrans",
"numPacketsTransmittedInclRetrans",
- "numRetries", "numTimeouts", "numTunneledL7BytesReceived",
- "roundTripTime", "timeToFirstByte"
+ "numRetries",
+ "numTimeouts",
+ "numTunneledL7BytesReceived",
+ "roundTripTime",
+ "timeToFirstByte"
]
},
"heartbeatFields": {
@@ -1040,7 +1100,10 @@
"type": "integer"
}
},
- "required": ["heartbeatFieldsVersion", "heartbeatInterval"]
+ "required": [
+ "heartbeatFieldsVersion",
+ "heartbeatInterval"
+ ]
},
"internalHeaderFields": {
"description": "enrichment fields for internal VES Event Listener service use only, not supplied by event sources",
@@ -1078,7 +1141,10 @@
"type": "string"
}
},
- "required": ["objectInstances", "objectName"]
+ "required": [
+ "objectInstances",
+ "objectName"
+ ]
},
"jsonObjectInstance": {
"description": "meta-information about an instance of a jsonObject along with the actual object instance",
@@ -1100,7 +1166,9 @@
}
}
},
- "required": ["objectInstance"]
+ "required": [
+ "objectInstance"
+ ]
},
"key": {
"description": "tuple which provides the name of a key along with its value and relative order",
@@ -1119,7 +1187,9 @@
"type": "string"
}
},
- "required": ["keyName"]
+ "required": [
+ "keyName"
+ ]
},
"latencyBucketMeasure": {
"description": "number of counts falling within a defined latency bucket",
@@ -1135,7 +1205,9 @@
"type": "number"
}
},
- "required": ["countsInTheBucket"]
+ "required": [
+ "countsInTheBucket"
+ ]
},
"measurementsForVfScalingFields": {
"description": "measurementsForVfScaling fields",
@@ -1251,7 +1323,10 @@
}
}
},
- "required": ["measurementInterval", "measurementsForVfScalingVersion"]
+ "required": [
+ "measurementInterval",
+ "measurementsForVfScalingVersion"
+ ]
},
"memoryUsage": {
"description": "memory usage of an identified virtual machine",
@@ -1290,7 +1365,11 @@
"type": "string"
}
},
- "required": ["memoryFree", "memoryUsed", "vmIdentifier"]
+ "required": [
+ "memoryFree",
+ "memoryUsed",
+ "vmIdentifier"
+ ]
},
"mobileFlowFields": {
"description": "mobileFlow fields",
@@ -1431,9 +1510,16 @@
"type": "string"
}
},
- "required": ["flowDirection", "gtpPerFlowMetrics", "ipProtocolType", "ipVersion",
- "mobileFlowFieldsVersion", "otherEndpointIpAddress", "otherEndpointPort",
- "reportingEndpointIpAddr", "reportingEndpointPort"
+ "required": [
+ "flowDirection",
+ "gtpPerFlowMetrics",
+ "ipProtocolType",
+ "ipVersion",
+ "mobileFlowFieldsVersion",
+ "otherEndpointIpAddress",
+ "otherEndpointPort",
+ "reportingEndpointIpAddr",
+ "reportingEndpointPort"
]
},
"namedArrayOfFields": {
@@ -1451,7 +1537,10 @@
}
}
},
- "required": ["name", "arrayOfFields"]
+ "required": [
+ "name",
+ "arrayOfFields"
+ ]
},
"otherFields": {
"description": "fields for events belonging to the 'other' domain of the commonEventHeader domain enumeration",
@@ -1483,7 +1572,9 @@
"type": "number"
}
},
- "required": ["otherFieldsVersion"]
+ "required": [
+ "otherFieldsVersion"
+ ]
},
"requestError": {
"description": "standard request error data structure",
@@ -1506,7 +1597,10 @@
"type": "string"
}
},
- "required": ["messageId", "text"]
+ "required": [
+ "messageId",
+ "text"
+ ]
},
"sipSignalingFields": {
"description": "sip signaling fields",
@@ -1555,8 +1649,14 @@
"$ref": "#/definitions/vendorVnfNameFields"
}
},
- "required": ["correlator", "localIpAddress", "localPort", "remoteIpAddress",
- "remotePort", "sipSignalingFieldsVersion", "vendorVnfNameFields"
+ "required": [
+ "correlator",
+ "localIpAddress",
+ "localPort",
+ "remoteIpAddress",
+ "remotePort",
+ "sipSignalingFieldsVersion",
+ "vendorVnfNameFields"
]
},
"stateChangeFields": {
@@ -1597,7 +1697,12 @@
"type": "string"
}
},
- "required": ["newState", "oldState", "stateChangeFieldsVersion", "stateInterface"]
+ "required": [
+ "newState",
+ "oldState",
+ "stateChangeFieldsVersion",
+ "stateInterface"
+ ]
},
"suppressedNvPairs": {
"description": "List of specific NvPairsNames to suppress within a given Name-Value Field for event Throttling",
@@ -1615,7 +1720,10 @@
}
}
},
- "required": ["nvPairFieldName", "suppressedNvPairNames"]
+ "required": [
+ "nvPairFieldName",
+ "suppressedNvPairNames"
+ ]
},
"syslogFields": {
"description": "sysLog fields",
@@ -1688,7 +1796,12 @@
"type": "number"
}
},
- "required": ["eventSourceType", "syslogFieldsVersion", "syslogMsg", "syslogTag"]
+ "required": [
+ "eventSourceType",
+ "syslogFieldsVersion",
+ "syslogMsg",
+ "syslogTag"
+ ]
},
"thresholdCrossingAlertFields": {
"description": "fields specific to threshold crossing alert events",
@@ -1814,7 +1927,9 @@
"type": "string"
}
},
- "required": ["vendorName"]
+ "required": [
+ "vendorName"
+ ]
},
"vNicPerformance": {
"description": "describes the performance and errors of an identified virtual network interface card",
@@ -1935,14 +2050,20 @@
"valuesAreSuspect": {
"description": "Indicates whether vNicPerformance values are likely inaccurate due to counter overflow or other condtions",
"type": "string",
- "enum": ["true", "false"]
+ "enum": [
+ "true",
+ "false"
+ ]
},
"vNicIdentifier": {
"description": "vNic identification",
"type": "string"
}
},
- "required": ["valuesAreSuspect", "vNicIdentifier"]
+ "required": [
+ "valuesAreSuspect",
+ "vNicIdentifier"
+ ]
},
"voiceQualityFields": {
"description": "provides statistics related to customer facing voice products",
@@ -1986,8 +2107,13 @@
"type": "number"
}
},
- "required": ["calleeSideCodec", "callerSideCodec", "correlator", "midCallRtcp",
- "vendorVnfNameFields", "voiceQualityFieldsVersion"
+ "required": [
+ "calleeSideCodec",
+ "callerSideCodec",
+ "correlator",
+ "midCallRtcp",
+ "vendorVnfNameFields",
+ "voiceQualityFieldsVersion"
]
}
}
diff --git a/data-formats/healthcheck-docker-config.json b/dpo/data-formats/healthcheck-docker-config.json
index 74deb6bb..74deb6bb 100644
--- a/data-formats/healthcheck-docker-config.json
+++ b/dpo/data-formats/healthcheck-docker-config.json
diff --git a/dpo/data-formats/ves-dmaap-config.json b/dpo/data-formats/ves-dmaap-config.json
new file mode 100644
index 00000000..c28c0ce0
--- /dev/null
+++ b/dpo/data-formats/ves-dmaap-config.json
@@ -0,0 +1,149 @@
+{
+ "ves_syslog": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_statechange": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+
+ "ves_thresholdCrossingAlert": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_heartbeat": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+
+ "ves_other": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_mobileflow": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_sipsignaling": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_voicequality": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_fault": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_measurement": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+
+
+ "ves_syslog_secondary": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_statechange_secondary": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+
+ "ves_thresholdCrossingAlert_secondary": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_heartbeat_secondary": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+
+ "ves_other_secondary": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_mobileflow_secondary": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_sipsignaling_secondary": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_voicequality_secondary": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_fault_secondary": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves_measurement_secondary": {
+ "type": "message_router",
+ "dmaap_info": {
+ "location": "mtl5",
+ "topic_url": "http://dmaap-mr-hostname:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ }
+
+}
diff --git a/data-formats/ves-response.json b/dpo/data-formats/ves-response.json
index 5292b177..5292b177 100644
--- a/data-formats/ves-response.json
+++ b/dpo/data-formats/ves-response.json
diff --git a/dpo/spec/vescollector-componentspec.json b/dpo/spec/vescollector-componentspec.json
index 5b58347f..32144e2f 100644
--- a/dpo/spec/vescollector-componentspec.json
+++ b/dpo/spec/vescollector-componentspec.json
@@ -1,223 +1,241 @@
{
- "self": {
- "version": "1.1.0",
- "name": "dcaegen2-collectors-ves",
- "description": "Collector for receiving VES events through restful interface",
- "component_type": "docker"
- },
- "streams": {
- "subscribes": [
-
- ],
- "publishes": [
- {
- "format": "VES_specification",
- "version": "5.28.4",
- "type": "message router",
- "config_key": "ves_fault"
- },
- {
- "format": "VES_specification",
- "version": "5.28.4",
- "type": "message router",
- "config_key": "ves_measurement"
- },
- {
- "format": "VES_specification",
- "version": "5.28.4",
- "type": "message router",
- "config_key": "ves_syslog"
- },
- {
- "format": "VES_specification",
- "version": "5.28.4",
- "type": "message router",
- "config_key": "ves_heartbeat"
- },
- {
- "format": "VES_specification",
- "version": "5.28.4",
- "type": "message router",
- "config_key": "ves_other"
- },
- {
- "format": "VES_specification",
- "version": "5.28.4",
- "type": "message router",
- "config_key": "ves_mobileflow"
- },
- {
- "format": "VES_specification",
- "version": "5.28.4",
- "type": "message router",
- "config_key": "ves_statechange"
- },
- {
- "format": "VES_specification",
- "version": "5.28.4",
- "type": "message router",
- "config_key": "ves_thresholdCrossingAlert"
- },
- {
- "format": "VES_specification",
- "version": "5.28.4",
- "type": "message router",
- "config_key": "ves_voicequality"
- },
- {
- "format": "VES_specification",
- "version": "5.28.4",
- "type": "message router",
- "config_key": "ves_sipsignaling"
- }
- ]
- },
- "services": {
- "calls": [],
- "provides": [
- {
- "route": "/eventListener/v1",
- "verb": "POST",
- "request": {
- "format": "VES_specification",
- "version": "4.27.2"
- },
- "response": {
- "format": "ves.coll.response",
- "version": "1.0.0"
- }
- },
- {
- "route": "/eventListener/v2",
- "verb": "POST",
- "request": {
- "format": "VES_specification",
- "version": "4.27.2"
- },
- "response": {
- "format": "ves.coll.response",
- "version": "1.0.0"
- }
- },
- {
- "route": "/eventListener/v3",
- "verb": "POST",
- "request": {
- "format": "VES_specification",
- "version": "4.27.2"
- },
- "response": {
- "format": "ves.coll.response",
- "version": "1.0.0"
- }
- },
- {
- "route": "/eventListener/v4",
- "verb": "POST",
- "request": {
- "format": "VES_specification",
- "version": "4.27.2"
- },
- "response": {
- "format": "ves.coll.response",
- "version": "1.0.0"
- }
- },
- {
- "route": "/eventListener/v5",
- "verb": "POST",
- "request": {
- "format": "VES_specification",
- "version": "5.28.4"
- },
- "response": {
- "format": "ves.coll.response",
- "version": "1.0.0"
- }
- }
-
- ]
- },
- "parameters": [
- {
- "name": "collector.service.port",
- "value": 8080,
- "description": "standard http port"
- },
- {
- "name": "collector.service.secure.port",
- "value": 8443,
- "description": "secure port "
- },
- {
- "name": "collector.keystore.file.location",
- "value": "/opt/app/dcae-certificate/keystore.jks",
- "description": "fs location of keystore in vm"
- },
- {
- "name": "collector.keystore.passwordfile",
- "value": "/opt/app/dcae-certificate/.password",
- "description": "location of keystore password file in vm"
- },
- {
- "name": "collector.keystore.alias",
- "value": "dynamically generated",
- "description": "alias to access the keystore"
- },
- {
- "name": "collector.inputQueue.maxPending",
- "value": 8096,
- "description": "Maximum queue limit before publish"
- },
- {
- "name": "collector.dmaap.streamid",
- "value": "fault=ves_fault|syslog=ves_syslog|heartbeat=ves_heartbeat|measurementsForVfScaling=ves_measurement|mobileFlow=ves_mobileflow|other=ves_other|stateChange=ves_statechange|thresholdCrossingAlert=ves_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling",
- "description": "domain-streamid mapping"
- },
- {
- "name": "header.authflag",
- "value": 0,
- "description": "Basic Authentication flag"
- },
- {
- "name": "header.authlist",
- "value": "userid1,base64encodepwd1|userid2,base64encodepwd2",
- "description": "List of id and base64 encoded pwd"
- },
- {
- "name": "collector.schema.checkflag",
- "value": 1,
- "description": "Schema check validation flag"
- },
- {
- "name": "collector.schema.file",
- "value": "{\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.json\"}",
- "description": "validation schema file name per version"
- },
- {
- "name": "event.transform.flag",
- "value": 0,
- "description": "flag to enable tranformation rules defined under eventTransform.json"
- },
- {
- "name": "tomcat.maxthreads",
- "value": "200",
- "description": "Tomcat control for concurrent request"
- }
- ],
- "auxilary": {
- "healthcheck": {
- "type": "http",
- "interval": "15s",
- "timeout": "1s",
- "endpoint": "/healthcheck"
- }
- },
- "artifacts": [
- {
- "type": "docker image",
- "uri": "nexus.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.1"
- }
- ]
+ "self": {
+ "version": "1.2.0",
+ "name": "dcae-ves-collector",
+ "description": "Collector for receiving VES events through restful interface",
+ "component_type": "docker"
+ },
+ "streams": {
+ "subscribes": [],
+ "publishes": [
+ {
+ "format": "VES_specification",
+ "version": "5.28.4",
+ "type": "message router",
+ "config_key": "ves-fault"
+ },
+ {
+ "format": "VES_specification",
+ "version": "5.28.4",
+ "type": "message router",
+ "config_key": "ves-measurement"
+ },
+ {
+ "format": "VES_specification",
+ "version": "5.28.4",
+ "type": "message router",
+ "config_key": "ves-syslog"
+ },
+ {
+ "format": "VES_specification",
+ "version": "5.28.4",
+ "type": "message router",
+ "config_key": "ves-heartbeat"
+ },
+ {
+ "format": "VES_specification",
+ "version": "5.28.4",
+ "type": "message router",
+ "config_key": "ves-other"
+ },
+ {
+ "format": "VES_specification",
+ "version": "5.28.4",
+ "type": "message router",
+ "config_key": "ves-mobileflow"
+ },
+ {
+ "format": "VES_specification",
+ "version": "5.28.4",
+ "type": "message router",
+ "config_key": "ves-statechange"
+ },
+ {
+ "format": "VES_specification",
+ "version": "5.28.4",
+ "type": "message router",
+ "config_key": "ves-thresholdCrossingAlert"
+ },
+ {
+ "format": "VES_specification",
+ "version": "5.28.4",
+ "type": "message router",
+ "config_key": "ves-voicequality"
+ },
+ {
+ "format": "VES_specification",
+ "version": "5.28.4",
+ "type": "message router",
+ "config_key": "ves-sipsignaling"
+ }
+ ]
+ },
+ "services": {
+ "calls": [],
+ "provides": [
+ {
+ "route": "/eventListener/v1",
+ "verb": "POST",
+ "request": {
+ "format": "VES_specification",
+ "version": "4.27.2"
+ },
+ "response": {
+ "format": "ves.coll.response",
+ "version": "1.0.0"
+ }
+ },
+ {
+ "route": "/eventListener/v2",
+ "verb": "POST",
+ "request": {
+ "format": "VES_specification",
+ "version": "4.27.2"
+ },
+ "response": {
+ "format": "ves.coll.response",
+ "version": "1.0.0"
+ }
+ },
+ {
+ "route": "/eventListener/v3",
+ "verb": "POST",
+ "request": {
+ "format": "VES_specification",
+ "version": "4.27.2"
+ },
+ "response": {
+ "format": "ves.coll.response",
+ "version": "1.0.0"
+ }
+ },
+ {
+ "route": "/eventListener/v4",
+ "verb": "POST",
+ "request": {
+ "format": "VES_specification",
+ "version": "4.27.2"
+ },
+ "response": {
+ "format": "ves.coll.response",
+ "version": "1.0.0"
+ }
+ },
+ {
+ "route": "/eventListener/v5",
+ "verb": "POST",
+ "request": {
+ "format": "VES_specification",
+ "version": "5.28.4"
+ },
+ "response": {
+ "format": "ves.coll.response",
+ "version": "1.0.0"
+ }
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "collector.service.port",
+ "value": -1,
+ "description": "standard http port"
+ },
+ {
+ "name": "collector.service.secure.port",
+ "value": 8443,
+ "description": "secure port "
+ },
+ {
+ "name": "collector.keystore.file.location",
+ "value": "/opt/app/dcae-certificate/keystore.jks",
+ "description": "fs location of keystore in vm"
+ },
+ {
+ "name": "collector.keystore.passwordfile",
+ "value": "/opt/app/dcae-certificate/.password",
+ "description": "location of keystore password file in vm"
+ },
+ {
+ "name": "collector.keystore.alias",
+ "value": "dynamically generated",
+ "description": "alias to access the keystore"
+ },
+ {
+ "name": "collector.inputQueue.maxPending",
+ "value": 8096,
+ "description": "Maximum queue limit before publish"
+ },
+ {
+ "name": "collector.dmaap.streamid",
+ "value": "fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling",
+ "description": "domain-streamid mapping"
+ },
+ {
+ "name": "header.authflag",
+ "value": 1,
+ "description": "Basic Authentication flag"
+ },
+ {
+ "name": "header.authlist",
+ "value": "sample1,c2FtcGxlMQ==|userid1,base64encodepwd1|userid2,base64encodepwd2",
+ "description": "List of id and base64 encoded pwd",
+ "sourced_at_deployment":true
+ },
+ {
+ "name": "collector.schema.checkflag",
+ "value": 1,
+ "description": "Schema check validation flag"
+ },
+ {
+ "name": "collector.schema.file",
+ "value": "{\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.json\"}",
+ "description": "validation schema file name per version"
+ },
+ {
+ "name": "event.transform.flag",
+ "value": 1,
+ "description": "flag to enable tranformation rules defined under eventTransform.json"
+ },
+ {
+ "name": "tomcat.maxthreads",
+ "value": "200",
+ "description": "Tomcat control for concurrent request"
+ }
+ ],
+ "auxilary": {
+ "healthcheck": {
+ "type": "https",
+ "interval": "15s",
+ "timeout": "1s",
+ "endpoint": "/healthcheck"
+ },
+ "volumes": [
+ {
+ "container": {
+ "bind": "/opt/app/dcae-certificate"
+ },
+ "host": {
+ "path": "/opt/app/dcae-certificate"
+ }
+ },
+ {
+ "container": {
+ "bind": "/opt/app/VESCollector/logs"
+ },
+ "host": {
+ "path": "/opt/logs/DCAE/VESCollector/logs"
+ }
+ }
+ ],
+ "ports": [
+ "8443:8443"
+ ]
+ },
+ "artifacts": [
+ {
+ "type": "docker image",
+ "uri": "nexus.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.1"
+ }
+ ]
}
-
diff --git a/dpo/tosca_model/schema.yaml b/dpo/tosca_model/schema.yaml
index f2eaae76..d8b16765 100644
--- a/dpo/tosca_model/schema.yaml
+++ b/dpo/tosca_model/schema.yaml
@@ -1,3 +1,20 @@
+# ================================================================================
+# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed 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.
+# ============LICENSE_END=========================================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
tosca_definitions_version: tosca_simple_yaml_1_0_0
capability_types:
dcae.capabilities.cdapHost:
diff --git a/dpo/tosca_model/template.yaml b/dpo/tosca_model/template.yaml
index 9f2379ea..b439fd18 100644
--- a/dpo/tosca_model/template.yaml
+++ b/dpo/tosca_model/template.yaml
@@ -1,3 +1,20 @@
+# ================================================================================
+# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed 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.
+# ============LICENSE_END=========================================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
tosca_definitions_version: tosca_simple_yaml_1_0_0
metadata:
template_name: ves
diff --git a/dpo/tosca_model/translate.yaml b/dpo/tosca_model/translate.yaml
index f1607e76..efda8a54 100644
--- a/dpo/tosca_model/translate.yaml
+++ b/dpo/tosca_model/translate.yaml
@@ -1,3 +1,20 @@
+# ================================================================================
+# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed 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.
+# ============LICENSE_END=========================================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
tosca_definitions_version: tosca_simple_yaml_1_0_0
metadata:
template_name: ves_translate
diff --git a/etc/CommonEventFormat_27.2.json b/etc/CommonEventFormat_27.2.json
index 76f87e2f..bfa52b9d 100644..100755
--- a/etc/CommonEventFormat_27.2.json
+++ b/etc/CommonEventFormat_27.2.json
@@ -1,1384 +1,1375 @@
-{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "definitions": {
- "attCopyrightNotice": {
- "description": "Copyright (c) <2017>, AT&T Intellectual Property. All rights reserved. Licensed under the Apache License, Version 2.0 (the License)",
- "type": "object",
- "properties": {
- "useAndRedistribution": {
- "description": "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",
- "type": "string"
- },
- "licenseLink": {
- "description": "http://www.apache.org/licenses/LICENSE-2.0",
- "type":"string"
- },
- "condition1": {
- "description": "Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an AS IS BASIS,",
- "type": "string"
- },
- "condition2": {
- "description": "Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.",
- "type": "string"
- },
- "condition3": {
- "description": "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
- "type": "string"
- },
- "condition4": {
- "description": "See the License for the specific language governing permissions and limitations under the License.",
- "type": "string"
- },
- "Trademarks": {
- "description": "ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property.",
- "type": "string"
- }
- }
- },
- "codecsInUse": {
- "description": "number of times an identified codec was used over the measurementInterval",
- "type": "object",
- "properties": {
- "codecIdentifier": {
- "type": "string"
- },
- "numberInUse": {
- "type": "number"
- }
- },
- "required": [
- "codecIdentifier",
- "numberInUse"
- ]
- },
- "command": {
- "description": "command from an event collector toward an event source",
- "type": "object",
- "properties": {
- "commandType": {
- "type": "string",
- "enum": [
- "heartbeatIntervalChange",
- "measurementIntervalChange",
- "provideThrottlingState",
- "throttlingSpecification"
- ]
- },
- "eventDomainThrottleSpecification": {
- "$ref": "#/definitions/eventDomainThrottleSpecification"
- },
- "measurementInterval": {
- "type": "number"
- }
- },
- "required": [
- "commandType"
- ]
- },
- "commandList": {
- "description": "array of commands from an event collector toward an event source",
- "type": "array",
- "items": {
- "$ref": "#/definitions/commandListEntry"
- },
- "minItems": 0
- },
- "commandListEntry": {
- "description": "reference to a command object",
- "type": "object",
- "properties": {
- "command": {
- "$ref": "#/definitions/command"
- }
- },
- "required": [
- "command"
- ]
- },
- "commonEventHeader": {
- "description": "fields common to all events",
- "type": "object",
- "properties": {
- "domain": {
- "description": "the eventing domain associated with the event",
- "type": "string",
- "enum": [
- "fault",
- "heartbeat",
- "measurementsForVfScaling",
- "mobileFlow",
- "other",
- "stateChange",
- "syslog",
- "thresholdCrossingAlert"
- ]
- },
- "eventId": {
- "description": "event key that is unique to the event source",
- "type": "string"
- },
- "eventType": {
- "description": "unique event topic name",
- "type": "string"
- },
- "functionalRole": {
- "description": "function of the event source e.g., eNodeB, MME, PCRF",
- "type": "string"
- },
- "internalHeaderFields": {
- "$ref": "#/definitions/internalHeaderFields"
- },
- "lastEpochMicrosec": {
- "description": "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
- "type": "number"
- },
- "priority": {
- "description": "processing priority",
- "type": "string",
- "enum": [
- "High",
- "Medium",
- "Normal",
- "Low"
- ]
- },
- "reportingEntityId": {
- "description": "UUID identifying the entity reporting the event, for example an OAM VM; must be populated by the ATT enrichment process",
- "type": "string"
- },
- "reportingEntityName": {
- "description": "name of the entity reporting the event, for example, an OAM VM",
- "type": "string"
- },
- "sequence": {
- "description": "ordering of events communicated by an event source instance or 0 if not needed",
- "type": "integer"
- },
- "sourceId": {
- "description": "UUID identifying the entity experiencing the event issue; must be populated by the ATT enrichment process",
- "type": "string"
- },
- "sourceName": {
- "description": "name of the entity experiencing the event issue",
- "type": "string"
- },
- "startEpochMicrosec": {
- "description": "the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
- "type": "number"
- },
- "version": {
- "description": "version of the event header",
- "type": "number"
- }
- },
- "required": [
- "domain",
- "eventId",
- "functionalRole",
- "lastEpochMicrosec",
- "priority",
- "reportingEntityName",
- "sequence",
- "sourceName",
- "startEpochMicrosec"
- ]
- },
- "counter": {
- "description": "performance counter",
- "type": "object",
- "properties": {
- "criticality": {
- "type": "string",
- "enum": [
- "CRIT",
- "MAJ"
- ]
- },
- "name": {
- "type": "string"
- },
- "thresholdCrossed": {
- "type": "string"
- },
- "value": {
- "type": "string"
- }
- },
- "required": [
- "criticality",
- "name",
- "thresholdCrossed",
- "value"
- ]
- },
- "cpuUsage": {
- "description": "percent usage of an identified CPU",
- "type": "object",
- "properties": {
- "cpuIdentifier": {
- "type": "string"
- },
- "percentUsage": {
- "type": "number"
- }
- },
- "required": [
- "cpuIdentifier",
- "percentUsage"
- ]
- },
- "errors": {
- "description": "receive and transmit errors for the measurements domain",
- "type": "object",
- "properties": {
- "receiveDiscards": {
- "type": "number"
- },
- "receiveErrors": {
- "type": "number"
- },
- "transmitDiscards": {
- "type": "number"
- },
- "transmitErrors": {
- "type": "number"
- }
- },
- "required": [
- "receiveDiscards",
- "receiveErrors",
- "transmitDiscards",
- "transmitErrors"
- ]
- },
- "event": {
- "description": "the root level of the common event format",
- "type": "object",
- "properties": {
- "commonEventHeader": {
- "$ref": "#/definitions/commonEventHeader"
- },
- "faultFields": {
- "$ref": "#/definitions/faultFields"
- },
- "measurementsForVfScalingFields": {
- "$ref": "#/definitions/measurementsForVfScalingFields"
- },
- "mobileFlowFields": {
- "$ref": "#/definitions/mobileFlowFields"
- },
- "otherFields": {
- "$ref": "#/definitions/otherFields"
- },
- "stateChangeFields": {
- "$ref": "#/definitions/stateChangeFields"
- },
- "syslogFields": {
- "$ref": "#/definitions/syslogFields"
- },
- "thresholdCrossingAlertFields": {
- "$ref": "#/definitions/thresholdCrossingAlertFields"
- }
- },
- "required": [
- "commonEventHeader"
- ]
- },
- "eventDomainThrottleSpecification": {
- "description": "specification of what information to suppress within an event domain",
- "type": "object",
- "properties": {
- "eventDomain": {
- "description": "Event domain enum from the commonEventHeader domain field",
- "type": "string"
- },
- "suppressedFieldNames": {
- "description": "List of optional field names in the event block that should not be sent to the Event Listener",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "suppressedNvPairsList": {
- "description": "Optional list of specific NvPairsNames to suppress within a given Name-Value Field",
- "type": "array",
- "items": {
- "$ref": "#/definitions/suppressedNvPairs"
- }
- }
- },
- "required": [
- "eventDomain"
- ]
- },
- "eventDomainThrottleSpecificationList": {
- "description": "array of eventDomainThrottleSpecifications",
- "type": "array",
- "items": {
- "$ref": "#/definitions/eventDomainThrottleSpecification"
- },
- "minItems": 0
- },
- "eventList": {
- "description": "array of events",
- "type": "array",
- "items": {
- "$ref": "#/definitions/event"
- }
- },
- "eventThrottlingState": {
- "description": "reports the throttling in force at the event source",
- "type": "object",
- "properties": {
- "eventThrottlingMode": {
- "description": "Mode the event manager is in",
- "type": "string",
- "enum": [
- "normal",
- "throttled"
- ]
- },
- "eventDomainThrottleSpecificationList": {
- "$ref": "#/definitions/eventDomainThrottleSpecificationList"
- }
- },
- "required": [
- "eventThrottlingMode"
- ]
- },
- "faultFields": {
- "description": "fields specific to fault events",
- "type": "object",
- "properties": {
- "alarmAdditionalInformation": {
- "description": "additional alarm information",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "alarmCondition": {
- "description": "alarm condition reported by the device",
- "type": "string"
- },
- "alarmInterfaceA": {
- "description": "card, port, channel or interface name of the device generating the alarm",
- "type": "string"
- },
- "eventSeverity": {
- "description": "event severity or priority",
- "type": "string",
- "enum": [
- "CRITICAL",
- "MAJOR",
- "MINOR",
- "WARNING",
- "NORMAL"
- ]
- },
- "eventSourceType": {
- "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
- "type": "string"
- },
- "faultFieldsVersion": {
- "description": "version of the faultFields block",
- "type": "number"
- },
- "specificProblem": {
- "description": "short description of the alarm or problem",
- "type": "string"
- },
- "vfStatus": {
- "description": "virtual function status enumeration",
- "type": "string",
- "enum": [
- "Active",
- "Idle",
- "Preparing to terminate",
- "Ready to terminate",
- "Requesting termination"
- ]
- }
- },
- "required": [
- "alarmCondition",
- "eventSeverity",
- "eventSourceType",
- "specificProblem",
- "vfStatus"
- ]
- },
- "featuresInUse": {
- "description": "number of times an identified feature was used over the measurementInterval",
- "type": "object",
- "properties": {
- "featureIdentifier": {
- "type": "string"
- },
- "featureUtilization": {
- "type": "number"
- }
- },
- "required": [
- "featureIdentifier",
- "featureUtilization"
- ]
- },
- "field": {
- "description": "name value pair",
- "type": "object",
- "properties": {
- "name": {
- "type": "string"
- },
- "value": {
- "type": "string"
- }
- },
- "required": [
- "name",
- "value"
- ]
- },
- "filesystemUsage": {
- "description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second",
- "type": "object",
- "properties": {
- "blockConfigured": {
- "type": "number"
- },
- "blockIops": {
- "type": "number"
- },
- "blockUsed": {
- "type": "number"
- },
- "ephemeralConfigured": {
- "type": "number"
- },
- "ephemeralIops": {
- "type": "number"
- },
- "ephemeralUsed": {
- "type": "number"
- },
- "filesystemName": {
- "type": "string"
- }
- },
- "required": [
- "blockConfigured",
- "blockIops",
- "blockUsed",
- "ephemeralConfigured",
- "ephemeralIops",
- "ephemeralUsed",
- "filesystemName"
- ]
- },
- "gtpPerFlowMetrics": {
- "description": "Mobility GTP Protocol per flow metrics",
- "type": "object",
- "properties": {
- "avgBitErrorRate": {
- "description": "average bit error rate",
- "type": "number"
- },
- "avgPacketDelayVariation": {
- "description": "Average packet delay variation or jitter in milliseconds for received packets: Average difference between the packet timestamp and time received for all pairs of consecutive packets",
- "type": "number"
- },
- "avgPacketLatency": {
- "description": "average delivery latency",
- "type": "number"
- },
- "avgReceiveThroughput": {
- "description": "average receive throughput",
- "type": "number"
- },
- "avgTransmitThroughput": {
- "description": "average transmit throughput",
- "type": "number"
- },
- "durConnectionFailedStatus": {
- "description": "duration of failed state in milliseconds, computed as the cumulative time between a failed echo request and the next following successful error request, over this reporting interval",
- "type": "number"
- },
- "durTunnelFailedStatus": {
- "description": "Duration of errored state, computed as the cumulative time between a tunnel error indicator and the next following non-errored indicator, over this reporting interval",
- "type": "number"
- },
- "flowActivatedBy": {
- "description": "Endpoint activating the flow",
- "type": "string"
- },
- "flowActivationEpoch": {
- "description": "Time the connection is activated in the flow (connection) being reported on, or transmission time of the first packet if activation time is not available",
- "type": "number"
- },
- "flowActivationMicrosec": {
- "description": "Integer microseconds for the start of the flow connection",
- "type": "number"
- },
- "flowActivationTime": {
- "description": "time the connection is activated in the flow being reported on, or transmission time of the first packet if activation time is not available; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "flowDeactivatedBy": {
- "description": "Endpoint deactivating the flow",
- "type": "string"
- },
- "flowDeactivationEpoch": {
- "description": "Time for the start of the flow connection, in integer UTC epoch time aka UNIX time",
- "type": "number"
- },
- "flowDeactivationMicrosec": {
- "description": "Integer microseconds for the start of the flow connection",
- "type": "number"
- },
- "flowDeactivationTime": {
- "description": "Transmission time of the first packet in the flow connection being reported on; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "flowStatus": {
- "description": "connection status at reporting time as a working / inactive / failed indicator value",
- "type": "string"
- },
- "gtpConnectionStatus": {
- "description": "Current connection state at reporting time",
- "type": "string"
- },
- "gtpTunnelStatus": {
- "description": "Current tunnel state at reporting time",
- "type": "string"
- },
- "ipTosCountList": {
- "description": "array of key: value pairs where the keys are drawn from the IP Type-of-Service identifiers which range from '0' to '255', and the values are the count of packets that had those ToS identifiers in the flow",
- "type": "array",
- "items": {
- "type": "array",
- "items": [
- {
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "ipTosList": {
- "description": "Array of unique IP Type-of-Service values observed in the flow where values range from '0' to '255'",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "largePacketRtt": {
- "description": "large packet round trip time",
- "type": "number"
- },
- "largePacketThreshold": {
- "description": "large packet threshold being applied",
- "type": "number"
- },
- "maxPacketDelayVariation": {
- "description": "Maximum packet delay variation or jitter in milliseconds for received packets: Maximum of the difference between the packet timestamp and time received for all pairs of consecutive packets",
- "type": "number"
- },
- "maxReceiveBitRate": {
- "description": "maximum receive bit rate",
- "type": "number"
- },
- "maxTransmitBitRate": {
- "description": "maximum transmit bit rate",
- "type": "number"
- },
- "mobileQciCosCountList": {
- "description": "array of key: value pairs where the keys are drawn from LTE QCI or UMTS class of service strings, and the values are the count of packets that had those strings in the flow",
- "type": "array",
- "items": {
- "type": "array",
- "items": [
- {
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "mobileQciCosList": {
- "description": "Array of unique LTE QCI or UMTS class-of-service values observed in the flow",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "numActivationFailures": {
- "description": "Number of failed activation requests, as observed by the reporting node",
- "type": "number"
- },
- "numBitErrors": {
- "description": "number of errored bits",
- "type": "number"
- },
- "numBytesReceived": {
- "description": "number of bytes received, including retransmissions",
- "type": "number"
- },
- "numBytesTransmitted": {
- "description": "number of bytes transmitted, including retransmissions",
- "type": "number"
- },
- "numDroppedPackets": {
- "description": "number of received packets dropped due to errors per virtual interface",
- "type": "number"
- },
- "numGtpEchoFailures": {
- "description": "Number of Echo request path failures where failed paths are defined in 3GPP TS 29.281 sec 7.2.1 and 3GPP TS 29.060 sec. 11.2",
- "type": "number"
- },
- "numGtpTunnelErrors": {
- "description": "Number of tunnel error indications where errors are defined in 3GPP TS 29.281 sec 7.3.1 and 3GPP TS 29.060 sec. 11.1",
- "type": "number"
- },
- "numHttpErrors": {
- "description": "Http error count",
- "type": "number"
- },
- "numL7BytesReceived": {
- "description": "number of tunneled layer 7 bytes received, including retransmissions",
- "type": "number"
- },
- "numL7BytesTransmitted": {
- "description": "number of tunneled layer 7 bytes transmitted, excluding retransmissions",
- "type": "number"
- },
- "numLostPackets": {
- "description": "number of lost packets",
- "type": "number"
- },
- "numOutOfOrderPackets": {
- "description": "number of out-of-order packets",
- "type": "number"
- },
- "numPacketErrors": {
- "description": "number of errored packets",
- "type": "number"
- },
- "numPacketsReceivedExclRetrans": {
- "description": "number of packets received, excluding retransmission",
- "type": "number"
- },
- "numPacketsReceivedInclRetrans": {
- "description": "number of packets received, including retransmission",
- "type": "number"
- },
- "numPacketsTransmittedInclRetrans": {
- "description": "number of packets transmitted, including retransmissions",
- "type": "number"
- },
- "numRetries": {
- "description": "number of packet retries",
- "type": "number"
- },
- "numTimeouts": {
- "description": "number of packet timeouts",
- "type": "number"
- },
- "numTunneledL7BytesReceived": {
- "description": "number of tunneled layer 7 bytes received, excluding retransmissions",
- "type": "number"
- },
- "roundTripTime": {
- "description": "round trip time",
- "type": "number"
- },
- "tcpFlagCountList": {
- "description": "array of key: value pairs where the keys are drawn from TCP Flags and the values are the count of packets that had that TCP Flag in the flow",
- "type": "array",
- "items": {
- "type": "array",
- "items": [
- {
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "tcpFlagList": {
- "description": "Array of unique TCP Flags observed in the flow",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "timeToFirstByte": {
- "description": "Time in milliseconds between the connection activation and first byte received",
- "type": "number"
- }
- },
- "required": [
- "avgBitErrorRate",
- "avgPacketDelayVariation",
- "avgPacketLatency",
- "avgReceiveThroughput",
- "avgTransmitThroughput",
- "flowActivationEpoch",
- "flowActivationMicrosec",
- "flowDeactivationEpoch",
- "flowDeactivationMicrosec",
- "flowDeactivationTime",
- "flowStatus",
- "maxPacketDelayVariation",
- "numActivationFailures",
- "numBitErrors",
- "numBytesReceived",
- "numBytesTransmitted",
- "numDroppedPackets",
- "numL7BytesReceived",
- "numL7BytesTransmitted",
- "numLostPackets",
- "numOutOfOrderPackets",
- "numPacketErrors",
- "numPacketsReceivedExclRetrans",
- "numPacketsReceivedInclRetrans",
- "numPacketsTransmittedInclRetrans",
- "numRetries",
- "numTimeouts",
- "numTunneledL7BytesReceived",
- "roundTripTime",
- "timeToFirstByte"
- ]
- },
- "internalHeaderFields": {
- "description": "enrichment fields for internal VES Event Listener service use only, not supplied by event sources",
- "type": "object"
- },
- "latencyBucketMeasure": {
- "description": "number of counts falling within a defined latency bucket",
- "type": "object",
- "properties": {
- "countsInTheBucket": {
- "type": "number"
- },
- "highEndOfLatencyBucket": {
- "type": "number"
- },
- "lowEndOfLatencyBucket": {
- "type": "number"
- }
- },
- "required": [
- "countsInTheBucket"
- ]
- },
- "measurementGroup": {
- "description": "measurement group",
- "type": "object",
- "properties": {
- "name": {
- "type": "string"
- },
- "measurements": {
- "description": "array of name value pair measurements",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- }
- },
- "required": [
- "name",
- "measurements"
- ]
- },
- "measurementsForVfScalingFields": {
- "description": "measurementsForVfScaling fields",
- "type": "object",
- "properties": {
- "additionalMeasurements": {
- "description": "additional measurement fields",
- "type": "array",
- "items": {
- "$ref": "#/definitions/measurementGroup"
- }
- },
- "aggregateCpuUsage": {
- "description": "aggregate CPU usage of the VM on which the VNFC reporting the event is running",
- "type": "number"
- },
- "codecUsageArray": {
- "description": "array of codecs in use",
- "type": "array",
- "items": {
- "$ref": "#/definitions/codecsInUse"
- }
- },
- "concurrentSessions": {
- "description": "peak concurrent sessions for the VM or VNF over the measurementInterval",
- "type": "number"
- },
- "configuredEntities": {
- "description": "over the measurementInterval, peak total number of: users, subscribers, devices, adjacencies, etc., for the VM, or subscribers, devices, etc., for the VNF",
- "type": "number"
- },
- "cpuUsageArray": {
- "description": "usage of an array of CPUs",
- "type": "array",
- "items": {
- "$ref": "#/definitions/cpuUsage"
- }
- },
- "errors": {
- "$ref": "#/definitions/errors"
- },
- "featureUsageArray": {
- "description": "array of features in use",
- "type": "array",
- "items": {
- "$ref": "#/definitions/featuresInUse"
- }
- },
- "filesystemUsageArray": {
- "description": "filesystem usage of the VM on which the VNFC reporting the event is running",
- "type": "array",
- "items": {
- "$ref": "#/definitions/filesystemUsage"
- }
- },
- "latencyDistribution": {
- "description": "array of integers representing counts of requests whose latency in milliseconds falls within per-VNF configured ranges",
- "type": "array",
- "items": {
- "$ref": "#/definitions/latencyBucketMeasure"
- }
- },
- "meanRequestLatency": {
- "description": "mean seconds required to respond to each request for the VM on which the VNFC reporting the event is running",
- "type": "number"
- },
- "measurementInterval": {
- "description": "interval over which measurements are being reported in seconds",
- "type": "number"
- },
- "measurementsForVfScalingVersion": {
- "description": "version of the measurementsForVfScaling block",
- "type": "number"
- },
- "memoryConfigured": {
- "description": "memory in MB configured in the VM on which the VNFC reporting the event is running",
- "type": "number"
- },
- "memoryUsed": {
- "description": "memory usage in MB of the VM on which the VNFC reporting the event is running",
- "type": "number"
- },
- "numberOfMediaPortsInUse": {
- "description": "number of media ports in use",
- "type": "number"
- },
- "requestRate": {
- "description": "peak rate of service requests per second to the VNF over the measurementInterval",
- "type": "number"
- },
- "vnfcScalingMetric": {
- "description": "represents busy-ness of the VNF from 0 to 100 as reported by the VNFC",
- "type": "number"
- },
- "vNicUsageArray": {
- "description": "usage of an array of virtual network interface cards",
- "type": "array",
- "items": {
- "$ref": "#/definitions/vNicUsage"
- }
- }
- },
- "required": [
- "measurementInterval"
- ]
- },
- "mobileFlowFields": {
- "description": "mobileFlow fields",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional mobileFlow fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "applicationType": {
- "description": "Application type inferred",
- "type": "string"
- },
- "appProtocolType": {
- "description": "application protocol",
- "type": "string"
- },
- "appProtocolVersion": {
- "description": "application protocol version",
- "type": "string"
- },
- "cid": {
- "description": "cell id",
- "type": "string"
- },
- "connectionType": {
- "description": "Abbreviation referencing a 3GPP reference point e.g., S1-U, S11, etc",
- "type": "string"
- },
- "ecgi": {
- "description": "Evolved Cell Global Id",
- "type": "string"
- },
- "flowDirection": {
- "description": "Flow direction, indicating if the reporting node is the source of the flow or destination for the flow",
- "type": "string"
- },
- "gtpPerFlowMetrics": {
- "$ref": "#/definitions/gtpPerFlowMetrics"
- },
- "gtpProtocolType": {
- "description": "GTP protocol",
- "type": "string"
- },
- "gtpVersion": {
- "description": "GTP protocol version",
- "type": "string"
- },
- "httpHeader": {
- "description": "HTTP request header, if the flow connects to a node referenced by HTTP",
- "type": "string"
- },
- "imei": {
- "description": "IMEI for the subscriber UE used in this flow, if the flow connects to a mobile device",
- "type": "string"
- },
- "imsi": {
- "description": "IMSI for the subscriber UE used in this flow, if the flow connects to a mobile device",
- "type": "string"
- },
- "ipProtocolType": {
- "description": "IP protocol type e.g., TCP, UDP, RTP...",
- "type": "string"
- },
- "ipVersion": {
- "description": "IP protocol version e.g., IPv4, IPv6",
- "type": "string"
- },
- "lac": {
- "description": "location area code",
- "type": "string"
- },
- "mcc": {
- "description": "mobile country code",
- "type": "string"
- },
- "mnc": {
- "description": "mobile network code",
- "type": "string"
- },
- "mobileFlowFieldsVersion": {
- "description": "version of the mobileFlowFields block",
- "type": "number"
- },
- "msisdn": {
- "description": "MSISDN for the subscriber UE used in this flow, as an integer, if the flow connects to a mobile device",
- "type": "string"
- },
- "otherEndpointIpAddress": {
- "description": "IP address for the other endpoint, as used for the flow being reported on",
- "type": "string"
- },
- "otherEndpointPort": {
- "description": "IP Port for the reporting entity, as used for the flow being reported on",
- "type": "number"
- },
- "otherFunctionalRole": {
- "description": "Functional role of the other endpoint for the flow being reported on e.g., MME, S-GW, P-GW, PCRF...",
- "type": "string"
- },
- "rac": {
- "description": "routing area code",
- "type": "string"
- },
- "radioAccessTechnology": {
- "description": "Radio Access Technology e.g., 2G, 3G, LTE",
- "type": "string"
- },
- "reportingEndpointIpAddr": {
- "description": "IP address for the reporting entity, as used for the flow being reported on",
- "type": "string"
- },
- "reportingEndpointPort": {
- "description": "IP port for the reporting entity, as used for the flow being reported on",
- "type": "number"
- },
- "sac": {
- "description": "service area code",
- "type": "string"
- },
- "samplingAlgorithm": {
- "description": "Integer identifier for the sampling algorithm or rule being applied in calculating the flow metrics if metrics are calculated based on a sample of packets, or 0 if no sampling is applied",
- "type": "number"
- },
- "tac": {
- "description": "transport area code",
- "type": "string"
- },
- "tunnelId": {
- "description": "tunnel identifier",
- "type": "string"
- },
- "vlanId": {
- "description": "VLAN identifier used by this flow",
- "type": "string"
- }
- },
- "required": [
- "flowDirection",
- "gtpPerFlowMetrics",
- "ipProtocolType",
- "ipVersion",
- "otherEndpointIpAddress",
- "otherEndpointPort",
- "reportingEndpointIpAddr",
- "reportingEndpointPort"
- ]
- },
- "otherFields": {
- "description": "additional fields not reported elsewhere",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "requestError": {
- "description": "standard request error data structure",
- "type": "object",
- "properties": {
- "messageId": {
- "description": "Unique message identifier of the format ABCnnnn where ABC is either SVC for Service Exceptions or POL for Policy Exception",
- "type": "string"
- },
- "text": {
- "description": "Message text, with replacement variables marked with %n, where n is an index into the list of <variables> elements, starting at 1",
- "type": "string"
- },
- "url": {
- "description": "Hyperlink to a detailed error resource e.g., an HTML page for browser user agents",
- "type": "string"
- },
- "variables": {
- "description": "List of zero or more strings that represent the contents of the variables used by the message text",
- "type": "string"
- }
- },
- "required": [
- "messageId",
- "text"
- ]
- },
- "stateChangeFields": {
- "description": "stateChange fields",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional stateChange fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "newState": {
- "description": "new state of the entity",
- "type": "string",
- "enum": [
- "inService",
- "maintenance",
- "outOfService"
- ]
- },
- "oldState": {
- "description": "previous state of the entity",
- "type": "string",
- "enum": [
- "inService",
- "maintenance",
- "outOfService"
- ]
- },
- "stateChangeFieldsVersion": {
- "description": "version of the stateChangeFields block",
- "type": "number"
- },
- "stateInterface": {
- "description": "card or port name of the entity that changed state",
- "type": "string"
- }
- },
- "required": [
- "newState",
- "oldState",
- "stateInterface"
- ]
- },
- "suppressedNvPairs": {
- "description": "List of specific NvPairsNames to suppress within a given Name-Value Field for event Throttling",
- "type": "object",
- "properties": {
- "nvPairFieldName": {
- "description": "Name of the field within which are the nvpair names to suppress",
- "type": "string"
- },
- "suppressedNvPairNames": {
- "description": "Array of nvpair names to suppress within the nvpairFieldName",
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "required": [
- "nvPairFieldName",
- "suppressedNvPairNames"
- ]
- },
- "syslogFields": {
- "description": "sysLog fields",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional syslog fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "eventSourceHost": {
- "description": "hostname of the device",
- "type": "string"
- },
- "eventSourceType": {
- "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
- "type": "string"
- },
- "syslogFacility": {
- "description": "numeric code from 0 to 23 for facility--see table in documentation",
- "type": "number"
- },
- "syslogFieldsVersion": {
- "description": "version of the syslogFields block",
- "type": "number"
- },
- "syslogMsg": {
- "description": "syslog message",
- "type": "string"
- },
- "syslogPri": {
- "description": "0-192 combined severity and facility",
- "type": "number"
- },
- "syslogProc": {
- "description": "identifies the application that originated the message",
- "type": "string"
- },
- "syslogProcId": {
- "description": "a change in the value of this field indicates a discontinuity in syslog reporting",
- "type": "number"
- },
- "syslogSData": {
- "description": "syslog structured data consisting of a structured data Id followed by a set of key value pairs",
- "type": "string"
- },
- "syslogSdId": {
- "description": "0-32 char in format name@number for example ourSDID@32473",
- "type": "string"
- },
- "syslogSev": {
- "description": "numerical Code for severity derived from syslogPri as remaider of syslogPri / 8",
- "type": "string"
- },
- "syslogTag": {
- "description": "msgId indicating the type of message such as TCPOUT or TCPIN; NILVALUE should be used when no other value can be provided",
- "type": "string"
- },
- "syslogVer": {
- "description": "IANA assigned version of the syslog protocol specification - typically 1",
- "type": "number"
- }
- },
- "required": [
- "eventSourceType",
- "syslogMsg",
- "syslogTag"
- ]
- },
- "thresholdCrossingAlertFields": {
- "description": "fields specific to threshold crossing alert events",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional threshold crossing alert fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "additionalParameters": {
- "description": "performance counters",
- "type": "array",
- "items": {
- "$ref": "#/definitions/counter"
- }
- },
- "alertAction": {
- "description": "Event action",
- "type": "string",
- "enum": [
- "CLEAR",
- "CONT",
- "SET"
- ]
- },
- "alertDescription": {
- "description": "Unique short alert description such as IF-SHUB-ERRDROP",
- "type": "string"
- },
- "alertType": {
- "description": "Event type",
- "type": "string",
- "enum": [
- "CARD-ANOMALY",
- "ELEMENT-ANOMALY",
- "INTERFACE-ANOMALY",
- "SERVICE-ANOMALY"
- ]
- },
- "alertValue": {
- "description": "Calculated API value (if applicable)",
- "type": "string"
- },
- "associatedAlertIdList": {
- "description": "List of eventIds associated with the event being reported",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "collectionTimestamp": {
- "description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "dataCollector": {
- "description": "Specific performance collector instance used",
- "type": "string"
- },
- "elementType": {
- "description": "type of network element - internal ATT field",
- "type": "string"
- },
- "eventSeverity": {
- "description": "event severity or priority",
- "type": "string",
- "enum": [
- "CRITICAL",
- "MAJOR",
- "MINOR",
- "WARNING",
- "NORMAL"
- ]
- },
- "eventStartTimestamp": {
- "description": "Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "interfaceName": {
- "description": "Physical or logical port or card (if applicable)",
- "type": "string"
- },
- "networkService": {
- "description": "network name - internal ATT field",
- "type": "string"
- },
- "possibleRootCause": {
- "description": "Reserved for future use",
- "type": "string"
- },
- "thresholdCrossingFieldsVersion": {
- "description": "version of the thresholdCrossingAlertFields block",
- "type": "number"
- }
- },
- "required": [
- "additionalParameters",
- "alertAction",
- "alertDescription",
- "alertType",
- "collectionTimestamp",
- "eventSeverity",
- "eventStartTimestamp"
- ]
- },
- "vNicUsage": {
- "description": "usage of identified virtual network interface card",
- "type": "object",
- "properties": {
- "broadcastPacketsIn": {
- "type": "number"
- },
- "broadcastPacketsOut": {
- "type": "number"
- },
- "bytesIn": {
- "type": "number"
- },
- "bytesOut": {
- "type": "number"
- },
- "multicastPacketsIn": {
- "type": "number"
- },
- "multicastPacketsOut": {
- "type": "number"
- },
- "packetsIn": {
- "type": "number"
- },
- "packetsOut": {
- "type": "number"
- },
- "unicastPacketsIn": {
- "type": "number"
- },
- "unicastPacketsOut": {
- "type": "number"
- },
- "vNicIdentifier": {
- "type": "string"
- }
- },
- "required": [
- "bytesIn",
- "bytesOut",
- "packetsIn",
- "packetsOut",
- "vNicIdentifier"
- ]
- }
- },
- "title": "Event Listener",
- "type": "object",
- "properties": {
- "event": {
- "$ref": "#/definitions/event"
- }
- }
-}
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "definitions": {
+ "schemaLicenseAndCopyrightNotice": {
+ "description": "Copyright (c) 2017, AT&T Intellectual Property. All rights reserved",
+ "type": "object",
+ "properties": {
+ "apacheLicense2.0": {
+ "description": "Licensed 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:",
+ "type": "string"
+ },
+ "licenseUrl": {
+ "description": "http://www.apache.org/licenses/LICENSE-2.0",
+ "type": "string"
+ },
+ "asIsClause": {
+ "description": "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.",
+ "type": "string"
+ },
+ "permissionsAndLimitations": {
+ "description": "See the License for the specific language governing permissions and limitations under the License.",
+ "type": "string"
+ }
+ }
+ },
+ "codecsInUse": {
+ "description": "number of times an identified codec was used over the measurementInterval",
+ "type": "object",
+ "properties": {
+ "codecIdentifier": {
+ "type": "string"
+ },
+ "numberInUse": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "codecIdentifier",
+ "numberInUse"
+ ]
+ },
+ "command": {
+ "description": "command from an event collector toward an event source",
+ "type": "object",
+ "properties": {
+ "commandType": {
+ "type": "string",
+ "enum": [
+ "heartbeatIntervalChange",
+ "measurementIntervalChange",
+ "provideThrottlingState",
+ "throttlingSpecification"
+ ]
+ },
+ "eventDomainThrottleSpecification": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "measurementInterval": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "commandType"
+ ]
+ },
+ "commandList": {
+ "description": "array of commands from an event collector toward an event source",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/commandListEntry"
+ },
+ "minItems": 0
+ },
+ "commandListEntry": {
+ "description": "reference to a command object",
+ "type": "object",
+ "properties": {
+ "command": {
+ "$ref": "#/definitions/command"
+ }
+ },
+ "required": [
+ "command"
+ ]
+ },
+ "commonEventHeader": {
+ "description": "fields common to all events",
+ "type": "object",
+ "properties": {
+ "domain": {
+ "description": "the eventing domain associated with the event",
+ "type": "string",
+ "enum": [
+ "fault",
+ "heartbeat",
+ "measurementsForVfScaling",
+ "mobileFlow",
+ "other",
+ "stateChange",
+ "syslog",
+ "thresholdCrossingAlert"
+ ]
+ },
+ "eventId": {
+ "description": "event key that is unique to the event source",
+ "type": "string"
+ },
+ "eventType": {
+ "description": "unique event topic name",
+ "type": "string"
+ },
+ "functionalRole": {
+ "description": "function of the event source e.g., eNodeB, MME, PCRF",
+ "type": "string"
+ },
+ "internalHeaderFields": {
+ "$ref": "#/definitions/internalHeaderFields"
+ },
+ "lastEpochMicrosec": {
+ "description": "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "priority": {
+ "description": "processing priority",
+ "type": "string",
+ "enum": [
+ "High",
+ "Medium",
+ "Normal",
+ "Low"
+ ]
+ },
+ "reportingEntityId": {
+ "description": "UUID identifying the entity reporting the event, for example an OAM VM; must be populated by the ATT enrichment process",
+ "type": "string"
+ },
+ "reportingEntityName": {
+ "description": "name of the entity reporting the event, for example, an OAM VM",
+ "type": "string"
+ },
+ "sequence": {
+ "description": "ordering of events communicated by an event source instance or 0 if not needed",
+ "type": "integer"
+ },
+ "sourceId": {
+ "description": "UUID identifying the entity experiencing the event issue; must be populated by the ATT enrichment process",
+ "type": "string"
+ },
+ "sourceName": {
+ "description": "name of the entity experiencing the event issue",
+ "type": "string"
+ },
+ "startEpochMicrosec": {
+ "description": "the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "version": {
+ "description": "version of the event header",
+ "type": "number"
+ }
+ },
+ "required": [
+ "domain",
+ "eventId",
+ "functionalRole",
+ "lastEpochMicrosec",
+ "priority",
+ "reportingEntityName",
+ "sequence",
+ "sourceName",
+ "startEpochMicrosec"
+ ]
+ },
+ "counter": {
+ "description": "performance counter",
+ "type": "object",
+ "properties": {
+ "criticality": {
+ "type": "string",
+ "enum": [
+ "CRIT",
+ "MAJ"
+ ]
+ },
+ "name": {
+ "type": "string"
+ },
+ "thresholdCrossed": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "criticality",
+ "name",
+ "thresholdCrossed",
+ "value"
+ ]
+ },
+ "cpuUsage": {
+ "description": "percent usage of an identified CPU",
+ "type": "object",
+ "properties": {
+ "cpuIdentifier": {
+ "type": "string"
+ },
+ "percentUsage": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "cpuIdentifier",
+ "percentUsage"
+ ]
+ },
+ "errors": {
+ "description": "receive and transmit errors for the measurements domain",
+ "type": "object",
+ "properties": {
+ "receiveDiscards": {
+ "type": "number"
+ },
+ "receiveErrors": {
+ "type": "number"
+ },
+ "transmitDiscards": {
+ "type": "number"
+ },
+ "transmitErrors": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "receiveDiscards",
+ "receiveErrors",
+ "transmitDiscards",
+ "transmitErrors"
+ ]
+ },
+ "event": {
+ "description": "the root level of the common event format",
+ "type": "object",
+ "properties": {
+ "commonEventHeader": {
+ "$ref": "#/definitions/commonEventHeader"
+ },
+ "faultFields": {
+ "$ref": "#/definitions/faultFields"
+ },
+ "measurementsForVfScalingFields": {
+ "$ref": "#/definitions/measurementsForVfScalingFields"
+ },
+ "mobileFlowFields": {
+ "$ref": "#/definitions/mobileFlowFields"
+ },
+ "otherFields": {
+ "$ref": "#/definitions/otherFields"
+ },
+ "stateChangeFields": {
+ "$ref": "#/definitions/stateChangeFields"
+ },
+ "syslogFields": {
+ "$ref": "#/definitions/syslogFields"
+ },
+ "thresholdCrossingAlertFields": {
+ "$ref": "#/definitions/thresholdCrossingAlertFields"
+ }
+ },
+ "required": [
+ "commonEventHeader"
+ ]
+ },
+ "eventDomainThrottleSpecification": {
+ "description": "specification of what information to suppress within an event domain",
+ "type": "object",
+ "properties": {
+ "eventDomain": {
+ "description": "Event domain enum from the commonEventHeader domain field",
+ "type": "string"
+ },
+ "suppressedFieldNames": {
+ "description": "List of optional field names in the event block that should not be sent to the Event Listener",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "suppressedNvPairsList": {
+ "description": "Optional list of specific NvPairsNames to suppress within a given Name-Value Field",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/suppressedNvPairs"
+ }
+ }
+ },
+ "required": [
+ "eventDomain"
+ ]
+ },
+ "eventDomainThrottleSpecificationList": {
+ "description": "array of eventDomainThrottleSpecifications",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "minItems": 0
+ },
+ "eventList": {
+ "description": "array of events",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/event"
+ }
+ },
+ "eventThrottlingState": {
+ "description": "reports the throttling in force at the event source",
+ "type": "object",
+ "properties": {
+ "eventThrottlingMode": {
+ "description": "Mode the event manager is in",
+ "type": "string",
+ "enum": [
+ "normal",
+ "throttled"
+ ]
+ },
+ "eventDomainThrottleSpecificationList": {
+ "$ref": "#/definitions/eventDomainThrottleSpecificationList"
+ }
+ },
+ "required": [
+ "eventThrottlingMode"
+ ]
+ },
+ "faultFields": {
+ "description": "fields specific to fault events",
+ "type": "object",
+ "properties": {
+ "alarmAdditionalInformation": {
+ "description": "additional alarm information",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "alarmCondition": {
+ "description": "alarm condition reported by the device",
+ "type": "string"
+ },
+ "alarmInterfaceA": {
+ "description": "card, port, channel or interface name of the device generating the alarm",
+ "type": "string"
+ },
+ "eventSeverity": {
+ "description": "event severity or priority",
+ "type": "string",
+ "enum": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
+ },
+ "eventSourceType": {
+ "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
+ "type": "string"
+ },
+ "faultFieldsVersion": {
+ "description": "version of the faultFields block",
+ "type": "number"
+ },
+ "specificProblem": {
+ "description": "short description of the alarm or problem",
+ "type": "string"
+ },
+ "vfStatus": {
+ "description": "virtual function status enumeration",
+ "type": "string",
+ "enum": [
+ "Active",
+ "Idle",
+ "Preparing to terminate",
+ "Ready to terminate",
+ "Requesting termination"
+ ]
+ }
+ },
+ "required": [
+ "alarmCondition",
+ "eventSeverity",
+ "eventSourceType",
+ "specificProblem",
+ "vfStatus"
+ ]
+ },
+ "featuresInUse": {
+ "description": "number of times an identified feature was used over the measurementInterval",
+ "type": "object",
+ "properties": {
+ "featureIdentifier": {
+ "type": "string"
+ },
+ "featureUtilization": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "featureIdentifier",
+ "featureUtilization"
+ ]
+ },
+ "field": {
+ "description": "name value pair",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "value"
+ ]
+ },
+ "filesystemUsage": {
+ "description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second",
+ "type": "object",
+ "properties": {
+ "blockConfigured": {
+ "type": "number"
+ },
+ "blockIops": {
+ "type": "number"
+ },
+ "blockUsed": {
+ "type": "number"
+ },
+ "ephemeralConfigured": {
+ "type": "number"
+ },
+ "ephemeralIops": {
+ "type": "number"
+ },
+ "ephemeralUsed": {
+ "type": "number"
+ },
+ "filesystemName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "blockConfigured",
+ "blockIops",
+ "blockUsed",
+ "ephemeralConfigured",
+ "ephemeralIops",
+ "ephemeralUsed",
+ "filesystemName"
+ ]
+ },
+ "gtpPerFlowMetrics": {
+ "description": "Mobility GTP Protocol per flow metrics",
+ "type": "object",
+ "properties": {
+ "avgBitErrorRate": {
+ "description": "average bit error rate",
+ "type": "number"
+ },
+ "avgPacketDelayVariation": {
+ "description": "Average packet delay variation or jitter in milliseconds for received packets: Average difference between the packet timestamp and time received for all pairs of consecutive packets",
+ "type": "number"
+ },
+ "avgPacketLatency": {
+ "description": "average delivery latency",
+ "type": "number"
+ },
+ "avgReceiveThroughput": {
+ "description": "average receive throughput",
+ "type": "number"
+ },
+ "avgTransmitThroughput": {
+ "description": "average transmit throughput",
+ "type": "number"
+ },
+ "durConnectionFailedStatus": {
+ "description": "duration of failed state in milliseconds, computed as the cumulative time between a failed echo request and the next following successful error request, over this reporting interval",
+ "type": "number"
+ },
+ "durTunnelFailedStatus": {
+ "description": "Duration of errored state, computed as the cumulative time between a tunnel error indicator and the next following non-errored indicator, over this reporting interval",
+ "type": "number"
+ },
+ "flowActivatedBy": {
+ "description": "Endpoint activating the flow",
+ "type": "string"
+ },
+ "flowActivationEpoch": {
+ "description": "Time the connection is activated in the flow (connection) being reported on, or transmission time of the first packet if activation time is not available",
+ "type": "number"
+ },
+ "flowActivationMicrosec": {
+ "description": "Integer microseconds for the start of the flow connection",
+ "type": "number"
+ },
+ "flowActivationTime": {
+ "description": "time the connection is activated in the flow being reported on, or transmission time of the first packet if activation time is not available; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "flowDeactivatedBy": {
+ "description": "Endpoint deactivating the flow",
+ "type": "string"
+ },
+ "flowDeactivationEpoch": {
+ "description": "Time for the start of the flow connection, in integer UTC epoch time aka UNIX time",
+ "type": "number"
+ },
+ "flowDeactivationMicrosec": {
+ "description": "Integer microseconds for the start of the flow connection",
+ "type": "number"
+ },
+ "flowDeactivationTime": {
+ "description": "Transmission time of the first packet in the flow connection being reported on; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "flowStatus": {
+ "description": "connection status at reporting time as a working / inactive / failed indicator value",
+ "type": "string"
+ },
+ "gtpConnectionStatus": {
+ "description": "Current connection state at reporting time",
+ "type": "string"
+ },
+ "gtpTunnelStatus": {
+ "description": "Current tunnel state at reporting time",
+ "type": "string"
+ },
+ "ipTosCountList": {
+ "description": "array of key: value pairs where the keys are drawn from the IP Type-of-Service identifiers which range from '0' to '255', and the values are the count of packets that had those ToS identifiers in the flow",
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "ipTosList": {
+ "description": "Array of unique IP Type-of-Service values observed in the flow where values range from '0' to '255'",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "largePacketRtt": {
+ "description": "large packet round trip time",
+ "type": "number"
+ },
+ "largePacketThreshold": {
+ "description": "large packet threshold being applied",
+ "type": "number"
+ },
+ "maxPacketDelayVariation": {
+ "description": "Maximum packet delay variation or jitter in milliseconds for received packets: Maximum of the difference between the packet timestamp and time received for all pairs of consecutive packets",
+ "type": "number"
+ },
+ "maxReceiveBitRate": {
+ "description": "maximum receive bit rate",
+ "type": "number"
+ },
+ "maxTransmitBitRate": {
+ "description": "maximum transmit bit rate",
+ "type": "number"
+ },
+ "mobileQciCosCountList": {
+ "description": "array of key: value pairs where the keys are drawn from LTE QCI or UMTS class of service strings, and the values are the count of packets that had those strings in the flow",
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "mobileQciCosList": {
+ "description": "Array of unique LTE QCI or UMTS class-of-service values observed in the flow",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "numActivationFailures": {
+ "description": "Number of failed activation requests, as observed by the reporting node",
+ "type": "number"
+ },
+ "numBitErrors": {
+ "description": "number of errored bits",
+ "type": "number"
+ },
+ "numBytesReceived": {
+ "description": "number of bytes received, including retransmissions",
+ "type": "number"
+ },
+ "numBytesTransmitted": {
+ "description": "number of bytes transmitted, including retransmissions",
+ "type": "number"
+ },
+ "numDroppedPackets": {
+ "description": "number of received packets dropped due to errors per virtual interface",
+ "type": "number"
+ },
+ "numGtpEchoFailures": {
+ "description": "Number of Echo request path failures where failed paths are defined in 3GPP TS 29.281 sec 7.2.1 and 3GPP TS 29.060 sec. 11.2",
+ "type": "number"
+ },
+ "numGtpTunnelErrors": {
+ "description": "Number of tunnel error indications where errors are defined in 3GPP TS 29.281 sec 7.3.1 and 3GPP TS 29.060 sec. 11.1",
+ "type": "number"
+ },
+ "numHttpErrors": {
+ "description": "Http error count",
+ "type": "number"
+ },
+ "numL7BytesReceived": {
+ "description": "number of tunneled layer 7 bytes received, including retransmissions",
+ "type": "number"
+ },
+ "numL7BytesTransmitted": {
+ "description": "number of tunneled layer 7 bytes transmitted, excluding retransmissions",
+ "type": "number"
+ },
+ "numLostPackets": {
+ "description": "number of lost packets",
+ "type": "number"
+ },
+ "numOutOfOrderPackets": {
+ "description": "number of out-of-order packets",
+ "type": "number"
+ },
+ "numPacketErrors": {
+ "description": "number of errored packets",
+ "type": "number"
+ },
+ "numPacketsReceivedExclRetrans": {
+ "description": "number of packets received, excluding retransmission",
+ "type": "number"
+ },
+ "numPacketsReceivedInclRetrans": {
+ "description": "number of packets received, including retransmission",
+ "type": "number"
+ },
+ "numPacketsTransmittedInclRetrans": {
+ "description": "number of packets transmitted, including retransmissions",
+ "type": "number"
+ },
+ "numRetries": {
+ "description": "number of packet retries",
+ "type": "number"
+ },
+ "numTimeouts": {
+ "description": "number of packet timeouts",
+ "type": "number"
+ },
+ "numTunneledL7BytesReceived": {
+ "description": "number of tunneled layer 7 bytes received, excluding retransmissions",
+ "type": "number"
+ },
+ "roundTripTime": {
+ "description": "round trip time",
+ "type": "number"
+ },
+ "tcpFlagCountList": {
+ "description": "array of key: value pairs where the keys are drawn from TCP Flags and the values are the count of packets that had that TCP Flag in the flow",
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "tcpFlagList": {
+ "description": "Array of unique TCP Flags observed in the flow",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "timeToFirstByte": {
+ "description": "Time in milliseconds between the connection activation and first byte received",
+ "type": "number"
+ }
+ },
+ "required": [
+ "avgBitErrorRate",
+ "avgPacketDelayVariation",
+ "avgPacketLatency",
+ "avgReceiveThroughput",
+ "avgTransmitThroughput",
+ "flowActivationEpoch",
+ "flowActivationMicrosec",
+ "flowDeactivationEpoch",
+ "flowDeactivationMicrosec",
+ "flowDeactivationTime",
+ "flowStatus",
+ "maxPacketDelayVariation",
+ "numActivationFailures",
+ "numBitErrors",
+ "numBytesReceived",
+ "numBytesTransmitted",
+ "numDroppedPackets",
+ "numL7BytesReceived",
+ "numL7BytesTransmitted",
+ "numLostPackets",
+ "numOutOfOrderPackets",
+ "numPacketErrors",
+ "numPacketsReceivedExclRetrans",
+ "numPacketsReceivedInclRetrans",
+ "numPacketsTransmittedInclRetrans",
+ "numRetries",
+ "numTimeouts",
+ "numTunneledL7BytesReceived",
+ "roundTripTime",
+ "timeToFirstByte"
+ ]
+ },
+ "internalHeaderFields": {
+ "description": "enrichment fields for internal VES Event Listener service use only, not supplied by event sources",
+ "type": "object"
+ },
+ "latencyBucketMeasure": {
+ "description": "number of counts falling within a defined latency bucket",
+ "type": "object",
+ "properties": {
+ "countsInTheBucket": {
+ "type": "number"
+ },
+ "highEndOfLatencyBucket": {
+ "type": "number"
+ },
+ "lowEndOfLatencyBucket": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "countsInTheBucket"
+ ]
+ },
+ "measurementGroup": {
+ "description": "measurement group",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "measurements": {
+ "description": "array of name value pair measurements",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ }
+ },
+ "required": [
+ "name",
+ "measurements"
+ ]
+ },
+ "measurementsForVfScalingFields": {
+ "description": "measurementsForVfScaling fields",
+ "type": "object",
+ "properties": {
+ "additionalMeasurements": {
+ "description": "additional measurement fields",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/measurementGroup"
+ }
+ },
+ "aggregateCpuUsage": {
+ "description": "aggregate CPU usage of the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "codecUsageArray": {
+ "description": "array of codecs in use",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/codecsInUse"
+ }
+ },
+ "concurrentSessions": {
+ "description": "peak concurrent sessions for the VM or VNF over the measurementInterval",
+ "type": "number"
+ },
+ "configuredEntities": {
+ "description": "over the measurementInterval, peak total number of: users, subscribers, devices, adjacencies, etc., for the VM, or subscribers, devices, etc., for the VNF",
+ "type": "number"
+ },
+ "cpuUsageArray": {
+ "description": "usage of an array of CPUs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/cpuUsage"
+ }
+ },
+ "errors": {
+ "$ref": "#/definitions/errors"
+ },
+ "featureUsageArray": {
+ "description": "array of features in use",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/featuresInUse"
+ }
+ },
+ "filesystemUsageArray": {
+ "description": "filesystem usage of the VM on which the VNFC reporting the event is running",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/filesystemUsage"
+ }
+ },
+ "latencyDistribution": {
+ "description": "array of integers representing counts of requests whose latency in milliseconds falls within per-VNF configured ranges",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/latencyBucketMeasure"
+ }
+ },
+ "meanRequestLatency": {
+ "description": "mean seconds required to respond to each request for the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "measurementInterval": {
+ "description": "interval over which measurements are being reported in seconds",
+ "type": "number"
+ },
+ "measurementsForVfScalingVersion": {
+ "description": "version of the measurementsForVfScaling block",
+ "type": "number"
+ },
+ "memoryConfigured": {
+ "description": "memory in MB configured in the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "memoryUsed": {
+ "description": "memory usage in MB of the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "numberOfMediaPortsInUse": {
+ "description": "number of media ports in use",
+ "type": "number"
+ },
+ "requestRate": {
+ "description": "peak rate of service requests per second to the VNF over the measurementInterval",
+ "type": "number"
+ },
+ "vnfcScalingMetric": {
+ "description": "represents busy-ness of the VNF from 0 to 100 as reported by the VNFC",
+ "type": "number"
+ },
+ "vNicUsageArray": {
+ "description": "usage of an array of virtual network interface cards",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/vNicUsage"
+ }
+ }
+ },
+ "required": [
+ "measurementInterval"
+ ]
+ },
+ "mobileFlowFields": {
+ "description": "mobileFlow fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional mobileFlow fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "applicationType": {
+ "description": "Application type inferred",
+ "type": "string"
+ },
+ "appProtocolType": {
+ "description": "application protocol",
+ "type": "string"
+ },
+ "appProtocolVersion": {
+ "description": "application protocol version",
+ "type": "string"
+ },
+ "cid": {
+ "description": "cell id",
+ "type": "string"
+ },
+ "connectionType": {
+ "description": "Abbreviation referencing a 3GPP reference point e.g., S1-U, S11, etc",
+ "type": "string"
+ },
+ "ecgi": {
+ "description": "Evolved Cell Global Id",
+ "type": "string"
+ },
+ "flowDirection": {
+ "description": "Flow direction, indicating if the reporting node is the source of the flow or destination for the flow",
+ "type": "string"
+ },
+ "gtpPerFlowMetrics": {
+ "$ref": "#/definitions/gtpPerFlowMetrics"
+ },
+ "gtpProtocolType": {
+ "description": "GTP protocol",
+ "type": "string"
+ },
+ "gtpVersion": {
+ "description": "GTP protocol version",
+ "type": "string"
+ },
+ "httpHeader": {
+ "description": "HTTP request header, if the flow connects to a node referenced by HTTP",
+ "type": "string"
+ },
+ "imei": {
+ "description": "IMEI for the subscriber UE used in this flow, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "imsi": {
+ "description": "IMSI for the subscriber UE used in this flow, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "ipProtocolType": {
+ "description": "IP protocol type e.g., TCP, UDP, RTP...",
+ "type": "string"
+ },
+ "ipVersion": {
+ "description": "IP protocol version e.g., IPv4, IPv6",
+ "type": "string"
+ },
+ "lac": {
+ "description": "location area code",
+ "type": "string"
+ },
+ "mcc": {
+ "description": "mobile country code",
+ "type": "string"
+ },
+ "mnc": {
+ "description": "mobile network code",
+ "type": "string"
+ },
+ "mobileFlowFieldsVersion": {
+ "description": "version of the mobileFlowFields block",
+ "type": "number"
+ },
+ "msisdn": {
+ "description": "MSISDN for the subscriber UE used in this flow, as an integer, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "otherEndpointIpAddress": {
+ "description": "IP address for the other endpoint, as used for the flow being reported on",
+ "type": "string"
+ },
+ "otherEndpointPort": {
+ "description": "IP Port for the reporting entity, as used for the flow being reported on",
+ "type": "number"
+ },
+ "otherFunctionalRole": {
+ "description": "Functional role of the other endpoint for the flow being reported on e.g., MME, S-GW, P-GW, PCRF...",
+ "type": "string"
+ },
+ "rac": {
+ "description": "routing area code",
+ "type": "string"
+ },
+ "radioAccessTechnology": {
+ "description": "Radio Access Technology e.g., 2G, 3G, LTE",
+ "type": "string"
+ },
+ "reportingEndpointIpAddr": {
+ "description": "IP address for the reporting entity, as used for the flow being reported on",
+ "type": "string"
+ },
+ "reportingEndpointPort": {
+ "description": "IP port for the reporting entity, as used for the flow being reported on",
+ "type": "number"
+ },
+ "sac": {
+ "description": "service area code",
+ "type": "string"
+ },
+ "samplingAlgorithm": {
+ "description": "Integer identifier for the sampling algorithm or rule being applied in calculating the flow metrics if metrics are calculated based on a sample of packets, or 0 if no sampling is applied",
+ "type": "number"
+ },
+ "tac": {
+ "description": "transport area code",
+ "type": "string"
+ },
+ "tunnelId": {
+ "description": "tunnel identifier",
+ "type": "string"
+ },
+ "vlanId": {
+ "description": "VLAN identifier used by this flow",
+ "type": "string"
+ }
+ },
+ "required": [
+ "flowDirection",
+ "gtpPerFlowMetrics",
+ "ipProtocolType",
+ "ipVersion",
+ "otherEndpointIpAddress",
+ "otherEndpointPort",
+ "reportingEndpointIpAddr",
+ "reportingEndpointPort"
+ ]
+ },
+ "otherFields": {
+ "description": "additional fields not reported elsewhere",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "requestError": {
+ "description": "standard request error data structure",
+ "type": "object",
+ "properties": {
+ "messageId": {
+ "description": "Unique message identifier of the format ABCnnnn where ABC is either SVC for Service Exceptions or POL for Policy Exception",
+ "type": "string"
+ },
+ "text": {
+ "description": "Message text, with replacement variables marked with %n, where n is an index into the list of <variables> elements, starting at 1",
+ "type": "string"
+ },
+ "url": {
+ "description": "Hyperlink to a detailed error resource e.g., an HTML page for browser user agents",
+ "type": "string"
+ },
+ "variables": {
+ "description": "List of zero or more strings that represent the contents of the variables used by the message text",
+ "type": "string"
+ }
+ },
+ "required": [
+ "messageId",
+ "text"
+ ]
+ },
+ "stateChangeFields": {
+ "description": "stateChange fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional stateChange fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "newState": {
+ "description": "new state of the entity",
+ "type": "string",
+ "enum": [
+ "inService",
+ "maintenance",
+ "outOfService"
+ ]
+ },
+ "oldState": {
+ "description": "previous state of the entity",
+ "type": "string",
+ "enum": [
+ "inService",
+ "maintenance",
+ "outOfService"
+ ]
+ },
+ "stateChangeFieldsVersion": {
+ "description": "version of the stateChangeFields block",
+ "type": "number"
+ },
+ "stateInterface": {
+ "description": "card or port name of the entity that changed state",
+ "type": "string"
+ }
+ },
+ "required": [
+ "newState",
+ "oldState",
+ "stateInterface"
+ ]
+ },
+ "suppressedNvPairs": {
+ "description": "List of specific NvPairsNames to suppress within a given Name-Value Field for event Throttling",
+ "type": "object",
+ "properties": {
+ "nvPairFieldName": {
+ "description": "Name of the field within which are the nvpair names to suppress",
+ "type": "string"
+ },
+ "suppressedNvPairNames": {
+ "description": "Array of nvpair names to suppress within the nvpairFieldName",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "nvPairFieldName",
+ "suppressedNvPairNames"
+ ]
+ },
+ "syslogFields": {
+ "description": "sysLog fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional syslog fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "eventSourceHost": {
+ "description": "hostname of the device",
+ "type": "string"
+ },
+ "eventSourceType": {
+ "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
+ "type": "string"
+ },
+ "syslogFacility": {
+ "description": "numeric code from 0 to 23 for facility--see table in documentation",
+ "type": "number"
+ },
+ "syslogFieldsVersion": {
+ "description": "version of the syslogFields block",
+ "type": "number"
+ },
+ "syslogMsg": {
+ "description": "syslog message",
+ "type": "string"
+ },
+ "syslogPri": {
+ "description": "0-192 combined severity and facility",
+ "type": "number"
+ },
+ "syslogProc": {
+ "description": "identifies the application that originated the message",
+ "type": "string"
+ },
+ "syslogProcId": {
+ "description": "a change in the value of this field indicates a discontinuity in syslog reporting",
+ "type": "number"
+ },
+ "syslogSData": {
+ "description": "syslog structured data consisting of a structured data Id followed by a set of key value pairs",
+ "type": "string"
+ },
+ "syslogSdId": {
+ "description": "0-32 char in format name@number for example ourSDID@32473",
+ "type": "string"
+ },
+ "syslogSev": {
+ "description": "numerical Code for severity derived from syslogPri as remaider of syslogPri / 8",
+ "type": "string"
+ },
+ "syslogTag": {
+ "description": "msgId indicating the type of message such as TCPOUT or TCPIN; NILVALUE should be used when no other value can be provided",
+ "type": "string"
+ },
+ "syslogVer": {
+ "description": "IANA assigned version of the syslog protocol specification - typically 1",
+ "type": "number"
+ }
+ },
+ "required": [
+ "eventSourceType",
+ "syslogMsg",
+ "syslogTag"
+ ]
+ },
+ "thresholdCrossingAlertFields": {
+ "description": "fields specific to threshold crossing alert events",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional threshold crossing alert fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "additionalParameters": {
+ "description": "performance counters",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/counter"
+ }
+ },
+ "alertAction": {
+ "description": "Event action",
+ "type": "string",
+ "enum": [
+ "CLEAR",
+ "CONT",
+ "SET"
+ ]
+ },
+ "alertDescription": {
+ "description": "Unique short alert description such as IF-SHUB-ERRDROP",
+ "type": "string"
+ },
+ "alertType": {
+ "description": "Event type",
+ "type": "string",
+ "enum": [
+ "CARD-ANOMALY",
+ "ELEMENT-ANOMALY",
+ "INTERFACE-ANOMALY",
+ "SERVICE-ANOMALY"
+ ]
+ },
+ "alertValue": {
+ "description": "Calculated API value (if applicable)",
+ "type": "string"
+ },
+ "associatedAlertIdList": {
+ "description": "List of eventIds associated with the event being reported",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "collectionTimestamp": {
+ "description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "dataCollector": {
+ "description": "Specific performance collector instance used",
+ "type": "string"
+ },
+ "elementType": {
+ "description": "type of network element - internal ATT field",
+ "type": "string"
+ },
+ "eventSeverity": {
+ "description": "event severity or priority",
+ "type": "string",
+ "enum": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
+ },
+ "eventStartTimestamp": {
+ "description": "Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "interfaceName": {
+ "description": "Physical or logical port or card (if applicable)",
+ "type": "string"
+ },
+ "networkService": {
+ "description": "network name - internal ATT field",
+ "type": "string"
+ },
+ "possibleRootCause": {
+ "description": "Reserved for future use",
+ "type": "string"
+ },
+ "thresholdCrossingFieldsVersion": {
+ "description": "version of the thresholdCrossingAlertFields block",
+ "type": "number"
+ }
+ },
+ "required": [
+ "additionalParameters",
+ "alertAction",
+ "alertDescription",
+ "alertType",
+ "collectionTimestamp",
+ "eventSeverity",
+ "eventStartTimestamp"
+ ]
+ },
+ "vNicUsage": {
+ "description": "usage of identified virtual network interface card",
+ "type": "object",
+ "properties": {
+ "broadcastPacketsIn": {
+ "type": "number"
+ },
+ "broadcastPacketsOut": {
+ "type": "number"
+ },
+ "bytesIn": {
+ "type": "number"
+ },
+ "bytesOut": {
+ "type": "number"
+ },
+ "multicastPacketsIn": {
+ "type": "number"
+ },
+ "multicastPacketsOut": {
+ "type": "number"
+ },
+ "packetsIn": {
+ "type": "number"
+ },
+ "packetsOut": {
+ "type": "number"
+ },
+ "unicastPacketsIn": {
+ "type": "number"
+ },
+ "unicastPacketsOut": {
+ "type": "number"
+ },
+ "vNicIdentifier": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "bytesIn",
+ "bytesOut",
+ "packetsIn",
+ "packetsOut",
+ "vNicIdentifier"
+ ]
+ }
+ },
+ "title": "Event Listener",
+ "type": "object",
+ "properties": {
+ "event": {
+ "$ref": "#/definitions/event"
+ },
+ "eventList": {
+ "$ref": "#/definitions/eventList"
+ }
+ }
+} \ No newline at end of file
diff --git a/etc/CommonEventFormat_28.3.json b/etc/CommonEventFormat_28.3.json
index 90f6d81a..96c71bc1 100644
--- a/etc/CommonEventFormat_28.3.json
+++ b/etc/CommonEventFormat_28.3.json
@@ -1,52 +1,45 @@
{
- "$schema": "http://json-schema.org/draft-04/schema#",
-
+ "$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
- "attCopyrightNotice": {
- "description": "Copyright (c) <2017>, AT&T Intellectual Property. All rights reserved. Licensed under the Apache License, Version 2.0 (the License)",
+ "schemaLicenseAndCopyrightNotice": {
+ "description": "Copyright (c) 2017, AT&T Intellectual Property. All rights reserved",
"type": "object",
"properties": {
- "useAndRedistribution": {
- "description": "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",
+ "apacheLicense2.0": {
+ "description": "Licensed 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:",
"type": "string"
},
- "licenseLink": {
- "description": "http://www.apache.org/licenses/LICENSE-2.0",
- "type":"string"
- },
- "condition1": {
- "description": "Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an AS IS BASIS,",
- "type": "string"
- },
- "condition2": {
- "description": "Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.",
+ "licenseUrl": {
+ "description": "http://www.apache.org/licenses/LICENSE-2.0",
"type": "string"
},
- "condition3": {
- "description": "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
+ "asIsClause": {
+ "description": "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.",
"type": "string"
},
- "condition4": {
+ "permissionsAndLimitations": {
"description": "See the License for the specific language governing permissions and limitations under the License.",
"type": "string"
- },
- "Trademarks": {
- "description": "ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property.",
- "type": "string"
}
}
},
-
- "codecsInUse": {
+ "codecsInUse": {
"description": "number of times an identified codec was used over the measurementInterval",
"type": "object",
"properties": {
- "codecIdentifier": { "type": "string" },
- "numberInUse": { "type": "integer" }
+ "codecIdentifier": {
+ "type": "string"
+ },
+ "numberInUse": {
+ "type": "integer"
+ }
},
- "required": [ "codecIdentifier", "numberInUse" ]
+ "required": [
+ "codecIdentifier",
+ "numberInUse"
+ ]
},
- "command": {
+ "command": {
"description": "command from an event collector toward an event source",
"type": "object",
"properties": {
@@ -59,17 +52,25 @@
"throttlingSpecification"
]
},
- "eventDomainThrottleSpecification": { "$ref": "#/definitions/eventDomainThrottleSpecification" },
- "heartbeatInterval": { "type": "integer" },
- "measurementInterval": { "type": "integer" }
+ "eventDomainThrottleSpecification": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "heartbeatInterval": {
+ "type": "integer"
+ },
+ "measurementInterval": {
+ "type": "integer"
+ }
},
- "required": [ "commandType" ]
+ "required": [
+ "commandType"
+ ]
},
"commandList": {
"description": "array of commands from an event collector toward an event source",
"type": "array",
"items": {
- "$ref": "#/definitions/command"
+ "$ref": "#/definitions/command"
},
"minItems": 0
},
@@ -105,7 +106,9 @@
"description": "for example - applicationVnf, guestOS, hostOS, platform",
"type": "string"
},
- "internalHeaderFields": { "$ref": "#/definitions/internalHeaderFields" },
+ "internalHeaderFields": {
+ "$ref": "#/definitions/internalHeaderFields"
+ },
"lastEpochMicrosec": {
"description": "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
"type": "number"
@@ -157,379 +160,442 @@
"type": "number"
}
},
- "required": [ "domain", "eventId", "eventName", "lastEpochMicrosec",
- "priority", "reportingEntityName", "sequence", "sourceName",
- "startEpochMicrosec", "version" ]
+ "required": [
+ "domain",
+ "eventId",
+ "eventName",
+ "lastEpochMicrosec",
+ "priority",
+ "reportingEntityName",
+ "sequence",
+ "sourceName",
+ "startEpochMicrosec",
+ "version"
+ ]
},
"counter": {
"description": "performance counter",
"type": "object",
"properties": {
- "criticality": { "type": "string", "enum": [ "CRIT", "MAJ" ] },
- "name": { "type": "string" },
- "thresholdCrossed": { "type": "string" },
- "value": { "type": "string"}
+ "criticality": {
+ "type": "string",
+ "enum": [
+ "CRIT",
+ "MAJ"
+ ]
+ },
+ "name": {
+ "type": "string"
+ },
+ "thresholdCrossed": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
},
- "required": [ "criticality", "name", "thresholdCrossed", "value" ]
+ "required": [
+ "criticality",
+ "name",
+ "thresholdCrossed",
+ "value"
+ ]
},
"cpuUsage": {
"description": "usage of an identified CPU",
"type": "object",
"properties": {
- "cpuIdentifier": {
- "description": "cpu identifer",
- "type": "string"
- },
- "cpuIdle": {
- "description": "percentage of CPU time spent in the idle task",
- "type": "number"
- },
- "cpuUsageInterrupt": {
- "description": "percentage of time spent servicing interrupts",
- "type": "number"
- },
- "cpuUsageNice": {
- "description": "percentage of time spent running user space processes that have been niced",
- "type": "number"
- },
- "cpuUsageSoftIrq": {
- "description": "percentage of time spent handling soft irq interrupts",
- "type": "number"
- },
- "cpuUsageSteal": {
- "description": "percentage of time spent in involuntary wait which is neither user, system or idle time and is effectively time that went missing",
- "type": "number"
- },
- "cpuUsageSystem": {
- "description": "percentage of time spent on system tasks running the kernel",
- "type": "number"
- },
- "cpuUsageUser": {
- "description": "percentage of time spent running un-niced user space processes",
- "type": "number"
- },
- "cpuWait": {
- "description": "percentage of CPU time spent waiting for I/O operations to complete",
- "type": "number"
- },
- "percentUsage": {
- "description": "aggregate cpu usage of the virtual machine on which the VNFC reporting the event is running",
- "type": "number"
- }
+ "cpuIdentifier": {
+ "description": "cpu identifer",
+ "type": "string"
+ },
+ "cpuIdle": {
+ "description": "percentage of CPU time spent in the idle task",
+ "type": "number"
+ },
+ "cpuUsageInterrupt": {
+ "description": "percentage of time spent servicing interrupts",
+ "type": "number"
+ },
+ "cpuUsageNice": {
+ "description": "percentage of time spent running user space processes that have been niced",
+ "type": "number"
+ },
+ "cpuUsageSoftIrq": {
+ "description": "percentage of time spent handling soft irq interrupts",
+ "type": "number"
+ },
+ "cpuUsageSteal": {
+ "description": "percentage of time spent in involuntary wait which is neither user, system or idle time and is effectively time that went missing",
+ "type": "number"
+ },
+ "cpuUsageSystem": {
+ "description": "percentage of time spent on system tasks running the kernel",
+ "type": "number"
+ },
+ "cpuUsageUser": {
+ "description": "percentage of time spent running un-niced user space processes",
+ "type": "number"
+ },
+ "cpuWait": {
+ "description": "percentage of CPU time spent waiting for I/O operations to complete",
+ "type": "number"
+ },
+ "percentUsage": {
+ "description": "aggregate cpu usage of the virtual machine on which the VNFC reporting the event is running",
+ "type": "number"
+ }
},
- "required": [ "cpuIdentifier", "percentUsage" ]
+ "required": [
+ "cpuIdentifier",
+ "percentUsage"
+ ]
},
"diskUsage": {
"description": "usage of an identified disk",
"type": "object",
"properties": {
- "diskIdentifier": {
- "description": "disk identifier",
- "type": "string"
- },
- "diskIoTimeAvg": {
- "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the average over the measurement interval",
- "type": "number"
- },
- "diskIoTimeLast": {
- "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the last value measurement within the measurement interval",
- "type": "number"
- },
- "diskIoTimeMax": {
- "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the maximum value measurement within the measurement interval",
- "type": "number"
- },
- "diskIoTimeMin": {
- "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the minimum value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedReadAvg": {
- "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedReadLast": {
- "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the last value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedReadMax": {
- "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the maximum value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedReadMin": {
- "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the minimum value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedWriteAvg": {
- "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedWriteLast": {
- "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the last value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedWriteMax": {
- "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the maximum value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedWriteMin": {
- "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the minimum value measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsReadAvg": {
- "description": "number of octets per second read from a disk or partition; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsReadLast": {
- "description": "number of octets per second read from a disk or partition; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsReadMax": {
- "description": "number of octets per second read from a disk or partition; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsReadMin": {
- "description": "number of octets per second read from a disk or partition; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsWriteAvg": {
- "description": "number of octets per second written to a disk or partition; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsWriteLast": {
- "description": "number of octets per second written to a disk or partition; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsWriteMax": {
- "description": "number of octets per second written to a disk or partition; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsWriteMin": {
- "description": "number of octets per second written to a disk or partition; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsReadAvg": {
- "description": "number of read operations per second issued to the disk; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsReadLast": {
- "description": "number of read operations per second issued to the disk; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsReadMax": {
- "description": "number of read operations per second issued to the disk; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsReadMin": {
- "description": "number of read operations per second issued to the disk; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsWriteAvg": {
- "description": "number of write operations per second issued to the disk; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsWriteLast": {
- "description": "number of write operations per second issued to the disk; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsWriteMax": {
- "description": "number of write operations per second issued to the disk; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsWriteMin": {
- "description": "number of write operations per second issued to the disk; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskPendingOperationsAvg": {
- "description": "queue size of pending I/O operations per second; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskPendingOperationsLast": {
- "description": "queue size of pending I/O operations per second; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskPendingOperationsMax": {
- "description": "queue size of pending I/O operations per second; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskPendingOperationsMin": {
- "description": "queue size of pending I/O operations per second; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeReadAvg": {
- "description": "milliseconds a read operation took to complete; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeReadLast": {
- "description": "milliseconds a read operation took to complete; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeReadMax": {
- "description": "milliseconds a read operation took to complete; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeReadMin": {
- "description": "milliseconds a read operation took to complete; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeWriteAvg": {
- "description": "milliseconds a write operation took to complete; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeWriteLast": {
- "description": "milliseconds a write operation took to complete; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeWriteMax": {
- "description": "milliseconds a write operation took to complete; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeWriteMin": {
- "description": "milliseconds a write operation took to complete; provide the minimum measurement within the measurement interval",
- "type": "number"
- }
+ "diskIdentifier": {
+ "description": "disk identifier",
+ "type": "string"
+ },
+ "diskIoTimeAvg": {
+ "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the average over the measurement interval",
+ "type": "number"
+ },
+ "diskIoTimeLast": {
+ "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the last value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskIoTimeMax": {
+ "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the maximum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskIoTimeMin": {
+ "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the minimum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedReadAvg": {
+ "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedReadLast": {
+ "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the last value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedReadMax": {
+ "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the maximum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedReadMin": {
+ "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the minimum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedWriteAvg": {
+ "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedWriteLast": {
+ "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the last value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedWriteMax": {
+ "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the maximum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedWriteMin": {
+ "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the minimum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsReadAvg": {
+ "description": "number of octets per second read from a disk or partition; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsReadLast": {
+ "description": "number of octets per second read from a disk or partition; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsReadMax": {
+ "description": "number of octets per second read from a disk or partition; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsReadMin": {
+ "description": "number of octets per second read from a disk or partition; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsWriteAvg": {
+ "description": "number of octets per second written to a disk or partition; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsWriteLast": {
+ "description": "number of octets per second written to a disk or partition; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsWriteMax": {
+ "description": "number of octets per second written to a disk or partition; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsWriteMin": {
+ "description": "number of octets per second written to a disk or partition; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsReadAvg": {
+ "description": "number of read operations per second issued to the disk; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsReadLast": {
+ "description": "number of read operations per second issued to the disk; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsReadMax": {
+ "description": "number of read operations per second issued to the disk; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsReadMin": {
+ "description": "number of read operations per second issued to the disk; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsWriteAvg": {
+ "description": "number of write operations per second issued to the disk; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsWriteLast": {
+ "description": "number of write operations per second issued to the disk; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsWriteMax": {
+ "description": "number of write operations per second issued to the disk; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsWriteMin": {
+ "description": "number of write operations per second issued to the disk; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskPendingOperationsAvg": {
+ "description": "queue size of pending I/O operations per second; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskPendingOperationsLast": {
+ "description": "queue size of pending I/O operations per second; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskPendingOperationsMax": {
+ "description": "queue size of pending I/O operations per second; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskPendingOperationsMin": {
+ "description": "queue size of pending I/O operations per second; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeReadAvg": {
+ "description": "milliseconds a read operation took to complete; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeReadLast": {
+ "description": "milliseconds a read operation took to complete; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeReadMax": {
+ "description": "milliseconds a read operation took to complete; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeReadMin": {
+ "description": "milliseconds a read operation took to complete; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeWriteAvg": {
+ "description": "milliseconds a write operation took to complete; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeWriteLast": {
+ "description": "milliseconds a write operation took to complete; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeWriteMax": {
+ "description": "milliseconds a write operation took to complete; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeWriteMin": {
+ "description": "milliseconds a write operation took to complete; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ }
},
- "required": [ "diskIdentifier" ]
+ "required": [
+ "diskIdentifier"
+ ]
},
- "endOfCallVqmSummaries": {
- "description": "provides end of call voice quality metrics",
+ "endOfCallVqmSummaries": {
+ "description": "provides end of call voice quality metrics",
"type": "object",
"properties": {
- "adjacencyName": {
- "description": " adjacency name",
- "type": "string"
- },
- "endpointDescription": {
- "description": "Either Caller or Callee",
- "type": "string",
- "enum": ["Caller", "Callee"]
- },
- "endpointJitter": {
- "description": "",
- "type": "number"
- },
- "endpointRtpOctetsDiscarded": {
- "description": "",
- "type": "number"
- },
- "endpointRtpOctetsReceived": {
- "description": "",
- "type": "number"
- },
- "endpointRtpOctetsSent": {
- "description": "",
- "type": "number"
- },
- "endpointRtpPacketsDiscarded": {
- "description": "",
- "type": "number"
- },
- "endpointRtpPacketsReceived": {
- "description": "",
- "type": "number"
- },
- "endpointRtpPacketsSent": {
- "description": "",
- "type": "number"
- },
- "localJitter": {
- "description": "",
- "type": "number"
- },
- "localRtpOctetsDiscarded": {
- "description": "",
- "type": "number"
- },
- "localRtpOctetsReceived": {
- "description": "",
- "type": "number"
- },
- "localRtpOctetsSent": {
- "description": "",
- "type": "number"
- },
- "localRtpPacketsDiscarded": {
- "description": "",
- "type": "number"
- },
- "localRtpPacketsReceived": {
- "description": "",
- "type": "number"
- },
- "localRtpPacketsSent": {
- "description": "",
- "type": "number"
- },
- "mosCqe": {
- "description": "1-5 1dp",
- "type": "number"
- },
- "packetsLost": {
- "description": "",
- "type": "number"
- },
- "packetLossPercent": {
- "description" : "Calculated percentage packet loss based on Endpoint RTP packets lost (as reported in RTCP) and Local RTP packets sent. Direction is based on Endpoint description (Caller, Callee). Decimal (2 dp)",
- "type": "number"
- },
- "rFactor": {
- "description": "0-100",
- "type": "number"
- },
- "roundTripDelay": {
- "description": "millisecs",
- "type": "number"
- }
- },
- "required": [ "adjacencyName", "endpointDescription" ]
- },
- "event": {
- "description": "the root level of the common event format",
- "type": "object",
- "properties": {
- "commonEventHeader": { "$ref": "#/definitions/commonEventHeader" },
- "faultFields": { "$ref": "#/definitions/faultFields" },
- "heartbeatFields": { "$ref": "#/definitions/heartbeatFields" },
- "measurementsForVfScalingFields": { "$ref": "#/definitions/measurementsForVfScalingFields" },
- "mobileFlowFields": { "$ref": "#/definitions/mobileFlowFields" },
- "otherFields": { "$ref": "#/definitions/otherFields" },
- "sipSignalingFields": { "$ref": "#/definitions/sipSignalingFields" },
- "stateChangeFields": { "$ref": "#/definitions/stateChangeFields" },
- "syslogFields": { "$ref": "#/definitions/syslogFields" },
- "thresholdCrossingAlertFields": { "$ref": "#/definitions/thresholdCrossingAlertFields" },
- "voiceQualityFields": { "$ref": "#/definitions/voiceQualityFields" }
- },
- "required": [ "commonEventHeader" ]
- },
+ "adjacencyName": {
+ "description": " adjacency name",
+ "type": "string"
+ },
+ "endpointDescription": {
+ "description": "Either Caller or Callee",
+ "type": "string",
+ "enum": [
+ "Caller",
+ "Callee"
+ ]
+ },
+ "endpointJitter": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpOctetsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpOctetsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpOctetsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpPacketsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpPacketsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpPacketsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "localJitter": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpOctetsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpOctetsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpOctetsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpPacketsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpPacketsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpPacketsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "mosCqe": {
+ "description": "1-5 1dp",
+ "type": "number"
+ },
+ "packetsLost": {
+ "description": "",
+ "type": "number"
+ },
+ "packetLossPercent": {
+ "description": "Calculated percentage packet loss based on Endpoint RTP packets lost (as reported in RTCP) and Local RTP packets sent. Direction is based on Endpoint description (Caller, Callee). Decimal (2 dp)",
+ "type": "number"
+ },
+ "rFactor": {
+ "description": "0-100",
+ "type": "number"
+ },
+ "roundTripDelay": {
+ "description": "millisecs",
+ "type": "number"
+ }
+ },
+ "required": [
+ "adjacencyName",
+ "endpointDescription"
+ ]
+ },
+ "event": {
+ "description": "the root level of the common event format",
+ "type": "object",
+ "properties": {
+ "commonEventHeader": {
+ "$ref": "#/definitions/commonEventHeader"
+ },
+ "faultFields": {
+ "$ref": "#/definitions/faultFields"
+ },
+ "heartbeatFields": {
+ "$ref": "#/definitions/heartbeatFields"
+ },
+ "measurementsForVfScalingFields": {
+ "$ref": "#/definitions/measurementsForVfScalingFields"
+ },
+ "mobileFlowFields": {
+ "$ref": "#/definitions/mobileFlowFields"
+ },
+ "otherFields": {
+ "$ref": "#/definitions/otherFields"
+ },
+ "sipSignalingFields": {
+ "$ref": "#/definitions/sipSignalingFields"
+ },
+ "stateChangeFields": {
+ "$ref": "#/definitions/stateChangeFields"
+ },
+ "syslogFields": {
+ "$ref": "#/definitions/syslogFields"
+ },
+ "thresholdCrossingAlertFields": {
+ "$ref": "#/definitions/thresholdCrossingAlertFields"
+ },
+ "voiceQualityFields": {
+ "$ref": "#/definitions/voiceQualityFields"
+ }
+ },
+ "required": [
+ "commonEventHeader"
+ ]
+ },
"eventDomainThrottleSpecification": {
"description": "specification of what information to suppress within an event domain",
"type": "object",
"properties": {
- "eventDomain": {
- "description": "Event domain enum from the commonEventHeader domain field",
- "type": "string"
- },
- "suppressedFieldNames": {
- "description": "List of optional field names in the event block that should not be sent to the Event Listener",
- "type": "array",
+ "eventDomain": {
+ "description": "Event domain enum from the commonEventHeader domain field",
+ "type": "string"
+ },
+ "suppressedFieldNames": {
+ "description": "List of optional field names in the event block that should not be sent to the Event Listener",
+ "type": "array",
"items": {
- "type": "string"
+ "type": "string"
}
- },
+ },
"suppressedNvPairsList": {
"description": "Optional list of specific NvPairsNames to suppress within a given Name-Value Field",
- "type": "array",
+ "type": "array",
"items": {
- "$ref": "#/definitions/suppressedNvPairs"
+ "$ref": "#/definitions/suppressedNvPairs"
}
- }
+ }
},
- "required": [ "eventDomain" ]
+ "required": [
+ "eventDomain"
+ ]
},
"eventDomainThrottleSpecificationList": {
"description": "array of eventDomainThrottleSpecifications",
"type": "array",
"items": {
- "$ref": "#/definitions/eventDomainThrottleSpecification"
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
},
"minItems": 0
},
@@ -544,17 +610,21 @@
"description": "reports the throttling in force at the event source",
"type": "object",
"properties": {
- "eventThrottlingMode": {
- "description": "Mode the event manager is in",
- "type": "string",
+ "eventThrottlingMode": {
+ "description": "Mode the event manager is in",
+ "type": "string",
"enum": [
"normal",
"throttled"
]
- },
- "eventDomainThrottleSpecificationList": { "$ref": "#/definitions/eventDomainThrottleSpecificationList" }
+ },
+ "eventDomainThrottleSpecificationList": {
+ "$ref": "#/definitions/eventDomainThrottleSpecificationList"
+ }
},
- "required": [ "eventThrottlingMode" ]
+ "required": [
+ "eventThrottlingMode"
+ ]
},
"faultFields": {
"description": "fields specific to fault events",
@@ -614,41 +684,82 @@
]
}
},
- "required": [ "alarmCondition", "eventSeverity", "eventSourceType",
- "faultFieldsVersion", "specificProblem", "vfStatus" ]
+ "required": [
+ "alarmCondition",
+ "eventSeverity",
+ "eventSourceType",
+ "faultFieldsVersion",
+ "specificProblem",
+ "vfStatus"
+ ]
},
"featuresInUse": {
"description": "number of times an identified feature was used over the measurementInterval",
"type": "object",
"properties": {
- "featureIdentifier": { "type": "string" },
- "featureUtilization": { "type": "integer" }
+ "featureIdentifier": {
+ "type": "string"
+ },
+ "featureUtilization": {
+ "type": "integer"
+ }
},
- "required": [ "featureIdentifier", "featureUtilization" ]
+ "required": [
+ "featureIdentifier",
+ "featureUtilization"
+ ]
},
"field": {
"description": "name value pair",
"type": "object",
"properties": {
- "name": { "type": "string" },
- "value": { "type": "string" }
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
},
- "required": [ "name", "value" ]
+ "required": [
+ "name",
+ "value"
+ ]
},
"filesystemUsage": {
"description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second",
"type": "object",
"properties": {
- "blockConfigured": { "type": "number" },
- "blockIops": { "type": "number" },
- "blockUsed": { "type": "number" },
- "ephemeralConfigured": { "type": "number" },
- "ephemeralIops": { "type": "number" },
- "ephemeralUsed": { "type": "number" },
- "filesystemName": { "type": "string" }
+ "blockConfigured": {
+ "type": "number"
+ },
+ "blockIops": {
+ "type": "number"
+ },
+ "blockUsed": {
+ "type": "number"
+ },
+ "ephemeralConfigured": {
+ "type": "number"
+ },
+ "ephemeralIops": {
+ "type": "number"
+ },
+ "ephemeralUsed": {
+ "type": "number"
+ },
+ "filesystemName": {
+ "type": "string"
+ }
},
- "required": [ "blockConfigured", "blockIops", "blockUsed", "ephemeralConfigured",
- "ephemeralIops", "ephemeralUsed", "filesystemName" ]
+ "required": [
+ "blockConfigured",
+ "blockIops",
+ "blockUsed",
+ "ephemeralConfigured",
+ "ephemeralIops",
+ "ephemeralUsed",
+ "filesystemName"
+ ]
},
"gtpPerFlowMetrics": {
"description": "Mobility GTP Protocol per flow metrics",
@@ -728,12 +839,16 @@
},
"ipTosCountList": {
"description": "array of key: value pairs where the keys are drawn from the IP Type-of-Service identifiers which range from '0' to '255', and the values are the count of packets that had those ToS identifiers in the flow",
- "type": "array",
- "items": {
+ "type": "array",
+ "items": {
"type": "array",
"items": [
- { "type": "string" },
- { "type": "number" }
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
]
}
},
@@ -766,12 +881,16 @@
},
"mobileQciCosCountList": {
"description": "array of key: value pairs where the keys are drawn from LTE QCI or UMTS class of service strings, and the values are the count of packets that had those strings in the flow",
- "type": "array",
- "items": {
+ "type": "array",
+ "items": {
"type": "array",
"items": [
- { "type": "string" },
- { "type": "number" }
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
]
}
},
@@ -864,12 +983,16 @@
},
"tcpFlagCountList": {
"description": "array of key: value pairs where the keys are drawn from TCP Flags and the values are the count of packets that had that TCP Flag in the flow",
- "type": "array",
- "items": {
+ "type": "array",
+ "items": {
"type": "array",
"items": [
- { "type": "string" },
- { "type": "number" }
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
]
}
},
@@ -885,21 +1008,37 @@
"type": "number"
}
},
- "required": [ "avgBitErrorRate", "avgPacketDelayVariation", "avgPacketLatency",
- "avgReceiveThroughput", "avgTransmitThroughput",
- "flowActivationEpoch", "flowActivationMicrosec",
- "flowDeactivationEpoch", "flowDeactivationMicrosec",
- "flowDeactivationTime", "flowStatus",
- "maxPacketDelayVariation", "numActivationFailures",
- "numBitErrors", "numBytesReceived", "numBytesTransmitted",
- "numDroppedPackets", "numL7BytesReceived",
- "numL7BytesTransmitted", "numLostPackets",
- "numOutOfOrderPackets", "numPacketErrors",
- "numPacketsReceivedExclRetrans",
- "numPacketsReceivedInclRetrans",
- "numPacketsTransmittedInclRetrans",
- "numRetries", "numTimeouts", "numTunneledL7BytesReceived",
- "roundTripTime", "timeToFirstByte"
+ "required": [
+ "avgBitErrorRate",
+ "avgPacketDelayVariation",
+ "avgPacketLatency",
+ "avgReceiveThroughput",
+ "avgTransmitThroughput",
+ "flowActivationEpoch",
+ "flowActivationMicrosec",
+ "flowDeactivationEpoch",
+ "flowDeactivationMicrosec",
+ "flowDeactivationTime",
+ "flowStatus",
+ "maxPacketDelayVariation",
+ "numActivationFailures",
+ "numBitErrors",
+ "numBytesReceived",
+ "numBytesTransmitted",
+ "numDroppedPackets",
+ "numL7BytesReceived",
+ "numL7BytesTransmitted",
+ "numLostPackets",
+ "numOutOfOrderPackets",
+ "numPacketErrors",
+ "numPacketsReceivedExclRetrans",
+ "numPacketsReceivedInclRetrans",
+ "numPacketsTransmittedInclRetrans",
+ "numRetries",
+ "numTimeouts",
+ "numTunneledL7BytesReceived",
+ "roundTripTime",
+ "timeToFirstByte"
]
},
"heartbeatFields": {
@@ -922,7 +1061,10 @@
"type": "integer"
}
},
- "required": [ "heartbeatFieldsVersion", "heartbeatInterval" ]
+ "required": [
+ "heartbeatFieldsVersion",
+ "heartbeatInterval"
+ ]
},
"internalHeaderFields": {
"description": "enrichment fields for internal VES Event Listener service use only, not supplied by event sources",
@@ -932,86 +1074,101 @@
"description": "json object schema, name and other meta-information along with one or more object instances",
"type": "object",
"properties": {
- "objectInstances": {
- "description": "one or more instances of the jsonObject",
- "type": "array",
- "items": {
- "$ref": "#/definitions/jsonObjectInstance"
- }
- },
- "objectName": {
- "description": "name of the JSON Object",
- "type": "string"
- },
- "objectSchema": {
- "description": "json schema for the object",
- "type": "string"
- },
- "objectSchemaUrl": {
- "description": "Url to the json schema for the object",
- "type": "string"
- },
- "nfSubscribedObjectName": {
- "description": "name of the object associated with the nfSubscriptonId",
- "type": "string"
- },
- "nfSubscriptionId": {
- "description": "identifies an openConfig telemetry subscription on a network function, which configures the network function to send complex object data associated with the jsonObject",
- "type": "string"
- }
+ "objectInstances": {
+ "description": "one or more instances of the jsonObject",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/jsonObjectInstance"
+ }
+ },
+ "objectName": {
+ "description": "name of the JSON Object",
+ "type": "string"
+ },
+ "objectSchema": {
+ "description": "json schema for the object",
+ "type": "string"
+ },
+ "objectSchemaUrl": {
+ "description": "Url to the json schema for the object",
+ "type": "string"
+ },
+ "nfSubscribedObjectName": {
+ "description": "name of the object associated with the nfSubscriptonId",
+ "type": "string"
+ },
+ "nfSubscriptionId": {
+ "description": "identifies an openConfig telemetry subscription on a network function, which configures the network function to send complex object data associated with the jsonObject",
+ "type": "string"
+ }
},
- "required": [ "objectInstances", "objectName" ]
+ "required": [
+ "objectInstances",
+ "objectName"
+ ]
},
"jsonObjectInstance": {
"description": "meta-information about an instance of a jsonObject along with the actual object instance",
"type": "object",
"properties": {
- "objectInstance": {
- "description": "an instance conforming to the jsonObject schema",
- "type": "object"
- },
- "objectInstanceEpochMicrosec": {
- "description": "the unix time aka epoch time associated with this objectInstance--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
- "type": "number"
- },
- "objectKeys": {
- "description": "an ordered set of keys that identifies this particular instance of jsonObject",
- "type": "array",
- "items": {
- "$ref": "#/definitions/key"
- }
- }
+ "objectInstance": {
+ "description": "an instance conforming to the jsonObject schema",
+ "type": "object"
+ },
+ "objectInstanceEpochMicrosec": {
+ "description": "the unix time aka epoch time associated with this objectInstance--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "objectKeys": {
+ "description": "an ordered set of keys that identifies this particular instance of jsonObject",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/key"
+ }
+ }
},
- "required": [ "objectInstance" ]
+ "required": [
+ "objectInstance"
+ ]
},
"key": {
"description": "tuple which provides the name of a key along with its value and relative order",
"type": "object",
"properties": {
- "keyName": {
- "description": "name of the key",
- "type": "string"
+ "keyName": {
+ "description": "name of the key",
+ "type": "string"
},
- "keyOrder": {
- "description": "relative sequence or order of the key with respect to other keys",
- "type": "integer"
+ "keyOrder": {
+ "description": "relative sequence or order of the key with respect to other keys",
+ "type": "integer"
},
- "keyValue": {
- "description": "value of the key",
- "type": "string"
+ "keyValue": {
+ "description": "value of the key",
+ "type": "string"
}
},
- "required": [ "keyName" ]
+ "required": [
+ "keyName"
+ ]
},
"latencyBucketMeasure": {
"description": "number of counts falling within a defined latency bucket",
"type": "object",
"properties": {
- "countsInTheBucket": { "type": "number" },
- "highEndOfLatencyBucket": { "type": "number" },
- "lowEndOfLatencyBucket": { "type": "number" }
+ "countsInTheBucket": {
+ "type": "number"
+ },
+ "highEndOfLatencyBucket": {
+ "type": "number"
+ },
+ "lowEndOfLatencyBucket": {
+ "type": "number"
+ }
},
- "required": [ "countsInTheBucket" ]
+ "required": [
+ "countsInTheBucket"
+ ]
},
"measurementsForVfScalingFields": {
"description": "measurementsForVfScaling fields",
@@ -1031,13 +1188,13 @@
"$ref": "#/definitions/namedArrayOfFields"
}
},
- "additionalObjects": {
- "description": "array of JSON objects described by name, schema and other meta-information",
+ "additionalObjects": {
+ "description": "array of JSON objects described by name, schema and other meta-information",
"type": "array",
"items": {
- "$ref": "#/definitions/jsonObject"
+ "$ref": "#/definitions/jsonObject"
}
- },
+ },
"codecUsageArray": {
"description": "array of codecs in use",
"type": "array",
@@ -1060,7 +1217,7 @@
"$ref": "#/definitions/cpuUsage"
}
},
- "diskUsageArray": {
+ "diskUsageArray": {
"description": "usage of an array of disks",
"type": "array",
"items": {
@@ -1127,46 +1284,53 @@
}
}
},
- "required": [ "measurementInterval", "measurementsForVfScalingVersion" ]
+ "required": [
+ "measurementInterval",
+ "measurementsForVfScalingVersion"
+ ]
},
"memoryUsage": {
"description": "memory usage of an identified virtual machine",
"type": "object",
"properties": {
- "memoryBuffered": {
- "description": "kibibytes of temporary storage for raw disk blocks",
- "type": "number"
- },
- "memoryCached": {
- "description": "kibibytes of memory used for cache",
- "type": "number"
- },
- "memoryConfigured": {
- "description": "kibibytes of memory configured in the virtual machine on which the VNFC reporting the event is running",
- "type": "number"
- },
- "memoryFree": {
- "description": "kibibytes of physical RAM left unused by the system",
- "type": "number"
- },
- "memorySlabRecl": {
- "description": "the part of the slab that can be reclaimed such as caches measured in kibibytes",
- "type": "number"
- },
- "memorySlabUnrecl": {
- "description": "the part of the slab that cannot be reclaimed even when lacking memory measured in kibibytes",
- "type": "number"
- },
- "memoryUsed": {
- "description": "total memory minus the sum of free, buffered, cached and slab memory measured in kibibytes",
- "type": "number"
- },
- "vmIdentifier": {
- "description": "virtual machine identifier associated with the memory metrics",
- "type": "string"
- }
+ "memoryBuffered": {
+ "description": "kibibytes of temporary storage for raw disk blocks",
+ "type": "number"
+ },
+ "memoryCached": {
+ "description": "kibibytes of memory used for cache",
+ "type": "number"
+ },
+ "memoryConfigured": {
+ "description": "kibibytes of memory configured in the virtual machine on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "memoryFree": {
+ "description": "kibibytes of physical RAM left unused by the system",
+ "type": "number"
+ },
+ "memorySlabRecl": {
+ "description": "the part of the slab that can be reclaimed such as caches measured in kibibytes",
+ "type": "number"
+ },
+ "memorySlabUnrecl": {
+ "description": "the part of the slab that cannot be reclaimed even when lacking memory measured in kibibytes",
+ "type": "number"
+ },
+ "memoryUsed": {
+ "description": "total memory minus the sum of free, buffered, cached and slab memory measured in kibibytes",
+ "type": "number"
+ },
+ "vmIdentifier": {
+ "description": "virtual machine identifier associated with the memory metrics",
+ "type": "string"
+ }
},
- "required": [ "memoryFree", "memoryUsed", "vmIdentifier" ]
+ "required": [
+ "memoryFree",
+ "memoryUsed",
+ "vmIdentifier"
+ ]
},
"mobileFlowFields": {
"description": "mobileFlow fields",
@@ -1207,7 +1371,9 @@
"description": "Flow direction, indicating if the reporting node is the source of the flow or destination for the flow",
"type": "string"
},
- "gtpPerFlowMetrics": { "$ref": "#/definitions/gtpPerFlowMetrics" },
+ "gtpPerFlowMetrics": {
+ "$ref": "#/definitions/gtpPerFlowMetrics"
+ },
"gtpProtocolType": {
"description": "GTP protocol",
"type": "string"
@@ -1248,10 +1414,10 @@
"description": "mobile network code",
"type": "string"
},
- "mobileFlowFieldsVersion": {
- "description": "version of the mobileFlowFields block",
- "type": "number"
- },
+ "mobileFlowFieldsVersion": {
+ "description": "version of the mobileFlowFields block",
+ "type": "number"
+ },
"msisdn": {
"description": "MSISDN for the subscriber UE used in this flow, as an integer, if the flow connects to a mobile device",
"type": "string"
@@ -1305,24 +1471,37 @@
"type": "string"
}
},
- "required": [ "flowDirection", "gtpPerFlowMetrics", "ipProtocolType", "ipVersion",
- "mobileFlowFieldsVersion", "otherEndpointIpAddress", "otherEndpointPort",
- "reportingEndpointIpAddr", "reportingEndpointPort" ]
+ "required": [
+ "flowDirection",
+ "gtpPerFlowMetrics",
+ "ipProtocolType",
+ "ipVersion",
+ "mobileFlowFieldsVersion",
+ "otherEndpointIpAddress",
+ "otherEndpointPort",
+ "reportingEndpointIpAddr",
+ "reportingEndpointPort"
+ ]
},
"namedArrayOfFields": {
"description": "an array of name value pairs along with a name for the array",
"type": "object",
"properties": {
- "name": { "type": "string" },
+ "name": {
+ "type": "string"
+ },
"arrayOfFields": {
"description": "array of name value pairs",
"type": "array",
- "items": {
- "$ref": "#/definitions/field"
+ "items": {
+ "$ref": "#/definitions/field"
}
}
},
- "required": [ "name", "arrayOfFields" ]
+ "required": [
+ "name",
+ "arrayOfFields"
+ ]
},
"otherFields": {
"description": "fields for events belonging to the 'other' domain of the commonEventHeader domain enumeration",
@@ -1335,32 +1514,34 @@
"$ref": "#/definitions/namedArrayOfFields"
}
},
- "jsonObjects": {
- "description": "array of JSON objects described by name, schema and other meta-information",
+ "jsonObjects": {
+ "description": "array of JSON objects described by name, schema and other meta-information",
"type": "array",
"items": {
- "$ref": "#/definitions/jsonObject"
+ "$ref": "#/definitions/jsonObject"
}
- },
+ },
"nameValuePairs": {
"description": "array of name-value pairs",
"type": "array",
"items": {
"$ref": "#/definitions/field"
}
- },
- "otherFieldsVersion": {
- "description": "version of the otherFields block",
- "type": "number"
- }
- },
- "required": [ "otherFieldsVersion" ]
+ },
+ "otherFieldsVersion": {
+ "description": "version of the otherFields block",
+ "type": "number"
+ }
+ },
+ "required": [
+ "otherFieldsVersion"
+ ]
},
"requestError": {
"description": "standard request error data structure",
"type": "object",
"properties": {
- "messageId": {
+ "messageId": {
"description": "Unique message identifier of the format ABCnnnn where ABC is either SVC for Service Exceptions or POL for Policy Exception",
"type": "string"
},
@@ -1377,58 +1558,68 @@
"type": "string"
}
},
- "required": [ "messageId", "text" ]
+ "required": [
+ "messageId",
+ "text"
+ ]
},
- "sipSignalingFields": {
- "description": "sip signaling fields",
- "type": "object",
- "properties": {
- "additionalInformation": {
+ "sipSignalingFields": {
+ "description": "sip signaling fields",
+ "type": "object",
+ "properties": {
+ "additionalInformation": {
"description": "additional sip signaling fields if needed",
"type": "array",
- "items": {
- "$ref": "#/definitions/field"
+ "items": {
+ "$ref": "#/definitions/field"
}
- },
- "compressedSip": {
- "description": "the full SIP request/response including headers and bodies",
- "type": "string"
- },
- "correlator": {
- "description": "this is the same for all events on this call",
- "type": "string"
- },
- "localIpAddress": {
- "description": "IP address on VNF",
- "type": "string"
- },
- "localPort": {
- "description": "port on VNF",
- "type": "string"
- },
- "remoteIpAddress": {
- "description": "IP address of peer endpoint",
- "type": "string"
- },
- "remotePort": {
- "description": "port of peer endpoint",
- "type": "string"
- },
- "sipSignalingFieldsVersion": {
- "description": "version of the sipSignalingFields block",
- "type": "number"
- },
- "summarySip": {
- "description": "the SIP Method or Response (‘INVITE’, ‘200 OK’, ‘BYE’, etc)",
- "type": "string"
- },
- "vendorVnfNameFields": {
- "$ref": "#/definitions/vendorVnfNameFields"
- }
- },
- "required": [ "correlator", "localIpAddress", "localPort", "remoteIpAddress",
- "remotePort", "sipSignalingFieldsVersion", "vendorVnfNameFields" ]
- },
+ },
+ "compressedSip": {
+ "description": "the full SIP request/response including headers and bodies",
+ "type": "string"
+ },
+ "correlator": {
+ "description": "this is the same for all events on this call",
+ "type": "string"
+ },
+ "localIpAddress": {
+ "description": "IP address on VNF",
+ "type": "string"
+ },
+ "localPort": {
+ "description": "port on VNF",
+ "type": "string"
+ },
+ "remoteIpAddress": {
+ "description": "IP address of peer endpoint",
+ "type": "string"
+ },
+ "remotePort": {
+ "description": "port of peer endpoint",
+ "type": "string"
+ },
+ "sipSignalingFieldsVersion": {
+ "description": "version of the sipSignalingFields block",
+ "type": "number"
+ },
+ "summarySip": {
+ "description": "the SIP Method or Response (‘INVITE’, ‘200 OK’, ‘BYE’, etc)",
+ "type": "string"
+ },
+ "vendorVnfNameFields": {
+ "$ref": "#/definitions/vendorVnfNameFields"
+ }
+ },
+ "required": [
+ "correlator",
+ "localIpAddress",
+ "localPort",
+ "remoteIpAddress",
+ "remotePort",
+ "sipSignalingFieldsVersion",
+ "vendorVnfNameFields"
+ ]
+ },
"stateChangeFields": {
"description": "stateChange fields",
"type": "object",
@@ -1467,7 +1658,12 @@
"type": "string"
}
},
- "required": [ "newState", "oldState", "stateChangeFieldsVersion", "stateInterface" ]
+ "required": [
+ "newState",
+ "oldState",
+ "stateChangeFieldsVersion",
+ "stateInterface"
+ ]
},
"suppressedNvPairs": {
"description": "List of specific NvPairsNames to suppress within a given Name-Value Field for event Throttling",
@@ -1479,13 +1675,16 @@
},
"suppressedNvPairNames": {
"description": "Array of nvpair names to suppress within the nvpairFieldName",
- "type": "array",
+ "type": "array",
"items": {
- "type": "string"
+ "type": "string"
}
}
},
- "required": [ "nvPairFieldName", "suppressedNvPairNames" ]
+ "required": [
+ "nvPairFieldName",
+ "suppressedNvPairNames"
+ ]
},
"syslogFields": {
"description": "sysLog fields",
@@ -1558,7 +1757,12 @@
"type": "number"
}
},
- "required": [ "eventSourceType", "syslogFieldsVersion", "syslogMsg", "syslogTag" ]
+ "required": [
+ "eventSourceType",
+ "syslogFieldsVersion",
+ "syslogMsg",
+ "syslogTag"
+ ]
},
"thresholdCrossingAlertFields": {
"description": "fields specific to threshold crossing alert events",
@@ -1567,8 +1771,8 @@
"additionalFields": {
"description": "additional threshold crossing alert fields if needed",
"type": "array",
- "items": {
- "$ref": "#/definitions/field"
+ "items": {
+ "$ref": "#/definitions/field"
}
},
"additionalParameters": {
@@ -1608,7 +1812,9 @@
"associatedAlertIdList": {
"description": "List of eventIds associated with the event being reported",
"type": "array",
- "items": { "type": "string" }
+ "items": {
+ "type": "string"
+ }
},
"collectionTimestamp": {
"description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
@@ -1682,7 +1888,9 @@
"type": "string"
}
},
- "required": [ "vendorName" ]
+ "required": [
+ "vendorName"
+ ]
},
"vNicPerformance": {
"description": "describes the performance and errors of an identified virtual network interface card",
@@ -1803,64 +2011,78 @@
"valuesAreSuspect": {
"description": "Indicates whether vNicPerformance values are likely inaccurate due to counter overflow or other condtions",
"type": "string",
- "enum": [ "true", "false" ]
+ "enum": [
+ "true",
+ "false"
+ ]
},
"vNicIdentifier": {
"description": "vNic identification",
"type": "string"
}
},
- "required": [ "valuesAreSuspect", "vNicIdentifier" ]
+ "required": [
+ "valuesAreSuspect",
+ "vNicIdentifier"
+ ]
},
- "voiceQualityFields": {
- "description": "provides statistics related to customer facing voice products",
- "type": "object",
- "properties": {
- "additionalInformation": {
+ "voiceQualityFields": {
+ "description": "provides statistics related to customer facing voice products",
+ "type": "object",
+ "properties": {
+ "additionalInformation": {
"description": "additional voice quality fields if needed",
"type": "array",
- "items": {
- "$ref": "#/definitions/field"
+ "items": {
+ "$ref": "#/definitions/field"
}
- },
- "calleeSideCodec": {
- "description": "callee codec for the call",
- "type": "string"
- },
- "callerSideCodec": {
- "description": "caller codec for the call",
- "type": "string"
- },
- "correlator": {
- "description": "this is the same for all events on this call",
- "type": "string"
- },
- "endOfCallVqmSummaries": {
- "$ref": "#/definitions/endOfCallVqmSummaries"
- },
- "phoneNumber": {
- "description": "phone number associated with the correlator",
- "type": "string"
- },
- "midCallRtcp": {
- "description": "Base64 encoding of the binary RTCP data excluding Eth/IP/UDP headers",
- "type": "string"
- },
- "vendorVnfNameFields": {
- "$ref": "#/definitions/vendorVnfNameFields"
- },
- "voiceQualityFieldsVersion": {
- "description": "version of the voiceQualityFields block",
- "type": "number"
- }
- },
- "required": [ "calleeSideCodec", "callerSideCodec", "correlator", "midCallRtcp",
- "vendorVnfNameFields", "voiceQualityFieldsVersion" ]
- }
+ },
+ "calleeSideCodec": {
+ "description": "callee codec for the call",
+ "type": "string"
+ },
+ "callerSideCodec": {
+ "description": "caller codec for the call",
+ "type": "string"
+ },
+ "correlator": {
+ "description": "this is the same for all events on this call",
+ "type": "string"
+ },
+ "endOfCallVqmSummaries": {
+ "$ref": "#/definitions/endOfCallVqmSummaries"
+ },
+ "phoneNumber": {
+ "description": "phone number associated with the correlator",
+ "type": "string"
+ },
+ "midCallRtcp": {
+ "description": "Base64 encoding of the binary RTCP data excluding Eth/IP/UDP headers",
+ "type": "string"
+ },
+ "vendorVnfNameFields": {
+ "$ref": "#/definitions/vendorVnfNameFields"
+ },
+ "voiceQualityFieldsVersion": {
+ "description": "version of the voiceQualityFields block",
+ "type": "number"
+ }
+ },
+ "required": [
+ "calleeSideCodec",
+ "callerSideCodec",
+ "correlator",
+ "midCallRtcp",
+ "vendorVnfNameFields",
+ "voiceQualityFieldsVersion"
+ ]
+ }
},
"title": "Event Listener",
"type": "object",
"properties": {
- "event": {"$ref": "#/definitions/event"}
- }
+ "event": {
+ "$ref": "#/definitions/event"
+ }
+ }
}
diff --git a/etc/CommonEventFormat_28.4.json b/etc/CommonEventFormat_28.4.1.json
index cc0ce73b..7ebb6dc1 100644..100755
--- a/etc/CommonEventFormat_28.4.json
+++ b/etc/CommonEventFormat_28.4.1.json
@@ -1,1889 +1,2113 @@
-{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "title": "VES Event Listener",
- "type": "object",
- "properties": {
- "event": {"$ref": "#/definitions/event"},
- "eventList": {"$ref": "#/definitions/eventList"}
- },
-
- "definitions": {
- "schemaHeaderBlock": {
- "description": "schema date, version, author and associated API",
- "type": "object",
- "properties": {
- "associatedApi": {
- "description": "VES Event Listener",
- "type": "string"
- },
- "lastUpdatedBy": {
- "description": "re2947",
- "type": "string"
- },
- "schemaDate": {
- "description": "September 12, 2017",
- "type": "string"
- },
- "schemaVersion": {
- "description": "28.4",
- "type": "number"
- }
- }
- },
- "attCopyrightNotice": {
- "description": "Copyright (c) <2017>, AT&T Intellectual Property. All rights reserved. Licensed under the Apache License, Version 2.0 (the License)",
- "type": "object",
- "properties": {
- "useAndRedistribution": {
- "description": "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",
- "type": "string"
- },
- "licenseLink": {
- "description": "http://www.apache.org/licenses/LICENSE-2.0",
- "type":"string"
- },
- "condition1": {
- "description": "Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an AS IS BASIS,",
- "type": "string"
- },
- "condition2": {
- "description": "Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.",
- "type": "string"
- },
- "condition3": {
- "description": "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
- "type": "string"
- },
- "condition4": {
- "description": "See the License for the specific language governing permissions and limitations under the License.",
- "type": "string"
- },
- "Trademarks": {
- "description": "ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property.",
- "type": "string"
- }
- }
- },
-
- "codecsInUse": {
- "description": "number of times an identified codec was used over the measurementInterval",
- "type": "object",
- "properties": {
- "codecIdentifier": { "type": "string" },
- "numberInUse": { "type": "integer" }
- },
- "required": [ "codecIdentifier", "numberInUse" ]
- },
- "command": {
- "description": "command from an event collector toward an event source",
- "type": "object",
- "properties": {
- "commandType": {
- "type": "string",
- "enum": [
- "heartbeatIntervalChange",
- "measurementIntervalChange",
- "provideThrottlingState",
- "throttlingSpecification"
- ]
- },
- "eventDomainThrottleSpecification": { "$ref": "#/definitions/eventDomainThrottleSpecification" },
- "heartbeatInterval": { "type": "integer" },
- "measurementInterval": { "type": "integer" }
- },
- "required": [ "commandType" ]
- },
- "commandList": {
- "description": "array of commands from an event collector toward an event source",
- "type": "array",
- "items": {
- "$ref": "#/definitions/command"
- },
- "minItems": 0
- },
- "commonEventHeader": {
- "description": "fields common to all events",
- "type": "object",
- "properties": {
- "domain": {
- "description": "the eventing domain associated with the event",
- "type": "string",
- "enum": [
- "fault",
- "heartbeat",
- "measurementsForVfScaling",
- "mobileFlow",
- "other",
- "sipSignaling",
- "stateChange",
- "syslog",
- "thresholdCrossingAlert",
- "voiceQuality"
- ]
- },
- "eventId": {
- "description": "event key that is unique to the event source",
- "type": "string"
- },
- "eventName": {
- "description": "unique event name",
- "type": "string"
- },
- "eventType": {
- "description": "for example - applicationVnf, guestOS, hostOS, platform",
- "type": "string"
- },
- "internalHeaderFields": { "$ref": "#/definitions/internalHeaderFields" },
- "lastEpochMicrosec": {
- "description": "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
- "type": "number"
- },
- "nfcNamingCode": {
- "description": "3 character network function component type, aligned with vfc naming standards",
- "type": "string"
- },
- "nfNamingCode": {
- "description": "4 character network function type, aligned with vnf naming standards",
- "type": "string"
- },
- "priority": {
- "description": "processing priority",
- "type": "string",
- "enum": [
- "High",
- "Medium",
- "Normal",
- "Low"
- ]
- },
- "reportingEntityId": {
- "description": "UUID identifying the entity reporting the event, for example an OAM VM; must be populated by the ATT enrichment process",
- "type": "string"
- },
- "reportingEntityName": {
- "description": "name of the entity reporting the event, for example, an EMS name; may be the same as sourceName",
- "type": "string"
- },
- "sequence": {
- "description": "ordering of events communicated by an event source instance or 0 if not needed",
- "type": "integer"
- },
- "sourceId": {
- "description": "UUID identifying the entity experiencing the event issue; must be populated by the ATT enrichment process",
- "type": "string"
- },
- "sourceName": {
- "description": "name of the entity experiencing the event issue",
- "type": "string"
- },
- "startEpochMicrosec": {
- "description": "the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
- "type": "number"
- },
- "version": {
- "description": "version of the event header",
- "type": "number"
- }
- },
- "required": [ "domain", "eventId", "eventName", "lastEpochMicrosec",
- "priority", "reportingEntityName", "sequence", "sourceName",
- "startEpochMicrosec", "version" ]
- },
- "counter": {
- "description": "performance counter",
- "type": "object",
- "properties": {
- "criticality": { "type": "string", "enum": [ "CRIT", "MAJ" ] },
- "name": { "type": "string" },
- "thresholdCrossed": { "type": "string" },
- "value": { "type": "string"}
- },
- "required": [ "criticality", "name", "thresholdCrossed", "value" ]
- },
- "cpuUsage": {
- "description": "usage of an identified CPU",
- "type": "object",
- "properties": {
- "cpuIdentifier": {
- "description": "cpu identifer",
- "type": "string"
- },
- "cpuIdle": {
- "description": "percentage of CPU time spent in the idle task",
- "type": "number"
- },
- "cpuUsageInterrupt": {
- "description": "percentage of time spent servicing interrupts",
- "type": "number"
- },
- "cpuUsageNice": {
- "description": "percentage of time spent running user space processes that have been niced",
- "type": "number"
- },
- "cpuUsageSoftIrq": {
- "description": "percentage of time spent handling soft irq interrupts",
- "type": "number"
- },
- "cpuUsageSteal": {
- "description": "percentage of time spent in involuntary wait which is neither user, system or idle time and is effectively time that went missing",
- "type": "number"
- },
- "cpuUsageSystem": {
- "description": "percentage of time spent on system tasks running the kernel",
- "type": "number"
- },
- "cpuUsageUser": {
- "description": "percentage of time spent running un-niced user space processes",
- "type": "number"
- },
- "cpuWait": {
- "description": "percentage of CPU time spent waiting for I/O operations to complete",
- "type": "number"
- },
- "percentUsage": {
- "description": "aggregate cpu usage of the virtual machine on which the VNFC reporting the event is running",
- "type": "number"
- }
- },
- "required": [ "cpuIdentifier", "percentUsage" ]
- },
- "diskUsage": {
- "description": "usage of an identified disk",
- "type": "object",
- "properties": {
- "diskIdentifier": {
- "description": "disk identifier",
- "type": "string"
- },
- "diskIoTimeAvg": {
- "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the average over the measurement interval",
- "type": "number"
- },
- "diskIoTimeLast": {
- "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the last value measurement within the measurement interval",
- "type": "number"
- },
- "diskIoTimeMax": {
- "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the maximum value measurement within the measurement interval",
- "type": "number"
- },
- "diskIoTimeMin": {
- "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the minimum value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedReadAvg": {
- "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedReadLast": {
- "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the last value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedReadMax": {
- "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the maximum value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedReadMin": {
- "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the minimum value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedWriteAvg": {
- "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedWriteLast": {
- "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the last value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedWriteMax": {
- "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the maximum value measurement within the measurement interval",
- "type": "number"
- },
- "diskMergedWriteMin": {
- "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the minimum value measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsReadAvg": {
- "description": "number of octets per second read from a disk or partition; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsReadLast": {
- "description": "number of octets per second read from a disk or partition; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsReadMax": {
- "description": "number of octets per second read from a disk or partition; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsReadMin": {
- "description": "number of octets per second read from a disk or partition; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsWriteAvg": {
- "description": "number of octets per second written to a disk or partition; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsWriteLast": {
- "description": "number of octets per second written to a disk or partition; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsWriteMax": {
- "description": "number of octets per second written to a disk or partition; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskOctetsWriteMin": {
- "description": "number of octets per second written to a disk or partition; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsReadAvg": {
- "description": "number of read operations per second issued to the disk; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsReadLast": {
- "description": "number of read operations per second issued to the disk; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsReadMax": {
- "description": "number of read operations per second issued to the disk; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsReadMin": {
- "description": "number of read operations per second issued to the disk; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsWriteAvg": {
- "description": "number of write operations per second issued to the disk; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsWriteLast": {
- "description": "number of write operations per second issued to the disk; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsWriteMax": {
- "description": "number of write operations per second issued to the disk; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskOpsWriteMin": {
- "description": "number of write operations per second issued to the disk; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskPendingOperationsAvg": {
- "description": "queue size of pending I/O operations per second; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskPendingOperationsLast": {
- "description": "queue size of pending I/O operations per second; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskPendingOperationsMax": {
- "description": "queue size of pending I/O operations per second; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskPendingOperationsMin": {
- "description": "queue size of pending I/O operations per second; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeReadAvg": {
- "description": "milliseconds a read operation took to complete; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeReadLast": {
- "description": "milliseconds a read operation took to complete; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeReadMax": {
- "description": "milliseconds a read operation took to complete; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeReadMin": {
- "description": "milliseconds a read operation took to complete; provide the minimum measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeWriteAvg": {
- "description": "milliseconds a write operation took to complete; provide the average measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeWriteLast": {
- "description": "milliseconds a write operation took to complete; provide the last measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeWriteMax": {
- "description": "milliseconds a write operation took to complete; provide the maximum measurement within the measurement interval",
- "type": "number"
- },
- "diskTimeWriteMin": {
- "description": "milliseconds a write operation took to complete; provide the minimum measurement within the measurement interval",
- "type": "number"
- }
- },
- "required": [ "diskIdentifier" ]
- },
- "endOfCallVqmSummaries": {
- "description": "provides end of call voice quality metrics",
- "type": "object",
- "properties": {
- "adjacencyName": {
- "description": " adjacency name",
- "type": "string"
- },
- "endpointDescription": {
- "description": "Either Caller or Callee",
- "type": "string",
- "enum": ["Caller", "Callee"]
- },
- "endpointJitter": {
- "description": "",
- "type": "number"
- },
- "endpointRtpOctetsDiscarded": {
- "description": "",
- "type": "number"
- },
- "endpointRtpOctetsReceived": {
- "description": "",
- "type": "number"
- },
- "endpointRtpOctetsSent": {
- "description": "",
- "type": "number"
- },
- "endpointRtpPacketsDiscarded": {
- "description": "",
- "type": "number"
- },
- "endpointRtpPacketsReceived": {
- "description": "",
- "type": "number"
- },
- "endpointRtpPacketsSent": {
- "description": "",
- "type": "number"
- },
- "localJitter": {
- "description": "",
- "type": "number"
- },
- "localRtpOctetsDiscarded": {
- "description": "",
- "type": "number"
- },
- "localRtpOctetsReceived": {
- "description": "",
- "type": "number"
- },
- "localRtpOctetsSent": {
- "description": "",
- "type": "number"
- },
- "localRtpPacketsDiscarded": {
- "description": "",
- "type": "number"
- },
- "localRtpPacketsReceived": {
- "description": "",
- "type": "number"
- },
- "localRtpPacketsSent": {
- "description": "",
- "type": "number"
- },
- "mosCqe": {
- "description": "1-5 1dp",
- "type": "number"
- },
- "packetsLost": {
- "description": "",
- "type": "number"
- },
- "packetLossPercent": {
- "description" : "Calculated percentage packet loss based on Endpoint RTP packets lost (as reported in RTCP) and Local RTP packets sent. Direction is based on Endpoint description (Caller, Callee). Decimal (2 dp)",
- "type": "number"
- },
- "rFactor": {
- "description": "0-100",
- "type": "number"
- },
- "roundTripDelay": {
- "description": "millisecs",
- "type": "number"
- }
- },
- "required": [ "adjacencyName", "endpointDescription" ]
- },
- "event": {
- "description": "the root level of the common event format",
- "type": "object",
- "properties": {
- "commonEventHeader": { "$ref": "#/definitions/commonEventHeader" },
- "faultFields": { "$ref": "#/definitions/faultFields" },
- "heartbeatFields": { "$ref": "#/definitions/heartbeatFields" },
- "measurementsForVfScalingFields": { "$ref": "#/definitions/measurementsForVfScalingFields" },
- "mobileFlowFields": { "$ref": "#/definitions/mobileFlowFields" },
- "otherFields": { "$ref": "#/definitions/otherFields" },
- "sipSignalingFields": { "$ref": "#/definitions/sipSignalingFields" },
- "stateChangeFields": { "$ref": "#/definitions/stateChangeFields" },
- "syslogFields": { "$ref": "#/definitions/syslogFields" },
- "thresholdCrossingAlertFields": { "$ref": "#/definitions/thresholdCrossingAlertFields" },
- "voiceQualityFields": { "$ref": "#/definitions/voiceQualityFields" }
- },
- "required": [ "commonEventHeader" ]
- },
- "eventDomainThrottleSpecification": {
- "description": "specification of what information to suppress within an event domain",
- "type": "object",
- "properties": {
- "eventDomain": {
- "description": "Event domain enum from the commonEventHeader domain field",
- "type": "string"
- },
- "suppressedFieldNames": {
- "description": "List of optional field names in the event block that should not be sent to the Event Listener",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "suppressedNvPairsList": {
- "description": "Optional list of specific NvPairsNames to suppress within a given Name-Value Field",
- "type": "array",
- "items": {
- "$ref": "#/definitions/suppressedNvPairs"
- }
- }
- },
- "required": [ "eventDomain" ]
- },
- "eventDomainThrottleSpecificationList": {
- "description": "array of eventDomainThrottleSpecifications",
- "type": "array",
- "items": {
- "$ref": "#/definitions/eventDomainThrottleSpecification"
- },
- "minItems": 0
- },
- "eventList": {
- "description": "array of events",
- "type": "array",
- "items": {
- "$ref": "#/definitions/event"
- }
- },
- "eventThrottlingState": {
- "description": "reports the throttling in force at the event source",
- "type": "object",
- "properties": {
- "eventThrottlingMode": {
- "description": "Mode the event manager is in",
- "type": "string",
- "enum": [
- "normal",
- "throttled"
- ]
- },
- "eventDomainThrottleSpecificationList": { "$ref": "#/definitions/eventDomainThrottleSpecificationList" }
- },
- "required": [ "eventThrottlingMode" ]
- },
- "faultFields": {
- "description": "fields specific to fault events",
- "type": "object",
- "properties": {
- "alarmAdditionalInformation": {
- "description": "additional alarm information",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "alarmCondition": {
- "description": "alarm condition reported by the device",
- "type": "string"
- },
- "alarmInterfaceA": {
- "description": "card, port, channel or interface name of the device generating the alarm",
- "type": "string"
- },
- "eventCategory": {
- "description": "Event category, for example: license, link, routing, security, signaling",
- "type": "string"
- },
- "eventSeverity": {
- "description": "event severity",
- "type": "string",
- "enum": [
- "CRITICAL",
- "MAJOR",
- "MINOR",
- "WARNING",
- "NORMAL"
- ]
- },
- "eventSourceType": {
- "description": "type of event source; examples: card, host, other, port, portThreshold, router, slotThreshold, switch, virtualMachine, virtualNetworkFunction",
- "type": "string"
- },
- "faultFieldsVersion": {
- "description": "version of the faultFields block",
- "type": "number"
- },
- "specificProblem": {
- "description": "short description of the alarm or problem",
- "type": "string"
- },
- "vfStatus": {
- "description": "virtual function status enumeration",
- "type": "string",
- "enum": [
- "Active",
- "Idle",
- "Preparing to terminate",
- "Ready to terminate",
- "Requesting termination"
- ]
- }
- },
- "required": [ "alarmCondition", "eventSeverity", "eventSourceType",
- "faultFieldsVersion", "specificProblem", "vfStatus" ]
- },
- "featuresInUse": {
- "description": "number of times an identified feature was used over the measurementInterval",
- "type": "object",
- "properties": {
- "featureIdentifier": { "type": "string" },
- "featureUtilization": { "type": "integer" }
- },
- "required": [ "featureIdentifier", "featureUtilization" ]
- },
- "field": {
- "description": "name value pair",
- "type": "object",
- "properties": {
- "name": { "type": "string" },
- "value": { "type": "string" }
- },
- "required": [ "name", "value" ]
- },
- "filesystemUsage": {
- "description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second",
- "type": "object",
- "properties": {
- "blockConfigured": { "type": "number" },
- "blockIops": { "type": "number" },
- "blockUsed": { "type": "number" },
- "ephemeralConfigured": { "type": "number" },
- "ephemeralIops": { "type": "number" },
- "ephemeralUsed": { "type": "number" },
- "filesystemName": { "type": "string" }
- },
- "required": [ "blockConfigured", "blockIops", "blockUsed", "ephemeralConfigured",
- "ephemeralIops", "ephemeralUsed", "filesystemName" ]
- },
- "gtpPerFlowMetrics": {
- "description": "Mobility GTP Protocol per flow metrics",
- "type": "object",
- "properties": {
- "avgBitErrorRate": {
- "description": "average bit error rate",
- "type": "number"
- },
- "avgPacketDelayVariation": {
- "description": "Average packet delay variation or jitter in milliseconds for received packets: Average difference between the packet timestamp and time received for all pairs of consecutive packets",
- "type": "number"
- },
- "avgPacketLatency": {
- "description": "average delivery latency",
- "type": "number"
- },
- "avgReceiveThroughput": {
- "description": "average receive throughput",
- "type": "number"
- },
- "avgTransmitThroughput": {
- "description": "average transmit throughput",
- "type": "number"
- },
- "durConnectionFailedStatus": {
- "description": "duration of failed state in milliseconds, computed as the cumulative time between a failed echo request and the next following successful error request, over this reporting interval",
- "type": "number"
- },
- "durTunnelFailedStatus": {
- "description": "Duration of errored state, computed as the cumulative time between a tunnel error indicator and the next following non-errored indicator, over this reporting interval",
- "type": "number"
- },
- "flowActivatedBy": {
- "description": "Endpoint activating the flow",
- "type": "string"
- },
- "flowActivationEpoch": {
- "description": "Time the connection is activated in the flow (connection) being reported on, or transmission time of the first packet if activation time is not available",
- "type": "number"
- },
- "flowActivationMicrosec": {
- "description": "Integer microseconds for the start of the flow connection",
- "type": "number"
- },
- "flowActivationTime": {
- "description": "time the connection is activated in the flow being reported on, or transmission time of the first packet if activation time is not available; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "flowDeactivatedBy": {
- "description": "Endpoint deactivating the flow",
- "type": "string"
- },
- "flowDeactivationEpoch": {
- "description": "Time for the start of the flow connection, in integer UTC epoch time aka UNIX time",
- "type": "number"
- },
- "flowDeactivationMicrosec": {
- "description": "Integer microseconds for the start of the flow connection",
- "type": "number"
- },
- "flowDeactivationTime": {
- "description": "Transmission time of the first packet in the flow connection being reported on; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "flowStatus": {
- "description": "connection status at reporting time as a working / inactive / failed indicator value",
- "type": "string"
- },
- "gtpConnectionStatus": {
- "description": "Current connection state at reporting time",
- "type": "string"
- },
- "gtpTunnelStatus": {
- "description": "Current tunnel state at reporting time",
- "type": "string"
- },
- "ipTosCountList": {
- "description": "array of key: value pairs where the keys are drawn from the IP Type-of-Service identifiers which range from '0' to '255', and the values are the count of packets that had those ToS identifiers in the flow",
- "type": "array",
- "items": {
- "type": "array",
- "items": [
- { "type": "string" },
- { "type": "number" }
- ]
- }
- },
- "ipTosList": {
- "description": "Array of unique IP Type-of-Service values observed in the flow where values range from '0' to '255'",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "largePacketRtt": {
- "description": "large packet round trip time",
- "type": "number"
- },
- "largePacketThreshold": {
- "description": "large packet threshold being applied",
- "type": "number"
- },
- "maxPacketDelayVariation": {
- "description": "Maximum packet delay variation or jitter in milliseconds for received packets: Maximum of the difference between the packet timestamp and time received for all pairs of consecutive packets",
- "type": "number"
- },
- "maxReceiveBitRate": {
- "description": "maximum receive bit rate",
- "type": "number"
- },
- "maxTransmitBitRate": {
- "description": "maximum transmit bit rate",
- "type": "number"
- },
- "mobileQciCosCountList": {
- "description": "array of key: value pairs where the keys are drawn from LTE QCI or UMTS class of service strings, and the values are the count of packets that had those strings in the flow",
- "type": "array",
- "items": {
- "type": "array",
- "items": [
- { "type": "string" },
- { "type": "number" }
- ]
- }
- },
- "mobileQciCosList": {
- "description": "Array of unique LTE QCI or UMTS class-of-service values observed in the flow",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "numActivationFailures": {
- "description": "Number of failed activation requests, as observed by the reporting node",
- "type": "number"
- },
- "numBitErrors": {
- "description": "number of errored bits",
- "type": "number"
- },
- "numBytesReceived": {
- "description": "number of bytes received, including retransmissions",
- "type": "number"
- },
- "numBytesTransmitted": {
- "description": "number of bytes transmitted, including retransmissions",
- "type": "number"
- },
- "numDroppedPackets": {
- "description": "number of received packets dropped due to errors per virtual interface",
- "type": "number"
- },
- "numGtpEchoFailures": {
- "description": "Number of Echo request path failures where failed paths are defined in 3GPP TS 29.281 sec 7.2.1 and 3GPP TS 29.060 sec. 11.2",
- "type": "number"
- },
- "numGtpTunnelErrors": {
- "description": "Number of tunnel error indications where errors are defined in 3GPP TS 29.281 sec 7.3.1 and 3GPP TS 29.060 sec. 11.1",
- "type": "number"
- },
- "numHttpErrors": {
- "description": "Http error count",
- "type": "number"
- },
- "numL7BytesReceived": {
- "description": "number of tunneled layer 7 bytes received, including retransmissions",
- "type": "number"
- },
- "numL7BytesTransmitted": {
- "description": "number of tunneled layer 7 bytes transmitted, excluding retransmissions",
- "type": "number"
- },
- "numLostPackets": {
- "description": "number of lost packets",
- "type": "number"
- },
- "numOutOfOrderPackets": {
- "description": "number of out-of-order packets",
- "type": "number"
- },
- "numPacketErrors": {
- "description": "number of errored packets",
- "type": "number"
- },
- "numPacketsReceivedExclRetrans": {
- "description": "number of packets received, excluding retransmission",
- "type": "number"
- },
- "numPacketsReceivedInclRetrans": {
- "description": "number of packets received, including retransmission",
- "type": "number"
- },
- "numPacketsTransmittedInclRetrans": {
- "description": "number of packets transmitted, including retransmissions",
- "type": "number"
- },
- "numRetries": {
- "description": "number of packet retries",
- "type": "number"
- },
- "numTimeouts": {
- "description": "number of packet timeouts",
- "type": "number"
- },
- "numTunneledL7BytesReceived": {
- "description": "number of tunneled layer 7 bytes received, excluding retransmissions",
- "type": "number"
- },
- "roundTripTime": {
- "description": "round trip time",
- "type": "number"
- },
- "tcpFlagCountList": {
- "description": "array of key: value pairs where the keys are drawn from TCP Flags and the values are the count of packets that had that TCP Flag in the flow",
- "type": "array",
- "items": {
- "type": "array",
- "items": [
- { "type": "string" },
- { "type": "number" }
- ]
- }
- },
- "tcpFlagList": {
- "description": "Array of unique TCP Flags observed in the flow",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "timeToFirstByte": {
- "description": "Time in milliseconds between the connection activation and first byte received",
- "type": "number"
- }
- },
- "required": [ "avgBitErrorRate", "avgPacketDelayVariation", "avgPacketLatency",
- "avgReceiveThroughput", "avgTransmitThroughput",
- "flowActivationEpoch", "flowActivationMicrosec",
- "flowDeactivationEpoch", "flowDeactivationMicrosec",
- "flowDeactivationTime", "flowStatus",
- "maxPacketDelayVariation", "numActivationFailures",
- "numBitErrors", "numBytesReceived", "numBytesTransmitted",
- "numDroppedPackets", "numL7BytesReceived",
- "numL7BytesTransmitted", "numLostPackets",
- "numOutOfOrderPackets", "numPacketErrors",
- "numPacketsReceivedExclRetrans",
- "numPacketsReceivedInclRetrans",
- "numPacketsTransmittedInclRetrans",
- "numRetries", "numTimeouts", "numTunneledL7BytesReceived",
- "roundTripTime", "timeToFirstByte"
- ]
- },
- "heartbeatFields": {
- "description": "optional field block for fields specific to heartbeat events",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional heartbeat fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "heartbeatFieldsVersion": {
- "description": "version of the heartbeatFields block",
- "type": "number"
- },
- "heartbeatInterval": {
- "description": "current heartbeat interval in seconds",
- "type": "integer"
- }
- },
- "required": [ "heartbeatFieldsVersion", "heartbeatInterval" ]
- },
- "internalHeaderFields": {
- "description": "enrichment fields for internal VES Event Listener service use only, not supplied by event sources",
- "type": "object"
- },
- "jsonObject": {
- "description": "json object schema, name and other meta-information along with one or more object instances",
- "type": "object",
- "properties": {
- "objectInstances": {
- "description": "one or more instances of the jsonObject",
- "type": "array",
- "items": {
- "$ref": "#/definitions/jsonObjectInstance"
- }
- },
- "objectName": {
- "description": "name of the JSON Object",
- "type": "string"
- },
- "objectSchema": {
- "description": "json schema for the object",
- "type": "string"
- },
- "objectSchemaUrl": {
- "description": "Url to the json schema for the object",
- "type": "string"
- },
- "nfSubscribedObjectName": {
- "description": "name of the object associated with the nfSubscriptonId",
- "type": "string"
- },
- "nfSubscriptionId": {
- "description": "identifies an openConfig telemetry subscription on a network function, which configures the network function to send complex object data associated with the jsonObject",
- "type": "string"
- }
- },
- "required": [ "objectInstances", "objectName" ]
- },
- "jsonObjectInstance": {
- "description": "meta-information about an instance of a jsonObject along with the actual object instance",
- "type": "object",
- "properties": {
- "objectInstance": {
- "description": "an instance conforming to the jsonObject schema",
- "type": "object"
- },
- "objectInstanceEpochMicrosec": {
- "description": "the unix time aka epoch time associated with this objectInstance--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
- "type": "number"
- },
- "objectKeys": {
- "description": "an ordered set of keys that identifies this particular instance of jsonObject",
- "type": "array",
- "items": {
- "$ref": "#/definitions/key"
- }
- }
- },
- "required": [ "objectInstance" ]
- },
- "key": {
- "description": "tuple which provides the name of a key along with its value and relative order",
- "type": "object",
- "properties": {
- "keyName": {
- "description": "name of the key",
- "type": "string"
- },
- "keyOrder": {
- "description": "relative sequence or order of the key with respect to other keys",
- "type": "integer"
- },
- "keyValue": {
- "description": "value of the key",
- "type": "string"
- }
- },
- "required": [ "keyName" ]
- },
- "latencyBucketMeasure": {
- "description": "number of counts falling within a defined latency bucket",
- "type": "object",
- "properties": {
- "countsInTheBucket": { "type": "number" },
- "highEndOfLatencyBucket": { "type": "number" },
- "lowEndOfLatencyBucket": { "type": "number" }
- },
- "required": [ "countsInTheBucket" ]
- },
- "measurementsForVfScalingFields": {
- "description": "measurementsForVfScaling fields",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional name-value-pair fields",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "additionalMeasurements": {
- "description": "array of named name-value-pair arrays",
- "type": "array",
- "items": {
- "$ref": "#/definitions/namedArrayOfFields"
- }
- },
- "additionalObjects": {
- "description": "array of JSON objects described by name, schema and other meta-information",
- "type": "array",
- "items": {
- "$ref": "#/definitions/jsonObject"
- }
- },
- "codecUsageArray": {
- "description": "array of codecs in use",
- "type": "array",
- "items": {
- "$ref": "#/definitions/codecsInUse"
- }
- },
- "concurrentSessions": {
- "description": "peak concurrent sessions for the VM or VNF over the measurementInterval",
- "type": "integer"
- },
- "configuredEntities": {
- "description": "over the measurementInterval, peak total number of: users, subscribers, devices, adjacencies, etc., for the VM, or subscribers, devices, etc., for the VNF",
- "type": "integer"
- },
- "cpuUsageArray": {
- "description": "usage of an array of CPUs",
- "type": "array",
- "items": {
- "$ref": "#/definitions/cpuUsage"
- }
- },
- "diskUsageArray": {
- "description": "usage of an array of disks",
- "type": "array",
- "items": {
- "$ref": "#/definitions/diskUsage"
- }
- },
- "featureUsageArray": {
- "description": "array of features in use",
- "type": "array",
- "items": {
- "$ref": "#/definitions/featuresInUse"
- }
- },
- "filesystemUsageArray": {
- "description": "filesystem usage of the VM on which the VNFC reporting the event is running",
- "type": "array",
- "items": {
- "$ref": "#/definitions/filesystemUsage"
- }
- },
- "latencyDistribution": {
- "description": "array of integers representing counts of requests whose latency in milliseconds falls within per-VNF configured ranges",
- "type": "array",
- "items": {
- "$ref": "#/definitions/latencyBucketMeasure"
- }
- },
- "meanRequestLatency": {
- "description": "mean seconds required to respond to each request for the VM on which the VNFC reporting the event is running",
- "type": "number"
- },
- "measurementInterval": {
- "description": "interval over which measurements are being reported in seconds",
- "type": "number"
- },
- "measurementsForVfScalingVersion": {
- "description": "version of the measurementsForVfScaling block",
- "type": "number"
- },
- "memoryUsageArray": {
- "description": "memory usage of an array of VMs",
- "type": "array",
- "items": {
- "$ref": "#/definitions/memoryUsage"
- }
- },
- "numberOfMediaPortsInUse": {
- "description": "number of media ports in use",
- "type": "integer"
- },
- "requestRate": {
- "description": "peak rate of service requests per second to the VNF over the measurementInterval",
- "type": "number"
- },
- "vnfcScalingMetric": {
- "description": "represents busy-ness of the VNF from 0 to 100 as reported by the VNFC",
- "type": "integer"
- },
- "vNicPerformanceArray": {
- "description": "usage of an array of virtual network interface cards",
- "type": "array",
- "items": {
- "$ref": "#/definitions/vNicPerformance"
- }
- }
- },
- "required": [ "measurementInterval", "measurementsForVfScalingVersion" ]
- },
- "memoryUsage": {
- "description": "memory usage of an identified virtual machine",
- "type": "object",
- "properties": {
- "memoryBuffered": {
- "description": "kibibytes of temporary storage for raw disk blocks",
- "type": "number"
- },
- "memoryCached": {
- "description": "kibibytes of memory used for cache",
- "type": "number"
- },
- "memoryConfigured": {
- "description": "kibibytes of memory configured in the virtual machine on which the VNFC reporting the event is running",
- "type": "number"
- },
- "memoryFree": {
- "description": "kibibytes of physical RAM left unused by the system",
- "type": "number"
- },
- "memorySlabRecl": {
- "description": "the part of the slab that can be reclaimed such as caches measured in kibibytes",
- "type": "number"
- },
- "memorySlabUnrecl": {
- "description": "the part of the slab that cannot be reclaimed even when lacking memory measured in kibibytes",
- "type": "number"
- },
- "memoryUsed": {
- "description": "total memory minus the sum of free, buffered, cached and slab memory measured in kibibytes",
- "type": "number"
- },
- "vmIdentifier": {
- "description": "virtual machine identifier associated with the memory metrics",
- "type": "string"
- }
- },
- "required": [ "memoryFree", "memoryUsed", "vmIdentifier" ]
- },
- "mobileFlowFields": {
- "description": "mobileFlow fields",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional mobileFlow fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "applicationType": {
- "description": "Application type inferred",
- "type": "string"
- },
- "appProtocolType": {
- "description": "application protocol",
- "type": "string"
- },
- "appProtocolVersion": {
- "description": "application protocol version",
- "type": "string"
- },
- "cid": {
- "description": "cell id",
- "type": "string"
- },
- "connectionType": {
- "description": "Abbreviation referencing a 3GPP reference point e.g., S1-U, S11, etc",
- "type": "string"
- },
- "ecgi": {
- "description": "Evolved Cell Global Id",
- "type": "string"
- },
- "flowDirection": {
- "description": "Flow direction, indicating if the reporting node is the source of the flow or destination for the flow",
- "type": "string"
- },
- "gtpPerFlowMetrics": { "$ref": "#/definitions/gtpPerFlowMetrics" },
- "gtpProtocolType": {
- "description": "GTP protocol",
- "type": "string"
- },
- "gtpVersion": {
- "description": "GTP protocol version",
- "type": "string"
- },
- "httpHeader": {
- "description": "HTTP request header, if the flow connects to a node referenced by HTTP",
- "type": "string"
- },
- "imei": {
- "description": "IMEI for the subscriber UE used in this flow, if the flow connects to a mobile device",
- "type": "string"
- },
- "imsi": {
- "description": "IMSI for the subscriber UE used in this flow, if the flow connects to a mobile device",
- "type": "string"
- },
- "ipProtocolType": {
- "description": "IP protocol type e.g., TCP, UDP, RTP...",
- "type": "string"
- },
- "ipVersion": {
- "description": "IP protocol version e.g., IPv4, IPv6",
- "type": "string"
- },
- "lac": {
- "description": "location area code",
- "type": "string"
- },
- "mcc": {
- "description": "mobile country code",
- "type": "string"
- },
- "mnc": {
- "description": "mobile network code",
- "type": "string"
- },
- "mobileFlowFieldsVersion": {
- "description": "version of the mobileFlowFields block",
- "type": "number"
- },
- "msisdn": {
- "description": "MSISDN for the subscriber UE used in this flow, as an integer, if the flow connects to a mobile device",
- "type": "string"
- },
- "otherEndpointIpAddress": {
- "description": "IP address for the other endpoint, as used for the flow being reported on",
- "type": "string"
- },
- "otherEndpointPort": {
- "description": "IP Port for the reporting entity, as used for the flow being reported on",
- "type": "integer"
- },
- "otherFunctionalRole": {
- "description": "Functional role of the other endpoint for the flow being reported on e.g., MME, S-GW, P-GW, PCRF...",
- "type": "string"
- },
- "rac": {
- "description": "routing area code",
- "type": "string"
- },
- "radioAccessTechnology": {
- "description": "Radio Access Technology e.g., 2G, 3G, LTE",
- "type": "string"
- },
- "reportingEndpointIpAddr": {
- "description": "IP address for the reporting entity, as used for the flow being reported on",
- "type": "string"
- },
- "reportingEndpointPort": {
- "description": "IP port for the reporting entity, as used for the flow being reported on",
- "type": "integer"
- },
- "sac": {
- "description": "service area code",
- "type": "string"
- },
- "samplingAlgorithm": {
- "description": "Integer identifier for the sampling algorithm or rule being applied in calculating the flow metrics if metrics are calculated based on a sample of packets, or 0 if no sampling is applied",
- "type": "integer"
- },
- "tac": {
- "description": "transport area code",
- "type": "string"
- },
- "tunnelId": {
- "description": "tunnel identifier",
- "type": "string"
- },
- "vlanId": {
- "description": "VLAN identifier used by this flow",
- "type": "string"
- }
- },
- "required": [ "flowDirection", "gtpPerFlowMetrics", "ipProtocolType", "ipVersion",
- "mobileFlowFieldsVersion", "otherEndpointIpAddress", "otherEndpointPort",
- "reportingEndpointIpAddr", "reportingEndpointPort" ]
- },
- "namedArrayOfFields": {
- "description": "an array of name value pairs along with a name for the array",
- "type": "object",
- "properties": {
- "name": { "type": "string" },
- "arrayOfFields": {
- "description": "array of name value pairs",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- }
- },
- "required": [ "name", "arrayOfFields" ]
- },
- "otherFields": {
- "description": "fields for events belonging to the 'other' domain of the commonEventHeader domain enumeration",
- "type": "object",
- "properties": {
- "hashOfNameValuePairArrays": {
- "description": "array of named name-value-pair arrays",
- "type": "array",
- "items": {
- "$ref": "#/definitions/namedArrayOfFields"
- }
- },
- "jsonObjects": {
- "description": "array of JSON objects described by name, schema and other meta-information",
- "type": "array",
- "items": {
- "$ref": "#/definitions/jsonObject"
- }
- },
- "nameValuePairs": {
- "description": "array of name-value pairs",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "otherFieldsVersion": {
- "description": "version of the otherFields block",
- "type": "number"
- }
- },
- "required": [ "otherFieldsVersion" ]
- },
- "requestError": {
- "description": "standard request error data structure",
- "type": "object",
- "properties": {
- "messageId": {
- "description": "Unique message identifier of the format ABCnnnn where ABC is either SVC for Service Exceptions or POL for Policy Exception",
- "type": "string"
- },
- "text": {
- "description": "Message text, with replacement variables marked with %n, where n is an index into the list of <variables> elements, starting at 1",
- "type": "string"
- },
- "url": {
- "description": "Hyperlink to a detailed error resource e.g., an HTML page for browser user agents",
- "type": "string"
- },
- "variables": {
- "description": "List of zero or more strings that represent the contents of the variables used by the message text",
- "type": "string"
- }
- },
- "required": [ "messageId", "text" ]
- },
- "sipSignalingFields": {
- "description": "sip signaling fields",
- "type": "object",
- "properties": {
- "additionalInformation": {
- "description": "additional sip signaling fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "compressedSip": {
- "description": "the full SIP request/response including headers and bodies",
- "type": "string"
- },
- "correlator": {
- "description": "this is the same for all events on this call",
- "type": "string"
- },
- "localIpAddress": {
- "description": "IP address on VNF",
- "type": "string"
- },
- "localPort": {
- "description": "port on VNF",
- "type": "string"
- },
- "remoteIpAddress": {
- "description": "IP address of peer endpoint",
- "type": "string"
- },
- "remotePort": {
- "description": "port of peer endpoint",
- "type": "string"
- },
- "sipSignalingFieldsVersion": {
- "description": "version of the sipSignalingFields block",
- "type": "number"
- },
- "summarySip": {
- "description": "the SIP Method or Response (‘INVITE’, ‘200 OK’, ‘BYE’, etc)",
- "type": "string"
- },
- "vendorVnfNameFields": {
- "$ref": "#/definitions/vendorVnfNameFields"
- }
- },
- "required": [ "correlator", "localIpAddress", "localPort", "remoteIpAddress",
- "remotePort", "sipSignalingFieldsVersion", "vendorVnfNameFields" ]
- },
- "stateChangeFields": {
- "description": "stateChange fields",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional stateChange fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "newState": {
- "description": "new state of the entity",
- "type": "string",
- "enum": [
- "inService",
- "maintenance",
- "outOfService"
- ]
- },
- "oldState": {
- "description": "previous state of the entity",
- "type": "string",
- "enum": [
- "inService",
- "maintenance",
- "outOfService"
- ]
- },
- "stateChangeFieldsVersion": {
- "description": "version of the stateChangeFields block",
- "type": "number"
- },
- "stateInterface": {
- "description": "card or port name of the entity that changed state",
- "type": "string"
- }
- },
- "required": [ "newState", "oldState", "stateChangeFieldsVersion", "stateInterface" ]
- },
- "suppressedNvPairs": {
- "description": "List of specific NvPairsNames to suppress within a given Name-Value Field for event Throttling",
- "type": "object",
- "properties": {
- "nvPairFieldName": {
- "description": "Name of the field within which are the nvpair names to suppress",
- "type": "string"
- },
- "suppressedNvPairNames": {
- "description": "Array of nvpair names to suppress within the nvpairFieldName",
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "required": [ "nvPairFieldName", "suppressedNvPairNames" ]
- },
- "syslogFields": {
- "description": "sysLog fields",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional syslog fields if needed provided as name=value delimited by a pipe ‘|’ symbol, for example: 'name1=value1|name2=value2|…'",
- "type": "string"
- },
- "eventSourceHost": {
- "description": "hostname of the device",
- "type": "string"
- },
- "eventSourceType": {
- "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
- "type": "string"
- },
- "syslogFacility": {
- "description": "numeric code from 0 to 23 for facility--see table in documentation",
- "type": "integer"
- },
- "syslogFieldsVersion": {
- "description": "version of the syslogFields block",
- "type": "number"
- },
- "syslogMsg": {
- "description": "syslog message",
- "type": "string"
- },
- "syslogPri": {
- "description": "0-192 combined severity and facility",
- "type": "integer"
- },
- "syslogProc": {
- "description": "identifies the application that originated the message",
- "type": "string"
- },
- "syslogProcId": {
- "description": "a change in the value of this field indicates a discontinuity in syslog reporting",
- "type": "number"
- },
- "syslogSData": {
- "description": "syslog structured data consisting of a structured data Id followed by a set of key value pairs",
- "type": "string"
- },
- "syslogSdId": {
- "description": "0-32 char in format name@number for example ourSDID@32473",
- "type": "string"
- },
- "syslogSev": {
- "description": "numerical Code for severity derived from syslogPri as remaider of syslogPri / 8",
- "type": "string",
- "enum": [
- "Alert",
- "Critical",
- "Debug",
- "Emergency",
- "Error",
- "Info",
- "Notice",
- "Warning"
- ]
- },
- "syslogTag": {
- "description": "msgId indicating the type of message such as TCPOUT or TCPIN; NILVALUE should be used when no other value can be provided",
- "type": "string"
- },
- "syslogVer": {
- "description": "IANA assigned version of the syslog protocol specification - typically 1",
- "type": "number"
- }
- },
- "required": [ "eventSourceType", "syslogFieldsVersion", "syslogMsg", "syslogTag" ]
- },
- "thresholdCrossingAlertFields": {
- "description": "fields specific to threshold crossing alert events",
- "type": "object",
- "properties": {
- "additionalFields": {
- "description": "additional threshold crossing alert fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "additionalParameters": {
- "description": "performance counters",
- "type": "array",
- "items": {
- "$ref": "#/definitions/counter"
- }
- },
- "alertAction": {
- "description": "Event action",
- "type": "string",
- "enum": [
- "CLEAR",
- "CONT",
- "SET"
- ]
- },
- "alertDescription": {
- "description": "Unique short alert description such as IF-SHUB-ERRDROP",
- "type": "string"
- },
- "alertType": {
- "description": "Event type",
- "type": "string",
- "enum": [
- "CARD-ANOMALY",
- "ELEMENT-ANOMALY",
- "INTERFACE-ANOMALY",
- "SERVICE-ANOMALY"
- ]
- },
- "alertValue": {
- "description": "Calculated API value (if applicable)",
- "type": "string"
- },
- "associatedAlertIdList": {
- "description": "List of eventIds associated with the event being reported",
- "type": "array",
- "items": { "type": "string" }
- },
- "collectionTimestamp": {
- "description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "dataCollector": {
- "description": "Specific performance collector instance used",
- "type": "string"
- },
- "elementType": {
- "description": "type of network element - internal ATT field",
- "type": "string"
- },
- "eventSeverity": {
- "description": "event severity or priority",
- "type": "string",
- "enum": [
- "CRITICAL",
- "MAJOR",
- "MINOR",
- "WARNING",
- "NORMAL"
- ]
- },
- "eventStartTimestamp": {
- "description": "Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
- "type": "string"
- },
- "interfaceName": {
- "description": "Physical or logical port or card (if applicable)",
- "type": "string"
- },
- "networkService": {
- "description": "network name - internal ATT field",
- "type": "string"
- },
- "possibleRootCause": {
- "description": "Reserved for future use",
- "type": "string"
- },
- "thresholdCrossingFieldsVersion": {
- "description": "version of the thresholdCrossingAlertFields block",
- "type": "number"
- }
- },
- "required": [
- "additionalParameters",
- "alertAction",
- "alertDescription",
- "alertType",
- "collectionTimestamp",
- "eventSeverity",
- "eventStartTimestamp",
- "thresholdCrossingFieldsVersion"
- ]
- },
- "vendorVnfNameFields": {
- "description": "provides vendor, vnf and vfModule identifying information",
- "type": "object",
- "properties": {
- "vendorName": {
- "description": "VNF vendor name",
- "type": "string"
- },
- "vfModuleName": {
- "description": "ASDC vfModuleName for the vfModule generating the event",
- "type": "string"
- },
- "vnfName": {
- "description": "ASDC modelName for the VNF generating the event",
- "type": "string"
- }
- },
- "required": [ "vendorName" ]
- },
- "vNicPerformance": {
- "description": "describes the performance and errors of an identified virtual network interface card",
- "type": "object",
- "properties": {
- "receivedBroadcastPacketsAccumulated": {
- "description": "Cumulative count of broadcast packets received as read at the end of the measurement interval",
- "type": "number"
- },
- "receivedBroadcastPacketsDelta": {
- "description": "Count of broadcast packets received within the measurement interval",
- "type": "number"
- },
- "receivedDiscardedPacketsAccumulated": {
- "description": "Cumulative count of discarded packets received as read at the end of the measurement interval",
- "type": "number"
- },
- "receivedDiscardedPacketsDelta": {
- "description": "Count of discarded packets received within the measurement interval",
- "type": "number"
- },
- "receivedErrorPacketsAccumulated": {
- "description": "Cumulative count of error packets received as read at the end of the measurement interval",
- "type": "number"
- },
- "receivedErrorPacketsDelta": {
- "description": "Count of error packets received within the measurement interval",
- "type": "number"
- },
- "receivedMulticastPacketsAccumulated": {
- "description": "Cumulative count of multicast packets received as read at the end of the measurement interval",
- "type": "number"
- },
- "receivedMulticastPacketsDelta": {
- "description": "Count of multicast packets received within the measurement interval",
- "type": "number"
- },
- "receivedOctetsAccumulated": {
- "description": "Cumulative count of octets received as read at the end of the measurement interval",
- "type": "number"
- },
- "receivedOctetsDelta": {
- "description": "Count of octets received within the measurement interval",
- "type": "number"
- },
- "receivedTotalPacketsAccumulated": {
- "description": "Cumulative count of all packets received as read at the end of the measurement interval",
- "type": "number"
- },
- "receivedTotalPacketsDelta": {
- "description": "Count of all packets received within the measurement interval",
- "type": "number"
- },
- "receivedUnicastPacketsAccumulated": {
- "description": "Cumulative count of unicast packets received as read at the end of the measurement interval",
- "type": "number"
- },
- "receivedUnicastPacketsDelta": {
- "description": "Count of unicast packets received within the measurement interval",
- "type": "number"
- },
- "transmittedBroadcastPacketsAccumulated": {
- "description": "Cumulative count of broadcast packets transmitted as read at the end of the measurement interval",
- "type": "number"
- },
- "transmittedBroadcastPacketsDelta": {
- "description": "Count of broadcast packets transmitted within the measurement interval",
- "type": "number"
- },
- "transmittedDiscardedPacketsAccumulated": {
- "description": "Cumulative count of discarded packets transmitted as read at the end of the measurement interval",
- "type": "number"
- },
- "transmittedDiscardedPacketsDelta": {
- "description": "Count of discarded packets transmitted within the measurement interval",
- "type": "number"
- },
- "transmittedErrorPacketsAccumulated": {
- "description": "Cumulative count of error packets transmitted as read at the end of the measurement interval",
- "type": "number"
- },
- "transmittedErrorPacketsDelta": {
- "description": "Count of error packets transmitted within the measurement interval",
- "type": "number"
- },
- "transmittedMulticastPacketsAccumulated": {
- "description": "Cumulative count of multicast packets transmitted as read at the end of the measurement interval",
- "type": "number"
- },
- "transmittedMulticastPacketsDelta": {
- "description": "Count of multicast packets transmitted within the measurement interval",
- "type": "number"
- },
- "transmittedOctetsAccumulated": {
- "description": "Cumulative count of octets transmitted as read at the end of the measurement interval",
- "type": "number"
- },
- "transmittedOctetsDelta": {
- "description": "Count of octets transmitted within the measurement interval",
- "type": "number"
- },
- "transmittedTotalPacketsAccumulated": {
- "description": "Cumulative count of all packets transmitted as read at the end of the measurement interval",
- "type": "number"
- },
- "transmittedTotalPacketsDelta": {
- "description": "Count of all packets transmitted within the measurement interval",
- "type": "number"
- },
- "transmittedUnicastPacketsAccumulated": {
- "description": "Cumulative count of unicast packets transmitted as read at the end of the measurement interval",
- "type": "number"
- },
- "transmittedUnicastPacketsDelta": {
- "description": "Count of unicast packets transmitted within the measurement interval",
- "type": "number"
- },
- "valuesAreSuspect": {
- "description": "Indicates whether vNicPerformance values are likely inaccurate due to counter overflow or other condtions",
- "type": "string",
- "enum": [ "true", "false" ]
- },
- "vNicIdentifier": {
- "description": "vNic identification",
- "type": "string"
- }
- },
- "required": [ "valuesAreSuspect", "vNicIdentifier" ]
- },
- "voiceQualityFields": {
- "description": "provides statistics related to customer facing voice products",
- "type": "object",
- "properties": {
- "additionalInformation": {
- "description": "additional voice quality fields if needed",
- "type": "array",
- "items": {
- "$ref": "#/definitions/field"
- }
- },
- "calleeSideCodec": {
- "description": "callee codec for the call",
- "type": "string"
- },
- "callerSideCodec": {
- "description": "caller codec for the call",
- "type": "string"
- },
- "correlator": {
- "description": "this is the same for all events on this call",
- "type": "string"
- },
- "endOfCallVqmSummaries": {
- "$ref": "#/definitions/endOfCallVqmSummaries"
- },
- "phoneNumber": {
- "description": "phone number associated with the correlator",
- "type": "string"
- },
- "midCallRtcp": {
- "description": "Base64 encoding of the binary RTCP data excluding Eth/IP/UDP headers",
- "type": "string"
- },
- "vendorVnfNameFields": {
- "$ref": "#/definitions/vendorVnfNameFields"
- },
- "voiceQualityFieldsVersion": {
- "description": "version of the voiceQualityFields block",
- "type": "number"
- }
- },
- "required": [ "calleeSideCodec", "callerSideCodec", "correlator", "midCallRtcp",
- "vendorVnfNameFields", "voiceQualityFieldsVersion" ]
- }
- }
-}
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "VES Event Listener",
+ "type": "object",
+ "properties": {
+ "event": {
+ "$ref": "#/definitions/event"
+ },
+ "eventList": {
+ "$ref": "#/definitions/eventList"
+ }
+ },
+ "definitions": {
+ "schemaHeaderBlock": {
+ "description": "schema date, version, author and associated API",
+ "type": "object",
+ "properties": {
+ "associatedApi": {
+ "description": "VES Event Listener",
+ "type": "string"
+ },
+ "lastUpdatedBy": {
+ "description": "re2947",
+ "type": "string"
+ },
+ "schemaDate": {
+ "description": "September 19, 2017",
+ "type": "string"
+ },
+ "schemaVersion": {
+ "description": "28.4.1",
+ "type": "number"
+ }
+ }
+ },
+ "schemaLicenseAndCopyrightNotice": {
+ "description": "Copyright (c) 2017, AT&T Intellectual Property. All rights reserved",
+ "type": "object",
+ "properties": {
+ "apacheLicense2.0": {
+ "description": "Licensed 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:",
+ "type": "string"
+ },
+ "licenseUrl": {
+ "description": "http://www.apache.org/licenses/LICENSE-2.0",
+ "type": "string"
+ },
+ "asIsClause": {
+ "description": "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.",
+ "type": "string"
+ },
+ "permissionsAndLimitations": {
+ "description": "See the License for the specific language governing permissions and limitations under the License.",
+ "type": "string"
+ }
+ }
+ },
+ "codecsInUse": {
+ "description": "number of times an identified codec was used over the measurementInterval",
+ "type": "object",
+ "properties": {
+ "codecIdentifier": {
+ "type": "string"
+ },
+ "numberInUse": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "codecIdentifier",
+ "numberInUse"
+ ]
+ },
+ "command": {
+ "description": "command from an event collector toward an event source",
+ "type": "object",
+ "properties": {
+ "commandType": {
+ "type": "string",
+ "enum": [
+ "heartbeatIntervalChange",
+ "measurementIntervalChange",
+ "provideThrottlingState",
+ "throttlingSpecification"
+ ]
+ },
+ "eventDomainThrottleSpecification": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "heartbeatInterval": {
+ "type": "integer"
+ },
+ "measurementInterval": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "commandType"
+ ]
+ },
+ "commandList": {
+ "description": "array of commands from an event collector toward an event source",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/command"
+ },
+ "minItems": 0
+ },
+ "commonEventHeader": {
+ "description": "fields common to all events",
+ "type": "object",
+ "properties": {
+ "domain": {
+ "description": "the eventing domain associated with the event",
+ "type": "string",
+ "enum": [
+ "fault",
+ "heartbeat",
+ "measurementsForVfScaling",
+ "mobileFlow",
+ "other",
+ "sipSignaling",
+ "stateChange",
+ "syslog",
+ "thresholdCrossingAlert",
+ "voiceQuality"
+ ]
+ },
+ "eventId": {
+ "description": "event key that is unique to the event source",
+ "type": "string"
+ },
+ "eventName": {
+ "description": "unique event name",
+ "type": "string"
+ },
+ "eventType": {
+ "description": "for example - applicationVnf, guestOS, hostOS, platform",
+ "type": "string"
+ },
+ "internalHeaderFields": {
+ "$ref": "#/definitions/internalHeaderFields"
+ },
+ "lastEpochMicrosec": {
+ "description": "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "nfcNamingCode": {
+ "description": "3 character network function component type, aligned with vfc naming standards",
+ "type": "string"
+ },
+ "nfNamingCode": {
+ "description": "4 character network function type, aligned with vnf naming standards",
+ "type": "string"
+ },
+ "priority": {
+ "description": "processing priority",
+ "type": "string",
+ "enum": [
+ "High",
+ "Medium",
+ "Normal",
+ "Low"
+ ]
+ },
+ "reportingEntityId": {
+ "description": "UUID identifying the entity reporting the event, for example an OAM VM; must be populated by the ATT enrichment process",
+ "type": "string"
+ },
+ "reportingEntityName": {
+ "description": "name of the entity reporting the event, for example, an EMS name; may be the same as sourceName",
+ "type": "string"
+ },
+ "sequence": {
+ "description": "ordering of events communicated by an event source instance or 0 if not needed",
+ "type": "integer"
+ },
+ "sourceId": {
+ "description": "UUID identifying the entity experiencing the event issue; must be populated by the ATT enrichment process",
+ "type": "string"
+ },
+ "sourceName": {
+ "description": "name of the entity experiencing the event issue",
+ "type": "string"
+ },
+ "startEpochMicrosec": {
+ "description": "the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "version": {
+ "description": "version of the event header",
+ "type": "number"
+ }
+ },
+ "required": [
+ "domain",
+ "eventId",
+ "eventName",
+ "lastEpochMicrosec",
+ "priority",
+ "reportingEntityName",
+ "sequence",
+ "sourceName",
+ "startEpochMicrosec",
+ "version"
+ ]
+ },
+ "counter": {
+ "description": "performance counter",
+ "type": "object",
+ "properties": {
+ "criticality": {
+ "type": "string",
+ "enum": [
+ "CRIT",
+ "MAJ"
+ ]
+ },
+ "name": {
+ "type": "string"
+ },
+ "thresholdCrossed": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "criticality",
+ "name",
+ "thresholdCrossed",
+ "value"
+ ]
+ },
+ "cpuUsage": {
+ "description": "usage of an identified CPU",
+ "type": "object",
+ "properties": {
+ "cpuIdentifier": {
+ "description": "cpu identifer",
+ "type": "string"
+ },
+ "cpuIdle": {
+ "description": "percentage of CPU time spent in the idle task",
+ "type": "number"
+ },
+ "cpuUsageInterrupt": {
+ "description": "percentage of time spent servicing interrupts",
+ "type": "number"
+ },
+ "cpuUsageNice": {
+ "description": "percentage of time spent running user space processes that have been niced",
+ "type": "number"
+ },
+ "cpuUsageSoftIrq": {
+ "description": "percentage of time spent handling soft irq interrupts",
+ "type": "number"
+ },
+ "cpuUsageSteal": {
+ "description": "percentage of time spent in involuntary wait which is neither user, system or idle time and is effectively time that went missing",
+ "type": "number"
+ },
+ "cpuUsageSystem": {
+ "description": "percentage of time spent on system tasks running the kernel",
+ "type": "number"
+ },
+ "cpuUsageUser": {
+ "description": "percentage of time spent running un-niced user space processes",
+ "type": "number"
+ },
+ "cpuWait": {
+ "description": "percentage of CPU time spent waiting for I/O operations to complete",
+ "type": "number"
+ },
+ "percentUsage": {
+ "description": "aggregate cpu usage of the virtual machine on which the VNFC reporting the event is running",
+ "type": "number"
+ }
+ },
+ "required": [
+ "cpuIdentifier",
+ "percentUsage"
+ ]
+ },
+ "diskUsage": {
+ "description": "usage of an identified disk",
+ "type": "object",
+ "properties": {
+ "diskIdentifier": {
+ "description": "disk identifier",
+ "type": "string"
+ },
+ "diskIoTimeAvg": {
+ "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the average over the measurement interval",
+ "type": "number"
+ },
+ "diskIoTimeLast": {
+ "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the last value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskIoTimeMax": {
+ "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the maximum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskIoTimeMin": {
+ "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the minimum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedReadAvg": {
+ "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedReadLast": {
+ "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the last value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedReadMax": {
+ "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the maximum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedReadMin": {
+ "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the minimum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedWriteAvg": {
+ "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedWriteLast": {
+ "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the last value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedWriteMax": {
+ "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the maximum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskMergedWriteMin": {
+ "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the minimum value measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsReadAvg": {
+ "description": "number of octets per second read from a disk or partition; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsReadLast": {
+ "description": "number of octets per second read from a disk or partition; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsReadMax": {
+ "description": "number of octets per second read from a disk or partition; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsReadMin": {
+ "description": "number of octets per second read from a disk or partition; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsWriteAvg": {
+ "description": "number of octets per second written to a disk or partition; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsWriteLast": {
+ "description": "number of octets per second written to a disk or partition; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsWriteMax": {
+ "description": "number of octets per second written to a disk or partition; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOctetsWriteMin": {
+ "description": "number of octets per second written to a disk or partition; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsReadAvg": {
+ "description": "number of read operations per second issued to the disk; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsReadLast": {
+ "description": "number of read operations per second issued to the disk; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsReadMax": {
+ "description": "number of read operations per second issued to the disk; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsReadMin": {
+ "description": "number of read operations per second issued to the disk; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsWriteAvg": {
+ "description": "number of write operations per second issued to the disk; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsWriteLast": {
+ "description": "number of write operations per second issued to the disk; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsWriteMax": {
+ "description": "number of write operations per second issued to the disk; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskOpsWriteMin": {
+ "description": "number of write operations per second issued to the disk; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskPendingOperationsAvg": {
+ "description": "queue size of pending I/O operations per second; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskPendingOperationsLast": {
+ "description": "queue size of pending I/O operations per second; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskPendingOperationsMax": {
+ "description": "queue size of pending I/O operations per second; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskPendingOperationsMin": {
+ "description": "queue size of pending I/O operations per second; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeReadAvg": {
+ "description": "milliseconds a read operation took to complete; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeReadLast": {
+ "description": "milliseconds a read operation took to complete; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeReadMax": {
+ "description": "milliseconds a read operation took to complete; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeReadMin": {
+ "description": "milliseconds a read operation took to complete; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeWriteAvg": {
+ "description": "milliseconds a write operation took to complete; provide the average measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeWriteLast": {
+ "description": "milliseconds a write operation took to complete; provide the last measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeWriteMax": {
+ "description": "milliseconds a write operation took to complete; provide the maximum measurement within the measurement interval",
+ "type": "number"
+ },
+ "diskTimeWriteMin": {
+ "description": "milliseconds a write operation took to complete; provide the minimum measurement within the measurement interval",
+ "type": "number"
+ }
+ },
+ "required": [
+ "diskIdentifier"
+ ]
+ },
+ "endOfCallVqmSummaries": {
+ "description": "provides end of call voice quality metrics",
+ "type": "object",
+ "properties": {
+ "adjacencyName": {
+ "description": " adjacency name",
+ "type": "string"
+ },
+ "endpointDescription": {
+ "description": "Either Caller or Callee",
+ "type": "string",
+ "enum": [
+ "Caller",
+ "Callee"
+ ]
+ },
+ "endpointJitter": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpOctetsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpOctetsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpOctetsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpPacketsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpPacketsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpPacketsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "localJitter": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpOctetsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpOctetsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpOctetsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpPacketsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpPacketsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpPacketsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "mosCqe": {
+ "description": "1-5 1dp",
+ "type": "number"
+ },
+ "packetsLost": {
+ "description": "",
+ "type": "number"
+ },
+ "packetLossPercent": {
+ "description": "Calculated percentage packet loss based on Endpoint RTP packets lost (as reported in RTCP) and Local RTP packets sent. Direction is based on Endpoint description (Caller, Callee). Decimal (2 dp)",
+ "type": "number"
+ },
+ "rFactor": {
+ "description": "0-100",
+ "type": "number"
+ },
+ "roundTripDelay": {
+ "description": "millisecs",
+ "type": "number"
+ }
+ },
+ "required": [
+ "adjacencyName",
+ "endpointDescription"
+ ]
+ },
+ "event": {
+ "description": "the root level of the common event format",
+ "type": "object",
+ "properties": {
+ "commonEventHeader": {
+ "$ref": "#/definitions/commonEventHeader"
+ },
+ "faultFields": {
+ "$ref": "#/definitions/faultFields"
+ },
+ "heartbeatFields": {
+ "$ref": "#/definitions/heartbeatFields"
+ },
+ "measurementsForVfScalingFields": {
+ "$ref": "#/definitions/measurementsForVfScalingFields"
+ },
+ "mobileFlowFields": {
+ "$ref": "#/definitions/mobileFlowFields"
+ },
+ "otherFields": {
+ "$ref": "#/definitions/otherFields"
+ },
+ "sipSignalingFields": {
+ "$ref": "#/definitions/sipSignalingFields"
+ },
+ "stateChangeFields": {
+ "$ref": "#/definitions/stateChangeFields"
+ },
+ "syslogFields": {
+ "$ref": "#/definitions/syslogFields"
+ },
+ "thresholdCrossingAlertFields": {
+ "$ref": "#/definitions/thresholdCrossingAlertFields"
+ },
+ "voiceQualityFields": {
+ "$ref": "#/definitions/voiceQualityFields"
+ }
+ },
+ "required": [
+ "commonEventHeader"
+ ]
+ },
+ "eventDomainThrottleSpecification": {
+ "description": "specification of what information to suppress within an event domain",
+ "type": "object",
+ "properties": {
+ "eventDomain": {
+ "description": "Event domain enum from the commonEventHeader domain field",
+ "type": "string"
+ },
+ "suppressedFieldNames": {
+ "description": "List of optional field names in the event block that should not be sent to the Event Listener",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "suppressedNvPairsList": {
+ "description": "Optional list of specific NvPairsNames to suppress within a given Name-Value Field",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/suppressedNvPairs"
+ }
+ }
+ },
+ "required": [
+ "eventDomain"
+ ]
+ },
+ "eventDomainThrottleSpecificationList": {
+ "description": "array of eventDomainThrottleSpecifications",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "minItems": 0
+ },
+ "eventList": {
+ "description": "array of events",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/event"
+ }
+ },
+ "eventThrottlingState": {
+ "description": "reports the throttling in force at the event source",
+ "type": "object",
+ "properties": {
+ "eventThrottlingMode": {
+ "description": "Mode the event manager is in",
+ "type": "string",
+ "enum": [
+ "normal",
+ "throttled"
+ ]
+ },
+ "eventDomainThrottleSpecificationList": {
+ "$ref": "#/definitions/eventDomainThrottleSpecificationList"
+ }
+ },
+ "required": [
+ "eventThrottlingMode"
+ ]
+ },
+ "faultFields": {
+ "description": "fields specific to fault events",
+ "type": "object",
+ "properties": {
+ "alarmAdditionalInformation": {
+ "description": "additional alarm information",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "alarmCondition": {
+ "description": "alarm condition reported by the device",
+ "type": "string"
+ },
+ "alarmInterfaceA": {
+ "description": "card, port, channel or interface name of the device generating the alarm",
+ "type": "string"
+ },
+ "eventCategory": {
+ "description": "Event category, for example: license, link, routing, security, signaling",
+ "type": "string"
+ },
+ "eventSeverity": {
+ "description": "event severity",
+ "type": "string",
+ "enum": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
+ },
+ "eventSourceType": {
+ "description": "type of event source; examples: card, host, other, port, portThreshold, router, slotThreshold, switch, virtualMachine, virtualNetworkFunction",
+ "type": "string"
+ },
+ "faultFieldsVersion": {
+ "description": "version of the faultFields block",
+ "type": "number"
+ },
+ "specificProblem": {
+ "description": "short description of the alarm or problem",
+ "type": "string"
+ },
+ "vfStatus": {
+ "description": "virtual function status enumeration",
+ "type": "string",
+ "enum": [
+ "Active",
+ "Idle",
+ "Preparing to terminate",
+ "Ready to terminate",
+ "Requesting termination"
+ ]
+ }
+ },
+ "required": [
+ "alarmCondition",
+ "eventSeverity",
+ "eventSourceType",
+ "faultFieldsVersion",
+ "specificProblem",
+ "vfStatus"
+ ]
+ },
+ "featuresInUse": {
+ "description": "number of times an identified feature was used over the measurementInterval",
+ "type": "object",
+ "properties": {
+ "featureIdentifier": {
+ "type": "string"
+ },
+ "featureUtilization": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "featureIdentifier",
+ "featureUtilization"
+ ]
+ },
+ "field": {
+ "description": "name value pair",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "value"
+ ]
+ },
+ "filesystemUsage": {
+ "description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second",
+ "type": "object",
+ "properties": {
+ "blockConfigured": {
+ "type": "number"
+ },
+ "blockIops": {
+ "type": "number"
+ },
+ "blockUsed": {
+ "type": "number"
+ },
+ "ephemeralConfigured": {
+ "type": "number"
+ },
+ "ephemeralIops": {
+ "type": "number"
+ },
+ "ephemeralUsed": {
+ "type": "number"
+ },
+ "filesystemName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "blockConfigured",
+ "blockIops",
+ "blockUsed",
+ "ephemeralConfigured",
+ "ephemeralIops",
+ "ephemeralUsed",
+ "filesystemName"
+ ]
+ },
+ "gtpPerFlowMetrics": {
+ "description": "Mobility GTP Protocol per flow metrics",
+ "type": "object",
+ "properties": {
+ "avgBitErrorRate": {
+ "description": "average bit error rate",
+ "type": "number"
+ },
+ "avgPacketDelayVariation": {
+ "description": "Average packet delay variation or jitter in milliseconds for received packets: Average difference between the packet timestamp and time received for all pairs of consecutive packets",
+ "type": "number"
+ },
+ "avgPacketLatency": {
+ "description": "average delivery latency",
+ "type": "number"
+ },
+ "avgReceiveThroughput": {
+ "description": "average receive throughput",
+ "type": "number"
+ },
+ "avgTransmitThroughput": {
+ "description": "average transmit throughput",
+ "type": "number"
+ },
+ "durConnectionFailedStatus": {
+ "description": "duration of failed state in milliseconds, computed as the cumulative time between a failed echo request and the next following successful error request, over this reporting interval",
+ "type": "number"
+ },
+ "durTunnelFailedStatus": {
+ "description": "Duration of errored state, computed as the cumulative time between a tunnel error indicator and the next following non-errored indicator, over this reporting interval",
+ "type": "number"
+ },
+ "flowActivatedBy": {
+ "description": "Endpoint activating the flow",
+ "type": "string"
+ },
+ "flowActivationEpoch": {
+ "description": "Time the connection is activated in the flow (connection) being reported on, or transmission time of the first packet if activation time is not available",
+ "type": "number"
+ },
+ "flowActivationMicrosec": {
+ "description": "Integer microseconds for the start of the flow connection",
+ "type": "number"
+ },
+ "flowActivationTime": {
+ "description": "time the connection is activated in the flow being reported on, or transmission time of the first packet if activation time is not available; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "flowDeactivatedBy": {
+ "description": "Endpoint deactivating the flow",
+ "type": "string"
+ },
+ "flowDeactivationEpoch": {
+ "description": "Time for the start of the flow connection, in integer UTC epoch time aka UNIX time",
+ "type": "number"
+ },
+ "flowDeactivationMicrosec": {
+ "description": "Integer microseconds for the start of the flow connection",
+ "type": "number"
+ },
+ "flowDeactivationTime": {
+ "description": "Transmission time of the first packet in the flow connection being reported on; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "flowStatus": {
+ "description": "connection status at reporting time as a working / inactive / failed indicator value",
+ "type": "string"
+ },
+ "gtpConnectionStatus": {
+ "description": "Current connection state at reporting time",
+ "type": "string"
+ },
+ "gtpTunnelStatus": {
+ "description": "Current tunnel state at reporting time",
+ "type": "string"
+ },
+ "ipTosCountList": {
+ "description": "array of key: value pairs where the keys are drawn from the IP Type-of-Service identifiers which range from '0' to '255', and the values are the count of packets that had those ToS identifiers in the flow",
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "ipTosList": {
+ "description": "Array of unique IP Type-of-Service values observed in the flow where values range from '0' to '255'",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "largePacketRtt": {
+ "description": "large packet round trip time",
+ "type": "number"
+ },
+ "largePacketThreshold": {
+ "description": "large packet threshold being applied",
+ "type": "number"
+ },
+ "maxPacketDelayVariation": {
+ "description": "Maximum packet delay variation or jitter in milliseconds for received packets: Maximum of the difference between the packet timestamp and time received for all pairs of consecutive packets",
+ "type": "number"
+ },
+ "maxReceiveBitRate": {
+ "description": "maximum receive bit rate",
+ "type": "number"
+ },
+ "maxTransmitBitRate": {
+ "description": "maximum transmit bit rate",
+ "type": "number"
+ },
+ "mobileQciCosCountList": {
+ "description": "array of key: value pairs where the keys are drawn from LTE QCI or UMTS class of service strings, and the values are the count of packets that had those strings in the flow",
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "mobileQciCosList": {
+ "description": "Array of unique LTE QCI or UMTS class-of-service values observed in the flow",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "numActivationFailures": {
+ "description": "Number of failed activation requests, as observed by the reporting node",
+ "type": "number"
+ },
+ "numBitErrors": {
+ "description": "number of errored bits",
+ "type": "number"
+ },
+ "numBytesReceived": {
+ "description": "number of bytes received, including retransmissions",
+ "type": "number"
+ },
+ "numBytesTransmitted": {
+ "description": "number of bytes transmitted, including retransmissions",
+ "type": "number"
+ },
+ "numDroppedPackets": {
+ "description": "number of received packets dropped due to errors per virtual interface",
+ "type": "number"
+ },
+ "numGtpEchoFailures": {
+ "description": "Number of Echo request path failures where failed paths are defined in 3GPP TS 29.281 sec 7.2.1 and 3GPP TS 29.060 sec. 11.2",
+ "type": "number"
+ },
+ "numGtpTunnelErrors": {
+ "description": "Number of tunnel error indications where errors are defined in 3GPP TS 29.281 sec 7.3.1 and 3GPP TS 29.060 sec. 11.1",
+ "type": "number"
+ },
+ "numHttpErrors": {
+ "description": "Http error count",
+ "type": "number"
+ },
+ "numL7BytesReceived": {
+ "description": "number of tunneled layer 7 bytes received, including retransmissions",
+ "type": "number"
+ },
+ "numL7BytesTransmitted": {
+ "description": "number of tunneled layer 7 bytes transmitted, excluding retransmissions",
+ "type": "number"
+ },
+ "numLostPackets": {
+ "description": "number of lost packets",
+ "type": "number"
+ },
+ "numOutOfOrderPackets": {
+ "description": "number of out-of-order packets",
+ "type": "number"
+ },
+ "numPacketErrors": {
+ "description": "number of errored packets",
+ "type": "number"
+ },
+ "numPacketsReceivedExclRetrans": {
+ "description": "number of packets received, excluding retransmission",
+ "type": "number"
+ },
+ "numPacketsReceivedInclRetrans": {
+ "description": "number of packets received, including retransmission",
+ "type": "number"
+ },
+ "numPacketsTransmittedInclRetrans": {
+ "description": "number of packets transmitted, including retransmissions",
+ "type": "number"
+ },
+ "numRetries": {
+ "description": "number of packet retries",
+ "type": "number"
+ },
+ "numTimeouts": {
+ "description": "number of packet timeouts",
+ "type": "number"
+ },
+ "numTunneledL7BytesReceived": {
+ "description": "number of tunneled layer 7 bytes received, excluding retransmissions",
+ "type": "number"
+ },
+ "roundTripTime": {
+ "description": "round trip time",
+ "type": "number"
+ },
+ "tcpFlagCountList": {
+ "description": "array of key: value pairs where the keys are drawn from TCP Flags and the values are the count of packets that had that TCP Flag in the flow",
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "tcpFlagList": {
+ "description": "Array of unique TCP Flags observed in the flow",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "timeToFirstByte": {
+ "description": "Time in milliseconds between the connection activation and first byte received",
+ "type": "number"
+ }
+ },
+ "required": [
+ "avgBitErrorRate",
+ "avgPacketDelayVariation",
+ "avgPacketLatency",
+ "avgReceiveThroughput",
+ "avgTransmitThroughput",
+ "flowActivationEpoch",
+ "flowActivationMicrosec",
+ "flowDeactivationEpoch",
+ "flowDeactivationMicrosec",
+ "flowDeactivationTime",
+ "flowStatus",
+ "maxPacketDelayVariation",
+ "numActivationFailures",
+ "numBitErrors",
+ "numBytesReceived",
+ "numBytesTransmitted",
+ "numDroppedPackets",
+ "numL7BytesReceived",
+ "numL7BytesTransmitted",
+ "numLostPackets",
+ "numOutOfOrderPackets",
+ "numPacketErrors",
+ "numPacketsReceivedExclRetrans",
+ "numPacketsReceivedInclRetrans",
+ "numPacketsTransmittedInclRetrans",
+ "numRetries",
+ "numTimeouts",
+ "numTunneledL7BytesReceived",
+ "roundTripTime",
+ "timeToFirstByte"
+ ]
+ },
+ "heartbeatFields": {
+ "description": "optional field block for fields specific to heartbeat events",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional heartbeat fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "heartbeatFieldsVersion": {
+ "description": "version of the heartbeatFields block",
+ "type": "number"
+ },
+ "heartbeatInterval": {
+ "description": "current heartbeat interval in seconds",
+ "type": "integer"
+ }
+ },
+ "required": [
+ "heartbeatFieldsVersion",
+ "heartbeatInterval"
+ ]
+ },
+ "internalHeaderFields": {
+ "description": "enrichment fields for internal VES Event Listener service use only, not supplied by event sources",
+ "type": "object"
+ },
+ "jsonObject": {
+ "description": "json object schema, name and other meta-information along with one or more object instances",
+ "type": "object",
+ "properties": {
+ "objectInstances": {
+ "description": "one or more instances of the jsonObject",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/jsonObjectInstance"
+ }
+ },
+ "objectName": {
+ "description": "name of the JSON Object",
+ "type": "string"
+ },
+ "objectSchema": {
+ "description": "json schema for the object",
+ "type": "string"
+ },
+ "objectSchemaUrl": {
+ "description": "Url to the json schema for the object",
+ "type": "string"
+ },
+ "nfSubscribedObjectName": {
+ "description": "name of the object associated with the nfSubscriptonId",
+ "type": "string"
+ },
+ "nfSubscriptionId": {
+ "description": "identifies an openConfig telemetry subscription on a network function, which configures the network function to send complex object data associated with the jsonObject",
+ "type": "string"
+ }
+ },
+ "required": [
+ "objectInstances",
+ "objectName"
+ ]
+ },
+ "jsonObjectInstance": {
+ "description": "meta-information about an instance of a jsonObject along with the actual object instance",
+ "type": "object",
+ "properties": {
+ "objectInstance": {
+ "description": "an instance conforming to the jsonObject schema",
+ "type": "object"
+ },
+ "objectInstanceEpochMicrosec": {
+ "description": "the unix time aka epoch time associated with this objectInstance--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "objectKeys": {
+ "description": "an ordered set of keys that identifies this particular instance of jsonObject",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/key"
+ }
+ }
+ },
+ "required": [
+ "objectInstance"
+ ]
+ },
+ "key": {
+ "description": "tuple which provides the name of a key along with its value and relative order",
+ "type": "object",
+ "properties": {
+ "keyName": {
+ "description": "name of the key",
+ "type": "string"
+ },
+ "keyOrder": {
+ "description": "relative sequence or order of the key with respect to other keys",
+ "type": "integer"
+ },
+ "keyValue": {
+ "description": "value of the key",
+ "type": "string"
+ }
+ },
+ "required": [
+ "keyName"
+ ]
+ },
+ "latencyBucketMeasure": {
+ "description": "number of counts falling within a defined latency bucket",
+ "type": "object",
+ "properties": {
+ "countsInTheBucket": {
+ "type": "number"
+ },
+ "highEndOfLatencyBucket": {
+ "type": "number"
+ },
+ "lowEndOfLatencyBucket": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "countsInTheBucket"
+ ]
+ },
+ "measurementsForVfScalingFields": {
+ "description": "measurementsForVfScaling fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional name-value-pair fields",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "additionalMeasurements": {
+ "description": "array of named name-value-pair arrays",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/namedArrayOfFields"
+ }
+ },
+ "additionalObjects": {
+ "description": "array of JSON objects described by name, schema and other meta-information",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/jsonObject"
+ }
+ },
+ "codecUsageArray": {
+ "description": "array of codecs in use",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/codecsInUse"
+ }
+ },
+ "concurrentSessions": {
+ "description": "peak concurrent sessions for the VM or VNF over the measurementInterval",
+ "type": "integer"
+ },
+ "configuredEntities": {
+ "description": "over the measurementInterval, peak total number of: users, subscribers, devices, adjacencies, etc., for the VM, or subscribers, devices, etc., for the VNF",
+ "type": "integer"
+ },
+ "cpuUsageArray": {
+ "description": "usage of an array of CPUs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/cpuUsage"
+ }
+ },
+ "diskUsageArray": {
+ "description": "usage of an array of disks",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/diskUsage"
+ }
+ },
+ "featureUsageArray": {
+ "description": "array of features in use",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/featuresInUse"
+ }
+ },
+ "filesystemUsageArray": {
+ "description": "filesystem usage of the VM on which the VNFC reporting the event is running",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/filesystemUsage"
+ }
+ },
+ "latencyDistribution": {
+ "description": "array of integers representing counts of requests whose latency in milliseconds falls within per-VNF configured ranges",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/latencyBucketMeasure"
+ }
+ },
+ "meanRequestLatency": {
+ "description": "mean seconds required to respond to each request for the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "measurementInterval": {
+ "description": "interval over which measurements are being reported in seconds",
+ "type": "number"
+ },
+ "measurementsForVfScalingVersion": {
+ "description": "version of the measurementsForVfScaling block",
+ "type": "number"
+ },
+ "memoryUsageArray": {
+ "description": "memory usage of an array of VMs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/memoryUsage"
+ }
+ },
+ "numberOfMediaPortsInUse": {
+ "description": "number of media ports in use",
+ "type": "integer"
+ },
+ "requestRate": {
+ "description": "peak rate of service requests per second to the VNF over the measurementInterval",
+ "type": "number"
+ },
+ "vnfcScalingMetric": {
+ "description": "represents busy-ness of the VNF from 0 to 100 as reported by the VNFC",
+ "type": "integer"
+ },
+ "vNicPerformanceArray": {
+ "description": "usage of an array of virtual network interface cards",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/vNicPerformance"
+ }
+ }
+ },
+ "required": [
+ "measurementInterval",
+ "measurementsForVfScalingVersion"
+ ]
+ },
+ "memoryUsage": {
+ "description": "memory usage of an identified virtual machine",
+ "type": "object",
+ "properties": {
+ "memoryBuffered": {
+ "description": "kibibytes of temporary storage for raw disk blocks",
+ "type": "number"
+ },
+ "memoryCached": {
+ "description": "kibibytes of memory used for cache",
+ "type": "number"
+ },
+ "memoryConfigured": {
+ "description": "kibibytes of memory configured in the virtual machine on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "memoryFree": {
+ "description": "kibibytes of physical RAM left unused by the system",
+ "type": "number"
+ },
+ "memorySlabRecl": {
+ "description": "the part of the slab that can be reclaimed such as caches measured in kibibytes",
+ "type": "number"
+ },
+ "memorySlabUnrecl": {
+ "description": "the part of the slab that cannot be reclaimed even when lacking memory measured in kibibytes",
+ "type": "number"
+ },
+ "memoryUsed": {
+ "description": "total memory minus the sum of free, buffered, cached and slab memory measured in kibibytes",
+ "type": "number"
+ },
+ "vmIdentifier": {
+ "description": "virtual machine identifier associated with the memory metrics",
+ "type": "string"
+ }
+ },
+ "required": [
+ "memoryFree",
+ "memoryUsed",
+ "vmIdentifier"
+ ]
+ },
+ "mobileFlowFields": {
+ "description": "mobileFlow fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional mobileFlow fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "applicationType": {
+ "description": "Application type inferred",
+ "type": "string"
+ },
+ "appProtocolType": {
+ "description": "application protocol",
+ "type": "string"
+ },
+ "appProtocolVersion": {
+ "description": "application protocol version",
+ "type": "string"
+ },
+ "cid": {
+ "description": "cell id",
+ "type": "string"
+ },
+ "connectionType": {
+ "description": "Abbreviation referencing a 3GPP reference point e.g., S1-U, S11, etc",
+ "type": "string"
+ },
+ "ecgi": {
+ "description": "Evolved Cell Global Id",
+ "type": "string"
+ },
+ "flowDirection": {
+ "description": "Flow direction, indicating if the reporting node is the source of the flow or destination for the flow",
+ "type": "string"
+ },
+ "gtpPerFlowMetrics": {
+ "$ref": "#/definitions/gtpPerFlowMetrics"
+ },
+ "gtpProtocolType": {
+ "description": "GTP protocol",
+ "type": "string"
+ },
+ "gtpVersion": {
+ "description": "GTP protocol version",
+ "type": "string"
+ },
+ "httpHeader": {
+ "description": "HTTP request header, if the flow connects to a node referenced by HTTP",
+ "type": "string"
+ },
+ "imei": {
+ "description": "IMEI for the subscriber UE used in this flow, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "imsi": {
+ "description": "IMSI for the subscriber UE used in this flow, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "ipProtocolType": {
+ "description": "IP protocol type e.g., TCP, UDP, RTP...",
+ "type": "string"
+ },
+ "ipVersion": {
+ "description": "IP protocol version e.g., IPv4, IPv6",
+ "type": "string"
+ },
+ "lac": {
+ "description": "location area code",
+ "type": "string"
+ },
+ "mcc": {
+ "description": "mobile country code",
+ "type": "string"
+ },
+ "mnc": {
+ "description": "mobile network code",
+ "type": "string"
+ },
+ "mobileFlowFieldsVersion": {
+ "description": "version of the mobileFlowFields block",
+ "type": "number"
+ },
+ "msisdn": {
+ "description": "MSISDN for the subscriber UE used in this flow, as an integer, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "otherEndpointIpAddress": {
+ "description": "IP address for the other endpoint, as used for the flow being reported on",
+ "type": "string"
+ },
+ "otherEndpointPort": {
+ "description": "IP Port for the reporting entity, as used for the flow being reported on",
+ "type": "integer"
+ },
+ "otherFunctionalRole": {
+ "description": "Functional role of the other endpoint for the flow being reported on e.g., MME, S-GW, P-GW, PCRF...",
+ "type": "string"
+ },
+ "rac": {
+ "description": "routing area code",
+ "type": "string"
+ },
+ "radioAccessTechnology": {
+ "description": "Radio Access Technology e.g., 2G, 3G, LTE",
+ "type": "string"
+ },
+ "reportingEndpointIpAddr": {
+ "description": "IP address for the reporting entity, as used for the flow being reported on",
+ "type": "string"
+ },
+ "reportingEndpointPort": {
+ "description": "IP port for the reporting entity, as used for the flow being reported on",
+ "type": "integer"
+ },
+ "sac": {
+ "description": "service area code",
+ "type": "string"
+ },
+ "samplingAlgorithm": {
+ "description": "Integer identifier for the sampling algorithm or rule being applied in calculating the flow metrics if metrics are calculated based on a sample of packets, or 0 if no sampling is applied",
+ "type": "integer"
+ },
+ "tac": {
+ "description": "transport area code",
+ "type": "string"
+ },
+ "tunnelId": {
+ "description": "tunnel identifier",
+ "type": "string"
+ },
+ "vlanId": {
+ "description": "VLAN identifier used by this flow",
+ "type": "string"
+ }
+ },
+ "required": [
+ "flowDirection",
+ "gtpPerFlowMetrics",
+ "ipProtocolType",
+ "ipVersion",
+ "mobileFlowFieldsVersion",
+ "otherEndpointIpAddress",
+ "otherEndpointPort",
+ "reportingEndpointIpAddr",
+ "reportingEndpointPort"
+ ]
+ },
+ "namedArrayOfFields": {
+ "description": "an array of name value pairs along with a name for the array",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "arrayOfFields": {
+ "description": "array of name value pairs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ }
+ },
+ "required": [
+ "name",
+ "arrayOfFields"
+ ]
+ },
+ "otherFields": {
+ "description": "fields for events belonging to the 'other' domain of the commonEventHeader domain enumeration",
+ "type": "object",
+ "properties": {
+ "hashOfNameValuePairArrays": {
+ "description": "array of named name-value-pair arrays",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/namedArrayOfFields"
+ }
+ },
+ "jsonObjects": {
+ "description": "array of JSON objects described by name, schema and other meta-information",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/jsonObject"
+ }
+ },
+ "nameValuePairs": {
+ "description": "array of name-value pairs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "otherFieldsVersion": {
+ "description": "version of the otherFields block",
+ "type": "number"
+ }
+ },
+ "required": [
+ "otherFieldsVersion"
+ ]
+ },
+ "requestError": {
+ "description": "standard request error data structure",
+ "type": "object",
+ "properties": {
+ "messageId": {
+ "description": "Unique message identifier of the format ABCnnnn where ABC is either SVC for Service Exceptions or POL for Policy Exception",
+ "type": "string"
+ },
+ "text": {
+ "description": "Message text, with replacement variables marked with %n, where n is an index into the list of <variables> elements, starting at 1",
+ "type": "string"
+ },
+ "url": {
+ "description": "Hyperlink to a detailed error resource e.g., an HTML page for browser user agents",
+ "type": "string"
+ },
+ "variables": {
+ "description": "List of zero or more strings that represent the contents of the variables used by the message text",
+ "type": "string"
+ }
+ },
+ "required": [
+ "messageId",
+ "text"
+ ]
+ },
+ "sipSignalingFields": {
+ "description": "sip signaling fields",
+ "type": "object",
+ "properties": {
+ "additionalInformation": {
+ "description": "additional sip signaling fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "compressedSip": {
+ "description": "the full SIP request/response including headers and bodies",
+ "type": "string"
+ },
+ "correlator": {
+ "description": "this is the same for all events on this call",
+ "type": "string"
+ },
+ "localIpAddress": {
+ "description": "IP address on VNF",
+ "type": "string"
+ },
+ "localPort": {
+ "description": "port on VNF",
+ "type": "string"
+ },
+ "remoteIpAddress": {
+ "description": "IP address of peer endpoint",
+ "type": "string"
+ },
+ "remotePort": {
+ "description": "port of peer endpoint",
+ "type": "string"
+ },
+ "sipSignalingFieldsVersion": {
+ "description": "version of the sipSignalingFields block",
+ "type": "number"
+ },
+ "summarySip": {
+ "description": "the SIP Method or Response (‘INVITE’, ‘200 OK’, ‘BYE’, etc)",
+ "type": "string"
+ },
+ "vendorVnfNameFields": {
+ "$ref": "#/definitions/vendorVnfNameFields"
+ }
+ },
+ "required": [
+ "correlator",
+ "localIpAddress",
+ "localPort",
+ "remoteIpAddress",
+ "remotePort",
+ "sipSignalingFieldsVersion",
+ "vendorVnfNameFields"
+ ]
+ },
+ "stateChangeFields": {
+ "description": "stateChange fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional stateChange fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "newState": {
+ "description": "new state of the entity",
+ "type": "string",
+ "enum": [
+ "inService",
+ "maintenance",
+ "outOfService"
+ ]
+ },
+ "oldState": {
+ "description": "previous state of the entity",
+ "type": "string",
+ "enum": [
+ "inService",
+ "maintenance",
+ "outOfService"
+ ]
+ },
+ "stateChangeFieldsVersion": {
+ "description": "version of the stateChangeFields block",
+ "type": "number"
+ },
+ "stateInterface": {
+ "description": "card or port name of the entity that changed state",
+ "type": "string"
+ }
+ },
+ "required": [
+ "newState",
+ "oldState",
+ "stateChangeFieldsVersion",
+ "stateInterface"
+ ]
+ },
+ "suppressedNvPairs": {
+ "description": "List of specific NvPairsNames to suppress within a given Name-Value Field for event Throttling",
+ "type": "object",
+ "properties": {
+ "nvPairFieldName": {
+ "description": "Name of the field within which are the nvpair names to suppress",
+ "type": "string"
+ },
+ "suppressedNvPairNames": {
+ "description": "Array of nvpair names to suppress within the nvpairFieldName",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "nvPairFieldName",
+ "suppressedNvPairNames"
+ ]
+ },
+ "syslogFields": {
+ "description": "sysLog fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional syslog fields if needed provided as name=value delimited by a pipe ‘|’ symbol, for example: 'name1=value1|name2=value2|…'",
+ "type": "string"
+ },
+ "eventSourceHost": {
+ "description": "hostname of the device",
+ "type": "string"
+ },
+ "eventSourceType": {
+ "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
+ "type": "string"
+ },
+ "syslogFacility": {
+ "description": "numeric code from 0 to 23 for facility--see table in documentation",
+ "type": "integer"
+ },
+ "syslogFieldsVersion": {
+ "description": "version of the syslogFields block",
+ "type": "number"
+ },
+ "syslogMsg": {
+ "description": "syslog message",
+ "type": "string"
+ },
+ "syslogPri": {
+ "description": "0-192 combined severity and facility",
+ "type": "integer"
+ },
+ "syslogProc": {
+ "description": "identifies the application that originated the message",
+ "type": "string"
+ },
+ "syslogProcId": {
+ "description": "a change in the value of this field indicates a discontinuity in syslog reporting",
+ "type": "number"
+ },
+ "syslogSData": {
+ "description": "syslog structured data consisting of a structured data Id followed by a set of key value pairs",
+ "type": "string"
+ },
+ "syslogSdId": {
+ "description": "0-32 char in format name@number for example ourSDID@32473",
+ "type": "string"
+ },
+ "syslogSev": {
+ "description": "numerical Code for severity derived from syslogPri as remaider of syslogPri / 8",
+ "type": "string",
+ "enum": [
+ "Alert",
+ "Critical",
+ "Debug",
+ "Emergency",
+ "Error",
+ "Info",
+ "Notice",
+ "Warning"
+ ]
+ },
+ "syslogTag": {
+ "description": "msgId indicating the type of message such as TCPOUT or TCPIN; NILVALUE should be used when no other value can be provided",
+ "type": "string"
+ },
+ "syslogVer": {
+ "description": "IANA assigned version of the syslog protocol specification - typically 1",
+ "type": "number"
+ }
+ },
+ "required": [
+ "eventSourceType",
+ "syslogFieldsVersion",
+ "syslogMsg",
+ "syslogTag"
+ ]
+ },
+ "thresholdCrossingAlertFields": {
+ "description": "fields specific to threshold crossing alert events",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional threshold crossing alert fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "additionalParameters": {
+ "description": "performance counters",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/counter"
+ }
+ },
+ "alertAction": {
+ "description": "Event action",
+ "type": "string",
+ "enum": [
+ "CLEAR",
+ "CONT",
+ "SET"
+ ]
+ },
+ "alertDescription": {
+ "description": "Unique short alert description such as IF-SHUB-ERRDROP",
+ "type": "string"
+ },
+ "alertType": {
+ "description": "Event type",
+ "type": "string",
+ "enum": [
+ "CARD-ANOMALY",
+ "ELEMENT-ANOMALY",
+ "INTERFACE-ANOMALY",
+ "SERVICE-ANOMALY"
+ ]
+ },
+ "alertValue": {
+ "description": "Calculated API value (if applicable)",
+ "type": "string"
+ },
+ "associatedAlertIdList": {
+ "description": "List of eventIds associated with the event being reported",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "collectionTimestamp": {
+ "description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "dataCollector": {
+ "description": "Specific performance collector instance used",
+ "type": "string"
+ },
+ "elementType": {
+ "description": "type of network element - internal ATT field",
+ "type": "string"
+ },
+ "eventSeverity": {
+ "description": "event severity or priority",
+ "type": "string",
+ "enum": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
+ },
+ "eventStartTimestamp": {
+ "description": "Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800",
+ "type": "string"
+ },
+ "interfaceName": {
+ "description": "Physical or logical port or card (if applicable)",
+ "type": "string"
+ },
+ "networkService": {
+ "description": "network name - internal ATT field",
+ "type": "string"
+ },
+ "possibleRootCause": {
+ "description": "Reserved for future use",
+ "type": "string"
+ },
+ "thresholdCrossingFieldsVersion": {
+ "description": "version of the thresholdCrossingAlertFields block",
+ "type": "number"
+ }
+ },
+ "required": [
+ "additionalParameters",
+ "alertAction",
+ "alertDescription",
+ "alertType",
+ "collectionTimestamp",
+ "eventSeverity",
+ "eventStartTimestamp",
+ "thresholdCrossingFieldsVersion"
+ ]
+ },
+ "vendorVnfNameFields": {
+ "description": "provides vendor, vnf and vfModule identifying information",
+ "type": "object",
+ "properties": {
+ "vendorName": {
+ "description": "VNF vendor name",
+ "type": "string"
+ },
+ "vfModuleName": {
+ "description": "ASDC vfModuleName for the vfModule generating the event",
+ "type": "string"
+ },
+ "vnfName": {
+ "description": "ASDC modelName for the VNF generating the event",
+ "type": "string"
+ }
+ },
+ "required": [
+ "vendorName"
+ ]
+ },
+ "vNicPerformance": {
+ "description": "describes the performance and errors of an identified virtual network interface card",
+ "type": "object",
+ "properties": {
+ "receivedBroadcastPacketsAccumulated": {
+ "description": "Cumulative count of broadcast packets received as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "receivedBroadcastPacketsDelta": {
+ "description": "Count of broadcast packets received within the measurement interval",
+ "type": "number"
+ },
+ "receivedDiscardedPacketsAccumulated": {
+ "description": "Cumulative count of discarded packets received as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "receivedDiscardedPacketsDelta": {
+ "description": "Count of discarded packets received within the measurement interval",
+ "type": "number"
+ },
+ "receivedErrorPacketsAccumulated": {
+ "description": "Cumulative count of error packets received as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "receivedErrorPacketsDelta": {
+ "description": "Count of error packets received within the measurement interval",
+ "type": "number"
+ },
+ "receivedMulticastPacketsAccumulated": {
+ "description": "Cumulative count of multicast packets received as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "receivedMulticastPacketsDelta": {
+ "description": "Count of multicast packets received within the measurement interval",
+ "type": "number"
+ },
+ "receivedOctetsAccumulated": {
+ "description": "Cumulative count of octets received as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "receivedOctetsDelta": {
+ "description": "Count of octets received within the measurement interval",
+ "type": "number"
+ },
+ "receivedTotalPacketsAccumulated": {
+ "description": "Cumulative count of all packets received as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "receivedTotalPacketsDelta": {
+ "description": "Count of all packets received within the measurement interval",
+ "type": "number"
+ },
+ "receivedUnicastPacketsAccumulated": {
+ "description": "Cumulative count of unicast packets received as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "receivedUnicastPacketsDelta": {
+ "description": "Count of unicast packets received within the measurement interval",
+ "type": "number"
+ },
+ "transmittedBroadcastPacketsAccumulated": {
+ "description": "Cumulative count of broadcast packets transmitted as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "transmittedBroadcastPacketsDelta": {
+ "description": "Count of broadcast packets transmitted within the measurement interval",
+ "type": "number"
+ },
+ "transmittedDiscardedPacketsAccumulated": {
+ "description": "Cumulative count of discarded packets transmitted as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "transmittedDiscardedPacketsDelta": {
+ "description": "Count of discarded packets transmitted within the measurement interval",
+ "type": "number"
+ },
+ "transmittedErrorPacketsAccumulated": {
+ "description": "Cumulative count of error packets transmitted as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "transmittedErrorPacketsDelta": {
+ "description": "Count of error packets transmitted within the measurement interval",
+ "type": "number"
+ },
+ "transmittedMulticastPacketsAccumulated": {
+ "description": "Cumulative count of multicast packets transmitted as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "transmittedMulticastPacketsDelta": {
+ "description": "Count of multicast packets transmitted within the measurement interval",
+ "type": "number"
+ },
+ "transmittedOctetsAccumulated": {
+ "description": "Cumulative count of octets transmitted as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "transmittedOctetsDelta": {
+ "description": "Count of octets transmitted within the measurement interval",
+ "type": "number"
+ },
+ "transmittedTotalPacketsAccumulated": {
+ "description": "Cumulative count of all packets transmitted as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "transmittedTotalPacketsDelta": {
+ "description": "Count of all packets transmitted within the measurement interval",
+ "type": "number"
+ },
+ "transmittedUnicastPacketsAccumulated": {
+ "description": "Cumulative count of unicast packets transmitted as read at the end of the measurement interval",
+ "type": "number"
+ },
+ "transmittedUnicastPacketsDelta": {
+ "description": "Count of unicast packets transmitted within the measurement interval",
+ "type": "number"
+ },
+ "valuesAreSuspect": {
+ "description": "Indicates whether vNicPerformance values are likely inaccurate due to counter overflow or other condtions",
+ "type": "string",
+ "enum": [
+ "true",
+ "false"
+ ]
+ },
+ "vNicIdentifier": {
+ "description": "vNic identification",
+ "type": "string"
+ }
+ },
+ "required": [
+ "valuesAreSuspect",
+ "vNicIdentifier"
+ ]
+ },
+ "voiceQualityFields": {
+ "description": "provides statistics related to customer facing voice products",
+ "type": "object",
+ "properties": {
+ "additionalInformation": {
+ "description": "additional voice quality fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "calleeSideCodec": {
+ "description": "callee codec for the call",
+ "type": "string"
+ },
+ "callerSideCodec": {
+ "description": "caller codec for the call",
+ "type": "string"
+ },
+ "correlator": {
+ "description": "this is the same for all events on this call",
+ "type": "string"
+ },
+ "endOfCallVqmSummaries": {
+ "$ref": "#/definitions/endOfCallVqmSummaries"
+ },
+ "phoneNumber": {
+ "description": "phone number associated with the correlator",
+ "type": "string"
+ },
+ "midCallRtcp": {
+ "description": "Base64 encoding of the binary RTCP data excluding Eth/IP/UDP headers",
+ "type": "string"
+ },
+ "vendorVnfNameFields": {
+ "$ref": "#/definitions/vendorVnfNameFields"
+ },
+ "voiceQualityFieldsVersion": {
+ "description": "version of the voiceQualityFields block",
+ "type": "number"
+ }
+ },
+ "required": [
+ "calleeSideCodec",
+ "callerSideCodec",
+ "correlator",
+ "midCallRtcp",
+ "vendorVnfNameFields",
+ "voiceQualityFieldsVersion"
+ ]
+ }
+ }
+} \ No newline at end of file
diff --git a/etc/CommonEventFormat_Vendors_v25.json b/etc/CommonEventFormat_Vendors_v25.json
new file mode 100755
index 00000000..e439ddeb
--- /dev/null
+++ b/etc/CommonEventFormat_Vendors_v25.json
@@ -0,0 +1,1331 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "definitions": {
+ "schemaLicenseAndCopyrightNotice": {
+ "description": "Copyright (c) 2017, AT&T Intellectual Property. All rights reserved",
+ "type": "object",
+ "properties": {
+ "apacheLicense2.0": {
+ "description": "Licensed 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:",
+ "type": "string"
+ },
+ "licenseUrl": {
+ "description": "http://www.apache.org/licenses/LICENSE-2.0",
+ "type": "string"
+ },
+ "asIsClause": {
+ "description": "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.",
+ "type": "string"
+ },
+ "permissionsAndLimitations": {
+ "description": "See the License for the specific language governing permissions and limitations under the License.",
+ "type": "string"
+ }
+ }
+ },
+ "codecsInUse": {
+ "description": "number of times an identified codec was used over the measurementInterval",
+ "type": "object",
+ "properties": {
+ "codecIdentifier": {
+ "type": "string"
+ },
+ "numberInUse": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "codecIdentifier",
+ "codecUtilization"
+ ]
+ },
+ "command": {
+ "description": "command from an event collector toward an event source",
+ "type": "object",
+ "properties": {
+ "commandType": {
+ "type": "string",
+ "enum": [
+ "measurementIntervalChange",
+ "provideThrottlingState",
+ "throttlingSpecification"
+ ]
+ },
+ "eventDomainThrottleSpecification": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "measurementInterval": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "commandType"
+ ]
+ },
+ "commandList": {
+ "description": "array of commands from an event collector toward an event source",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/command"
+ },
+ "minItems": 0
+ },
+ "commonEventHeader": {
+ "description": "fields common to all events",
+ "type": "object",
+ "properties": {
+ "domain": {
+ "description": "the eventing domain associated with the event",
+ "type": "string",
+ "enum": [
+ "fault",
+ "heartbeat",
+ "measurementsForVfScaling",
+ "mobileFlow",
+ "other",
+ "stateChange",
+ "syslog",
+ "thresholdCrossingAlert"
+ ]
+ },
+ "eventId": {
+ "description": "event key that is unique to the event source",
+ "type": "string"
+ },
+ "eventType": {
+ "description": "unique event topic name",
+ "type": "string"
+ },
+ "functionalRole": {
+ "description": "function of the event source e.g., eNodeB, MME, PCRF",
+ "type": "string"
+ },
+ "lastEpochMicrosec": {
+ "description": "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "priority": {
+ "description": "processing priority",
+ "type": "string",
+ "enum": [
+ "High",
+ "Medium",
+ "Normal",
+ "Low"
+ ]
+ },
+ "reportingEntityId": {
+ "description": "UUID identifying the entity reporting the event, for example an OAM VM",
+ "type": "string"
+ },
+ "reportingEntityName": {
+ "description": "name of the entity reporting the event, for example, an OAM VM",
+ "type": "string"
+ },
+ "sequence": {
+ "description": "ordering of events communicated by an event source instance or 0 if not needed",
+ "type": "integer"
+ },
+ "sourceId": {
+ "description": "UUID identifying the entity experiencing the event issue",
+ "type": "string"
+ },
+ "sourceName": {
+ "description": "name of the entity experiencing the event issue",
+ "type": "string"
+ },
+ "startEpochMicrosec": {
+ "description": "the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "version": {
+ "description": "version of the event header",
+ "type": "number"
+ }
+ },
+ "required": [
+ "domain",
+ "eventId",
+ "functionalRole",
+ "lastEpochMicrosec",
+ "priority",
+ "reportingEntityName",
+ "sequence",
+ "sourceName",
+ "startEpochMicrosec"
+ ]
+ },
+ "counter": {
+ "description": "performance counter",
+ "type": "object",
+ "properties": {
+ "criticality": {
+ "type": "string",
+ "enum": [
+ "CRIT",
+ "MAJ"
+ ]
+ },
+ "name": {
+ "type": "string"
+ },
+ "thresholdCrossed": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "criticality",
+ "name",
+ "thresholdCrossed",
+ "value"
+ ]
+ },
+ "cpuUsage": {
+ "description": "percent usage of an identified CPU",
+ "type": "object",
+ "properties": {
+ "cpuIdentifier": {
+ "type": "string"
+ },
+ "percentUsage": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "cpuIdentifier",
+ "percentUsage"
+ ]
+ },
+ "errors": {
+ "description": "receive and transmit errors for the measurements domain",
+ "type": "object",
+ "properties": {
+ "receiveDiscards": {
+ "type": "number"
+ },
+ "receiveErrors": {
+ "type": "number"
+ },
+ "transmitDiscards": {
+ "type": "number"
+ },
+ "transmitErrors": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "receiveDiscards",
+ "receiveErrors",
+ "transmitDiscards",
+ "transmitErrors"
+ ]
+ },
+ "event": {
+ "description": "generic event format",
+ "type": "object",
+ "properties": {
+ "commonEventHeader": {
+ "$ref": "#/definitions/commonEventHeader"
+ },
+ "faultFields": {
+ "$ref": "#/definitions/faultFields"
+ },
+ "measurementsForVfScalingFields": {
+ "$ref": "#/definitions/measurementsForVfScalingFields"
+ },
+ "mobileFlowFields": {
+ "$ref": "#/definitions/mobileFlowFields"
+ },
+ "otherFields": {
+ "$ref": "#/definitions/otherFields"
+ },
+ "stateChangeFields": {
+ "$ref": "#/definitions/stateChangeFields"
+ },
+ "syslogFields": {
+ "$ref": "#/definitions/syslogFields"
+ },
+ "thresholdCrossingAlertFields": {
+ "$ref": "#/definitions/thresholdCrossingAlertFields"
+ }
+ },
+ "required": [
+ "commonEventHeader"
+ ]
+ },
+ "eventDomainThrottleSpecification": {
+ "description": "specification of what information to suppress within an event domain",
+ "type": "object",
+ "properties": {
+ "eventDomain": {
+ "description": "Event domain enum from the commonEventHeader domain field",
+ "type": "string"
+ },
+ "suppressedFieldNames": {
+ "description": "List of optional field names in the event block that should not be sent to the Event Listener",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "suppressedNvPairsList": {
+ "description": "Optional list of specific NvPairsNames to suppress within a given Name-Value Field",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/suppressedNvPairs"
+ }
+ }
+ },
+ "required": [
+ "eventDomain"
+ ]
+ },
+ "eventDomainThrottleSpecificationList": {
+ "description": "array of eventDomainThrottleSpecifications",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "minItems": 0
+ },
+ "eventList": {
+ "description": "array of events",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/event"
+ }
+ },
+ "eventThrottlingState": {
+ "description": "reports the throttling in force at the event source",
+ "type": "object",
+ "properties": {
+ "eventThrottlingMode": {
+ "description": "Mode the event manager is in",
+ "type": "string",
+ "enum": [
+ "normal",
+ "throttled"
+ ]
+ },
+ "eventDomainThrottleSpecificationList": {
+ "$ref": "#/definitions/eventDomainThrottleSpecificationList"
+ }
+ },
+ "required": [
+ "eventThrottlingMode"
+ ]
+ },
+ "faultFields": {
+ "description": "fields specific to fault events",
+ "type": "object",
+ "properties": {
+ "alarmAdditionalInformation": {
+ "description": "additional alarm information",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "alarmCondition": {
+ "description": "alarm condition reported by the device",
+ "type": "string"
+ },
+ "alarmInterfaceA": {
+ "description": "card, port, channel or interface name of the device generating the alarm",
+ "type": "string"
+ },
+ "eventSeverity": {
+ "description": "event severity or priority",
+ "type": "string",
+ "enum": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
+ },
+ "eventSourceType": {
+ "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
+ "type": "string"
+ },
+ "faultFieldsVersion": {
+ "description": "version of the faultFields block",
+ "type": "number"
+ },
+ "specificProblem": {
+ "description": "short description of the alarm or problem",
+ "type": "string"
+ },
+ "vfStatus": {
+ "description": "virtual function status enumeration",
+ "type": "string",
+ "enum": [
+ "Active",
+ "Idle",
+ "Preparing to terminate",
+ "Ready to terminate",
+ "Requesting termination"
+ ]
+ }
+ },
+ "required": [
+ "alarmCondition",
+ "eventSeverity",
+ "eventSourceType",
+ "specificProblem",
+ "vfStatus"
+ ]
+ },
+ "featuresInUse": {
+ "description": "number of times an identified feature was used over the measurementInterval",
+ "type": "object",
+ "properties": {
+ "featureIdentifier": {
+ "type": "string"
+ },
+ "featureUtilization": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "featureIdentifier",
+ "featureUtilization"
+ ]
+ },
+ "field": {
+ "description": "name value pair",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "value"
+ ]
+ },
+ "filesystemUsage": {
+ "description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second",
+ "type": "object",
+ "properties": {
+ "blockConfigured": {
+ "type": "number"
+ },
+ "blockIops": {
+ "type": "number"
+ },
+ "blockUsed": {
+ "type": "number"
+ },
+ "ephemeralConfigured": {
+ "type": "number"
+ },
+ "ephemeralIops": {
+ "type": "number"
+ },
+ "ephemeralUsed": {
+ "type": "number"
+ },
+ "filesystemName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "blockConfigured",
+ "blockIops",
+ "blockUsed",
+ "ephemeralConfigured",
+ "ephemeralIops",
+ "ephemeralUsed",
+ "filesystemName"
+ ]
+ },
+ "gtpPerFlowMetrics": {
+ "description": "Mobility GTP Protocol per flow metrics",
+ "type": "object",
+ "properties": {
+ "avgBitErrorRate": {
+ "description": "average bit error rate",
+ "type": "number"
+ },
+ "avgPacketDelayVariation": {
+ "description": "Average packet delay variation or jitter in milliseconds for received packets: Average difference between the packet timestamp and time received for all pairs of consecutive packets",
+ "type": "number"
+ },
+ "avgPacketLatency": {
+ "description": "average delivery latency",
+ "type": "number"
+ },
+ "avgReceiveThroughput": {
+ "description": "average receive throughput",
+ "type": "number"
+ },
+ "avgTransmitThroughput": {
+ "description": "average transmit throughput",
+ "type": "number"
+ },
+ "durConnectionFailedStatus": {
+ "description": "duration of failed state in milliseconds, computed as the cumulative time between a failed echo request and the next following successful error request, over this reporting interval",
+ "type": "number"
+ },
+ "durTunnelFailedStatus": {
+ "description": "Duration of errored state, computed as the cumulative time between a tunnel error indicator and the next following non-errored indicator, over this reporting interval",
+ "type": "number"
+ },
+ "flowActivatedBy": {
+ "description": "Endpoint activating the flow",
+ "type": "string"
+ },
+ "flowActivationEpoch": {
+ "description": "Time the connection is activated in the flow (connection) being reported on, or transmission time of the first packet if activation time is not available",
+ "type": "number"
+ },
+ "flowActivationMicrosec": {
+ "description": "Integer microseconds for the start of the flow connection",
+ "type": "number"
+ },
+ "flowActivationTime": {
+ "description": "time the connection is activated in the flow being reported on, or transmission time of the first packet if activation time is not available; with RFC 2822 compliant format: ‘Sat, 13 Mar 2010 11:29:05 -0800’",
+ "type": "string"
+ },
+ "flowDeactivatedBy": {
+ "description": "Endpoint deactivating the flow",
+ "type": "string"
+ },
+ "flowDeactivationEpoch": {
+ "description": "Time for the start of the flow connection, in integer UTC epoch time aka UNIX time",
+ "type": "number"
+ },
+ "flowDeactivationMicrosec": {
+ "description": "Integer microseconds for the start of the flow connection",
+ "type": "number"
+ },
+ "flowDeactivationTime": {
+ "description": "Transmission time of the first packet in the flow connection being reported on; with RFC 2822 compliant format: ‘Sat, 13 Mar 2010 11:29:05 -0800’",
+ "type": "string"
+ },
+ "flowStatus": {
+ "description": "connection status at reporting time as a working / inactive / failed indicator value",
+ "type": "string"
+ },
+ "gtpConnectionStatus": {
+ "description": "Current connection state at reporting time",
+ "type": "string"
+ },
+ "gtpTunnelStatus": {
+ "description": "Current tunnel state at reporting time",
+ "type": "string"
+ },
+ "ipTosCountList": {
+ "description": "array of key: value pairs where the keys are drawn from the IP Type-of-Service identifiers which range from '0' to '255', and the values are the count of packets that had those ToS identifiers in the flow",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ],
+ "additionalItems": false
+ }
+ },
+ "ipTosList": {
+ "description": "Array of unique IP Type-of-Service values observed in the flow where values range from '0' to '255'",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "largePacketRtt": {
+ "description": "large packet round trip time",
+ "type": "number"
+ },
+ "largePacketThreshold": {
+ "description": "large packet threshold being applied",
+ "type": "number"
+ },
+ "maxPacketDelayVariation": {
+ "description": "Maximum packet delay variation or jitter in milliseconds for received packets: Maximum of the difference between the packet timestamp and time received for all pairs of consecutive packets",
+ "type": "number"
+ },
+ "maxReceiveBitRate": {
+ "description": "maximum receive bit rate",
+ "type": "number"
+ },
+ "maxTransmitBitRate": {
+ "description": "maximum transmit bit rate",
+ "type": "number"
+ },
+ "mobileQciCosCountList": {
+ "description": "array of key: value pairs where the keys are drawn from LTE QCI or UMTS class of service strings, and the values are the count of packets that had those strings in the flow",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ],
+ "additionalItems": false
+ }
+ },
+ "mobileQciCosList": {
+ "description": "Array of unique LTE QCI or UMTS class-of-service values observed in the flow",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "numActivationFailures": {
+ "description": "Number of failed activation requests, as observed by the reporting node",
+ "type": "number"
+ },
+ "numBitErrors": {
+ "description": "number of errored bits",
+ "type": "number"
+ },
+ "numBytesReceived": {
+ "description": "number of bytes received, including retransmissions",
+ "type": "number"
+ },
+ "numBytesTransmitted": {
+ "description": "number of bytes transmitted, including retransmissions",
+ "type": "number"
+ },
+ "numDroppedPackets": {
+ "description": "number of received packets dropped due to errors per virtual interface",
+ "type": "number"
+ },
+ "numGtpEchoFailures": {
+ "description": "Number of Echo request path failures where failed paths are defined in 3GPP TS 29.281 sec 7.2.1 and 3GPP TS 29.060 sec. 11.2",
+ "type": "number"
+ },
+ "numGtpTunnelErrors": {
+ "description": "Number of tunnel error indications where errors are defined in 3GPP TS 29.281 sec 7.3.1 and 3GPP TS 29.060 sec. 11.1",
+ "type": "number"
+ },
+ "numHttpErrors": {
+ "description": "Http error count",
+ "type": "number"
+ },
+ "numL7BytesReceived": {
+ "description": "number of tunneled layer 7 bytes received, including retransmissions",
+ "type": "number"
+ },
+ "numL7BytesTransmitted": {
+ "description": "number of tunneled layer 7 bytes transmitted, excluding retransmissions",
+ "type": "number"
+ },
+ "numLostPackets": {
+ "description": "number of lost packets",
+ "type": "number"
+ },
+ "numOutOfOrderPackets": {
+ "description": "number of out-of-order packets",
+ "type": "number"
+ },
+ "numPacketErrors": {
+ "description": "number of errored packets",
+ "type": "number"
+ },
+ "numPacketsReceivedExclRetrans": {
+ "description": "number of packets received, excluding retransmission",
+ "type": "number"
+ },
+ "numPacketsReceivedInclRetrans": {
+ "description": "number of packets received, including retransmission",
+ "type": "number"
+ },
+ "numPacketsTransmittedInclRetrans": {
+ "description": "number of packets transmitted, including retransmissions",
+ "type": "number"
+ },
+ "numRetries": {
+ "description": "number of packet retries",
+ "type": "number"
+ },
+ "numTimeouts": {
+ "description": "number of packet timeouts",
+ "type": "number"
+ },
+ "numTunneledL7BytesReceived": {
+ "description": "number of tunneled layer 7 bytes received, excluding retransmissions",
+ "type": "number"
+ },
+ "roundTripTime": {
+ "description": "round trip time",
+ "type": "number"
+ },
+ "tcpFlagCountList": {
+ "description": "array of key: value pairs where the keys are drawn from TCP Flags and the values are the count of packets that had that TCP Flag in the flow",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ],
+ "additionalItems": false
+ }
+ },
+ "tcpFlagList": {
+ "description": "Array of unique TCP Flags observed in the flow",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "timeToFirstByte": {
+ "description": "Time in milliseconds between the connection activation and first byte received",
+ "type": "number"
+ }
+ },
+ "required": [
+ "avgBitErrorRate",
+ "avgPacketDelayVariation",
+ "avgPacketLatency",
+ "avgReceiveThroughput",
+ "avgTransmitThroughput",
+ "flowActivationEpoch",
+ "flowActivationMicrosec",
+ "flowDeactivationEpoch",
+ "flowDeactivationMicrosec",
+ "flowDeactivationTime",
+ "flowStatus",
+ "maxPacketDelayVariation",
+ "numActivationFailures",
+ "numBitErrors",
+ "numBytesReceived",
+ "numBytesTransmitted",
+ "numDroppedPackets",
+ "numL7BytesReceived",
+ "numL7BytesTransmitted",
+ "numLostPackets",
+ "numOutOfOrderPackets",
+ "numPacketErrors",
+ "numPacketsReceivedExclRetrans",
+ "numPacketsReceivedInclRetrans",
+ "numPacketsTransmittedInclRetrans",
+ "numRetries",
+ "numTimeouts",
+ "numTunneledL7BytesReceived",
+ "roundTripTime",
+ "timeToFirstByte"
+ ]
+ },
+ "latencyBucketMeasure": {
+ "description": "number of counts falling within a defined latency bucket",
+ "type": "object",
+ "properties": {
+ "countsInTheBucket": {
+ "type": "number"
+ },
+ "highEndOfLatencyBucket": {
+ "type": "number"
+ },
+ "lowEndOfLatencyBucket": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "countsInTheBucket"
+ ]
+ },
+ "measurementGroup": {
+ "description": "measurement group",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "measurements": {
+ "description": "array of name value pair measurements",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ }
+ },
+ "required": [
+ "name",
+ "measurements"
+ ]
+ },
+ "measurementsForVfScalingFields": {
+ "description": "measurementsForVfScaling fields",
+ "type": "object",
+ "properties": {
+ "additionalMeasurements": {
+ "description": "additional measurement fields",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/measurementGroup"
+ }
+ },
+ "aggregateCpuUsage": {
+ "description": "aggregate CPU usage of the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "codecUsageArray": {
+ "description": "array of codecs in use",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/codecsInUse"
+ }
+ },
+ "concurrentSessions": {
+ "description": "peak concurrent sessions for the VM or VNF over the measurementInterval",
+ "type": "number"
+ },
+ "configuredEntities": {
+ "description": "over the measurementInterval, peak total number of: users, subscribers, devices, adjacencies, etc., for the VM, or subscribers, devices, etc., for the VNF",
+ "type": "number"
+ },
+ "cpuUsageArray": {
+ "description": "usage of an array of CPUs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/cpuUsage"
+ }
+ },
+ "errors": {
+ "$ref": "#/definitions/errors"
+ },
+ "featureUsageArray": {
+ "description": "array of features in use",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/featuresInUse"
+ }
+ },
+ "filesystemUsageArray": {
+ "description": "filesystem usage of the VM on which the VNFC reporting the event is running",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/filesystemUsage"
+ }
+ },
+ "latencyDistribution": {
+ "description": "array of integers representing counts of requests whose latency in milliseconds falls within per-VNF configured ranges",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/latencyBucketMeasure"
+ }
+ },
+ "meanRequestLatency": {
+ "description": "mean seconds required to respond to each request for the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "measurementInterval": {
+ "description": "interval over which measurements are being reported in seconds",
+ "type": "number"
+ },
+ "measurementsForVfScalingVersion": {
+ "description": "version of the measurementsForVfScaling block",
+ "type": "number"
+ },
+ "memoryConfigured": {
+ "description": "memory configured in the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "memoryUsed": {
+ "description": "memory usage of the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "numberOfMediaPortsInUse": {
+ "description": "number of media ports in use",
+ "type": "number"
+ },
+ "requestRate": {
+ "description": "peak rate of service requests per second to the VNF over the measurementInterval",
+ "type": "number"
+ },
+ "vnfcScalingMetric": {
+ "description": "represents busy-ness of the VNF from 0 to 100 as reported by the VNFC",
+ "type": "number"
+ },
+ "vNicUsageArray": {
+ "description": "usage of an array of virtual network interface cards",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/vNicUsage"
+ }
+ }
+ },
+ "required": [
+ "measurementInterval"
+ ]
+ },
+ "mobileFlowFields": {
+ "description": "mobileFlow fields",
+ "type": "object",
+ "properties": {
+ "applicationType": {
+ "description": "Application type inferred",
+ "type": "string"
+ },
+ "appProtocolType": {
+ "description": "application protocol",
+ "type": "string"
+ },
+ "appProtocolVersion": {
+ "description": "application protocol version",
+ "type": "string"
+ },
+ "cid": {
+ "description": "cell id",
+ "type": "string"
+ },
+ "connectionType": {
+ "description": "Abbreviation referencing a 3GPP reference point e.g., S1-U, S11, etc",
+ "type": "string"
+ },
+ "ecgi": {
+ "description": "Evolved Cell Global Id",
+ "type": "string"
+ },
+ "flowDirection": {
+ "description": "Flow direction, indicating if the reporting node is the source of the flow or destination for the flow",
+ "type": "string"
+ },
+ "gtpPerFlowMetrics": {
+ "$ref": "#/definitions/gtpPerFlowMetrics"
+ },
+ "gtpProtocolType": {
+ "description": "GTP protocol",
+ "type": "string"
+ },
+ "gtpVersion": {
+ "description": "GTP protocol version",
+ "type": "string"
+ },
+ "httpHeader": {
+ "description": "HTTP request header, if the flow connects to a node referenced by HTTP",
+ "type": "string"
+ },
+ "imei": {
+ "description": "IMEI for the subscriber UE used in this flow, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "imsi": {
+ "description": "IMSI for the subscriber UE used in this flow, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "ipProtocolType": {
+ "description": "IP protocol type e.g., TCP, UDP, RTP...",
+ "type": "string"
+ },
+ "ipVersion": {
+ "description": "IP protocol version e.g., IPv4, IPv6",
+ "type": "string"
+ },
+ "lac": {
+ "description": "location area code",
+ "type": "string"
+ },
+ "mcc": {
+ "description": "mobile country code",
+ "type": "string"
+ },
+ "mnc": {
+ "description": "mobile network code",
+ "type": "string"
+ },
+ "msisdn": {
+ "description": "MSISDN for the subscriber UE used in this flow, as an integer, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "otherEndpointIpAddress": {
+ "description": "IP address for the other endpoint, as used for the flow being reported on",
+ "type": "string"
+ },
+ "otherEndpointPort": {
+ "description": "IP Port for the reporting entity, as used for the flow being reported on",
+ "type": "number"
+ },
+ "otherFunctionalRole": {
+ "description": "Functional role of the other endpoint for the flow being reported on e.g., MME, S-GW, P-GW, PCRF...",
+ "type": "string"
+ },
+ "rac": {
+ "description": "routing area code",
+ "type": "string"
+ },
+ "radioAccessTechnology": {
+ "description": "Radio Access Technology e.g., 2G, 3G, LTE",
+ "type": "string"
+ },
+ "reportingEndpointIpAddr": {
+ "description": "IP address for the reporting entity, as used for the flow being reported on",
+ "type": "string"
+ },
+ "reportingEndpointPort": {
+ "description": "IP port for the reporting entity, as used for the flow being reported on",
+ "type": "number"
+ },
+ "sac": {
+ "description": "service area code",
+ "type": "string"
+ },
+ "samplingAlgorithm": {
+ "description": "Integer identifier for the sampling algorithm or rule being applied in calculating the flow metrics if metrics are calculated based on a sample of packets, or 0 if no sampling is applied",
+ "type": "number"
+ },
+ "tac": {
+ "description": "transport area code",
+ "type": "string"
+ },
+ "tunnelId": {
+ "description": "tunnel identifier",
+ "type": "string"
+ },
+ "vlanId": {
+ "description": "VLAN identifier used by this flow",
+ "type": "string"
+ }
+ },
+ "required": [
+ "flowDirection",
+ "gtpPerFlowMetrics",
+ "ipProtocolType",
+ "ipVersion",
+ "otherEndpointIpAddress",
+ "otherEndpointPort",
+ "reportingEndpointIpAddr",
+ "reportingEndpointPort"
+ ]
+ },
+ "otherFields": {
+ "description": "additional fields not reported elsewhere",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "requestError": {
+ "description": "standard request error data structure",
+ "type": "object",
+ "properties": {
+ "messageId": {
+ "description": "Unique message identifier of the format ‘ABCnnnn’ where ‘ABC’ is either ‘SVC’ for Service Exceptions or ‘POL’ for Policy Exception",
+ "type": "string"
+ },
+ "text": {
+ "description": "Message text, with replacement variables marked with %n, where n is an index into the list of <variables> elements, starting at 1",
+ "type": "string"
+ },
+ "url": {
+ "description": "Hyperlink to a detailed error resource e.g., an HTML page for browser user agents",
+ "type": "string"
+ },
+ "variables": {
+ "description": "List of zero or more strings that represent the contents of the variables used by the message text",
+ "type": "string"
+ }
+ },
+ "required": [
+ "messageId",
+ "text"
+ ]
+ },
+ "stateChangeFields": {
+ "description": "stateChange fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional stateChange fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "newState": {
+ "description": "new state of the entity",
+ "type": "string",
+ "enum": [
+ "inService",
+ "maintenance",
+ "outOfService"
+ ]
+ },
+ "oldState": {
+ "description": "previous state of the entity",
+ "type": "string",
+ "enum": [
+ "inService",
+ "maintenance",
+ "outOfService"
+ ]
+ },
+ "stateChangeFieldsVersion": {
+ "description": "version of the stateChangeFields block",
+ "type": "number"
+ },
+ "stateInterface": {
+ "description": "card or port name of the entity that changed state",
+ "type": "string"
+ }
+ },
+ "required": [
+ "newState",
+ "oldState",
+ "stateInterface"
+ ]
+ },
+ "suppressedNvPairs": {
+ "description": "List of specific NvPairsNames to suppress within a given Name-Value Field for event Throttling",
+ "type": "object",
+ "properties": {
+ "nvPairFieldName": {
+ "description": "Name of the field within which are the nvpair names to suppress",
+ "type": "string"
+ },
+ "suppressedNvPairNames": {
+ "description": "Array of nvpair names to suppress within the nvpairFieldName",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "nvPairFieldName",
+ "suppressedNvPairNames"
+ ]
+ },
+ "syslogFields": {
+ "description": "sysLog fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional syslog fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "eventSourceHost": {
+ "description": "hostname of the device",
+ "type": "string"
+ },
+ "eventSourceType": {
+ "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
+ "type": "string"
+ },
+ "syslogFacility": {
+ "description": "numeric code from 0 to 23 for facility--see table in documentation",
+ "type": "number"
+ },
+ "syslogFieldsVersion": {
+ "description": "version of the syslogFields block",
+ "type": "number"
+ },
+ "syslogMsg": {
+ "description": "syslog message",
+ "type": "string"
+ },
+ "syslogProc": {
+ "description": "identifies the application that originated the message",
+ "type": "string"
+ },
+ "syslogProcId": {
+ "description": "a change in the value of this field indicates a discontinuity in syslog reporting",
+ "type": "number"
+ },
+ "syslogSData": {
+ "description": "syslog structured data consisting of a structured data Id followed by a set of key value pairs",
+ "type": "string"
+ },
+ "syslogTag": {
+ "description": "msgId indicating the type of message such as TCPOUT or TCPIN; NILVALUE should be used when no other value can be provided",
+ "type": "string"
+ },
+ "syslogVer": {
+ "description": "IANA assigned version of the syslog protocol specification - typically 1",
+ "type": "number"
+ }
+ },
+ "required": [
+ "eventSourceType",
+ "syslogMsg",
+ "syslogTag"
+ ]
+ },
+ "thresholdCrossingAlertFields": {
+ "description": "fields specific to threshold crossing alert events",
+ "type": "object",
+ "properties": {
+ "additionalParameters": {
+ "description": "performance counters",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/counter"
+ }
+ },
+ "alertAction": {
+ "description": "Event action",
+ "type": "string",
+ "enum": [
+ "CLEAR",
+ "CONT",
+ "SET"
+ ]
+ },
+ "alertDescription": {
+ "description": "Unique short alert description such as IF-SHUB-ERRDROP",
+ "type": "string"
+ },
+ "alertType": {
+ "description": "Event type",
+ "type": "string",
+ "enum": [
+ "CARD-ANOMALY",
+ "ELEMENT-ANOMALY",
+ "INTERFACE-ANOMALY",
+ "SERVICE-ANOMALY"
+ ]
+ },
+ "alertValue": {
+ "description": "Calculated API value (if applicable)",
+ "type": "string"
+ },
+ "associatedAlertIdList": {
+ "description": "List of eventIds associated with the event being reported",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "collectionTimestamp": {
+ "description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: ‘Sat, 13 Mar 2010 11:29:05 -0800’",
+ "type": "string"
+ },
+ "dataCollector": {
+ "description": "Specific performance collector instance used",
+ "type": "string"
+ },
+ "elementType": {
+ "description": "type of network element - internal ATT field",
+ "type": "string"
+ },
+ "eventSeverity": {
+ "description": "event severity or priority",
+ "type": "string",
+ "enum": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
+ },
+ "eventStartTimestamp": {
+ "description": "Time closest to when the measurement was made; with RFC 2822 compliant format: ‘Sat, 13 Mar 2010 11:29:05 -0800’",
+ "type": "string"
+ },
+ "interfaceName": {
+ "description": "Physical or logical port or card (if applicable)",
+ "type": "string"
+ },
+ "networkService": {
+ "description": "network name - internal ATT field",
+ "type": "string"
+ },
+ "possibleRootCause": {
+ "description": "Reserved for future use",
+ "type": "string"
+ },
+ "thresholdCrossingFieldsVersion": {
+ "description": "version of the thresholdCrossingAlertFields block",
+ "type": "number"
+ }
+ },
+ "required": [
+ "additionalParameters",
+ "alertAction",
+ "alertDescription",
+ "alertType",
+ "collectionTimestamp",
+ "eventSeverity",
+ "eventStartTimestamp"
+ ]
+ },
+ "vNicUsage": {
+ "description": "usage of identified virtual network interface card",
+ "type": "object",
+ "properties": {
+ "broadcastPacketsIn": {
+ "type": "number"
+ },
+ "broadcastPacketsOut": {
+ "type": "number"
+ },
+ "bytesIn": {
+ "type": "number"
+ },
+ "bytesOut": {
+ "type": "number"
+ },
+ "multicastPacketsIn": {
+ "type": "number"
+ },
+ "multicastPacketsOut": {
+ "type": "number"
+ },
+ "packetsIn": {
+ "type": "number"
+ },
+ "packetsOut": {
+ "type": "number"
+ },
+ "unicastPacketsIn": {
+ "type": "number"
+ },
+ "unicastPacketsOut": {
+ "type": "number"
+ },
+ "vNicIdentifier": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "bytesIn",
+ "bytesOut",
+ "packetsIn",
+ "packetsOut",
+ "vNicIdentifier"
+ ]
+ }
+ },
+ "title": "Event Listener",
+ "type": "object",
+ "properties": {
+ "event": {
+ "$ref": "#/definitions/event"
+ }
+ },
+ "required": [
+ "event"
+ ]
+} \ No newline at end of file
diff --git a/etc/CommonEventFormat_Vendors_v26.0.json b/etc/CommonEventFormat_Vendors_v26.0.json
new file mode 100755
index 00000000..f2785626
--- /dev/null
+++ b/etc/CommonEventFormat_Vendors_v26.0.json
@@ -0,0 +1,1612 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "definitions": {
+ "schemaLicenseAndCopyrightNotice": {
+ "description": "Copyright (c) 2017, AT&T Intellectual Property. All rights reserved",
+ "type": "object",
+ "properties": {
+ "apacheLicense2.0": {
+ "description": "Licensed 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:",
+ "type": "string"
+ },
+ "licenseUrl": {
+ "description": "http://www.apache.org/licenses/LICENSE-2.0",
+ "type": "string"
+ },
+ "asIsClause": {
+ "description": "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.",
+ "type": "string"
+ },
+ "permissionsAndLimitations": {
+ "description": "See the License for the specific language governing permissions and limitations under the License.",
+ "type": "string"
+ }
+ }
+ },
+ "codecsInUse": {
+ "description": "number of times an identified codec was used over the measurementInterval",
+ "type": "object",
+ "properties": {
+ "codecIdentifier": {
+ "type": "string"
+ },
+ "numberInUse": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "codecIdentifier",
+ "numberInUse"
+ ]
+ },
+ "codecSelected": {
+ "description": "codec selected for the call - 'PCMA', 'G729A', ...",
+ "type": "object",
+ "properties": {
+ "codec": {
+ "type": "string"
+ }
+ }
+ },
+ "codecSelectedTranscoding": {
+ "description": "codecs selected for the call, when transcoding is occurring",
+ "type": "object",
+ "properties": {
+ "calleeSideCodec": {
+ "type": "string"
+ },
+ "callerSideCodec": {
+ "type": "string"
+ }
+ }
+ },
+ "command": {
+ "description": "command from an event collector toward an event source",
+ "type": "object",
+ "properties": {
+ "commandType": {
+ "type": "string",
+ "enum": [
+ "measurementIntervalChange",
+ "provideThrottlingState",
+ "throttlingSpecification"
+ ]
+ },
+ "eventDomainThrottleSpecification": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "measurementInterval": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "commandType"
+ ]
+ },
+ "commandList": {
+ "description": "array of commands from an event collector toward an event source",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/commandListEntry"
+ },
+ "minItems": 0
+ },
+ "commandListEntry": {
+ "description": "reference to a command object",
+ "type": "object",
+ "properties": {
+ "command": {
+ "$ref": "#/definitions/command"
+ }
+ },
+ "required": [
+ "command"
+ ]
+ },
+ "commonEventHeader": {
+ "description": "fields common to all events",
+ "type": "object",
+ "properties": {
+ "domain": {
+ "description": "the eventing domain associated with the event",
+ "type": "string",
+ "enum": [
+ "fault",
+ "heartbeat",
+ "measurementsForVfScaling",
+ "mobileFlow",
+ "other",
+ "serviceEvents",
+ "signaling",
+ "stateChange",
+ "syslog",
+ "thresholdCrossingAlert"
+ ]
+ },
+ "eventId": {
+ "description": "event key that is unique to the event source",
+ "type": "string"
+ },
+ "eventType": {
+ "description": "unique event topic name",
+ "type": "string"
+ },
+ "functionalRole": {
+ "description": "function of the event source e.g., eNodeB, MME, PCRF",
+ "type": "string"
+ },
+ "lastEpochMicrosec": {
+ "description": "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "priority": {
+ "description": "processing priority",
+ "type": "string",
+ "enum": [
+ "High",
+ "Medium",
+ "Normal",
+ "Low"
+ ]
+ },
+ "reportingEntityId": {
+ "description": "UUID identifying the entity reporting the event, for example an OAM VM",
+ "type": "string"
+ },
+ "reportingEntityName": {
+ "description": "name of the entity reporting the event, for example, an OAM VM",
+ "type": "string"
+ },
+ "sequence": {
+ "description": "ordering of events communicated by an event source instance or 0 if not needed",
+ "type": "integer"
+ },
+ "sourceId": {
+ "description": "UUID identifying the entity experiencing the event issue",
+ "type": "string"
+ },
+ "sourceName": {
+ "description": "name of the entity experiencing the event issue",
+ "type": "string"
+ },
+ "startEpochMicrosec": {
+ "description": "the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds",
+ "type": "number"
+ },
+ "version": {
+ "description": "version of the event header",
+ "type": "number"
+ }
+ },
+ "required": [
+ "domain",
+ "eventId",
+ "functionalRole",
+ "lastEpochMicrosec",
+ "priority",
+ "reportingEntityName",
+ "sequence",
+ "sourceName",
+ "startEpochMicrosec"
+ ]
+ },
+ "counter": {
+ "description": "performance counter",
+ "type": "object",
+ "properties": {
+ "criticality": {
+ "type": "string",
+ "enum": [
+ "CRIT",
+ "MAJ"
+ ]
+ },
+ "name": {
+ "type": "string"
+ },
+ "thresholdCrossed": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "criticality",
+ "name",
+ "thresholdCrossed",
+ "value"
+ ]
+ },
+ "cpuUsage": {
+ "description": "percent usage of an identified CPU",
+ "type": "object",
+ "properties": {
+ "cpuIdentifier": {
+ "type": "string"
+ },
+ "percentUsage": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "cpuIdentifier",
+ "percentUsage"
+ ]
+ },
+ "endOfCallVqmSummaries": {
+ "description": "",
+ "type": "object",
+ "properties": {
+ "adjacencyName": {
+ "description": " adjacency name",
+ "type": "string"
+ },
+ "endpointDescription": {
+ "description": "‘Caller’, ‘Callee’",
+ "type": "string",
+ "enum": [
+ "Caller",
+ "Callee"
+ ]
+ },
+ "endpointJitter": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpOctetsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpOctetsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpOctetsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpPacketsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpPacketsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "endpointRtpPacketsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "localJitter": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpOctetsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpOctetsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpOctetsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpPacketsDiscarded": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpPacketsReceived": {
+ "description": "",
+ "type": "number"
+ },
+ "localRtpPacketsSent": {
+ "description": "",
+ "type": "number"
+ },
+ "mosCqe": {
+ "description": "1-5 1dp",
+ "type": "number"
+ },
+ "packetsLost": {
+ "description": "",
+ "type": "number"
+ },
+ "packetLossPercent": {
+ "description": "Calculated percentage packet loss based on Endpoint RTP packets lost (as reported in RTCP) and Local RTP packets sent. Direction is based on Endpoint description (Caller, Callee). Decimal (2 dp)",
+ "type": "number"
+ },
+ "rFactor": {
+ "description": "0-100",
+ "type": "number"
+ },
+ "roundTripDelay": {
+ "description": "millisecs",
+ "type": "number"
+ }
+ }
+ },
+ "errors": {
+ "description": "receive and transmit errors for the measurements domain",
+ "type": "object",
+ "properties": {
+ "receiveDiscards": {
+ "type": "number"
+ },
+ "receiveErrors": {
+ "type": "number"
+ },
+ "transmitDiscards": {
+ "type": "number"
+ },
+ "transmitErrors": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "receiveDiscards",
+ "receiveErrors",
+ "transmitDiscards",
+ "transmitErrors"
+ ]
+ },
+ "event": {
+ "description": "generic event format",
+ "type": "object",
+ "properties": {
+ "commonEventHeader": {
+ "$ref": "#/definitions/commonEventHeader"
+ },
+ "faultFields": {
+ "$ref": "#/definitions/faultFields"
+ },
+ "measurementsForVfScalingFields": {
+ "$ref": "#/definitions/measurementsForVfScalingFields"
+ },
+ "mobileFlowFields": {
+ "$ref": "#/definitions/mobileFlowFields"
+ },
+ "otherFields": {
+ "$ref": "#/definitions/otherFields"
+ },
+ "serviceEventsFields": {
+ "$ref": "#/definitions/serviceEventsFields"
+ },
+ "signalingFields": {
+ "$ref": "#/definitions/signalingFields"
+ },
+ "stateChangeFields": {
+ "$ref": "#/definitions/stateChangeFields"
+ },
+ "syslogFields": {
+ "$ref": "#/definitions/syslogFields"
+ },
+ "thresholdCrossingAlertFields": {
+ "$ref": "#/definitions/thresholdCrossingAlertFields"
+ }
+ },
+ "required": [
+ "commonEventHeader"
+ ]
+ },
+ "eventDomainThrottleSpecification": {
+ "description": "specification of what information to suppress within an event domain",
+ "type": "object",
+ "properties": {
+ "eventDomain": {
+ "description": "Event domain enum from the commonEventHeader domain field",
+ "type": "string"
+ },
+ "suppressedFieldNames": {
+ "description": "List of optional field names in the event block that should not be sent to the Event Listener",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "suppressedNvPairsList": {
+ "description": "Optional list of specific NvPairsNames to suppress within a given Name-Value Field",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/suppressedNvPairs"
+ }
+ }
+ },
+ "required": [
+ "eventDomain"
+ ]
+ },
+ "eventDomainThrottleSpecificationList": {
+ "description": "array of eventDomainThrottleSpecifications",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/eventDomainThrottleSpecification"
+ },
+ "minItems": 0
+ },
+ "eventInstanceIdentifier": {
+ "description": "event instance identifiers",
+ "type": "object",
+ "properties": {
+ "eventId": {
+ "description": "event identifier",
+ "type": "string"
+ },
+ "vendorId": {
+ "description": "vendor identifier",
+ "type": "string"
+ },
+ "productId": {
+ "description": "product identifier",
+ "type": "string"
+ },
+ "subsystemId": {
+ "description": "subsystem identifier",
+ "type": "string"
+ },
+ "eventFriendlyName": {
+ "description": "event instance friendly name",
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventId",
+ "vendorId"
+ ]
+ },
+ "eventList": {
+ "description": "array of events",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/event"
+ }
+ },
+ "eventThrottlingState": {
+ "description": "reports the throttling in force at the event source",
+ "type": "object",
+ "properties": {
+ "eventThrottlingMode": {
+ "description": "Mode the event manager is in",
+ "type": "string",
+ "enum": [
+ "normal",
+ "throttled"
+ ]
+ },
+ "eventDomainThrottleSpecificationList": {
+ "$ref": "#/definitions/eventDomainThrottleSpecificationList"
+ }
+ },
+ "required": [
+ "eventThrottlingMode"
+ ]
+ },
+ "faultFields": {
+ "description": "fields specific to fault events",
+ "type": "object",
+ "properties": {
+ "alarmAdditionalInformation": {
+ "description": "additional alarm information",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "alarmCondition": {
+ "description": "alarm condition reported by the device",
+ "type": "string"
+ },
+ "alarmInterfaceA": {
+ "description": "card, port, channel or interface name of the device generating the alarm",
+ "type": "string"
+ },
+ "eventSeverity": {
+ "description": "event severity or priority",
+ "type": "string",
+ "enum": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
+ },
+ "eventSourceType": {
+ "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
+ "type": "string"
+ },
+ "faultFieldsVersion": {
+ "description": "version of the faultFields block",
+ "type": "number"
+ },
+ "specificProblem": {
+ "description": "short description of the alarm or problem",
+ "type": "string"
+ },
+ "vfStatus": {
+ "description": "virtual function status enumeration",
+ "type": "string",
+ "enum": [
+ "Active",
+ "Idle",
+ "Preparing to terminate",
+ "Ready to terminate",
+ "Requesting termination"
+ ]
+ }
+ },
+ "required": [
+ "alarmCondition",
+ "eventSeverity",
+ "eventSourceType",
+ "specificProblem",
+ "vfStatus"
+ ]
+ },
+ "featuresInUse": {
+ "description": "number of times an identified feature was used over the measurementInterval",
+ "type": "object",
+ "properties": {
+ "featureIdentifier": {
+ "type": "string"
+ },
+ "featureUtilization": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "featureIdentifier",
+ "featureUtilization"
+ ]
+ },
+ "field": {
+ "description": "name value pair",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "value"
+ ]
+ },
+ "filesystemUsage": {
+ "description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second",
+ "type": "object",
+ "properties": {
+ "blockConfigured": {
+ "type": "number"
+ },
+ "blockIops": {
+ "type": "number"
+ },
+ "blockUsed": {
+ "type": "number"
+ },
+ "ephemeralConfigured": {
+ "type": "number"
+ },
+ "ephemeralIops": {
+ "type": "number"
+ },
+ "ephemeralUsed": {
+ "type": "number"
+ },
+ "filesystemName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "blockConfigured",
+ "blockIops",
+ "blockUsed",
+ "ephemeralConfigured",
+ "ephemeralIops",
+ "ephemeralUsed",
+ "filesystemName"
+ ]
+ },
+ "gtpPerFlowMetrics": {
+ "description": "Mobility GTP Protocol per flow metrics",
+ "type": "object",
+ "properties": {
+ "avgBitErrorRate": {
+ "description": "average bit error rate",
+ "type": "number"
+ },
+ "avgPacketDelayVariation": {
+ "description": "Average packet delay variation or jitter in milliseconds for received packets: Average difference between the packet timestamp and time received for all pairs of consecutive packets",
+ "type": "number"
+ },
+ "avgPacketLatency": {
+ "description": "average delivery latency",
+ "type": "number"
+ },
+ "avgReceiveThroughput": {
+ "description": "average receive throughput",
+ "type": "number"
+ },
+ "avgTransmitThroughput": {
+ "description": "average transmit throughput",
+ "type": "number"
+ },
+ "durConnectionFailedStatus": {
+ "description": "duration of failed state in milliseconds, computed as the cumulative time between a failed echo request and the next following successful error request, over this reporting interval",
+ "type": "number"
+ },
+ "durTunnelFailedStatus": {
+ "description": "Duration of errored state, computed as the cumulative time between a tunnel error indicator and the next following non-errored indicator, over this reporting interval",
+ "type": "number"
+ },
+ "flowActivatedBy": {
+ "description": "Endpoint activating the flow",
+ "type": "string"
+ },
+ "flowActivationEpoch": {
+ "description": "Time the connection is activated in the flow (connection) being reported on, or transmission time of the first packet if activation time is not available",
+ "type": "number"
+ },
+ "flowActivationMicrosec": {
+ "description": "Integer microseconds for the start of the flow connection",
+ "type": "number"
+ },
+ "flowActivationTime": {
+ "description": "time the connection is activated in the flow being reported on, or transmission time of the first packet if activation time is not available; with RFC 2822 compliant format: ‘Sat, 13 Mar 2010 11:29:05 -0800’",
+ "type": "string"
+ },
+ "flowDeactivatedBy": {
+ "description": "Endpoint deactivating the flow",
+ "type": "string"
+ },
+ "flowDeactivationEpoch": {
+ "description": "Time for the start of the flow connection, in integer UTC epoch time aka UNIX time",
+ "type": "number"
+ },
+ "flowDeactivationMicrosec": {
+ "description": "Integer microseconds for the start of the flow connection",
+ "type": "number"
+ },
+ "flowDeactivationTime": {
+ "description": "Transmission time of the first packet in the flow connection being reported on; with RFC 2822 compliant format: ‘Sat, 13 Mar 2010 11:29:05 -0800’",
+ "type": "string"
+ },
+ "flowStatus": {
+ "description": "connection status at reporting time as a working / inactive / failed indicator value",
+ "type": "string"
+ },
+ "gtpConnectionStatus": {
+ "description": "Current connection state at reporting time",
+ "type": "string"
+ },
+ "gtpTunnelStatus": {
+ "description": "Current tunnel state at reporting time",
+ "type": "string"
+ },
+ "ipTosCountList": {
+ "description": "array of key: value pairs where the keys are drawn from the IP Type-of-Service identifiers which range from '0' to '255', and the values are the count of packets that had those ToS identifiers in the flow",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ],
+ "additionalItems": false
+ }
+ },
+ "ipTosList": {
+ "description": "Array of unique IP Type-of-Service values observed in the flow where values range from '0' to '255'",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "largePacketRtt": {
+ "description": "large packet round trip time",
+ "type": "number"
+ },
+ "largePacketThreshold": {
+ "description": "large packet threshold being applied",
+ "type": "number"
+ },
+ "maxPacketDelayVariation": {
+ "description": "Maximum packet delay variation or jitter in milliseconds for received packets: Maximum of the difference between the packet timestamp and time received for all pairs of consecutive packets",
+ "type": "number"
+ },
+ "maxReceiveBitRate": {
+ "description": "maximum receive bit rate",
+ "type": "number"
+ },
+ "maxTransmitBitRate": {
+ "description": "maximum transmit bit rate",
+ "type": "number"
+ },
+ "mobileQciCosCountList": {
+ "description": "array of key: value pairs where the keys are drawn from LTE QCI or UMTS class of service strings, and the values are the count of packets that had those strings in the flow",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ],
+ "additionalItems": false
+ }
+ },
+ "mobileQciCosList": {
+ "description": "Array of unique LTE QCI or UMTS class-of-service values observed in the flow",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "numActivationFailures": {
+ "description": "Number of failed activation requests, as observed by the reporting node",
+ "type": "number"
+ },
+ "numBitErrors": {
+ "description": "number of errored bits",
+ "type": "number"
+ },
+ "numBytesReceived": {
+ "description": "number of bytes received, including retransmissions",
+ "type": "number"
+ },
+ "numBytesTransmitted": {
+ "description": "number of bytes transmitted, including retransmissions",
+ "type": "number"
+ },
+ "numDroppedPackets": {
+ "description": "number of received packets dropped due to errors per virtual interface",
+ "type": "number"
+ },
+ "numGtpEchoFailures": {
+ "description": "Number of Echo request path failures where failed paths are defined in 3GPP TS 29.281 sec 7.2.1 and 3GPP TS 29.060 sec. 11.2",
+ "type": "number"
+ },
+ "numGtpTunnelErrors": {
+ "description": "Number of tunnel error indications where errors are defined in 3GPP TS 29.281 sec 7.3.1 and 3GPP TS 29.060 sec. 11.1",
+ "type": "number"
+ },
+ "numHttpErrors": {
+ "description": "Http error count",
+ "type": "number"
+ },
+ "numL7BytesReceived": {
+ "description": "number of tunneled layer 7 bytes received, including retransmissions",
+ "type": "number"
+ },
+ "numL7BytesTransmitted": {
+ "description": "number of tunneled layer 7 bytes transmitted, excluding retransmissions",
+ "type": "number"
+ },
+ "numLostPackets": {
+ "description": "number of lost packets",
+ "type": "number"
+ },
+ "numOutOfOrderPackets": {
+ "description": "number of out-of-order packets",
+ "type": "number"
+ },
+ "numPacketErrors": {
+ "description": "number of errored packets",
+ "type": "number"
+ },
+ "numPacketsReceivedExclRetrans": {
+ "description": "number of packets received, excluding retransmission",
+ "type": "number"
+ },
+ "numPacketsReceivedInclRetrans": {
+ "description": "number of packets received, including retransmission",
+ "type": "number"
+ },
+ "numPacketsTransmittedInclRetrans": {
+ "description": "number of packets transmitted, including retransmissions",
+ "type": "number"
+ },
+ "numRetries": {
+ "description": "number of packet retries",
+ "type": "number"
+ },
+ "numTimeouts": {
+ "description": "number of packet timeouts",
+ "type": "number"
+ },
+ "numTunneledL7BytesReceived": {
+ "description": "number of tunneled layer 7 bytes received, excluding retransmissions",
+ "type": "number"
+ },
+ "roundTripTime": {
+ "description": "round trip time",
+ "type": "number"
+ },
+ "tcpFlagCountList": {
+ "description": "array of key: value pairs where the keys are drawn from TCP Flags and the values are the count of packets that had that TCP Flag in the flow",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "array",
+ "items": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ],
+ "additionalItems": false
+ }
+ },
+ "tcpFlagList": {
+ "description": "Array of unique TCP Flags observed in the flow",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "timeToFirstByte": {
+ "description": "Time in milliseconds between the connection activation and first byte received",
+ "type": "number"
+ }
+ },
+ "required": [
+ "avgBitErrorRate",
+ "avgPacketDelayVariation",
+ "avgPacketLatency",
+ "avgReceiveThroughput",
+ "avgTransmitThroughput",
+ "flowActivationEpoch",
+ "flowActivationMicrosec",
+ "flowDeactivationEpoch",
+ "flowDeactivationMicrosec",
+ "flowDeactivationTime",
+ "flowStatus",
+ "maxPacketDelayVariation",
+ "numActivationFailures",
+ "numBitErrors",
+ "numBytesReceived",
+ "numBytesTransmitted",
+ "numDroppedPackets",
+ "numL7BytesReceived",
+ "numL7BytesTransmitted",
+ "numLostPackets",
+ "numOutOfOrderPackets",
+ "numPacketErrors",
+ "numPacketsReceivedExclRetrans",
+ "numPacketsReceivedInclRetrans",
+ "numPacketsTransmittedInclRetrans",
+ "numRetries",
+ "numTimeouts",
+ "numTunneledL7BytesReceived",
+ "roundTripTime",
+ "timeToFirstByte"
+ ]
+ },
+ "latencyBucketMeasure": {
+ "description": "number of counts falling within a defined latency bucket",
+ "type": "object",
+ "properties": {
+ "countsInTheBucket": {
+ "type": "number"
+ },
+ "highEndOfLatencyBucket": {
+ "type": "number"
+ },
+ "lowEndOfLatencyBucket": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "countsInTheBucket"
+ ]
+ },
+ "marker": {
+ "description": "",
+ "type": "object",
+ "properties": {
+ "phoneNumber": {
+ "type": "string"
+ }
+ }
+ },
+ "measurementGroup": {
+ "description": "measurement group",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "measurements": {
+ "description": "array of name value pair measurements",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ }
+ },
+ "required": [
+ "name",
+ "measurements"
+ ]
+ },
+ "measurementsForVfScalingFields": {
+ "description": "measurementsForVfScaling fields",
+ "type": "object",
+ "properties": {
+ "additionalMeasurements": {
+ "description": "additional measurement fields",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/measurementGroup"
+ }
+ },
+ "aggregateCpuUsage": {
+ "description": "aggregate CPU usage of the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "codecUsageArray": {
+ "description": "array of codecs in use",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/codecsInUse"
+ }
+ },
+ "concurrentSessions": {
+ "description": "peak concurrent sessions for the VM or VNF over the measurementInterval",
+ "type": "number"
+ },
+ "configuredEntities": {
+ "description": "over the measurementInterval, peak total number of: users, subscribers, devices, adjacencies, etc., for the VM, or subscribers, devices, etc., for the VNF",
+ "type": "number"
+ },
+ "cpuUsageArray": {
+ "description": "usage of an array of CPUs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/cpuUsage"
+ }
+ },
+ "errors": {
+ "$ref": "#/definitions/errors"
+ },
+ "featureUsageArray": {
+ "description": "array of features in use",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/featuresInUse"
+ }
+ },
+ "filesystemUsageArray": {
+ "description": "filesystem usage of the VM on which the VNFC reporting the event is running",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/filesystemUsage"
+ }
+ },
+ "latencyDistribution": {
+ "description": "array of integers representing counts of requests whose latency in milliseconds falls within per-VNF configured ranges",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/latencyBucketMeasure"
+ }
+ },
+ "meanRequestLatency": {
+ "description": "mean seconds required to respond to each request for the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "measurementInterval": {
+ "description": "interval over which measurements are being reported in seconds",
+ "type": "number"
+ },
+ "measurementsForVfScalingVersion": {
+ "description": "version of the measurementsForVfScaling block",
+ "type": "number"
+ },
+ "memoryConfigured": {
+ "description": "memory configured in the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "memoryUsed": {
+ "description": "memory usage of the VM on which the VNFC reporting the event is running",
+ "type": "number"
+ },
+ "numberOfMediaPortsInUse": {
+ "description": "number of media ports in use",
+ "type": "number"
+ },
+ "requestRate": {
+ "description": "peak rate of service requests per second to the VNF over the measurementInterval",
+ "type": "number"
+ },
+ "vnfcScalingMetric": {
+ "description": "represents busy-ness of the VNF from 0 to 100 as reported by the VNFC",
+ "type": "number"
+ },
+ "vNicUsageArray": {
+ "description": "usage of an array of virtual network interface cards",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/vNicUsage"
+ }
+ }
+ },
+ "required": [
+ "measurementInterval"
+ ]
+ },
+ "midCallRtcp": {
+ "description": "RTCP packet received ",
+ "type": "object",
+ "properties": {
+ "rtcpData": {
+ "description": "Base64 encoding of the binary RTCP data (excluding Eth/IP/UDP headers) Base64 encoded array of bytes",
+ "type": "string"
+ }
+ }
+ },
+ "mobileFlowFields": {
+ "description": "mobileFlow fields",
+ "type": "object",
+ "properties": {
+ "applicationType": {
+ "description": "Application type inferred",
+ "type": "string"
+ },
+ "appProtocolType": {
+ "description": "application protocol",
+ "type": "string"
+ },
+ "appProtocolVersion": {
+ "description": "application protocol version",
+ "type": "string"
+ },
+ "cid": {
+ "description": "cell id",
+ "type": "string"
+ },
+ "connectionType": {
+ "description": "Abbreviation referencing a 3GPP reference point e.g., S1-U, S11, etc",
+ "type": "string"
+ },
+ "ecgi": {
+ "description": "Evolved Cell Global Id",
+ "type": "string"
+ },
+ "flowDirection": {
+ "description": "Flow direction, indicating if the reporting node is the source of the flow or destination for the flow",
+ "type": "string"
+ },
+ "gtpPerFlowMetrics": {
+ "$ref": "#/definitions/gtpPerFlowMetrics"
+ },
+ "gtpProtocolType": {
+ "description": "GTP protocol",
+ "type": "string"
+ },
+ "gtpVersion": {
+ "description": "GTP protocol version",
+ "type": "string"
+ },
+ "httpHeader": {
+ "description": "HTTP request header, if the flow connects to a node referenced by HTTP",
+ "type": "string"
+ },
+ "imei": {
+ "description": "IMEI for the subscriber UE used in this flow, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "imsi": {
+ "description": "IMSI for the subscriber UE used in this flow, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "ipProtocolType": {
+ "description": "IP protocol type e.g., TCP, UDP, RTP...",
+ "type": "string"
+ },
+ "ipVersion": {
+ "description": "IP protocol version e.g., IPv4, IPv6",
+ "type": "string"
+ },
+ "lac": {
+ "description": "location area code",
+ "type": "string"
+ },
+ "mcc": {
+ "description": "mobile country code",
+ "type": "string"
+ },
+ "mnc": {
+ "description": "mobile network code",
+ "type": "string"
+ },
+ "mobileFlowFieldsVersion": {
+ "description": "version of the mobileFlowFields block",
+ "type": "number"
+ },
+ "msisdn": {
+ "description": "MSISDN for the subscriber UE used in this flow, as an integer, if the flow connects to a mobile device",
+ "type": "string"
+ },
+ "otherEndpointIpAddress": {
+ "description": "IP address for the other endpoint, as used for the flow being reported on",
+ "type": "string"
+ },
+ "otherEndpointPort": {
+ "description": "IP Port for the reporting entity, as used for the flow being reported on",
+ "type": "number"
+ },
+ "otherFunctionalRole": {
+ "description": "Functional role of the other endpoint for the flow being reported on e.g., MME, S-GW, P-GW, PCRF...",
+ "type": "string"
+ },
+ "rac": {
+ "description": "routing area code",
+ "type": "string"
+ },
+ "radioAccessTechnology": {
+ "description": "Radio Access Technology e.g., 2G, 3G, LTE",
+ "type": "string"
+ },
+ "reportingEndpointIpAddr": {
+ "description": "IP address for the reporting entity, as used for the flow being reported on",
+ "type": "string"
+ },
+ "reportingEndpointPort": {
+ "description": "IP port for the reporting entity, as used for the flow being reported on",
+ "type": "number"
+ },
+ "sac": {
+ "description": "service area code",
+ "type": "string"
+ },
+ "samplingAlgorithm": {
+ "description": "Integer identifier for the sampling algorithm or rule being applied in calculating the flow metrics if metrics are calculated based on a sample of packets, or 0 if no sampling is applied",
+ "type": "number"
+ },
+ "tac": {
+ "description": "transport area code",
+ "type": "string"
+ },
+ "tunnelId": {
+ "description": "tunnel identifier",
+ "type": "string"
+ },
+ "vlanId": {
+ "description": "VLAN identifier used by this flow",
+ "type": "string"
+ }
+ },
+ "required": [
+ "flowDirection",
+ "gtpPerFlowMetrics",
+ "ipProtocolType",
+ "ipVersion",
+ "otherEndpointIpAddress",
+ "otherEndpointPort",
+ "reportingEndpointIpAddr",
+ "reportingEndpointPort"
+ ]
+ },
+ "otherFields": {
+ "description": "additional fields not reported elsewhere",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "requestError": {
+ "description": "standard request error data structure",
+ "type": "object",
+ "properties": {
+ "messageId": {
+ "description": "Unique message identifier of the format ‘ABCnnnn’ where ‘ABC’ is either ‘SVC’ for Service Exceptions or ‘POL’ for Policy Exception",
+ "type": "string"
+ },
+ "text": {
+ "description": "Message text, with replacement variables marked with %n, where n is an index into the list of <variables> elements, starting at 1",
+ "type": "string"
+ },
+ "url": {
+ "description": "Hyperlink to a detailed error resource e.g., an HTML page for browser user agents",
+ "type": "string"
+ },
+ "variables": {
+ "description": "List of zero or more strings that represent the contents of the variables used by the message text",
+ "type": "string"
+ }
+ },
+ "required": [
+ "messageId",
+ "text"
+ ]
+ },
+ "serviceEventsFields": {
+ "description": "service events fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional service event fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "codecSelected": {
+ "$ref": "#/definitions/codecSelected"
+ },
+ "codecSelectedTranscoding": {
+ "$ref": "#/definitions/codecSelectedTranscoding"
+ },
+ "correlator": {
+ "description": "this is the same for all events on this call",
+ "type": "string"
+ },
+ "endOfCallVqmSummaries": {
+ "$ref": "#/definitions/endOfCallVqmSummaries"
+ },
+ "eventInstanceIdentifier": {
+ "$ref": "#/definitions/eventInstanceIdentifier"
+ },
+ "marker": {
+ "$ref": "#/definitions/marker"
+ },
+ "midCallRtcp": {
+ "$ref": "#/definitions/midCallRtcp"
+ },
+ "serviceEventsFieldsVersion": {
+ "description": "version of the serviceEventsFields block",
+ "type": "number"
+ }
+ },
+ "required": [
+ "eventInstanceIdentifier"
+ ]
+ },
+ "signalingFields": {
+ "description": "signaling fields",
+ "type": "object",
+ "properties": {
+ "compressedSip": {
+ "description": "the full SIP request/response including headers and bodies",
+ "type": "string"
+ },
+ "correlator": {
+ "description": "this is the same for all events on this call",
+ "type": "string"
+ },
+ "eventInstanceIdentifier": {
+ "$ref": "#/definitions/eventInstanceIdentifier"
+ },
+ "localIpAddress": {
+ "description": "IP address on VNF",
+ "type": "string"
+ },
+ "localPort": {
+ "description": "port on VNF",
+ "type": "string"
+ },
+ "remoteIpAddress": {
+ "description": "IP address of peer endpoint",
+ "type": "string"
+ },
+ "remotePort": {
+ "description": "port of peer endpoint",
+ "type": "string"
+ },
+ "signalingFieldsVersion": {
+ "description": "version of the signalingFields block",
+ "type": "number"
+ },
+ "summarySip": {
+ "description": "the SIP Method or Response (‘INVITE’, ‘200 OK’, ‘BYE’, etc)",
+ "type": "string"
+ }
+ },
+ "required": [
+ "eventInstanceIdentifier"
+ ]
+ },
+ "stateChangeFields": {
+ "description": "stateChange fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional stateChange fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "newState": {
+ "description": "new state of the entity",
+ "type": "string",
+ "enum": [
+ "inService",
+ "maintenance",
+ "outOfService"
+ ]
+ },
+ "oldState": {
+ "description": "previous state of the entity",
+ "type": "string",
+ "enum": [
+ "inService",
+ "maintenance",
+ "outOfService"
+ ]
+ },
+ "stateChangeFieldsVersion": {
+ "description": "version of the stateChangeFields block",
+ "type": "number"
+ },
+ "stateInterface": {
+ "description": "card or port name of the entity that changed state",
+ "type": "string"
+ }
+ },
+ "required": [
+ "newState",
+ "oldState",
+ "stateInterface"
+ ]
+ },
+ "suppressedNvPairs": {
+ "description": "List of specific NvPairsNames to suppress within a given Name-Value Field for event Throttling",
+ "type": "object",
+ "properties": {
+ "nvPairFieldName": {
+ "description": "Name of the field within which are the nvpair names to suppress",
+ "type": "string"
+ },
+ "suppressedNvPairNames": {
+ "description": "Array of nvpair names to suppress within the nvpairFieldName",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "nvPairFieldName",
+ "suppressedNvPairNames"
+ ]
+ },
+ "syslogFields": {
+ "description": "sysLog fields",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional syslog fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "eventSourceHost": {
+ "description": "hostname of the device",
+ "type": "string"
+ },
+ "eventSourceType": {
+ "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction",
+ "type": "string"
+ },
+ "syslogFacility": {
+ "description": "numeric code from 0 to 23 for facility--see table in documentation",
+ "type": "number"
+ },
+ "syslogFieldsVersion": {
+ "description": "version of the syslogFields block",
+ "type": "number"
+ },
+ "syslogMsg": {
+ "description": "syslog message",
+ "type": "string"
+ },
+ "syslogProc": {
+ "description": "identifies the application that originated the message",
+ "type": "string"
+ },
+ "syslogProcId": {
+ "description": "a change in the value of this field indicates a discontinuity in syslog reporting",
+ "type": "number"
+ },
+ "syslogSData": {
+ "description": "syslog structured data consisting of a structured data Id followed by a set of key value pairs",
+ "type": "string"
+ },
+ "syslogTag": {
+ "description": "msgId indicating the type of message such as TCPOUT or TCPIN; NILVALUE should be used when no other value can be provided",
+ "type": "string"
+ },
+ "syslogVer": {
+ "description": "IANA assigned version of the syslog protocol specification - typically 1",
+ "type": "number"
+ }
+ },
+ "required": [
+ "eventSourceType",
+ "syslogMsg",
+ "syslogTag"
+ ]
+ },
+ "thresholdCrossingAlertFields": {
+ "description": "fields specific to threshold crossing alert events",
+ "type": "object",
+ "properties": {
+ "additionalFields": {
+ "description": "additional threshold crossing alert fields if needed",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ },
+ "additionalParameters": {
+ "description": "performance counters",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/counter"
+ }
+ },
+ "alertAction": {
+ "description": "Event action",
+ "type": "string",
+ "enum": [
+ "CLEAR",
+ "CONT",
+ "SET"
+ ]
+ },
+ "alertDescription": {
+ "description": "Unique short alert description such as IF-SHUB-ERRDROP",
+ "type": "string"
+ },
+ "alertType": {
+ "description": "Event type",
+ "type": "string",
+ "enum": [
+ "CARD-ANOMALY",
+ "ELEMENT-ANOMALY",
+ "INTERFACE-ANOMALY",
+ "SERVICE-ANOMALY"
+ ]
+ },
+ "alertValue": {
+ "description": "Calculated API value (if applicable)",
+ "type": "string"
+ },
+ "associatedAlertIdList": {
+ "description": "List of eventIds associated with the event being reported",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "collectionTimestamp": {
+ "description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: ‘Sat, 13 Mar 2010 11:29:05 -0800’",
+ "type": "string"
+ },
+ "dataCollector": {
+ "description": "Specific performance collector instance used",
+ "type": "string"
+ },
+ "elementType": {
+ "description": "type of network element - internal ATT field",
+ "type": "string"
+ },
+ "eventSeverity": {
+ "description": "event severity or priority",
+ "type": "string",
+ "enum": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
+ },
+ "eventStartTimestamp": {
+ "description": "Time closest to when the measurement was made; with RFC 2822 compliant format: ‘Sat, 13 Mar 2010 11:29:05 -0800’",
+ "type": "string"
+ },
+ "interfaceName": {
+ "description": "Physical or logical port or card (if applicable)",
+ "type": "string"
+ },
+ "networkService": {
+ "description": "network name - internal ATT field",
+ "type": "string"
+ },
+ "possibleRootCause": {
+ "description": "Reserved for future use",
+ "type": "string"
+ },
+ "thresholdCrossingFieldsVersion": {
+ "description": "version of the thresholdCrossingAlertFields block",
+ "type": "number"
+ }
+ },
+ "required": [
+ "additionalParameters",
+ "alertAction",
+ "alertDescription",
+ "alertType",
+ "collectionTimestamp",
+ "eventSeverity",
+ "eventStartTimestamp"
+ ]
+ },
+ "vNicUsage": {
+ "description": "usage of identified virtual network interface card",
+ "type": "object",
+ "properties": {
+ "broadcastPacketsIn": {
+ "type": "number"
+ },
+ "broadcastPacketsOut": {
+ "type": "number"
+ },
+ "bytesIn": {
+ "type": "number"
+ },
+ "bytesOut": {
+ "type": "number"
+ },
+ "multicastPacketsIn": {
+ "type": "number"
+ },
+ "multicastPacketsOut": {
+ "type": "number"
+ },
+ "packetsIn": {
+ "type": "number"
+ },
+ "packetsOut": {
+ "type": "number"
+ },
+ "unicastPacketsIn": {
+ "type": "number"
+ },
+ "unicastPacketsOut": {
+ "type": "number"
+ },
+ "vNicIdentifier": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "bytesIn",
+ "bytesOut",
+ "packetsIn",
+ "packetsOut",
+ "vNicIdentifier"
+ ]
+ }
+ },
+ "title": "Event Listener",
+ "type": "object",
+ "properties": {
+ "event": {
+ "$ref": "#/definitions/event"
+ }
+ },
+ "required": [
+ "event"
+ ]
+}
diff --git a/etc/DmaapConfig.json b/etc/DmaapConfig.json
index 8586a9bd..e7f30f4f 100644
--- a/etc/DmaapConfig.json
+++ b/etc/DmaapConfig.json
@@ -1,20 +1,36 @@
-{
- "channels": [
- {
- "name": "sec_measurement",
- "cambria.topic": "unauthenticated.SEC_MEASUREMENT_OUTPUT",
- "class": "HpCambriaOutputStream",
- "stripHpId": "true",
- "type": "out",
- "cambria.hosts": "onap.dmaap.org"
- },
- {
- "name": "sec_fault",
- "cambria.topic": "unauthenticated.SEC_FAULT_OUTPUT",
- "class": "HpCambriaOutputStream",
- "stripHpId": "true",
- "type": "out",
- "cambria.hosts": "onap.dmaap.org"
- }
- ]
-}
+{
+ "channels": [
+ {
+ "name": "ves_measurement",
+ "cambria.topic": "unauthenticated.SEC_MEASUREMENT_OUTPUT",
+ "class": "HpCambriaOutputStream",
+ "stripHpId": "true",
+ "type": "out",
+ "cambria.hosts": "onap-dmaap"
+ },
+ {
+ "name": "ves_fault",
+ "cambria.topic": "unauthenticated.SEC_FAULT_OUTPUT",
+ "class": "HpCambriaOutputStream",
+ "stripHpId": "true",
+ "type": "out",
+ "cambria.hosts": "onap-dmaap"
+ },
+ {
+ "name": "ves_heartbeat",
+ "cambria.topic": "unauthenticated.SEC_FAULT_OUTPUT",
+ "class": "HpCambriaOutputStream",
+ "stripHpId": "true",
+ "type": "out",
+ "cambria.hosts": "onap-dmaap"
+ },
+ {
+ "name": "ves_other",
+ "cambria.topic": "unauthenticated.SEC_OTHER_OUTPUT",
+ "class": "HpCambriaOutputStream",
+ "stripHpId": "true",
+ "type": "out",
+ "cambria.hosts": "onap-dmaap"
+ }
+ ]
+}
diff --git a/etc/ExceptionConfig.json b/etc/ExceptionConfig.json
deleted file mode 100644
index 1345cdcd..00000000
--- a/etc/ExceptionConfig.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "code" : {
- "200" :
- [
- {
- "Reason" : "OK",
- "ErrorCode": ["OK","Event message has been accepted"]
- }
- ],
-
- "204": [
- {
- "Reason" : "Accepted",
- "ErrorCode": ["OK","Event message has been accepted"]
- }
- ],
- "400" :
- [
- {
- "Reason" : "BadParameter",
- "ErrorCode": ["SVC0002","Bad Parameter" ]
- },
-
- {
- "Reason" : "Error",
- "ErrorCode": ["SVC2000","General Service Error with details"]
- },
- {
- "Reason" : "exceeded",
- "ErrorCode": ["POL9003","Message content size exceeded" ]
- }
-
- ],
- "401" :
- [
- {
- "Reason" : "Unauthorized",
- "ErrorCode": ["POL2000","Unauthorized user"]
- }
- ]
- }
-} \ No newline at end of file
diff --git a/etc/collector.properties b/etc/collector.properties
index 8da81d7e..67c6d39c 100644..100755
--- a/etc/collector.properties
+++ b/etc/collector.properties
@@ -1,74 +1,72 @@
-###############################################################################
-##
-## Collector Server config
-##
-## - Default values are shown as commented settings.
-##
-###############################################################################
-##
-## HTTP(S) service
-##
-## Normally:
-##
-## - 8080 is http service
-## - https is disabled by default (-1)
-##
-## - At this time, the server always binds to 0.0.0.0
-##
-## The default port when header.authflag is disabled (0)
-collector.service.port=8080
-
-## The secure port is required if header.authflag is set to 1 (true)
-## Authentication is only supported via secure port
-## When enabled - require valid keystore defined
-collector.service.secure.port=8443
-
-## The keystore must be setup per installation when secure port is configured
-collector.keystore.file.location=../etc/keystore
-collector.keystore.passwordfile=./etc/passwordfile
-collector.keystore.alias=tomcat
-
-
-###############################################################################
-## Processing
-##
-## If there's a problem that prevents the collector from processing alarms,
-## it's normally better to apply back pressure to the caller than to try to
-## buffer beyond a reasonable size limit. With a limit, the server won't crash
-## due to being out of memory, and the caller will get a 5xx reply saying the
-## server is in trouble.
-collector.inputQueue.maxPending=8096
-
-## Schema Validation checkflag
-## default no validation checkflag (-1)
-## If enabled (1) - schemafile location must be specified
-collector.schema.checkflag=1
-collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.3.json\"}
-
-## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile
-collector.dmaap.streamid=fault=sec_fault|syslog=sec_syslog|heartbeat=sec_heartbeat|measurementsForVfScaling=sec_measurement|mobileFlow=sec_mobileflow|other=sec_other|stateChange=sec_statechange|thresholdCrossingAlert=sec_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling
-collector.dmaapfile=./etc/DmaapConfig.json
-
-## Custom ExceptionConfiguration
-exceptionConfig=./etc/ExceptionConfig.json
-
-## authflag control authentication by the collector
-## If enabled (1) - then authlist has to be defined
-## When authflag is enabled, only secure port will be supported
-## To disable enter 0
-header.authflag=0
-## Combination of userid,base64 encoded pwd list to be supported
-## userid and pwd comma separated; pipe delimitation between each pair
-header.authlist=sample1,c2FtcGxlMQ==|vdnsagg,dmRuc2FnZw==
-
-## Event transformation Flag - when set expects configurable transformation
-## defined under ./etc/eventTransform.json
-## Enabled by default; to disable set to 0
-event.transform.flag=0
-
-###############################################################################
-##
-## Tomcat control
-##
-#tomcat.maxthreads=(tomcat default, which is usually 200)
-
+###############################################################################
+##
+## Collector Server config
+##
+## - Default values are shown as commented settings.
+##
+###############################################################################
+##
+## HTTP(S) service
+##
+## Normally:
+##
+## - 8080 is http service
+## - https is disabled by default (-1)
+##
+## - At this time, the server always binds to 0.0.0.0
+##
+## The default port when header.authflag is disabled (0)
+collector.service.port=8080
+
+## The secure port is required if header.authflag is set to 1 (true)
+## Authentication is only supported via secure port
+## When enabled - require valid keystore defined
+collector.service.secure.port=8443
+
+## The keystore must be setup per installation when secure port is configured
+collector.keystore.file.location=../etc/keystore
+collector.keystore.passwordfile=./etc/passwordfile
+collector.keystore.alias=tomcat
+
+
+###############################################################################
+## Processing
+##
+## If there's a problem that prevents the collector from processing alarms,
+## it's normally better to apply back pressure to the caller than to try to
+## buffer beyond a reasonable size limit. With a limit, the server won't crash
+## due to being out of memory, and the caller will get a 5xx reply saying the
+## server is in trouble.
+collector.inputQueue.maxPending=8096
+
+## Schema Validation checkflag
+## default no validation checkflag (-1)
+## If enabled (1) - schemafile location must be specified
+collector.schema.checkflag=1
+collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\"}
+
+## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile
+collector.dmaap.streamid=fault=ves_fault|syslog=ves_syslog|heartbeat=ves_heartbeat|measurementsForVfScaling=ves_measurement|mobileFlow=ves_mobileflow|other=ves_other|stateChange=ves_statechange|thresholdCrossingAlert=ves_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling
+collector.dmaapfile=./etc/DmaapConfig.json
+
+## authflag control authentication by the collector
+## If enabled (1) - then authlist has to be defined
+## When authflag is enabled, only secure port will be supported
+## To disable enter 0
+header.authflag=0
+
+## Combination of userid,base64 encoded pwd list to be supported
+## userid and pwd comma separated; pipe delimitation between each pair
+header.authlist=sample1,c2FtcGxlMQ==
+
+## Event transformation Flag - when set expects configurable transformation
+## defined under ./etc/eventTransform.json
+## Enabled by default; to disable set to 0
+event.transform.flag=1
+
+###############################################################################
+##
+## Tomcat control
+##
+#tomcat.maxthreads=(tomcat default, which is usually 200)
+
diff --git a/etc/eventTransform.json b/etc/eventTransform.json
index 26e059b4..0437d04d 100644
--- a/etc/eventTransform.json
+++ b/etc/eventTransform.json
@@ -58,6 +58,22 @@
}
},
{
+ "functionName": "addAttribute",
+ "args":{
+ "field": "event.faultFields.faultFieldsVersion",
+ "value": "2.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args":{
+ "field": "event.commonEventHeader.version",
+ "value": "3.0",
+ "fieldType": "number"
+ }
+ },
+ {
"functionName": "map",
"args":{
"field": "event.commonEventHeader.nfNamingCode",
@@ -212,3 +228,4 @@
}
]
+
diff --git a/etc/log4j.xml b/etc/log4j.xml
index ef186761..460004c6 100644
--- a/etc/log4j.xml
+++ b/etc/log4j.xml
@@ -1,23 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<!--
+================================================================================
+Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+================================================================================
+Licensed 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.
+============LICENSE_END=========================================================
+
+ECOMP is a trademark and service mark of AT&T Intellectual Property.
+-->
+
+
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="threshold" value="INFO" />
<layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="[%d{ABSOLUTE}][%-5p][%-10t]%m%n" />
- </layout>
- </appender>
-
- <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
- <param name="threshold" value="INFO" />
- <param name="File" value="logs/collector.log" />
- <param name="MaxFileSize" value="32MB"/>
- <param name="MaxBackupIndex" value="20"/>
- <layout class="org.apache.log4j.PatternLayout">
- <!-- param name="ConversionPattern" value="[%d{ABSOLUTE}][%-5p][%-10t][%-5c][%4L]%m%n" / -->
- <param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%-10t][%-5c]%m%n" />
+ <param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%-10t][%c] - %m%n"/>
</layout>
</appender>
@@ -27,7 +37,6 @@
<param name="MaxFileSize" value="32MB"/>
<param name="MaxBackupIndex" value="10"/>
<layout class="org.apache.log4j.PatternLayout">
- <!-- param name="ConversionPattern" value="[%d{ABSOLUTE}][%-5p][%-10t][%-5c][%4L]%m%n" / -->
<param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%-10t][%-5c]%m%n" />
</layout>
</appender>
@@ -38,33 +47,30 @@
<param name="MaxFileSize" value="32MB"/>
<param name="MaxBackupIndex" value="10"/>
<layout class="org.apache.log4j.PatternLayout">
- <!-- param name="ConversionPattern" value="[%d{ABSOLUTE}][%-5p][%-10t][%-5c][%4L]%m%n" / -->
<param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%-10t][%-5c]%m%n" />
</layout>
</appender>
-
+
<appender name="EFILE" class="org.apache.log4j.RollingFileAppender">
<param name="threshold" value="INFO" />
<param name="File" value="logs/error.log" />
<param name="MaxFileSize" value="32MB"/>
<param name="MaxBackupIndex" value="5"/>
<layout class="org.apache.log4j.PatternLayout">
- <!-- param name="ConversionPattern" value="[%d{ABSOLUTE}][%-5p][%-10t][%-5c][%4L]%m%n" / -->
<param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%-10t][%-5c]%m%n" />
</layout>
</appender>
-
+
<!--
ECOMP logging setup
-
+
NOTES:
-
+
1. files are written to "./logs/<filename>". You must setup the environment
so that ./logs is a symlink to the correct location according to the ECOMP
log standard. For example, "/opt/logs/DCAE/highlandParkVcScope". If that's
not possible, change the File setting in each appender appropriately.
-->
-
<appender name="ECOMP_AUDIT" class="org.apache.log4j.RollingFileAppender">
<param name="threshold" value="DEBUG" />
<param name="File" value="./logs/ecomp/audit.log" />
@@ -144,25 +150,20 @@
<logger name="org.onap.dcae.commonFunction.EventPublisher" additivity="false">
<level value="debug"/>
<appender-ref ref="CONSOLE" />
- <appender-ref ref="FILE" />
</logger>
-
<logger name="com.att.nsa.apiClient.http.HttpClient" additivity="false">
<level value="info"/>
- <appender-ref ref="FILE" />
<appender-ref ref="CONSOLE" />
</logger>
<logger name="com.att.nsa.cambria.client.impl.CambriaSimplerBatchPublisher" additivity="false">
<level value="info"/>
- <appender-ref ref="FILE" />
<appender-ref ref="CONSOLE" />
</logger>
<root>
<level value="DEBUG" />
- <appender-ref ref="FILE" />
<appender-ref ref="CONSOLE" />
<appender-ref ref="ECOMP_AUDIT" />
<appender-ref ref="ECOMP_DEBUG" />
diff --git a/etc/logrotate.conf b/etc/logrotate.conf
new file mode 100644
index 00000000..41bf4edc
--- /dev/null
+++ b/etc/logrotate.conf
@@ -0,0 +1,7 @@
+/opt/app/VESCollector/logs/collector.log {
+ size 64M
+ rotate 10
+ copytruncate
+ dateext
+ dateformat .%Y-%m-%dT%H:%M:%S
+} \ No newline at end of file
diff --git a/mvn-phase-lib.sh b/mvn-phase-lib.sh
deleted file mode 100755
index d3c3f258..00000000
--- a/mvn-phase-lib.sh
+++ /dev/null
@@ -1,296 +0,0 @@
-#!/bin/bash
-
-# ================================================================================
-# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed 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.
-# ============LICENSE_END=========================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-
-
-clean_templated_files()
-{
- TEMPLATE_FILES=$(find . -name "*-template")
- for F in $TEMPLATE_FILES; do
- F2=$(echo "$F" | sed 's/-template$//')
- rm -f "$F2"
- done
-}
-clean_tox_files()
-{
- TOX_FILES=$(find . -name ".tox")
- TOX_FILES="$TOX_FILES $(find . -name 'venv-tox')"
- for F in $TOX_FILES; do
- rm -rf "$F"
- done
-}
-
-expand_templates()
-{
- # set up env variables, get ready for template resolution
- # NOTE: CCSDK artifacts do not distinguish REALESE vs SNAPSHOTs
- export ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.ccsdk.platform.plugins"
- export ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.ccsdk.platform.plugins"
- export ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_blueprints_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.ccsdk.platform.blueprints"
- export ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_blueprints_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.ccsdk.platform.blueprints"
-
- export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2/releases"
- export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2/snapshots"
- export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2.platform.plugins/releases"
- export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2.platform.plugins/snapshots"
- export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2.platform.blueprints/releases"
- export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2.platform.blueprints/snapshots"
-
- export ONAPTEMPLATE_PYPIURL_org_onap_dcaegen2="${MVN_NEXUSPROXY}/content/sites/pypi"
-
- export ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases="$MVN_DOCKERREGISTRY_DAILY"
- export ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_snapshots="$MVN_DOCKERREGISTRY_DAILY/snapshots"
-
-
- TEMPLATE_FILES=$(find . -name "*-template")
- for F in $TEMPLATE_FILES; do
- F2=$(echo "$F" | sed 's/-template$//')
- cp "$F" "$F2"
- MOD=$(stat --format '%a' "$F")
- chmod "$MOD" "$F2"
- done
-
-
- TEMPLATES=$(env |grep ONAPTEMPLATE)
- if [ -z "$TEMPLATES" ]; then
- return 0
- fi
-
- echo "====> Resolving the following temaplate from environment variables "
- echo "[$TEMPLATES]"
- SELFFILE=$(echo "$0" | rev | cut -f1 -d '/' | rev)
- for TEMPLATE in $TEMPLATES; do
- KEY=$(echo "$TEMPLATE" | cut -f1 -d'=')
- VALUE=$(echo "$TEMPLATE" | cut -f2 -d'=')
- VALUE2=$(echo "$TEMPLATE" | cut -f2 -d'=' |sed 's/\//\\\//g')
- set +e
- FILES=$(grep -rl "$KEY")
- set -e
-
- if [ -z "$FILES" ]; then
- continue
- fi
-
- # assuming FILES is not longer than 2M bytes, the limit for variable value max size on this VM
- for F in $FILES; do
- if [[ $F == *"$SELFFILE" ]]; then
- continue
- fi
- if [[ "$F" == *-template ]]; then
- continue
- fi
-
- echo "======> Resolving template $KEY to value $VALUE for file $F"
- sed -i "s/{{[[:space:]]*$KEY[[:space:]]*}}/$VALUE2/g" "$F"
- #cat "$F"
- done
-
- #if [ ! -z "$FILES" ]; then
- # echo "====> Resolving template $VALUE to value $VALUE"
- # #CMD="grep -rl \"$VALUE\" | tr '\n' '\0' | xargs -0 sed -i \"s/{{[[:space:]]*$VALUE[[:space:]]*}}/$VALUE/g\""
- # grep -rl "$KEY" | tr '\n' '\0' | xargs -0 sed -i 's/$KEY/$VALUE2/g'
- # #echo $CMD
- # #eval $CMD
- #fi
- done
- echo "====> Done template reolving"
-}
-
-
-run_tox_test()
-{
- set -x
- CURDIR=$(pwd)
- TOXINIS=$(find . -name "tox.ini")
- for TOXINI in "${TOXINIS[@]}"; do
- DIR=$(echo "$TOXINI" | rev | cut -f2- -d'/' | rev)
- cd "${CURDIR}/${DIR}"
- rm -rf ./venv-tox ./.tox
- virtualenv ./venv-tox
- source ./venv-tox/bin/activate
- pip install --upgrade pip
- pip install --upgrade tox argparse
- pip freeze
- tox
- deactivate
- rm -rf ./venv-tox ./.tox
- done
-}
-
-build_wagons()
-{
- rm -rf ./*.wgn venv-pkg
-
- SETUPFILES=$(find . -name "setup.py")
- for SETUPFILE in $SETUPFILES; do
- PLUGIN_DIR=$(echo "$SETUPFILE" |rev | cut -f 2- -d '/' |rev)
- PLUGIN_NAME=$(grep 'name' "$SETUPFILE" | cut -f2 -d'=' | sed 's/[^0-9a-zA-Z\.]*//g')
- PLUGIN_VERSION=$(grep 'version' "$SETUPFILE" | cut -f2 -d'=' | sed 's/[^0-9\.]*//g')
-
- echo "In $PLUGIN_DIR, $PLUGIN_NAME, $PLUGIN_VERSION"
-
- virtualenv ./venv-pkg
- source ./venv-pkg/bin/activate
- pip install --upgrade pip
- pip install wagon
- wagon create --format tar.gz "$PLUGIN_DIR"
- deactivate
- rm -rf venv-pkg
-
- PKG_FILE_NAMES=( "${PLUGIN_NAME}-${PLUGIN_VERSION}"*.wgn )
- echo Built package: "${PKG_FILE_NAMES[@]}"
- done
-}
-
-
-upload_raw_file()
-{
- # Extract the username and password to the nexus repo from the settings file
- USER=$(xpath -q -e "//servers/server[id='$MVN_RAWREPO_SERVERID']/username/text()" "$SETTINGS_FILE")
- PASS=$(xpath -q -e "//servers/server[id='$MVN_RAWREPO_SERVERID']/password/text()" "$SETTINGS_FILE")
- NETRC=$(mktemp)
- echo "machine $MVN_RAWREPO_HOST login $USER password $PASS" > "$NETRC"
-
- REPO="$MVN_RAWREPO_BASEURL_UPLOAD"
-
- OUTPUT_FILE=$1
- EXT=$(echo "$OUTPUT_FILE" | rev |cut -f1 -d '.' |rev)
- if [ "$EXT" == 'yaml' ]; then
- OUTPUT_FILE_TYPE='text/x-yaml'
- elif [ "$EXT" == 'sh' ]; then
- OUTPUT_FILE_TYPE='text/x-shellscript'
- elif [ "$EXT" == 'gz' ]; then
- OUTPUT_FILE_TYPE='application/gzip'
- elif [ "$EXT" == 'wgn' ]; then
- OUTPUT_FILE_TYPE='application/gzip'
- else
- OUTPUT_FILE_TYPE='application/octet-stream'
- fi
-
-
- if [ "$MVN_DEPLOYMENT_TYPE" == 'SNAPSHOT' ]; then
- SEND_TO="${REPO}/${FQDN}/snapshots"
- elif [ "$MVN_DEPLOYMENT_TYPE" == 'STAGING' ]; then
- SEND_TO="${REPO}/${FQDN}/releases"
- else
- echo "Unreconfnized deployment type, quit"
- exit
- fi
- if [ ! -z "$MVN_PROJECT_MODULEID" ]; then
- SEND_TO="$SEND_TO/$MVN_PROJECT_MODULEID"
- fi
-
- echo "Sending ${OUTPUT_FILE} to Nexus: ${SEND_TO}"
- curl -vkn --netrc-file "${NETRC}" --upload-file "${OUTPUT_FILE}" -X PUT -H "Content-Type: $OUTPUT_FILE_TYPE" "${SEND_TO}/${OUTPUT_FILE}-${MVN_PROJECT_VERSION}-${TIMESTAMP}"
- curl -vkn --netrc-file "${NETRC}" --upload-file "${OUTPUT_FILE}" -X PUT -H "Content-Type: $OUTPUT_FILE_TYPE" "${SEND_TO}/${OUTPUT_FILE}-${MVN_PROJECT_VERSION}"
- curl -vkn --netrc-file "${NETRC}" --upload-file "${OUTPUT_FILE}" -X PUT -H "Content-Type: $OUTPUT_FILE_TYPE" "${SEND_TO}/${OUTPUT_FILE}"
-}
-
-
-
-upload_wagons_and_type_yamls()
-{
- WAGONS=$(ls -1 ./*.wgn)
- for WAGON in $WAGONS ; do
- WAGON_NAME=$(echo "$WAGON" | cut -f1 -d '-')
- WAGON_VERSION=$(echo "$WAGON" | cut -f2 -d '-')
- WAGON_TYPEFILE=$(grep -rl "$WAGON_NAME" | grep yaml | head -1)
-
- upload_raw_file "$WAGON"
- upload_raw_file "$WAGON_TYPEFILE"
- done
-}
-
-upload_files_of_extension()
-{
- FILES=$(ls -1 ./*."$1")
- for F in $FILES ; do
- upload_raw_file "$F"
- done
-}
-
-
-
-build_and_push_docker()
-{
- IMAGENAME="onap/${FQDN}.${MVN_PROJECT_MODULEID}"
- IMAGENAME=$(echo "$IMAGENAME" | sed -e 's/_*$//g' -e 's/\.*$//g')
- IMAGENAME=$(echo "$IMAGENAME" | tr '[:upper:]' '[:lower:]')
-
- # use the major and minor version of the MVN artifact version as docker image version
- VERSION="${MVN_PROJECT_VERSION//[^0-9.]/}"
- VERSION2=$(echo "$VERSION" | cut -f1-2 -d'.')
-
- LFQI="${IMAGENAME}:${VERSION}-${TIMESTAMP}"
- # build a docker image
- docker build --rm -f ./Dockerfile -t "${LFQI}" ./
-
- REPO=""
- if [ $MVN_DEPLOYMENT_TYPE == "SNAPSHOT" ]; then
- REPO=$MVN_DOCKERREGISTRY_DAILY
- elif [ $MVN_DEPLOYMENT_TYPE == "STAGING" ]; then
- # there seems to be no staging docker registry? set to use SNAPSHOT also
- #REPO=$MVN_DOCKERREGISTRY_RELEASE
- REPO=$MVN_DOCKERREGISTRY_DAILY
- else
- echo "Fail to determine DEPLOYMENT_TYPE"
- REPO=$MVN_DOCKERREGISTRY_DAILY
- fi
- echo "DEPLOYMENT_TYPE is: $MVN_DEPLOYMENT_TYPE, repo is $REPO"
-
- if [ ! -z "$REPO" ]; then
- USER=$(xpath -e "//servers/server[id='$REPO']/username/text()" "$SETTINGS_FILE")
- PASS=$(xpath -e "//servers/server[id='$REPO']/password/text()" "$SETTINGS_FILE")
- if [ -z "$USER" ]; then
- echo "Error: no user provided"
- fi
- if [ -z "$PASS" ]; then
- echo "Error: no password provided"
- fi
- [ -z "$PASS" ] && PASS_PROVIDED="<empty>" || PASS_PROVIDED="<password>"
- echo docker login "$REPO" -u "$USER" -p "$PASS_PROVIDED"
- docker login "$REPO" -u "$USER" -p "$PASS"
-
- if [ $MVN_DEPLOYMENT_TYPE == "SNAPSHOT" ]; then
- REPO="$REPO/snapshots"
- elif [ $MVN_DEPLOYMENT_TYPE == "STAGING" ]; then
- # there seems to be no staging docker registry? set to use SNAPSHOT also
- #REPO=$MVN_DOCKERREGISTRY_RELEASE
- REPO="$REPO"
- else
- echo "Fail to determine DEPLOYMENT_TYPE"
- REPO="$REPO/unknown"
- fi
-
- OLDTAG="${LFQI}"
- PUSHTAGS="${REPO}/${IMAGENAME}:${VERSION2}-${TIMESTAMP} ${REPO}/${IMAGENAME}:${VERSION2} ${REPO}/${IMAGENAME}:${VERSION2}-latest"
- for NEWTAG in ${PUSHTAGS}
- do
- echo "tagging ${OLDTAG} to ${NEWTAG}"
- docker tag "${OLDTAG}" "${NEWTAG}"
- echo "pushing ${NEWTAG}"
- docker push "${NEWTAG}"
- OLDTAG="${NEWTAG}"
- done
- fi
-
-}
-
-
-
diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh
deleted file mode 100755
index ea045de5..00000000
--- a/mvn-phase-script.sh
+++ /dev/null
@@ -1,203 +0,0 @@
-#!/bin/bash
-
-# ================================================================================
-# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed 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.
-# ============LICENSE_END=========================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-
-set -ex
-
-
-echo "running script: [$0] for module [$1] at stage [$2]"
-
-MVN_PROJECT_MODULEID="$1"
-MVN_PHASE="$2"
-
-
-PROJECT_ROOT=$(dirname $0)
-if [ -z "$WORKSPACE" ]; then
- export WORKSPACE="$PROJECT_ROOT"
-fi
-
-
-FQDN="${MVN_PROJECT_GROUPID}.${MVN_PROJECT_ARTIFACTID}"
-if [ "$MVN_PROJECT_MODULEID" == "__" ]; then
- MVN_PROJECT_MODULEID=""
-fi
-
-if [[ "$MVN_PROJECT_VERSION" == *SNAPSHOT ]]; then
- echo "=> for SNAPSHOT artifact build"
- MVN_DEPLOYMENT_TYPE='SNAPSHOT'
-else
- echo "=> for STAGING/RELEASE artifact build"
- MVN_DEPLOYMENT_TYPE='STAGING'
-fi
-echo "MVN_DEPLOYMENT_TYPE is [$MVN_DEPLOYMENT_TYPE]"
-
-
-TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
-
-# expected environment variables
-if [ -z "${MVN_NEXUSPROXY}" ]; then
- echo "MVN_NEXUSPROXY environment variable not set. Cannot proceed"
- exit
-fi
-MVN_NEXUSPROXY_HOST=$(echo "$MVN_NEXUSPROXY" |cut -f3 -d'/' | cut -f1 -d':')
-echo "=> Nexus Proxy at $MVN_NEXUSPROXY_HOST, $MVN_NEXUSPROXY"
-
-if [ -z "$WORKSPACE" ]; then
- WORKSPACE=$(pwd)
-fi
-
-if [ -z "$SETTINGS_FILE" ]; then
- echo "SETTINGS_FILE environment variable not set. Cannot proceed"
- exit
-fi
-
-
-
-# mvn phase in life cycle
-MVN_PHASE="$2"
-
-
-echo "MVN_PROJECT_MODULEID is [$MVN_PROJECT_MODULEID]"
-echo "MVN_PHASE is [$MVN_PHASE]"
-echo "MVN_PROJECT_GROUPID is [$MVN_PROJECT_GROUPID]"
-echo "MVN_PROJECT_ARTIFACTID is [$MVN_PROJECT_ARTIFACTID]"
-echo "MVN_PROJECT_VERSION is [$MVN_PROJECT_VERSION]"
-echo "MVN_NEXUSPROXY is [$MVN_NEXUSPROXY]"
-echo "MVN_RAWREPO_BASEURL_UPLOAD is [$MVN_RAWREPO_BASEURL_UPLOAD]"
-echo "MVN_RAWREPO_BASEURL_DOWNLOAD is [$MVN_RAWREPO_BASEURL_DOWNLOAD]"
-MVN_RAWREPO_HOST=$(echo "$MVN_RAWREPO_BASEURL_UPLOAD" | cut -f3 -d'/' |cut -f1 -d':')
-echo "MVN_RAWREPO_HOST is [$MVN_RAWREPO_HOST]"
-echo "MVN_RAWREPO_SERVERID is [$MVN_RAWREPO_SERVERID]"
-echo "MVN_DOCKERREGISTRY_DAILY is [$MVN_DOCKERREGISTRY_DAILY]"
-echo "MVN_DOCKERREGISTRY_RELEASE is [$MVN_DOCKERREGISTRY_RELEASE]"
-
-
-source "${PROJECT_ROOT}"/mvn-phase-lib.sh
-
-
-# Customize the section below for each project
-case $MVN_PHASE in
-clean)
- echo "==> clean phase script"
- clean_templated_files
- clean_tox_files
- rm -rf ./venv-* ./*.wgn ./site
- ;;
-generate-sources)
- echo "==> generate-sources phase script"
- expand_templates
- ;;
-compile)
- echo "==> compile phase script"
- ;;
-test)
- echo "==> test phase script"
- ;;
-package)
- echo "==> package phase script"
- ;;
-install)
- echo "==> install phase script"
- ;;
-deploy)
- echo "==> deploy phase script"
-
- case $MVN_DEPLOYMENT_TYPE in
- SNAPSHOT)
- phase='merge'
- ;;
- STAGING)
- phase='release'
- ;;
- *)
- exit 1
- ;;
- esac
-
- VERSION=$(xpath -e '//project/version/text()' 'pom.xml')
- VERSION=${VERSION//\"/}
- EXT=$(echo "$VERSION" | rev | cut -s -f1 -d'-' | rev)
- if [ -z "$EXT" ]; then
- EXT="STAGING"
- fi
- case $phase in
- verify|merge)
- if [ "$EXT" != 'SNAPSHOT' ]; then
- echo "$phase job only takes SNAPSHOT version, got \"$EXT\" instead"
- exit 1
- fi
- ;;
- release)
- if [ ! -z "$EXT" ] && [ "$EXT" != 'STAGING' ]; then
- echo "$phase job only takes STAGING or pure numerical version, got \"$EXT\" instead"
- exit 1
- fi
- ;;
- *)
- echo "Unknown phase \"$phase\""
- exit 1
- esac
- echo "Running \"$phase\" job for version \"$VERSION\""
-
- # unarchive the service manager
- TARGET="${WORKSPACE}/target"
- #STAGE="${TARGET}/stage"
- STAGE=.
- BASE_DIR="${STAGE}/opt/app"
-
- # unarchive the collector
- AR=${WORKSPACE}/target/VESCollector-${VERSION}-bundle.tar.gz
- APP_DIR=${STAGE}/opt/app/VESCollector
-
- [ -d "${STAGE}/opt/app/VESCollector-${VERSION}" ] && rm -rf "${STAGE}/opt/app/VESCollector-${VERSION}"
-
- [ ! -f "${APP_DIR}" ] && mkdir -p "${APP_DIR}"
-
- gunzip -c "${AR}" | tar xvf - -C "${APP_DIR}" --strip-components=1
-
-
- if [ ! -f "${APP_DIR}/bin/docker-entry.sh" ]
- then
- echo "FATAL error cannot locate ${APP_DIR}/bin/docker-entry.sh"
- exit 2
- fi
- cp -p ${APP_DIR}/bin/docker-entry.sh ${BASE_DIR}/docker-entry.sh
- chmod 755 "${BASE_DIR}/docker-entry.sh"
-
-
-
-
- #
- # generate docker file
- #
- if [ ! -f "${APP_DIR}/Dockerfile" ]
- then
- echo "FATAL error cannot locate ${APP_DIR}/Dockerfile"
- exit 2
- fi
- cp -p ${APP_DIR}/Dockerfile ${STAGE}/Dockerfile
-
- BUILD_PATH="${WORKSPACE}/target/stage"
- build_and_push_docker
- ;;
-*)
- echo "==> unprocessed phase"
- ;;
-esac
-
diff --git a/pom.xml b/pom.xml
index ec6492fa..d3a3c2e8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,349 +1,457 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.oparent</groupId>
- <artifactId>oparent</artifactId>
- <version>0.1.1</version>
- <relativePath/>
- </parent>
- <groupId>org.onap.dcaegen2.collectors.ves</groupId>
- <artifactId>VESCollector</artifactId>
- <version>1.1.4-SNAPSHOT</version>
- <name>dcaegen2-collectors-ves</name>
- <description>VESCollector</description>
-
- <properties>
- <compiler.source.version>1.7</compiler.source.version>
- <compiler.target.version>1.7</compiler.target.version>
- <main.basedir>${project.basedir}</main.basedir>
- <compiler.plugin.version>3.3</compiler.plugin.version>
- <jar.plugin.version>2.4</jar.plugin.version>
- <deploy.plugin.version>2.8</deploy.plugin.version>
- <source.plugin.version>2.4</source.plugin.version>
- <javadoc.plugin.version>2.10.4</javadoc.plugin.version>
-
- <!--TEST SETTINGS -->
- <surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
-
- <!--PLUGIN SETTINGS -->
-
- <dependency.locations.enabled>false</dependency.locations.enabled>
- <!-- <maven.test.skip>true</maven.test.skip> -->
-
- <nexusproxy>https://nexus.onap.org</nexusproxy>
- <snapshots.path>content/repositories/snapshots/</snapshots.path>
- <releases.path>content/repositories/releases/</releases.path>
- <site.path>content/sites/site/org/onap/dcaegen2/collectors/ves/${project.artifactId}/${project.version}</site.path>
- </properties>
-
- <pluginRepositories>
- <!-- Black Duck plugin dependencies -->
- <pluginRepository>
- <id>JCenter</id>
- <name>JCenter Repository</name>
- <url>http://jcenter.bintray.com</url>
- </pluginRepository>
-
- <pluginRepository>
- <id>Restlet</id>
- <name>Restlet Repository</name>
- <url>http://maven.restlet.com</url>
- </pluginRepository>
- </pluginRepositories>
-
- <dependencies>
-
- <!-- JSON libraries -->
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- <version>1.1.1</version>
- </dependency>
-
- <dependency>
- <groupId>com.github.fge</groupId>
- <artifactId>json-schema-validator</artifactId>
- <version>2.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.3.1</version>
- </dependency>
-
- <!-- NSA server library -->
- <dependency>
- <groupId>com.att.nsa</groupId>
- <artifactId>nsaServerLibrary</artifactId>
- <version>1.0.10</version>
- </dependency>
-
- <!-- <dependency> <groupId>com.att.nsa</groupId> <artifactId>saToolkit</artifactId>
- <version>1.1.3</version> </dependency> -->
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.7.21</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>apache-log4j-extras</artifactId>
- <version>1.2.17</version>
- </dependency>
-
-
- <!-- https://mvnrepository.com/artifact/org.json/json -->
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- <version>20160810</version>
- </dependency>
-
- <dependency>
- <groupId>commons-configuration</groupId>
- <artifactId>commons-configuration</artifactId>
- <version>1.10</version>
- </dependency>
-
- </dependencies>
-
-
- <repositories>
- <repository>
- <id>external-repository</id>
- <url>https://oss.sonatype.org/content/repositories</url>
- </repository>
- </repositories>
-
-
- <build>
- <pluginManagement>
- <plugins>
-
- <!-- COMPILER PLUGIN -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${compiler.plugin.version}</version>
- <configuration>
- <source>${compiler.target.version}</source>
- <target>${compiler.source.version}</target>
- </configuration>
- </plugin>
-
- <!-- MAVEN SOURCE PLUGIN -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>${source.plugin.version}</version>
- <configuration>
- <excludeResources>true</excludeResources>
- </configuration>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>verify</phase>
- <goals>
- <goal>jar-no-fork</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- JAR PLUGIN -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>${jar.plugin.version}</version>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <Implementation-Build-Version>${project.version}</Implementation-Build-Version>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.4.1</version>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/dep.xml</descriptor>
- </descriptors>
- </configuration>
-
- <executions>
- <execution>
- <id>make-assembly</id> <!-- this is used for inheritance merges -->
- <phase>package</phase> <!-- bind to the packaging phase -->
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- MAVEN JAVADOC PLUGIN -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>${javadoc.plugin.version}</version>
- <configuration>
- <!-- minimize console output messages -->
- <quiet>true</quiet>
- <verbose>false</verbose>
- <useStandardDocletOptions>false</useStandardDocletOptions>
- </configuration>
- <executions>
- <execution>
- <id>aggregate</id>
- <phase>site</phase>
- <goals>
- <goal>aggregate</goal>
- </goals>
- </execution>
- <execution>
- <id>attach-javadoc</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.2.1</version>
- <configuration>
- <executable>${session.executionRootDirectory}/mvn-phase-script.sh</executable>
- <environmentVariables>
- <!-- make mvn properties as env for our script -->
- <MVN_PROJECT_GROUPID>${project.groupId}</MVN_PROJECT_GROUPID>
- <MVN_PROJECT_ARTIFACTID>${project.artifactId}</MVN_PROJECT_ARTIFACTID>
- <MVN_PROJECT_VERSION>${project.version}</MVN_PROJECT_VERSION>
- <MVN_NEXUSPROXY>${onap.nexus.url}</MVN_NEXUSPROXY>
- <MVN_RAWREPO_BASEURL_UPLOAD>${onap.nexus.rawrepo.baseurl.upload}</MVN_RAWREPO_BASEURL_UPLOAD>
- <MVN_RAWREPO_BASEURL_DOWNLOAD>${onap.nexus.rawrepo.baseurl.download}</MVN_RAWREPO_BASEURL_DOWNLOAD>
- <MVN_RAWREPO_SERVERID>${onap.nexus.rawrepo.serverid}</MVN_RAWREPO_SERVERID>
- <MVN_DOCKERREGISTRY_DAILY>${onap.nexus.dockerregistry.daily}</MVN_DOCKERREGISTRY_DAILY>
- <MVN_DOCKERREGISTRY_RELEASE>${onap.nexus.dockerregistry.release}</MVN_DOCKERREGISTRY_RELEASE>
- </environmentVariables>
- </configuration>
- </plugin>
-
- </plugins>
- </pluginManagement>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
-
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- </plugin>
-
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- </plugin>
-
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.2.1</version>
- <executions>
- <execution>
- <id>deploy script</id>
- <phase>deploy</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- <configuration>
- <arguments>
- <argument>__</argument>
- <argument>deploy</argument>
- </arguments>
- </configuration>
- </execution>
- <execution>
- <id>install script</id>
- <phase>install</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- <configuration>
- <arguments>
- <argument>__</argument>
- <argument>install</argument>
- </arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
-
- </build>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.6</version>
- <reportSets>
- <reportSet>
- <reports>
- <report>dependencies</report>
- <report>license</report>
- </reports>
- </reportSet>
- </reportSets>
-
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.4</version>
- <configuration>
- <failOnError>false</failOnError>
- <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
- <docletArtifact>
- <groupId>org.umlgraph</groupId>
- <artifactId>umlgraph</artifactId>
- <version>5.6</version>
- </docletArtifact>
- <additionalparam>-views</additionalparam>
- <useStandardDocletOptions>true</useStandardDocletOptions>
- </configuration>
- </plugin>
-
- </plugins>
- </reporting>
-
+<!--
+================================================================================
+Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+Copyright (c) 2018 Nokia. All rights reserved.
+================================================================================
+Licensed 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.
+============LICENSE_END=========================================================
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.oparent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>0.1.1</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.dcaegen2.collectors.ves</groupId>
+ <artifactId>VESCollector</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+
+ <name>dcaegen2-collectors-ves</name>
+ <description>VESCollector</description>
+
+ <properties>
+ <!-- PROJECT SETTINGS -->
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <java.version>8</java.version>
+ <docker.image.name>onap/org.onap.dcaegen2.collectors.ves.vescollector</docker.image.name>
+
+ <!-- TEST SETTINGS -->
+ <surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
+
+ <!-- PLUGIN SETTINGS -->
+ <dependency.locations.enabled>false</dependency.locations.enabled>
+
+ <!-- NEXUS RELATED SETTINGS -->
+ <nexusproxy>https://nexus.onap.org</nexusproxy>
+ <snapshots.path>content/repositories/snapshots/</snapshots.path>
+ <releases.path>content/repositories/releases/</releases.path>
+ <site.path>
+ content/sites/site/org/onap/dcaegen2/collectors/ves/${project.artifactId}/${project.version}
+ </site.path>
+ <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
+
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.7.0</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>3.0.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.1.0</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>3.1.0</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.0.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.9</version>
+ </plugin>
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ <showWarnings>true</showWarnings>
+ <showDeprecation>true</showDeprecation>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <configuration>
+ <excludeResources>true</excludeResources>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Implementation-Build-Version>${project.version}</Implementation-Build-Version>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/dep.xml</descriptor>
+ </descriptors>
+ <attach>false</attach>
+ <appendAssemblyId>false</appendAssemblyId>
+ <updateOnly>true</updateOnly>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <!-- minimize console output messages -->
+ <quiet>true</quiet>
+ <verbose>false</verbose>
+ <useStandardDocletOptions>false</useStandardDocletOptions>
+ </configuration>
+ <executions>
+ <execution>
+ <id>aggregate</id>
+ <phase>site</phase>
+ <goals>
+ <goal>aggregate</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>attach-javadoc</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <configuration>
+ <serverId>${onap.nexus.dockerregistry.daily}</serverId>
+ <imageName>${docker.image.name}</imageName>
+ <imageTags>
+ <tag>latest</tag>
+ </imageTags>
+ <baseImage>openjdk:8-jre-slim</baseImage>
+ <env>
+ <HOSTALIASES>/etc/host.aliases</HOSTALIASES>
+ </env>
+ <workdir>/opt/app/VESCollector</workdir>
+ <resources>
+ <resource>
+ <targetPath>.</targetPath>
+ <directory>${project.build.directory}/${project.artifactId}-${project.version}</directory>
+ </resource>
+ </resources>
+ <runs>
+ <run>chmod +x bin/*.sh</run> <!-- Maven is loosing file permissions during artifacts copy -->
+ <run>
+ <![CDATA[apt-get update && apt-get install -y --no-install-recommends logrotate && apt-get install -y procps && apt-get install -y vim && apt-get clean all]]>
+ </run>
+ <run>chmod 0644 etc/logrotate.conf</run>
+ </runs>
+ <exposes>
+ <expose>8080</expose>
+ <expose>8443</expose>
+ </exposes>
+ <entryPoint>bin/docker-entry.sh</entryPoint>
+ </configuration>
+
+ <executions>
+ <execution>
+ <id>build-image</id>
+ <phase>package</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>tag-and-push-image-latest</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>tag</goal>
+ </goals>
+ <configuration>
+ <image>${docker.image.name}:latest</image>
+ <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</newName>
+ <pushImage>true</pushImage>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tag-and-push-image-with-version</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>tag</goal>
+ </goals>
+ <configuration>
+ <image>${docker.image.name}:latest</image>
+ <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}
+ </newName>
+ <pushImage>true</pushImage>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tag-and-push-image-with-version-and-date</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>tag</goal>
+ </goals>
+ <configuration>
+ <image>${docker.image.name}:latest</image>
+ <newName>
+ ${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}-${maven.build.timestamp}Z
+ </newName>
+ <pushImage>true</pushImage>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>with-system-proxy</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <configuration>
+ <buildArgs>
+ <http_proxy>${env.http_proxy}</http_proxy>
+ </buildArgs>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>dependencies</report>
+ <report>license</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <failOnError>false</failOnError>
+ <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
+ <docletArtifact>
+ <groupId>org.umlgraph</groupId>
+ <artifactId>umlgraph</artifactId>
+ <version>5.6</version>
+ </docletArtifact>
+ <additionalparam>-views</additionalparam>
+ <useStandardDocletOptions>true</useStandardDocletOptions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <dependencies>
+ <!-- JSON RELATED -->
+ <dependency>
+ <groupId>com.googlecode.json-simple</groupId>
+ <artifactId>json-simple</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.github.fge</groupId>
+ <artifactId>json-schema-validator</artifactId>
+ <version>2.2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>com.github.fge</groupId>
+ <artifactId>json-schema-core</artifactId>
+ <version>1.2.5</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <version>20160810</version>
+ </dependency>
+
+ <!-- REST API RELATED -->
+ <dependency>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-core</artifactId>
+ <version>8.5.23</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-catalina</artifactId>
+ <version>8.5.23</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-coyote</artifactId>
+ <version>8.5.23</version>
+ </dependency>
+ <dependency>
+ <groupId>com.att.nsa</groupId>
+ <artifactId>nsaServerLibrary</artifactId>
+ <version>1.0.10</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.8.11</version>
+ </dependency>
+
+ <!-- LOGGING RELATED -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.7.21</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>apache-log4j-extras</artifactId>
+ <version>1.2.17</version>
+ </dependency>
+
+ <!-- MISCELLANEOUS -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>18.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.10</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4.7</version>
+ </dependency>
+ <dependency>
+ <groupId>io.vavr</groupId>
+ <artifactId>vavr</artifactId>
+ <version>0.9.2</version>
+ </dependency>
+
+
+ <!-- TESTING -->
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>2.18.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <version>3.8.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>external-repository</id>
+ <url>https://oss.sonatype.org/content/repositories</url>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <!-- Black Duck plugin dependencies -->
+ <pluginRepository>
+ <id>JCenter</id>
+ <name>JCenter Repository</name>
+ <url>http://jcenter.bintray.com</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>Restlet</id>
+ <name>Restlet Repository</name>
+ <url>http://maven.restlet.com</url>
+ </pluginRepository>
+ </pluginRepositories>
</project>
-
diff --git a/settings.xml b/settings.xml
index 1cfab4d2..03047a3b 100644
--- a/settings.xml
+++ b/settings.xml
@@ -1,3 +1,22 @@
+<!--
+================================================================================
+Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+================================================================================
+Licensed 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.
+============LICENSE_END=========================================================
+
+ECOMP is a trademark and service mark of AT&T Intellectual Property.
+-->
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
@@ -65,4 +84,4 @@
</servers>
-</settings> \ No newline at end of file
+</settings>
diff --git a/src/assembly/dep.xml b/src/assembly/dep.xml
index cb72aa4a..7d72f84f 100644
--- a/src/assembly/dep.xml
+++ b/src/assembly/dep.xml
@@ -1,86 +1,79 @@
<!--
- ============LICENSE_START=======================================================
- PROJECT
- ================================================================================
- Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- ================================================================================
- Licensed 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.
- ============LICENSE_END=========================================================
- -->
+================================================================================
+Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+Copyright (c) 2018 Nokia. All rights reserved.
+================================================================================
+Licensed 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
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
- <id>bundle</id>
- <formats>
- <format>tar.gz</format>
- </formats>
- <files>
- <file>
- <source>target/${project.artifactId}-${project.version}.jar</source>
- <outputDirectory>lib</outputDirectory>
- </file>
- </files>
- <fileSets>
- <fileSet>
- <directory>src/main/scripts</directory>
- <outputDirectory>bin</outputDirectory>
- <includes>
- <include>**/*.sh</include>
- </includes>
- <fileMode>0755</fileMode>
- <lineEnding>unix</lineEnding>
- </fileSet>
- <fileSet>
- <directory>etc</directory>
- <outputDirectory>etc</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.conf</include>
- </includes>
- <outputDirectory>etc</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>data-formats</directory>
- <includes>
- <include>**/*.json</include>
- </includes>
- <outputDirectory>specs</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>dpo/spec</directory>
- <includes>
- <include>**/*.json</include>
- </includes>
- <outputDirectory>specs</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>./</directory>
- <includes>
- <include>Dockerfile</include>
- </includes>
- <outputDirectory>./</outputDirectory>
- </fileSet>
- </fileSets>
- <dependencySets>
- <dependencySet>
- <includes>
- <include>*:jar</include>
- </includes>
- <outputDirectory>lib</outputDirectory>
- </dependencySet>
- </dependencySets>
-</assembly>
+ 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.
+============LICENSE_END=========================================================
+-->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/2.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+
+ <id>bundle</id>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <formats>
+ <format>dir</format>
+ </formats>
+
+ <fileSets>
+ <fileSet>
+ <directory>src/main/scripts</directory>
+ <outputDirectory>bin</outputDirectory>
+ <includes>
+ <include>**/*.sh</include>
+ </includes>
+ <fileMode>0755</fileMode>
+ <lineEnding>unix</lineEnding>
+ </fileSet>
+ <fileSet>
+ <directory>etc</directory>
+ <outputDirectory>etc</outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.conf</include>
+ </includes>
+ <outputDirectory>etc</outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>dpo/data-formats</directory>
+ <includes>
+ <include>**/*.json</include>
+ </includes>
+ <outputDirectory>specs</outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>dpo/spec</directory>
+ <includes>
+ <include>**/*.json</include>
+ </includes>
+ <outputDirectory>specs</outputDirectory>
+ </fileSet>
+ </fileSets>
+
+ <dependencySets>
+ <dependencySet>
+ <scope>runtime</scope>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <outputDirectory>lib</outputDirectory>
+ </dependencySet>
+ </dependencySets>
+</assembly>
diff --git a/src/main/java/org/onap/dcae/ApplicationSettings.java b/src/main/java/org/onap/dcae/ApplicationSettings.java
new file mode 100644
index 00000000..0ebd1e90
--- /dev/null
+++ b/src/main/java/org/onap/dcae/ApplicationSettings.java
@@ -0,0 +1,176 @@
+/*
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018 Nokia. All rights reserved.s
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dcae;
+
+import com.att.nsa.drumlin.till.nv.impl.nvReadableStack;
+import com.att.nsa.drumlin.till.nv.impl.nvReadableTable;
+import com.att.nsa.drumlin.till.nv.rrNvReadable;
+import com.google.common.annotations.VisibleForTesting;
+import io.vavr.Function1;
+import io.vavr.collection.HashMap;
+import io.vavr.collection.Map;
+import org.apache.commons.configuration.ConfigurationConverter;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.nio.file.Paths;
+
+/**
+ * Abstraction over application configuration.
+ * Its job is to provide easily discoverable (by method names lookup) and type safe access to configuration properties.
+ */
+public class ApplicationSettings {
+
+ private static final Logger inlog = LoggerFactory.getLogger(ApplicationSettings.class);
+ private static final String COLLECTOR_PROPERTIES = "etc/collector.properties";
+ private final PropertiesConfiguration properties = new PropertiesConfiguration();
+
+ public ApplicationSettings(String[] args, Function1<String[], Map<String, String>> argsParser) {
+ properties.setDelimiterParsingDisabled(true);
+ Map<String, String> parsedArgs = argsParser.apply(args);
+ loadProperties(Paths.get(new File(COLLECTOR_PROPERTIES).getAbsolutePath()).toString());
+ loadCommandLineProperties(parsedArgs);
+ parsedArgs.filterKeys(k -> !k.equals("c")).forEach(this::updateProperty);
+ }
+
+ private void loadCommandLineProperties(Map<String, String> parsedArgs) {
+ parsedArgs.get("c").forEach(e -> {
+ properties.clear();
+ loadProperties(e);
+ });
+ }
+
+ private void loadProperties(String property){
+ try {
+ properties.load(property);
+ } catch (ConfigurationException ex) {
+ inlog.error("Cannot load properties cause:", ex);
+ throw new RuntimeException(ex);
+ }
+ }
+
+ public String validAuthorizationCredentials() {
+ return properties.getString("header.authlist", null);
+ }
+
+ public int maximumAllowedQueuedEvents() {
+ return properties.getInt("collector.inputQueue.maxPending", 1024 * 4);
+ }
+
+ public boolean jsonSchemaValidationEnabled() {
+ return properties.getInt("collector.schema.checkflag", -1) > 0;
+ }
+
+ public boolean authorizationEnabled() {
+ return properties.getInt("header.authflag", 0) > 0;
+ }
+
+ public JSONObject jsonSchema() {
+ return new JSONObject(
+ properties.getString("collector.schema.file", "{\"v5\":\"./etc/CommonEventFormat_28.3.json\"}"));
+ }
+
+ public int httpPort() {
+ return properties.getInt("collector.service.port", 8080);
+ }
+
+ public int httpsPort() {
+ return properties.getInt("collector.service.secure.port", 8443);
+ }
+
+ public boolean httpsEnabled() {
+ return httpsPort() > 0;
+ }
+
+ public boolean eventTransformingEnabled() {
+ return properties.getInt("event.transform.flag", 1) > 0;
+ }
+
+ public String keystorePasswordFileLocation() {
+ return properties.getString("collector.keystore.passwordfile", "./etc/passwordfile");
+ }
+
+ public String keystoreFileLocation() {
+ return properties.getString("collector.keystore.file.location", "../etc/keystore");
+ }
+
+ public String keystoreAlias() {
+ return properties.getString("collector.keystore.alias", "tomcat");
+ }
+
+ public String exceptionConfigFileLocation() {
+ return properties.getString("exceptionConfig", null);
+ }
+
+ public String cambriaConfigurationFileLocation() {
+ return properties.getString("collector.dmaapfile", "./etc/DmaapConfig.json");
+ }
+
+ public Map<String, String[]> dMaaPStreamsMapping() {
+ String streamIdsProperty = properties.getString("collector.dmaap.streamid", null);
+ if (streamIdsProperty == null) {
+ return HashMap.empty();
+ } else {
+ return convertDMaaPStreamsPropertyToMap(streamIdsProperty);
+ }
+ }
+
+ /*
+ * Kept back here for backward compatibility.
+ * RestfulCollectorServlet upon its initialization requires options to be represented
+ * as object represented by rrNvReadable interface, so we define a a handy transformation function here.
+ */
+ public rrNvReadable torrNvReadable() {
+ final nvReadableStack settings = new nvReadableStack();
+ settings.push(new nvReadableTable(ConfigurationConverter.getProperties(properties)));
+ return settings;
+ }
+
+ private Map<String, String[]> convertDMaaPStreamsPropertyToMap(String streamIdsProperty) {
+ java.util.HashMap<String, String[]> domainToStreamIdsMapping = new java.util.HashMap<>();
+ String[] topics = streamIdsProperty.split("\\|");
+ for (String t : topics) {
+ String domain = t.split("=")[0];
+ String[] streamIds = t.split("=")[1].split(",");
+ domainToStreamIdsMapping.put(domain, streamIds);
+ }
+ return HashMap.ofAll(domainToStreamIdsMapping);
+ }
+
+ private void updateProperty(String key, String value) {
+ if (properties.containsKey(key)) {
+ properties.setProperty(key, value);
+ } else {
+ properties.addProperty(key, value);
+ }
+ }
+
+ @VisibleForTesting
+ String getStringDirectly(String key) {
+ return properties.getString(key);
+ }
+}
+
diff --git a/src/main/java/org/onap/dcae/CLIUtils.java b/src/main/java/org/onap/dcae/CLIUtils.java
new file mode 100644
index 00000000..6450d2e5
--- /dev/null
+++ b/src/main/java/org/onap/dcae/CLIUtils.java
@@ -0,0 +1,60 @@
+/*
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dcae;
+
+import java.util.HashMap;
+
+/**
+ * CLIUtils extracted from nsaServerLibrary this implementation will be removed once we switch to different API library
+ */
+public class CLIUtils {
+
+ public static io.vavr.collection.HashMap<String, String> processCmdLine (String[] args) {
+ final HashMap<String,String> map = new HashMap<String,String> ();
+
+ String lastKey = null;
+ for ( String arg : args )
+ {
+ if ( arg.startsWith ( "-" ) )
+ {
+ if ( lastKey != null )
+ {
+ map.put ( lastKey.substring(1), "" );
+ }
+ lastKey = arg;
+ }
+ else
+ {
+ if ( lastKey != null )
+ {
+ map.put ( lastKey.substring(1), arg );
+ }
+ lastKey = null;
+ }
+ }
+ if ( lastKey != null )
+ {
+ map.put ( lastKey.substring(1), "" );
+ }
+ return io.vavr.collection.HashMap.ofAll(map);
+ }
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/AnyNode.java b/src/main/java/org/onap/dcae/commonFunction/AnyNode.java
new file mode 100644
index 00000000..97d73ddd
--- /dev/null
+++ b/src/main/java/org/onap/dcae/commonFunction/AnyNode.java
@@ -0,0 +1,113 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2018 Nokia Networks Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction;
+
+import static io.vavr.API.Set;
+
+import io.vavr.collection.List;
+import io.vavr.collection.Set;
+import io.vavr.control.Option;
+import java.util.stream.StreamSupport;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This class is a wrapper for 2 most used entities of org.json lib: JSONArray and JSONObject and comprises utility
+ * methods for fast access of json structures without need to explicitly coerce between them. While using this, bear in
+ * mind it does not contain exception handling - it is assumed that when using, the parsed json structure is known.
+ *
+ * @author koblosz
+ */
+public class AnyNode {
+
+ private Object obj;
+
+ private AnyNode(Object object) {
+ this.obj = object;
+ }
+
+ public static AnyNode fromString(String content) {
+ return new AnyNode(new JSONObject(content));
+ }
+
+ /**
+ * Returns key set of underlying object. It is assumed that underlying object is of type org.json.JSONObject.
+ */
+ public Set<String> keys() {
+ return Set(asJsonObject().keySet().toArray(new String[]{}));
+ }
+
+ /**
+ * Returns value associated with specified key wrapped with AnyValue object. It is assumed that this is of type
+ * org.json.JSONObject.
+ */
+ public AnyNode get(String key) {
+ return new AnyNode(asJsonObject().get(key));
+ }
+
+ /**
+ * Returns string representation of this. If it happens to have null, the value is treated as
+ * org.json.JSONObject.NULL and "null" string is returned then.
+ */
+ public String toString() {
+ return this.obj.toString();
+ }
+
+ /**
+ * Returns optional of object under specified key, wrapped with AnyNode object.
+ * If underlying object is not of type org.json.JSONObject
+ * or underlying object has no given key
+ * or given key is null
+ * then Optional.empty will be returned.
+ */
+ public Option<AnyNode> getAsOption(String key) {
+ try {
+ AnyNode value = get(key);
+ if (value.toString().equals("null")) {
+ return Option.none();
+ }
+ return Option.some(value);
+ } catch (JSONException ex) {
+ return Option.none();
+ }
+ }
+
+ /**
+ * Converts underlying object to map representation with map values wrapped with AnyNode object. It is assumed that
+ * underlying object is of type org.json.JSONObject.
+ */
+ public List<AnyNode> toList() {
+ return List.ofAll(StreamSupport.stream(((JSONArray) this.obj).spliterator(), false).map(AnyNode::new));
+ }
+
+ /**
+ * Checks if specified key is present in this. It is assumed that this is of type JSONObject.
+ */
+ public boolean has(String key) {
+ return !getAsOption(key).isEmpty();
+ }
+
+ private JSONObject asJsonObject() {
+ return (JSONObject) this.obj;
+ }
+
+
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/CommonStartup.java b/src/main/java/org/onap/dcae/commonFunction/CommonStartup.java
index b974ed53..36713aa4 100644
--- a/src/main/java/org/onap/dcae/commonFunction/CommonStartup.java
+++ b/src/main/java/org/onap/dcae/commonFunction/CommonStartup.java
@@ -1,310 +1,204 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.dcae.commonFunction;
-
-import com.att.nsa.apiServer.ApiServer;
-import com.att.nsa.apiServer.ApiServerConnector;
-import com.att.nsa.apiServer.endpoints.NsaBaseEndpoint;
-import com.att.nsa.cmdLine.NsaCommandLineUtil;
-import com.att.nsa.drumlin.service.framework.DrumlinServlet;
-import com.att.nsa.drumlin.till.nv.impl.nvPropertiesFile;
-import com.att.nsa.drumlin.till.nv.impl.nvReadableStack;
-import com.att.nsa.drumlin.till.nv.impl.nvReadableTable;
-import com.att.nsa.drumlin.till.nv.rrNvReadable;
-import com.att.nsa.drumlin.till.nv.rrNvReadable.invalidSettingValue;
-import com.att.nsa.drumlin.till.nv.rrNvReadable.loadException;
-import com.att.nsa.drumlin.till.nv.rrNvReadable.missingReqdSetting;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.github.fge.jsonschema.exceptions.ProcessingException;
-import com.github.fge.jsonschema.main.JsonSchema;
-import com.github.fge.jsonschema.main.JsonSchemaFactory;
-import com.github.fge.jsonschema.report.ProcessingMessage;
-import com.github.fge.jsonschema.report.ProcessingReport;
-import com.github.fge.jsonschema.util.JsonLoader;
-import org.apache.catalina.LifecycleException;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.onap.dcae.restapi.RestfulCollectorServlet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Queue;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.LinkedBlockingQueue;
-import javax.servlet.ServletException;
-
-
-public class CommonStartup extends NsaBaseEndpoint implements Runnable {
-
- public static final String KCONFIG = "c";
-
- public static final String KSETTING_PORT = "collector.service.port";
- public static final int KDEFAULT_PORT = 8080;
-
- public static final String KSETTING_SECUREPORT = "collector.service.secure.port";
- public static final int KDEFAULT_SECUREPORT = -1;
-
- public static final String KSETTING_KEYSTOREPASSFILE = "collector.keystore.passwordfile";
- public static final String KDEFAULT_KEYSTOREPASSFILE = "../etc/passwordfile";
- public static final String KSETTING_KEYSTOREFILE = "collector.keystore.file.location";
- public static final String KDEFAULT_KEYSTOREFILE = "../etc/keystore";
- public static final String KSETTING_KEYALIAS = "collector.keystore.alias";
- public static final String KDEFAULT_KEYALIAS = "tomcat";
-
- public static final String KSETTING_DMAAPCONFIGS = "collector.dmaapfile";
- protected static final String[] KDEFAULT_DMAAPCONFIGS = new String[] { "/etc/DmaapConfig.json" };
-
- public static final String KSETTING_MAXQUEUEDEVENTS = "collector.inputQueue.maxPending";
- public static final int KDEFAULT_MAXQUEUEDEVENTS = 1024 * 4;
-
- public static final String KSETTING_SCHEMAVALIDATOR = "collector.schema.checkflag";
- public static final int KDEFAULT_SCHEMAVALIDATOR = -1;
-
- public static final String KSETTING_SCHEMAFILE = "collector.schema.file";
- public static final String KDEFAULT_SCHEMAFILE = "{\"v5\":\"./etc/CommonEventFormat_28.3.json\"}";
- public static final String KSETTING_EXCEPTIONCONFIG = "exceptionConfig";
-
- public static final String KSETTING_DMAAPSTREAMID = "collector.dmaap.streamid";
-
- public static final String KSETTING_AUTHFLAG = "header.authflag";
- public static final int KDEFAULT_AUTHFLAG = 0;
-
- public static final String kSetting_authlist = "header.authlist";
-
- public static final String KSETTING_EVENTTRANSFORMFLAG = "event.transform.flag";
- public static final int KDEFAULT_EVENTTRANSFORMFLAG = 1;
-
- public static final Logger inlog = LoggerFactory.getLogger("org.onap.dcae.commonFunction.input");
- public static final Logger oplog = LoggerFactory.getLogger("org.onap.dcae.commonFunction.output");
- public static final Logger eplog = LoggerFactory.getLogger("org.onap.dcae.commonFunction.error");
- public static final Logger metriclog = LoggerFactory.getLogger("com.att.ecomp.metrics");
-
- public static int schema_Validatorflag = -1;
- public static int authflag = 1;
- public static int eventTransformFlag = 1;
- public static String schemaFile;
- public static JSONObject schemaFileJson;
- public static String exceptionConfig;
- public static String cambriaConfigFile;
- private boolean listnerstatus;
- public static String streamid;
-
- private CommonStartup(rrNvReadable settings) throws loadException, IOException, rrNvReadable.missingReqdSetting,
- rrNvReadable.invalidSettingValue, ServletException, InterruptedException {
- final List<ApiServerConnector> connectors = new LinkedList<ApiServerConnector>();
-
- if (settings.getInt(KSETTING_PORT, KDEFAULT_PORT) > 0) {
- // http service
- connectors.add(new ApiServerConnector.Builder(settings.getInt(KSETTING_PORT, KDEFAULT_PORT)).secure(false)
- .build());
- }
-
- // optional https service
- final int securePort = settings.getInt(KSETTING_SECUREPORT, KDEFAULT_SECUREPORT);
- final String keystoreFile = settings.getString(KSETTING_KEYSTOREFILE, KDEFAULT_KEYSTOREFILE);
- final String keystorePasswordFile = settings.getString(KSETTING_KEYSTOREPASSFILE, KDEFAULT_KEYSTOREPASSFILE);
- final String keyAlias = settings.getString(KSETTING_KEYALIAS, KDEFAULT_KEYALIAS);
-
- if (securePort > 0) {
- final String KSETTING_KEYSTOREPASS = readFile(keystorePasswordFile, Charset.defaultCharset());
- connectors.add(new ApiServerConnector.Builder(securePort).secure(true)
- .keystorePassword(KSETTING_KEYSTOREPASS).keystoreFile(keystoreFile).keyAlias(keyAlias).build());
-
- }
-
- // Reading other config properties
-
- schema_Validatorflag = settings.getInt(KSETTING_SCHEMAVALIDATOR, KDEFAULT_SCHEMAVALIDATOR);
- if (schema_Validatorflag > 0) {
- schemaFile = settings.getString(KSETTING_SCHEMAFILE, KDEFAULT_SCHEMAFILE);
- // System.out.println("SchemaFile:" + schemaFile);
- schemaFileJson = new JSONObject(schemaFile);
-
- }
- exceptionConfig = settings.getString(KSETTING_EXCEPTIONCONFIG, null);
- authflag = settings.getInt(CommonStartup.KSETTING_AUTHFLAG, CommonStartup.KDEFAULT_AUTHFLAG);
- String[] currentconffile = settings.getStrings(CommonStartup.KSETTING_DMAAPCONFIGS,
- CommonStartup.KDEFAULT_DMAAPCONFIGS);
- cambriaConfigFile = currentconffile[0];
- streamid = settings.getString(KSETTING_DMAAPSTREAMID, null);
- eventTransformFlag = settings.getInt(KSETTING_EVENTTRANSFORMFLAG, KDEFAULT_EVENTTRANSFORMFLAG);
-
- fTomcatServer = new ApiServer.Builder(connectors, new RestfulCollectorServlet(settings)).encodeSlashes(true)
- .name("collector").build();
-
- // Load override exception map
- CustomExceptionLoader.LoadMap();
- setListnerstatus(true);
- }
-
- public static void main(String[] args) {
- ExecutorService executor = null;
- try {
- // process command line arguments
- final Map<String, String> argMap = NsaCommandLineUtil.processCmdLine(args, true);
- final String config = NsaCommandLineUtil.getSetting(argMap, KCONFIG, "collector.properties");
- final URL settingStream = DrumlinServlet.findStream(config, CommonStartup.class);
-
- final nvReadableStack settings = new nvReadableStack();
- settings.push(new nvPropertiesFile(settingStream));
- settings.push(new nvReadableTable(argMap));
-
- fProcessingInputQueue = new LinkedBlockingQueue<JSONObject>(CommonStartup.KDEFAULT_MAXQUEUEDEVENTS);
-
- VESLogger.setUpEcompLogging();
-
- CommonStartup cs = new CommonStartup(settings);
-
- Thread csmain = new Thread(cs);
- csmain.start();
-
- EventProcessor ep = new EventProcessor();
- // Thread epThread=new Thread(ep);
- // epThread.start();
- executor = Executors.newFixedThreadPool(20);
- executor.execute(ep);
-
- } catch (loadException | missingReqdSetting | IOException | invalidSettingValue | ServletException
- | InterruptedException e) {
- CommonStartup.eplog.error("FATAL_STARTUP_ERROR" + e.getMessage());
- throw new RuntimeException(e);
- } finally {
- // This will make the executor accept no new threads
- // and finish all existing threads in the queue
- if (executor != null) {
- executor.shutdown();
- }
-
- }
- }
-
- public void run() {
- try {
- fTomcatServer.start();
- } catch (LifecycleException | IOException e) {
-
- log.error("lifecycle or IO: ", e);
- }
- fTomcatServer.await();
- }
-
- public boolean isListnerstatus() {
- return listnerstatus;
- }
-
- public void setListnerstatus(boolean listnerstatus) {
- this.listnerstatus = listnerstatus;
- }
-
- public static Queue<JSONObject> getProcessingInputQueue() {
- return fProcessingInputQueue;
- }
-
- public static class QueueFullException extends Exception {
-
- private static final long serialVersionUID = 1L;
- }
-
- public static void handleEvents(JSONArray a) throws QueueFullException, JSONException, IOException {
- final Queue<JSONObject> queue = getProcessingInputQueue();
- try {
-
- CommonStartup.metriclog.info("EVENT_PUBLISH_START");
- for (int i = 0; i < a.length(); i++) {
- if (!queue.offer(a.getJSONObject(i))) {
- throw new QueueFullException();
- }
-
- }
- log.debug("CommonStartup.handleEvents:EVENTS has been published successfully!");
- CommonStartup.metriclog.info("EVENT_PUBLISH_END");
- // ecomplogger.debug(secloggerMessageEnum.SEC_COLLECT_AND_PULIBISH_SUCCESS);
-
- } catch (JSONException e) {
- throw e;
-
- }
- }
-
- static String readFile(String path, Charset encoding) throws IOException {
- byte[] encoded = Files.readAllBytes(Paths.get(path));
- String pwd = new String(encoded);
- return pwd.substring(0, pwd.length() - 1);
- }
-
- public static String schemavalidate(String jsonData, String jsonSchema) {
- ProcessingReport report;
- String result = "false";
-
- try {
- // System.out.println("Applying schema: @<@<"+jsonSchema+">@>@ to
- // data: #<#<"+jsonData+">#>#");
- log.trace("Schema validation for event:" + jsonData);
- JsonNode schemaNode = JsonLoader.fromString(jsonSchema);
- JsonNode data = JsonLoader.fromString(jsonData);
- JsonSchemaFactory factory = JsonSchemaFactory.byDefault();
- JsonSchema schema = factory.getJsonSchema(schemaNode);
- report = schema.validate(data);
- } catch (JsonParseException e) {
- log.error("schemavalidate:JsonParseException for event:" + jsonData);
- return e.getMessage().toString();
- } catch (ProcessingException e) {
- log.error("schemavalidate:Processing exception for event:" + jsonData);
- return e.getMessage().toString();
- } catch (IOException e) {
- log.error(
- "schemavalidate:IO exception; something went wrong trying to read json data for event:" + jsonData);
- return e.getMessage().toString();
- }
- if (report != null) {
- Iterator<ProcessingMessage> iter = report.iterator();
- while (iter.hasNext()) {
- ProcessingMessage pm = iter.next();
- log.trace("Processing Message: " + pm.getMessage());
- }
- result = String.valueOf(report.isSuccess());
- }
- try {
- log.debug("Validation Result:" + result + " Validation report:" + report);
- } catch (NullPointerException e) {
- log.error("schemavalidate:NullpointerException on report");
- }
- return result;
- }
-
- public static LinkedBlockingQueue<JSONObject> fProcessingInputQueue;
- private static ApiServer fTomcatServer = null;
- private static final Logger log = LoggerFactory.getLogger(CommonStartup.class);
-
-}
-
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dcae.commonFunction;
+
+import com.att.nsa.apiServer.ApiServer;
+import com.att.nsa.apiServer.ApiServerConnector;
+import com.att.nsa.apiServer.endpoints.NsaBaseEndpoint;
+import com.att.nsa.drumlin.till.nv.rrNvReadable;
+import com.att.nsa.drumlin.till.nv.rrNvReadable.loadException;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.github.fge.jackson.JsonLoader;
+import com.github.fge.jsonschema.core.exceptions.ProcessingException;
+import com.github.fge.jsonschema.core.report.ProcessingMessage;
+import com.github.fge.jsonschema.core.report.ProcessingReport;
+import com.github.fge.jsonschema.main.JsonSchema;
+import com.github.fge.jsonschema.main.JsonSchemaFactory;
+import org.apache.catalina.LifecycleException;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.onap.dcae.ApplicationSettings;
+import org.onap.dcae.CLIUtils;
+import org.onap.dcae.commonFunction.event.publishing.DMaaPConfigurationParser;
+import org.onap.dcae.commonFunction.event.publishing.EventPublisher;
+import org.onap.dcae.restapi.RestfulCollectorServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingQueue;
+
+public class CommonStartup extends NsaBaseEndpoint implements Runnable {
+
+ private static final Logger metriclog = LoggerFactory.getLogger("com.att.ecomp.metrics");
+ public static final Logger inlog = LoggerFactory.getLogger("org.onap.dcae.commonFunction.input");
+ static final Logger oplog = LoggerFactory.getLogger("org.onap.dcae.commonFunction.output");
+ public static final Logger eplog = LoggerFactory.getLogger("org.onap.dcae.commonFunction.error");
+
+ static int maxQueueEvent = 1024 * 4;
+ public static boolean schemaValidatorflag = false;
+ public static boolean authflag = false;
+ static boolean eventTransformFlag = true;
+ public static JSONObject schemaFileJson;
+ static String cambriaConfigFile;
+ public static io.vavr.collection.Map<String , String [] > streamID;
+
+ static LinkedBlockingQueue<JSONObject> fProcessingInputQueue;
+ private static ApiServer fTomcatServer = null;
+ private static final Logger log = LoggerFactory.getLogger(CommonStartup.class);
+
+ private CommonStartup(ApplicationSettings settings) throws loadException, IOException, rrNvReadable.missingReqdSetting {
+ final List<ApiServerConnector> connectors = new LinkedList<>();
+
+ if (!settings.authorizationEnabled()) {
+ connectors.add(new ApiServerConnector.Builder(settings.httpPort()).secure(false).build());
+ }
+
+ final int securePort = settings.httpsPort();
+ final String keystoreFile = settings.keystoreFileLocation();
+ final String keystorePasswordFile = settings.keystorePasswordFileLocation();
+ final String keyAlias = settings.keystoreAlias();
+
+ if (settings.authorizationEnabled()) {
+ String keystorePassword = readFile(keystorePasswordFile);
+ connectors.add(new ApiServerConnector.Builder(securePort).secure(true)
+ .keystorePassword(keystorePassword).keystoreFile(keystoreFile).keyAlias(keyAlias).build());
+
+ }
+
+ schemaValidatorflag = settings.jsonSchemaValidationEnabled();
+ maxQueueEvent = settings.maximumAllowedQueuedEvents();
+ if (schemaValidatorflag) {
+ schemaFileJson = settings.jsonSchema();
+
+ }
+ authflag = settings.authorizationEnabled();
+ cambriaConfigFile = settings.cambriaConfigurationFileLocation();
+ streamID = settings.dMaaPStreamsMapping();
+ eventTransformFlag = settings.eventTransformingEnabled();
+
+ fTomcatServer = new ApiServer.Builder(connectors, new RestfulCollectorServlet(settings)).encodeSlashes(true)
+ .name("collector").build();
+ }
+
+ public static void main(String[] args) {
+ try {
+
+ fProcessingInputQueue = new LinkedBlockingQueue<>(CommonStartup.maxQueueEvent);
+
+ VESLogger.setUpEcompLogging();
+
+ CommonStartup cs = new CommonStartup(new ApplicationSettings(args, CLIUtils::processCmdLine));
+
+ Thread commonStartupThread = new Thread(cs);
+ commonStartupThread.start();
+
+ EventProcessor ep = new EventProcessor(EventPublisher.createPublisher(oplog,
+ DMaaPConfigurationParser
+ .parseToDomainMapping(Paths.get(cambriaConfigFile))
+ .get()));
+ ExecutorService executor = Executors.newFixedThreadPool(20);
+ for (int i = 0; i < 20; ++i) {
+ executor.execute(ep);
+ }
+ } catch (Exception e) {
+ CommonStartup.eplog.error("Fatal error during application startup", e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void run() {
+ try {
+ fTomcatServer.start();
+ fTomcatServer.await();
+ } catch (LifecycleException | IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static class QueueFullException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+ }
+
+ public static void handleEvents(JSONArray a) throws QueueFullException, JSONException {
+ CommonStartup.metriclog.info("EVENT_PUBLISH_START");
+ for (int i = 0; i < a.length(); i++) {
+ if (!fProcessingInputQueue.offer(a.getJSONObject(i))) {
+ throw new QueueFullException();
+ }
+ }
+ log.debug("CommonStartup.handleEvents:EVENTS has been published successfully!");
+ CommonStartup.metriclog.info("EVENT_PUBLISH_END");
+ }
+
+ private static String readFile(String path) throws IOException {
+ byte[] encoded = Files.readAllBytes(Paths.get(path));
+ String pwd = new String(encoded);
+ return pwd.substring(0, pwd.length() - 1);
+ }
+
+ public static String validateAgainstSchema(String jsonData, String jsonSchema) {
+ ProcessingReport report;
+ String result = "false";
+
+ try {
+ log.trace("Schema validation for event:" + jsonData);
+ JsonNode schemaNode = JsonLoader.fromString(jsonSchema);
+ JsonNode data = JsonLoader.fromString(jsonData);
+ JsonSchemaFactory factory = JsonSchemaFactory.byDefault();
+ JsonSchema schema = factory.getJsonSchema(schemaNode);
+ report = schema.validate(data);
+ } catch (JsonParseException e) {
+ log.error("validateAgainstSchema:JsonParseException for event:" + jsonData);
+ return e.getMessage();
+ } catch (ProcessingException e) {
+ log.error("validateAgainstSchema:Processing exception for event:" + jsonData);
+ return e.getMessage();
+ } catch (IOException e) {
+ log.error(
+ "validateAgainstSchema:IO exception; something went wrong trying to read json data for event:" + jsonData);
+ return e.getMessage();
+ }
+ if (report != null) {
+ for (ProcessingMessage pm : report) {
+ log.trace("Processing Message: " + pm.getMessage());
+ }
+ result = String.valueOf(report.isSuccess());
+ }
+ try {
+ log.debug("Validation Result:" + result + " Validation report:" + report);
+ } catch (NullPointerException e) {
+ log.error("validateAgainstSchema:NullpointerException on report");
+ }
+ return result;
+ }
+
+
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/ConfigProcessors.java b/src/main/java/org/onap/dcae/commonFunction/ConfigProcessors.java
index 51158aa7..a6de0fc8 100644
--- a/src/main/java/org/onap/dcae/commonFunction/ConfigProcessors.java
+++ b/src/main/java/org/onap/dcae/commonFunction/ConfigProcessors.java
@@ -21,7 +21,6 @@
package org.onap.dcae.commonFunction;
-
import java.text.DecimalFormat;
import org.json.JSONArray;
import org.json.JSONObject;
@@ -30,640 +29,475 @@ import org.slf4j.LoggerFactory;
public class ConfigProcessors {
- private static Logger log = LoggerFactory.getLogger(ConfigProcessors.class);
+ private static final Logger log = LoggerFactory.getLogger(ConfigProcessors.class);
private static final String FIELD = "field";
private static final String OLD_FIELD = "oldField";
private static final String FILTER = "filter";
private static final String VALUE = "value";
private static final String REGEX = "\\[\\]";
private static final String OBJECT_NOT_FOUND = "ObjectNotFound";
-
- public ConfigProcessors(JSONObject eventJson)
- {
- event = eventJson;
- }
-
- /**
- *
- */
- public void getValue(JSONObject J)
- {
- //log.info("addAttribute");
- final String field = J.getString(FIELD);
- //final String value = J.getString(VALUE);
- final JSONObject filter = J.optJSONObject(FILTER);
- if (filter == null || isFilterMet(filter))
- {
- //log.info("field ==" + field);
- //log.info("value ==" + value);
- getEventObjectVal(field);
- }
- else
- log.info("Filter not met");
- }
-
- /**
- *
- */
- public void setValue(JSONObject J)
- {
- //log.info("addAttribute");
- final String field = J.getString(FIELD);
- final String value = J.getString(VALUE);
- final JSONObject filter = J.optJSONObject(FILTER);
- if (filter == null || isFilterMet(filter))
- {
- //log.info("field ==" + field);
- //log.info("value ==" + value);
- setEventObjectVal(field, value);
- }
- else
- log.info("Filter not met");
- }
-
- /**
- *
- */
- public String evaluate(String str)
- {
- String value = str;
- if (str.startsWith("$"))
- {
- value = (String) getEventObjectVal(str.substring(1));
-
- }
- return value;
- }
-
- /**
- * { "functionName":"suppressEvent",
- "args":{}
+ private static final String FILTER_NOT_MET = "Filter not met";
+ private static final String COMP_FALSE = "==false";
+
+ private final JSONObject event;
+
+ public ConfigProcessors(JSONObject eventJson) {
+ event = eventJson;
+ }
+
+ public void getValue(JSONObject jsonObject) {
+
+ final String field = jsonObject.getString(FIELD);
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+
+ if (filter == null || isFilterMet(filter)) {
+ getEventObjectVal(field);
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+
+ public void setValue(JSONObject jsonObject) {
+ final String field = jsonObject.getString(FIELD);
+ final String value = jsonObject.getString(VALUE);
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+ if (filter == null || isFilterMet(filter)) {
+ setEventObjectVal(field, value);
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+
+
+ private String evaluate(String str) {
+ String value = str;
+ if (str.startsWith("$")) {
+ value = (String) getEventObjectVal(str.substring(1));
+
+ }
+ return value;
+ }
+
+
+ public void suppressEvent(JSONObject jsonObject) {
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+
+ if (filter == null || isFilterMet(filter)) {
+ setEventObjectVal("suppressEvent", "true");
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+
+ public void addAttribute(JSONObject jsonObject) {
+
+ final String field = jsonObject.getString(FIELD);
+ final String value = evaluate(jsonObject.getString(VALUE));
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+ final String fieldType = jsonObject.optString("fieldType", "string").toLowerCase();
+
+ if (filter == null || isFilterMet(filter)) {
+ setEventObjectVal(field, value, fieldType);
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+
+ public void updateAttribute(JSONObject jsonObject) {
+
+ final String field = jsonObject.getString(FIELD);
+ final String value = evaluate(jsonObject.getString(VALUE));
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+ if (filter == null || isFilterMet(filter)) {
+ setEventObjectVal(field, value);
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+
+ public void removeAttribute(JSONObject jsonObject) {
+
+ final String field = jsonObject.getString(FIELD);
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+
+ if (filter == null || isFilterMet(filter)) {
+ removeEventKey(field);
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+
+ private void renameArrayInArray(JSONObject jsonObject) // map
+ {
+ log.info("renameArrayInArray");
+ final String field = jsonObject.getString(FIELD);
+ final String oldField = jsonObject.getString(OLD_FIELD);
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+
+ if (filter == null || isFilterMet(filter)) {
+
+ final String[] fsplit = field.split(REGEX, field.length());
+ final String[] oldfsplit = oldField.split(REGEX, oldField.length());
+
+ final String oldValue = getEventObjectVal(oldfsplit[0]).toString();
+ if (!oldValue.equals(OBJECT_NOT_FOUND)) {
+ final String oldArrayName = oldfsplit[1].substring(1);
+ final String newArrayName = fsplit[1].substring(1);
+ final String value = oldValue.replaceAll(oldArrayName, newArrayName);
+
+ log.info("oldValue ==" + oldValue);
+ log.info("value ==" + value);
+ JSONArray ja = new JSONArray(value);
+ removeEventKey(oldfsplit[0]);
+ setEventObjectVal(fsplit[0], ja);
}
- */
- public void suppressEvent(JSONObject J)
- {
- //log.info("addAttribute");
- final JSONObject filter = J.optJSONObject(FILTER);
-
- if (filter == null || isFilterMet(filter))
- {
- //log.info("field ==" + field);
- //log.info("value ==" + value);
- setEventObjectVal("suppressEvent", "true");
- }
- else
- log.info("Filter not met");
- }
-
- /**
- *
- */
- public void addAttribute(JSONObject J)
- {
- //log.info("addAttribute begin");
- final String field = J.getString(FIELD);
- final String value = evaluate(J.getString(VALUE));
- final JSONObject filter = J.optJSONObject(FILTER);
- final String fieldType = J.optString("fieldType", "string").toLowerCase();
-
- if (filter == null || isFilterMet(filter))
- {
- //log.info("field ==" + field);
- //log.info("value ==" + value);
- setEventObjectVal(field, value, fieldType);
- }
- else
- log.info("Filter not met");
- //log.info("addAttribute End");
- }
-
- /**
- *
- */
- public void updateAttribute(JSONObject J)
- {
- //log.info("updateAttribute");
- final String field = J.getString(FIELD);
- final String value = evaluate(J.getString(VALUE));
- final JSONObject filter = J.optJSONObject(FILTER);
- if (filter == null || isFilterMet(filter))
- {
- //log.info("field ==" + field);
- //log.info("value ==" + value);
- setEventObjectVal(field, value);
- }
- else
- log.info("Filter not met");
- }
-
- /**
- *
- */
- public void removeAttribute(JSONObject J)
- {
- //log.info("removeAttribute");
- final String field = J.getString(FIELD);
- final JSONObject filter = J.optJSONObject(FILTER);
-
- if (filter == null || isFilterMet(filter))
- {
- removeEventKey(field);
- }
- else
- log.info("Filter not met");
- }
-
- /**
- *
- */
- public void renameArrayInArray(JSONObject J) //map
- {
- log.info("renameArrayInArray");
- final String field = J.getString(FIELD);
- final String oldField = J.getString(OLD_FIELD);
- final JSONObject filter = J.optJSONObject(FILTER);
- //String value = "";
- if (filter == null || isFilterMet(filter))
- {
- //log.info("field ==" + field);
- final String[] fsplit = field.split(REGEX, field.length());
- final String[] oldfsplit = oldField.split(REGEX, oldField.length());
- /*for (int i=0; i< oldfsplit.length; i++ )
- {
- log.info( "renameArrayInArray " + i + " ==" + oldfsplit[i]);
- }*/
-
- final String oldValue = getEventObjectVal(oldfsplit[0]).toString();
- if (!oldValue.equals(OBJECT_NOT_FOUND)){
- final String oldArrayName = oldfsplit[1].substring(1);
- final String newArrayName = fsplit[1].substring(1);
- final String value = oldValue.replaceAll(oldArrayName, newArrayName);
- //log.info("oldArrayName ==" + oldArrayName);
- //log.info("newArrayName ==" + newArrayName);
- log.info("oldValue ==" + oldValue);
- log.info("value ==" + value);
- JSONArray ja = new JSONArray(value);
- removeEventKey(oldfsplit[0]);
- setEventObjectVal(fsplit[0], ja);
- }
- }
- else
- log.info("Filter not met");
- }
-
- /**
- *
- */
- public void map(JSONObject J)
- {
- //log.info("mapAttribute");
- final String field = J.getString(FIELD);
- if (field.contains("[]"))
- {
- if (field.matches(".*\\[\\]\\..*\\[\\]"))
- renameArrayInArray(J);
- else
- mapToJArray(J);
- }
- else
- mapAttribute(J);
- }
-
- /**
- *
- */
- public String performOperation(String operation, String value)
- {
- log.info("performOperation");
- if (operation != null)
- {
- if (operation.equals("convertMBtoKB"))
- {
- float kbValue = Float.parseFloat(value) * 1024;
- value = String.valueOf(kbValue);
- }
- }
- return value;
- }
-
- /**
- *
- */
- //public void mapAttributeToArrayAttribute(JSONObject J)
- public void mapAttribute(JSONObject J)
- {
- //log.info("mapAttribute");
- final String field = J.getString(FIELD);
- final String oldField = J.getString(OLD_FIELD);
- final JSONObject filter = J.optJSONObject(FILTER);
- final String operation = J.optString("operation");
- String value = "";
- if (filter == null || isFilterMet(filter))
- {
- //log.info("field ==" + field);
-
- value = getEventObjectVal(oldField).toString();
- if (!value.equals(OBJECT_NOT_FOUND))
- {
- if (operation != null && !operation.equals(""))
- value = performOperation(operation, value);
- //log.info("value ==" + value);
- setEventObjectVal(field, value);
-
- removeEventKey(oldField);
- }
- }
- else
- log.info("Filter not met");
- }
-
- /**
- *
- */
- public void mapToJArray(JSONObject J)
- {
- log.info("mapToJArray");
- String field = J.getString(FIELD);
- String oldField = J.getString(OLD_FIELD);
- final JSONObject filter = J.optJSONObject(FILTER);
- final JSONObject attrMap = J.optJSONObject("attrMap");
- oldField = oldField.replaceAll(REGEX, "");
- field = field.replaceAll(REGEX, "");
-
- //log.info("oldField ==" + field);
- if (filter == null || isFilterMet(filter))
- {
- //log.info("oldField ==" + field);
- String value = getEventObjectVal(oldField).toString();
- if (!value.equals(OBJECT_NOT_FOUND))
- {
- log.info("old value ==" + value.toString());
- //update old value based on attrMap
- if (attrMap != null)
- {
- //loop thru attrMap and update attribute name to new name
- for (String key : attrMap.keySet())
- {
- //log.info("attr key==" + key + " value==" + attrMap.getString(key));
- value = value.replaceAll(key, attrMap.getString(key));
- }
- }
-
- log.info("new value ==" + value);
- char c = value.charAt(0);
- if (c != '[')
- {
- //oldfield is JsonObject
- JSONObject valueJO = new JSONObject(value);
- // if the array already exists
-
- String existingValue = getEventObjectVal(field).toString();
- if (!existingValue.equals(OBJECT_NOT_FOUND))
- {
- JSONArray ja = new JSONArray(existingValue);
- JSONObject jo = ja.optJSONObject(0);
- if (jo != null)
- {
- for (String key : valueJO.keySet())
- {
- jo.put(key, valueJO.get(key));
-
- }
- ja.put(0, jo);
- //log.info("jarray== " + ja.toString());
- setEventObjectVal(field,ja);
- }
- }
- else //if new array
- setEventObjectVal(field + "[0]", new JSONObject(value), "JArray");
- }
- else //oldfield is jsonArray
- setEventObjectVal(field, new JSONArray(value));
-
- removeEventKey(oldField);
- }
- }
- else
- log.info("Filter not met");
- }
-
- /**
- * example -
- {
- "functionName": "concatenateValue",
- "args":{
- "filter": {"event.commonEventHeader.event":"heartbeat"},
- FIELD:"event.commonEventHeader.eventName",
- "concatenate": ["event.commonEventHeader.domain","event.commonEventHeader.eventType","event.commonEventHeader.alarmCondition"],
- "delimiter":"_"
- }
- }
- **/
- public void concatenateValue(JSONObject J)
- {
- //log.info("concatenateValue");
- final String field = J.getString(FIELD);
- final String delimiter = J.getString("delimiter");
- final JSONArray values = J.getJSONArray("concatenate");
- final JSONObject filter = J.optJSONObject(FILTER);
- if (filter == null || isFilterMet(filter))
- {
- String value = "";
- for (int i=0; i < values.length(); i++)
- {
- //log.info(values.getString(i));
- String tempVal = evaluate(values.getString(i));
- if (!tempVal.equals(OBJECT_NOT_FOUND))
- {
- if (i ==0)
- value = value + tempVal;
- else
- value = value + delimiter + tempVal;
- }
- }
- //log.info("value ==" + value);
- setEventObjectVal(field, value);
- }
- else
- log.info("Filter not met");
- }
-
- public void subtractValue(JSONObject J)
- {
- //log.info("concatenateValue");
- final String field = J.getString(FIELD);
- final JSONArray values = J.getJSONArray("subtract");
- final JSONObject filter = J.optJSONObject(FILTER);
- if (filter == null || isFilterMet(filter))
- {
- float value = 0;
- for (int i=0; i < values.length(); i++)
- {
- log.info(values.getString(i));
- String tempVal = evaluate(values.getString(i));
- log.info("tempVal==" + tempVal);
- if (!tempVal.equals(OBJECT_NOT_FOUND))
- {
- if (i ==0)
- value = value + Float.valueOf(tempVal);
- else
- value = value - Float.valueOf(tempVal);
- }
- }
- log.info("value ==" + value );
- setEventObjectVal(field, value, "number");
- }
- else
- log.info("Filter not met");
- }
-
- /**
- *
- */
- private void removeEventKey(String field)
- {
- String[] keySet = field.split("\\.",field.length());
- JSONObject keySeries = event;
- for (int i=0; i<(keySet.length -1); i++ )
- {
- //log.info( i + " ==" + keySet[i]);
- keySeries = keySeries.getJSONObject(keySet[i]);
- }
- //log.info(keySet[keySet.length -1]);
-
- keySeries.remove(keySet[keySet.length -1]);
-
- }
-
- /**
- *
- */
- private boolean checkFilter(JSONObject jo, String key, String logicKey)
- {
- String filterValue = jo.getString(key);
- boolean retVal = true;
-
- if(filterValue.contains(":"))
- {
- String[] splitVal = filterValue.split(":");
- //log.info(splitVal[0] + " " + splitVal[1]);
- if (splitVal[0].equals("matches"))
- {
- if (logicKey.equals("not"))
- {
- //log.info("not");
- //log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + "split1==" + splitVal[1]);
- if (getEventObjectVal(key).toString().matches(splitVal[1]))
- {
- log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + "==false");
- return false;
- }
- }
- else
- {
- if (!(getEventObjectVal(key).toString().matches(splitVal[1])))
- {
- log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + "==false");
- return false;
- }
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+
+ public void map(JSONObject jsonObject) {
+
+ final String field = jsonObject.getString(FIELD);
+ if (field.contains("[]")) {
+ if (field.matches(".*\\[\\]\\..*\\[\\]"))
+ renameArrayInArray(jsonObject);
+ else
+ mapToJArray(jsonObject);
+ } else
+ mapAttribute(jsonObject);
+ }
+
+ private String performOperation(String operation, String value) {
+ log.info("performOperation");
+ if ("convertMBtoKB".equals(operation)) {
+ float kbValue = Float.parseFloat(value) * 1024;
+ value = String.valueOf(kbValue);
+ }
+ return value;
+ }
+
+
+ public void mapAttribute(JSONObject jsonObject) {
+
+ final String field = jsonObject.getString(FIELD);
+ final String oldField = jsonObject.getString(OLD_FIELD);
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+ final String operation = jsonObject.optString("operation");
+ String value;
+ if (filter == null || isFilterMet(filter)) {
+
+ value = getEventObjectVal(oldField).toString();
+ if (!value.equals(OBJECT_NOT_FOUND)) {
+ if (operation != null && !operation.isEmpty())
+ value = performOperation(operation, value);
+
+ setEventObjectVal(field, value);
+
+ removeEventKey(oldField);
+ }
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+
+ private void mapToJArray(JSONObject jsonObject) {
+ log.info("mapToJArray");
+ String field = jsonObject.getString(FIELD);
+ String oldField = jsonObject.getString(OLD_FIELD);
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+ final JSONObject attrMap = jsonObject.optJSONObject("attrMap");
+ oldField = oldField.replaceAll(REGEX, "");
+ field = field.replaceAll(REGEX, "");
+
+ if (filter == null || isFilterMet(filter)) {
+
+ String value = getEventObjectVal(oldField).toString();
+ if (!value.equals(OBJECT_NOT_FOUND)) {
+ log.info("old value ==" + value);
+ // update old value based on attrMap
+ if (attrMap != null) {
+ // loop thru attrMap and update attribute name to new name
+ for (String key : attrMap.keySet()) {
+ value = value.replaceAll(key, attrMap.getString(key));
}
-
}
- if (splitVal[0].equals("contains"))
- {
- if (logicKey.equals("not"))
- {
- //log.info("not");
- //log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + "split1==" + splitVal[1]);
- if (getEventObjectVal(key).toString().contains(splitVal[1]))
- {
- log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + "==false");
- return false;
+
+ log.info("new value ==" + value);
+ char c = value.charAt(0);
+ if (c != '[') {
+ // oldfield is JsonObject
+ JSONObject valueJO = new JSONObject(value);
+ // if the array already exists
+ String existingValue = getEventObjectVal(field).toString();
+ if (!existingValue.equals(OBJECT_NOT_FOUND)) {
+ JSONArray ja = new JSONArray(existingValue);
+ JSONObject jo = ja.optJSONObject(0);
+ if (jo != null) {
+ for (String key : valueJO.keySet()) {
+ jo.put(key, valueJO.get(key));
+
+ }
+ ja.put(0, jo);
+
+ setEventObjectVal(field, ja);
}
- }
+ } else // if new array
+ setEventObjectVal(field + "[0]", new JSONObject(value), "JArray");
+ } else // oldfield is jsonArray
+ setEventObjectVal(field, new JSONArray(value));
+
+ removeEventKey(oldField);
+ }
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+ /**
+ * example - { "functionName": "concatenateValue", "args":{ "filter":
+ * {"event.commonEventHeader.event":"heartbeat"},
+ * FIELD:"event.commonEventHeader.eventName", "concatenate":
+ * ["event.commonEventHeader.domain","event.commonEventHeader.eventType","event.commonEventHeader.alarmCondition"],
+ * "delimiter":"_" } }
+ **/
+ public void concatenateValue(JSONObject jsonObject) {
+
+ final String field = jsonObject.getString(FIELD);
+ final String delimiter = jsonObject.getString("delimiter");
+ final JSONArray values = jsonObject.getJSONArray("concatenate");
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+ if (filter == null || isFilterMet(filter)) {
+ StringBuilder value = new StringBuilder();
+ for (int i = 0; i < values.length(); i++) {
+
+ String tempVal = evaluate(values.getString(i));
+ if (!tempVal.equals(OBJECT_NOT_FOUND)) {
+ if (i == 0)
+ value.append(tempVal);
else
- {
- if (!(getEventObjectVal(key).toString().contains(splitVal[1])))
- {
- log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + "==false");
- return false;
- }
+ value.append(delimiter).append(tempVal);
+ }
+ }
+
+ setEventObjectVal(field, value.toString());
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+ public void subtractValue(JSONObject jsonObject) {
+
+ final String field = jsonObject.getString(FIELD);
+ final JSONArray values = jsonObject.getJSONArray("subtract");
+ final JSONObject filter = jsonObject.optJSONObject(FILTER);
+ if (filter == null || isFilterMet(filter)) {
+ float value = 0;
+ for (int i = 0; i < values.length(); i++) {
+ log.info(values.getString(i));
+ String tempVal = evaluate(values.getString(i));
+ log.info("tempVal==" + tempVal);
+ if (!tempVal.equals(OBJECT_NOT_FOUND)) {
+ if (i == 0)
+ value = value + Float.valueOf(tempVal);
+ else
+ value = value - Float.valueOf(tempVal);
+ }
+ }
+ log.info("value ==" + value);
+ setEventObjectVal(field, value, "number");
+ } else
+ log.info(FILTER_NOT_MET);
+ }
+
+
+ private void removeEventKey(String field) {
+ String[] keySet = field.split("\\.", field.length());
+ JSONObject keySeries = event;
+ for (int i = 0; i < (keySet.length - 1); i++) {
+
+ keySeries = keySeries.getJSONObject(keySet[i]);
+ }
+
+ keySeries.remove(keySet[keySet.length - 1]);
+ }
+
+
+ private boolean checkFilter(JSONObject jo, String key, String logicKey) {
+ String filterValue = jo.getString(key);
+ if (filterValue.contains(":")) {
+ String[] splitVal = filterValue.split(":");
+ if ("matches".equals(splitVal[0])) {
+ if ("not".equals(logicKey)) {
+ if (getEventObjectVal(key).toString().matches(splitVal[1])) {
+ log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + COMP_FALSE);
+ return false;
+ }
+ } else {
+ if (!(getEventObjectVal(key).toString().matches(splitVal[1]))) {
+ log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + COMP_FALSE);
+ return false;
}
-
}
+
}
- else
- {
- if (logicKey.equals("not"))
- {
- if(getEventObjectVal(key).toString().equals(filterValue))
- {
- log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + "==false");
+ if ("contains".equals(splitVal[0])) {
+ if ("not".equals(logicKey)) {
+ if (getEventObjectVal(key).toString().contains(splitVal[1])) {
+ log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + COMP_FALSE);
+ return false;
+ }
+ } else {
+ if (!(getEventObjectVal(key).toString().contains(splitVal[1]))) {
+ log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + COMP_FALSE);
return false;
}
}
- else
+
+ }
+ } else {
+ if ("not".equals(logicKey)) {
+ if (getEventObjectVal(key).toString().equals(filterValue)) {
+ log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + COMP_FALSE);
+ return false;
+ }
+ } else {
+ if (!(getEventObjectVal(key).toString().equals(filterValue))) {
+ log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + COMP_FALSE);
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+
+ public boolean isFilterMet(JSONObject jo) {
+ for (String key : jo.keySet()) {
+ if ("not".equals(key)) {
+ JSONObject njo = jo.getJSONObject(key);
+ for (String njoKey : njo.keySet()) {
+ if (!checkFilter(njo, njoKey, key))
+ return false;
+ }
+ } else {
+ if (!checkFilter(jo, key, key))
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * returns a string or JSONObject or JSONArray
+ **/
+ public Object getEventObjectVal(String keySeriesStr) {
+ keySeriesStr = keySeriesStr.replaceAll("\\[", ".");
+ keySeriesStr = keySeriesStr.replaceAll("\\]", ".");
+ if (keySeriesStr.contains("..")) {
+ keySeriesStr = keySeriesStr.replaceAll("\\.\\.", ".");
+ }
+
+ if (keySeriesStr.lastIndexOf(".") == keySeriesStr.length() - 1)
+ keySeriesStr = keySeriesStr.substring(0, keySeriesStr.length() - 1);
+ String[] keySet = keySeriesStr.split("\\.", keySeriesStr.length());
+ Object keySeriesObj = event;
+ for (String aKeySet : keySet) {
+ if (keySeriesObj != null) {
+ if (keySeriesObj instanceof String) {
+
+ log.info("STRING==" + keySeriesObj);
+ } else if (keySeriesObj instanceof JSONArray) {
+ keySeriesObj = ((JSONArray) keySeriesObj).optJSONObject(Integer.parseInt(aKeySet));
+
+ } else if (keySeriesObj instanceof JSONObject) {
+ keySeriesObj = ((JSONObject) keySeriesObj).opt(aKeySet);
+
+ } else {
+ log.info("unknown object==" + keySeriesObj);
+ }
+ }
+ }
+
+ if (keySeriesObj == null)
+ return OBJECT_NOT_FOUND;
+ return keySeriesObj;
+ }
+
+ public void setEventObjectVal(String keySeriesStr, Object value) {
+ setEventObjectVal(keySeriesStr, value, "string");
+ }
+
+ /**
+ * returns a string or JSONObject or JSONArray
+ **/
+ public void setEventObjectVal(String keySeriesStr, Object value, String fieldType) {
+ keySeriesStr = keySeriesStr.replaceAll("\\[", ".");
+ keySeriesStr = keySeriesStr.replaceAll("\\]", ".");
+ if (keySeriesStr.contains("..")) {
+ keySeriesStr = keySeriesStr.replaceAll("\\.\\.", ".");
+ }
+ log.info("fieldType==" + fieldType);
+
+ if (keySeriesStr.lastIndexOf(".") == keySeriesStr.length() - 1)
+ keySeriesStr = keySeriesStr.substring(0, keySeriesStr.length() - 1);
+ String[] keySet = keySeriesStr.split("\\.", keySeriesStr.length());
+ Object keySeriesObj = event;
+ for (int i = 0; i < (keySet.length - 1); i++) {
+
+ if (keySeriesObj instanceof JSONArray) {
+
+ if (((JSONArray) keySeriesObj).optJSONObject(Integer.parseInt(keySet[i])) == null) // if
+ // the
+ // object
+ // is
+ // not
+ // there
+ // then
+ // add
+ // it
{
- if(!(getEventObjectVal(key).toString().equals(filterValue)))
- {
- log.info(filterValue + "==" + key + "==" + getEventObjectVal(key) + "==false");
- return false;
- }
+ log.info("Object is null, must add it");
+ if (keySet[i + 1].matches("[0-9]*")) // if index then array
+ ((JSONArray) keySeriesObj).put(Integer.parseInt(keySet[i]), new JSONArray());
+ else
+ ((JSONArray) keySeriesObj).put(Integer.parseInt(keySet[i]), new JSONObject());
}
+ keySeriesObj = ((JSONArray) keySeriesObj).optJSONObject(Integer.parseInt(keySet[i]));
+
+ } else if (keySeriesObj instanceof JSONObject) {
+ if (((JSONObject) keySeriesObj).opt(keySet[i]) == null) // if
+ // the
+ // object
+ // is
+ // not
+ // there
+ // then
+ // add
+ // it
+ {
+ if (keySet[i + 1].matches("[0-9]*")) // if index then array
+ ((JSONObject) keySeriesObj).put(keySet[i], new JSONArray());
+ else
+ ((JSONObject) keySeriesObj).put(keySet[i], new JSONObject());
+ log.info("Object is null, must add it");
+ }
+ keySeriesObj = ((JSONObject) keySeriesObj).opt(keySet[i]);
+ } else {
+ log.info("unknown object==" + keySeriesObj);
}
- return retVal;
- }
- /**
- *
- */
- public boolean isFilterMet(JSONObject jo)
- {
- boolean retval = true;
- //log.info("Filter==" + jo.toString());
- for (String key : jo.keySet())
- {
- if (key.equals("not"))
- {
- JSONObject njo = jo.getJSONObject(key);
- for (String njoKey : njo.keySet())
- {
- //log.info(njoKey);
- retval = checkFilter(njo, njoKey, key);
- if (retval == false)
- return retval;
- }
- }
- else
- {
- //log.info(key);
- //final String filterKey = key;
- retval = checkFilter(jo, key, key);
- if (retval == false)
- return retval;
- }
- }
- return true;
- }
-
- /**
- * returns a string or JSONObject or JSONArray
- **/
- public Object getEventObjectVal(String keySeriesStr)
- {
- keySeriesStr = keySeriesStr.replaceAll("\\[", ".");
- keySeriesStr = keySeriesStr.replaceAll("\\]", ".");
- if (keySeriesStr.contains(".."))
- {
- keySeriesStr = keySeriesStr.replaceAll("\\.\\.", ".");
- }
- //log.info(Integer.toString(keySeriesStr.lastIndexOf(".")));
- //log.info(Integer.toString(keySeriesStr.length() -1));
- if (keySeriesStr.lastIndexOf(".") == keySeriesStr.length() -1 )
- keySeriesStr = keySeriesStr.substring(0,keySeriesStr.length()-1 );
- String[] keySet = keySeriesStr.split("\\.", keySeriesStr.length());
- Object keySeriesObj = event;
- for (int i=0; i<(keySet.length); i++ )
- {
- //log.info( "getEventObject " + i + " ==" + keySet[i]);
- if (keySeriesObj != null)
- {
- if (keySeriesObj instanceof String)
- {
- //keySeriesObj = keySeriesObj.get(keySet[i]);
- log.info("STRING==" + keySeriesObj);
- }
- else if (keySeriesObj instanceof JSONArray) {
- keySeriesObj = ((JSONArray) keySeriesObj).optJSONObject(Integer.parseInt(keySet[i]));
- //log.info("ARRAY==" + keySeriesObj);
- }
- else if (keySeriesObj instanceof JSONObject) {
- keySeriesObj = ( (JSONObject) keySeriesObj).opt(keySet[i]);
- //log.info("JSONObject==" + keySeriesObj);
- }
- else
- {
- log.info("unknown object==" + keySeriesObj);
- }
- }
- }
-
- if (keySeriesObj == null)
- return OBJECT_NOT_FOUND;
- return keySeriesObj;
- }
-
- public void setEventObjectVal(String keySeriesStr, Object value)
- {
- setEventObjectVal(keySeriesStr, value, "string");
- }
-
- /**
- * returns a string or JSONObject or JSONArray
- **/
- public void setEventObjectVal(String keySeriesStr, Object value, String fieldType)
- {
- keySeriesStr = keySeriesStr.replaceAll("\\[", ".");
- keySeriesStr = keySeriesStr.replaceAll("\\]", ".");
- if (keySeriesStr.contains(".."))
- {
- keySeriesStr = keySeriesStr.replaceAll("\\.\\.", ".");
- }
- log.info("fieldType==" + fieldType);
- //log.info(Integer.toString(keySeriesStr.lastIndexOf(".")));
- //log.info(Integer.toString(keySeriesStr.length() -1));
- if (keySeriesStr.lastIndexOf(".") == keySeriesStr.length() -1 )
- keySeriesStr = keySeriesStr.substring(0,keySeriesStr.length()-1 );
- String[] keySet = keySeriesStr.split("\\.", keySeriesStr.length());
- Object keySeriesObj = event;
- for (int i=0; i<(keySet.length -1); i++ )
- {
- //log.info( "setEventObject " + i + " ==" + keySet[i]);
- if (keySeriesObj instanceof JSONArray) {
- //keySeriesObj = ((JSONArray) keySeriesObj).optJSONObject(Integer.parseInt(keySet[i]));
- if (((JSONArray) keySeriesObj).optJSONObject(Integer.parseInt(keySet[i])) == null) //if the object is not there then add it
- {
- log.info("Object is null, must add it");
- if (keySet[i+1].matches("[0-9]*")) // if index then array
- ((JSONArray) keySeriesObj).put(Integer.parseInt(keySet[i]), new JSONArray());
- else
- ((JSONArray) keySeriesObj).put(Integer.parseInt(keySet[i]), new JSONObject());
- }
- keySeriesObj = ((JSONArray) keySeriesObj).optJSONObject(Integer.parseInt(keySet[i]));
- //log.info("ARRAY==" + keySeriesObj);
- }
- else if (keySeriesObj instanceof JSONObject) {
- if (( (JSONObject) keySeriesObj).opt(keySet[i]) == null) //if the object is not there then add it
- {
- if (keySet[i+1].matches("[0-9]*")) // if index then array
- ((JSONObject) keySeriesObj).put(keySet[i], new JSONArray());
- else
- ((JSONObject) keySeriesObj).put(keySet[i], new JSONObject());
- log.info("Object is null, must add it");
- }
- keySeriesObj = ( (JSONObject) keySeriesObj).opt(keySet[i]);
- //log.info("JSONObject==" + keySeriesObj);
- }
- else
- {
- log.info("unknown object==" + keySeriesObj);
- }
- }
- if (fieldType.equals("number") )
- {
- DecimalFormat df = new DecimalFormat("#.0");
- if (value instanceof String)
- ((JSONObject)keySeriesObj).put(keySet[keySet.length -1], Float.valueOf(df.format(Float.valueOf((String) value))));
- else
- ((JSONObject)keySeriesObj).put(keySet[keySet.length -1], Float.valueOf(df.format(value)));
- }
- else if (fieldType.equals("integer") && value instanceof String)
- ((JSONObject)keySeriesObj).put(keySet[keySet.length -1], Integer.valueOf((String) value));
- else if (fieldType.equals("JArray"))
- ((JSONArray)keySeriesObj).put( value);
- else
- ((JSONObject)keySeriesObj).put(keySet[keySet.length -1], value);
-
- }
- private JSONObject event = new JSONObject();
-}
+ }
+ if ("number".equals(fieldType)) {
+ DecimalFormat df = new DecimalFormat("#.0");
+ if (value instanceof String)
+ ((JSONObject) keySeriesObj).put(keySet[keySet.length - 1],
+ Float.valueOf(df.format(Float.valueOf((String) value))));
+ else
+ ((JSONObject) keySeriesObj).put(keySet[keySet.length - 1], Float.valueOf(df.format(value)));
+ } else if ("integer".equals(fieldType) && value instanceof String)
+ ((JSONObject) keySeriesObj).put(keySet[keySet.length - 1], Integer.valueOf((String) value));
+ else if ("JArray".equals(fieldType))
+ ((JSONArray) keySeriesObj).put(value);
+ else
+ ((JSONObject) keySeriesObj).put(keySet[keySet.length - 1], value);
+ }
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/CustomExceptionLoader.java b/src/main/java/org/onap/dcae/commonFunction/CustomExceptionLoader.java
deleted file mode 100644
index 10a1db47..00000000
--- a/src/main/java/org/onap/dcae/commonFunction/CustomExceptionLoader.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.dcae.commonFunction;
-
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.HashMap;
-
-import java.util.Map.Entry;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonIOException;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import com.google.gson.JsonSyntaxException;
-
-public class CustomExceptionLoader {
-
- protected static HashMap<String, JsonArray> map = null;
- private static final Logger log = LoggerFactory.getLogger ( CustomExceptionLoader.class );
-
- //For standalone test
- //LoadMap Invoked from servletSetup
- /*
- public static void main(String[] args) {
-
- System.out.println("CustomExceptionLoader.main --> Arguments -- ExceptionConfig file: " + args[0] + "StatusCode:" + args[1]+ " Error Msg:" + args[2]);
- CommonStartup.exceptionConfig = args[0];
-
- //Read the Custom exception JSON file into map
- LoadMap();
- System.out.println("CustomExceptionLoader.main --> Map info post LoadMap:" + map);
-
- String[] str= LookupMap(args[1],args[2]);
- if (! (str==null)) {
- System.out.println("CustomExceptionLoader.main --> Return from lookup function" + str[0] + "value:" + str[1]);
- }
-
- }
- */
-
- public static void LoadMap () {
-
- map = new HashMap<String, JsonArray>();
- FileReader fr = null;
- try {
- JsonElement root = null;
- fr = new FileReader(CommonStartup.exceptionConfig);
- root = new JsonParser().parse(fr);
- JsonObject jsonObject = root.getAsJsonObject().get("code").getAsJsonObject();
-
- for (Entry<String, JsonElement> entry : jsonObject.entrySet()) {
- map.put(entry.getKey(), (JsonArray) entry.getValue());
- }
-
- log.debug("CustomExceptionLoader.LoadMap --> Map loaded - " + map);
- } catch (JsonIOException|JsonSyntaxException|FileNotFoundException e) {
- log.error("Exception in LoadMap:" + e.getMessage());
- //e.printStackTrace();
- map = null;
- }
- finally {
- if (fr != null) {
- try {
- fr.close();
- } catch (IOException e) {
- log.error("Error closing file reader stream : " +e.toString());
- map = null;
- }
- }
- }
- }
-
- public static String[] LookupMap (String error, String errormsg) {
-
- String[] retarray = null;
-
- log.debug("CustomExceptionLoader.LookupMap -->" + " HTTP StatusCode:" + error + " Msg:" + errormsg);
- try{
-
- JsonArray jarray = map.get(error);
- for (int i = 0; i < jarray.size(); i++) {
-
- JsonElement val = jarray.get(i).getAsJsonObject().get("Reason");
- JsonArray ec = (JsonArray) jarray.get(i).getAsJsonObject().get("ErrorCode");
- log.trace("CustomExceptionLoader.LookupMap Parameter -> Error msg : " + errormsg + " Reason text being matched:" + val);
- if (errormsg.contains(val.toString().replace("\"", ""))){
- log.trace("CustomExceptionLoader.LookupMap Successful! Exception matched to error message StatusCode:" + ec.get(0).toString() + "ErrorMessage:" + ec.get(1).toString());
- retarray = new String[2];
- retarray[0]=ec.get(0).toString();
- retarray[1]=ec.get(1).toString();
- return retarray;
- }
- }
-
- }
- catch (Exception e)
- {
- System.out.println(e.getMessage());
- }
-
- return retarray;
- }
-
-}
diff --git a/src/main/java/org/onap/dcae/commonFunction/DmaapPropertyReader.java b/src/main/java/org/onap/dcae/commonFunction/DmaapPropertyReader.java
deleted file mode 100644
index b10f5882..00000000
--- a/src/main/java/org/onap/dcae/commonFunction/DmaapPropertyReader.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.dcae.commonFunction;
-
-import java.io.FileNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonIOException;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import com.google.gson.JsonSyntaxException;
-
-public class DmaapPropertyReader {
-
- private static DmaapPropertyReader instance = null;
-
- private static final Logger log = LoggerFactory.getLogger(DmaapPropertyReader.class);
-
- public HashMap<String, String> dmaap_hash = new HashMap<String, String>();
-
- public DmaapPropertyReader(String CambriaConfigFile) {
-
- FileReader fr = null;
- try {
- JsonElement root = null;
- fr = new FileReader(CambriaConfigFile);
- root = new JsonParser().parse(fr);
-
- //Check if dmaap config is handled by legacy controller/service manager
- if (root.getAsJsonObject().has("channels")) {
- JsonArray jsonObject = (JsonArray) root.getAsJsonObject().get("channels");
-
- for (int i = 0; i < jsonObject.size(); i++) {
- log.debug("TOPIC:" + jsonObject.get(i).getAsJsonObject().get("cambria.topic") + " HOST-URL:"
- + jsonObject.get(i).getAsJsonObject().get("cambria.url") + " HOSTS:"
- + jsonObject.get(i).getAsJsonObject().get("cambria.hosts") + " PWD:"
- + jsonObject.get(i).getAsJsonObject().get("basicAuthPassword") + " USER:"
- + jsonObject.get(i).getAsJsonObject().get("basicAuthUsername") + " NAME:"
- + jsonObject.get(i).getAsJsonObject().get("name"));
-
- String convertedname = jsonObject.get(i).getAsJsonObject().get("name").toString().replace("\"", "");
- dmaap_hash.put(convertedname + ".cambria.topic",
- jsonObject.get(i).getAsJsonObject().get("cambria.topic").toString().replace("\"", ""));
-
- if (jsonObject.get(i).getAsJsonObject().get("cambria.hosts") != null) {
- dmaap_hash.put(convertedname + ".cambria.hosts",
- jsonObject.get(i).getAsJsonObject().get("cambria.hosts").toString().replace("\"", ""));
- }
- if (jsonObject.get(i).getAsJsonObject().get("cambria.url") != null) {
- dmaap_hash.put(convertedname + ".cambria.url",
- jsonObject.get(i).getAsJsonObject().get("cambria.url").toString().replace("\"", ""));
- }
- if (jsonObject.get(i).getAsJsonObject().get("basicAuthPassword") != null) {
- dmaap_hash.put(convertedname + ".basicAuthPassword", jsonObject.get(i).getAsJsonObject()
- .get("basicAuthPassword").toString().replace("\"", ""));
- }
- if (jsonObject.get(i).getAsJsonObject().get("basicAuthUsername") != null) {
- dmaap_hash.put(convertedname + ".basicAuthUsername", jsonObject.get(i).getAsJsonObject()
- .get("basicAuthUsername").toString().replace("\"", ""));
- }
-
- }
- } else {
-
- //Handing new format from controllergen2/config_binding_service
- JsonObject jsonObject = root.getAsJsonObject();
- Set<Map.Entry<String, JsonElement>> entries = jsonObject.entrySet();
-
- for (Map.Entry<String, JsonElement> entry : entries) {
-
- JsonElement topicurl = entry.getValue().getAsJsonObject().get("dmaap_info").getAsJsonObject().get("topic_url");
- String[] urlParts = dmaapUrlSplit(topicurl.toString().replace("\"", ""));
-
- String mrTopic = null;
- String mrUrl = null;
- String[] hostport = null;
- String username = null;
- String userpwd = null;
-
- try {
-
- if (null != urlParts) {
- mrUrl = urlParts[2];
-
- // DCAE internal dmaap topic convention
- if (urlParts[3].equals("events")) {
- mrTopic = urlParts[4];
- } else {
- // ONAP dmaap topic convention
- mrTopic = urlParts[3];
- hostport = mrUrl.split(":");
- }
-
- }
- } catch (NullPointerException e) {
- System.out.println("NullPointerException");
- e.getMessage();
- }
-
- if (entry.getValue().getAsJsonObject().has("aaf_username")) {
- username = entry.getValue().getAsJsonObject().get("aaf_username").toString().replace("\"", "");
- }
- if (entry.getValue().getAsJsonObject().has("aaf_password")) {
- userpwd = entry.getValue().getAsJsonObject().get("aaf_password").toString().replace("\"", "");
- }
- if (hostport == null) {
- log.debug("TOPIC:" + mrTopic + " HOST-URL:" + mrUrl + " PWD:" + userpwd + " USER:" + username);
- } else {
- log.debug("TOPIC:" + mrTopic + " HOST-URL:" + mrUrl + " HOSTS:" + hostport[0] + " PWD:"
- + userpwd + " USER:" + username + " NAME:" + entry.getKey());
- }
-
- dmaap_hash.put(entry.getKey() + ".cambria.topic", mrTopic);
-
- if (!(hostport == null)) {
- dmaap_hash.put(entry.getKey() + ".cambria.hosts", hostport[0]);
- }
-
- if (!(mrUrl == null)) {
- dmaap_hash.put(entry.getKey() + ".cambria.url", mrUrl);
- }
-
- if (!(username == null)) {
- dmaap_hash.put(entry.getKey() + ".basicAuthUsername", username);
- }
-
- if (!(userpwd == null)) {
- dmaap_hash.put(entry.getKey() + ".basicAuthPassword", userpwd);
- }
-
- }
-
- }
-
- } catch (JsonIOException | JsonSyntaxException |
-
- FileNotFoundException e1) {
- e1.printStackTrace();
- log.error("Problem loading Dmaap Channel configuration file: " + e1.toString());
- } finally {
- if (fr != null) {
- try {
- fr.close();
- } catch (IOException e) {
- log.error("Error closing file reader stream : " + e.toString());
- }
- }
- }
-
- }
-
- /***
- * Dmaap url structure pub - https://<dmaaphostname>:<port>/events/
- * <namespace>.<dmaapcluster>.<topic>, sub - https://<dmaaphostname>:
- * <port>/events/<namespace>.<dmaapcluster>.<topic>/G1/u1";
- *
- * Onap url structure pub - http://<dmaaphostname>:<port>/<unauthenticated>.
- * <topic>,
- */
-
- private String[] dmaapUrlSplit(String dmUrl) {
- String[] multUrls = dmUrl.split(",");
-
- StringBuffer newUrls = new StringBuffer();
- String urlParts[] = null;
- for (int i = 0; i < multUrls.length; i++) {
- urlParts = multUrls[i].split("/");
- if (i == 0) {
- newUrls = newUrls.append(urlParts[2]);
- } else {
- newUrls = newUrls.append(",").append(urlParts[2]);
- }
- }
- return urlParts;
- }
-
- public static synchronized DmaapPropertyReader getInstance(String ChannelConfig) {
- if (instance == null) {
- instance = new DmaapPropertyReader(ChannelConfig);
- }
- return instance;
- }
-
- public String getKeyValue(String HashKey) {
- return this.dmaap_hash.get(HashKey);
- }
-}
diff --git a/src/test/java/org/onap/dcae/vestest/TestDmaapPropertyReader.java b/src/main/java/org/onap/dcae/commonFunction/Event.java
index e54b4cbb..faae2451 100644
--- a/src/test/java/org/onap/dcae/vestest/TestDmaapPropertyReader.java
+++ b/src/main/java/org/onap/dcae/commonFunction/Event.java
@@ -7,9 +7,9 @@
* Licensed 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.
@@ -17,42 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-package org.onap.dcae.vestest;
+package org.onap.dcae.commonFunction;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import com.google.gson.JsonObject;
-import org.onap.dcae.commonFunction.DmaapPropertyReader;
+import java.util.List;
-public class TestDmaapPropertyReader {
-
- DmaapPropertyReader dr;
- String testinput = "src/test/resources/testDmaapConfig.json";
- Boolean flag = false;
-
- @Before
- public void setUp() throws Exception {
-
- // process command line arguments
-
- dr = new DmaapPropertyReader(testinput);
-
- }
-
- @After
- public void tearDown() throws Exception {
-
- }
-
- @Test
- public void testDmaapPropertyReader() {
-
- Boolean test = true;
- flag = !dr.dmaap_hash.isEmpty();
- Assert.assertEquals(test, flag);
- }
+class Event {
+ final JsonObject filter;
+ final List<Processor> processors;
+ Event(JsonObject filter, List<Processor> processors) {
+ this.filter = filter;
+ this.processors = processors;
+ }
}
-
diff --git a/src/main/java/org/onap/dcae/commonFunction/EventProcessor.java b/src/main/java/org/onap/dcae/commonFunction/EventProcessor.java
index 2bc5e45b..a57ea3f0 100644
--- a/src/main/java/org/onap/dcae/commonFunction/EventProcessor.java
+++ b/src/main/java/org/onap/dcae/commonFunction/EventProcessor.java
@@ -1,193 +1,172 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.dcae.commonFunction;
-
-import com.att.nsa.clock.SaClock;
-import com.att.nsa.logging.LoggingContext;
-import com.att.nsa.logging.log4j.EcompFields;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonParser;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.FileReader;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.TimeZone;
-
-public class EventProcessor implements Runnable {
-
- private static final Logger log = LoggerFactory.getLogger(EventProcessor.class);
- private static final String EVENT_LITERAL = "event";
- private static final String COMMON_EVENT_HEADER = "commonEventHeader";
-
- private static HashMap<String, String[]> streamid_hash = new HashMap<String, String[]>();
- public JSONObject event;
-
- public EventProcessor() {
- log.debug("EventProcessor: Default Constructor");
-
- String[] list = CommonStartup.streamid.split("\\|");
- for (String aList : list) {
- String domain = aList.split("=")[0];
- //String streamIdList[] = list[i].split("=")[1].split(",");
- String[] streamIdList = aList.substring(aList.indexOf('=') + 1).split(",");
-
- log.debug(String.format("Domain: %s streamIdList:%s", domain,
- Arrays.toString(streamIdList)));
- streamid_hash.put(domain, streamIdList);
- }
-
- }
-
- @Override
- public void run() {
-
- try {
-
- event = CommonStartup.fProcessingInputQueue.take();
- log.info("EventProcessor\tRemoving element: " + event);
-
- //EventPublisher Ep=new EventPublisher();
- while (event != null) {
- // As long as the producer is running we remove elements from the queue.
-
- //UUID uuid = UUID.fromString(event.get("VESuniqueId").toString());
- String uuid = event.get("VESuniqueId").toString();
- LoggingContext localLC = VESLogger.getLoggingContextForThread(uuid);
- localLC.put(EcompFields.kBeginTimestampMs, SaClock.now());
-
- log.debug("event.VESuniqueId" + event.get("VESuniqueId")
- + "event.commonEventHeader.domain:" + event.getJSONObject(EVENT_LITERAL)
- .getJSONObject(COMMON_EVENT_HEADER).getString("domain"));
- String[] streamIdList = streamid_hash.get(
- event.getJSONObject(EVENT_LITERAL).getJSONObject(COMMON_EVENT_HEADER)
- .getString("domain"));
- log.debug("streamIdList:" + streamIdList);
-
- if (streamIdList.length == 0) {
- log.error("No StreamID defined for publish - Message dropped" + event);
- } else {
- for (String aStreamIdList : streamIdList) {
- log.info("Invoking publisher for streamId:" + aStreamIdList);
- this.overrideEvent();
- EventPublisher.getInstance(aStreamIdList).sendEvent(event);
-
- }
- }
- log.debug("Message published" + event);
- event = CommonStartup.fProcessingInputQueue.take();
- // log.info("EventProcessor\tRemoving element: " + this.queue.remove());
- }
- } catch (InterruptedException e) {
- log.error("EventProcessor InterruptedException" + e.getMessage());
- }
-
- }
-
-
- @SuppressWarnings({"unchecked", "rawtypes"})
- public void overrideEvent() {
- //Set collector timestamp in event payload before publish
- final Date currentTime = new Date();
- final SimpleDateFormat sdf = new SimpleDateFormat("EEE, MM dd yyyy hh:mm:ss z");
- sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
-
- /*JSONArray additionalParametersarray = new JSONArray().put(new JSONObject().put("collectorTimeStamp", sdf.format(currentTime)));
- JSONObject additionalParameter = new JSONObject().put("additionalParameters",additionalParametersarray );
- JSONObject commonEventHeaderkey = event.getJSONObject("event").getJSONObject("commonEventHeader");
- commonEventHeaderkey.put("internalHeaderFields", additionalParameter);*/
-
-
-/* "event": {
- "commonEventHeader": {
- "internalHeaderFields": {
- "collectorTimeStamp": "Fri, 04 21 2017 04:11:52 GMT"
- },
-*/
-
- //JSONArray additionalParametersarray = new JSONArray().put(new JSONObject().put("collectorTimeStamp", sdf.format(currentTime)));
- JSONObject collectorTimeStamp = new JSONObject()
- .put("collectorTimeStamp", sdf.format(currentTime));
- JSONObject commonEventHeaderkey = event.getJSONObject(EVENT_LITERAL)
- .getJSONObject(COMMON_EVENT_HEADER);
- commonEventHeaderkey.put("internalHeaderFields", collectorTimeStamp);
- event.getJSONObject(EVENT_LITERAL).put(COMMON_EVENT_HEADER, commonEventHeaderkey);
-
- if (CommonStartup.eventTransformFlag == 1) {
- // read the mapping json file
- final JsonParser parser = new JsonParser();
- try {
- final JsonArray jo = (JsonArray) parser
- .parse(new FileReader("./etc/eventTransform.json"));
- log.info("parse eventTransform.json");
- // now convert to org.json
- final String jsonText = jo.toString();
- final JSONArray topLevel = new JSONArray(jsonText);
- //log.info("topLevel == " + topLevel);
-
- Class[] paramJSONObject = new Class[1];
- paramJSONObject[0] = JSONObject.class;
- //load VESProcessors class at runtime
- Class cls = Class.forName("org.onap.dcae.commonFunction.ConfigProcessors");
- Constructor constr = cls.getConstructor(paramJSONObject);
- Object obj = constr.newInstance(event);
-
- for (int j = 0; j < topLevel.length(); j++) {
- JSONObject filterObj = topLevel.getJSONObject(j).getJSONObject("filter");
- Method method = cls.getDeclaredMethod("isFilterMet", paramJSONObject);
- boolean filterMet = (boolean) method.invoke(obj, filterObj);
- if (filterMet) {
- final JSONArray processors = topLevel.getJSONObject(j)
- .getJSONArray("processors");
-
- //call the processor method
- for (int i = 0; i < processors.length(); i++) {
- final JSONObject processorList = processors.getJSONObject(i);
- final String functionName = processorList.getString("functionName");
- final JSONObject args = processorList.getJSONObject("args");
- //final JSONObject filter = processorList.getJSONObject("filter");
-
- log.info(String.format("functionName==%s | args==%s", functionName,
- args));
- //reflect method call
- method = cls.getDeclaredMethod(functionName, paramJSONObject);
- method.invoke(obj, args);
- }
- }
- }
-
- } catch (Exception e) {
-
- log.error("EventProcessor Exception" + e.getMessage() + e);
- log.error("EventProcessor Exception" + e.getCause());
- }
- }
- log.debug("Modified event:" + event);
-
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dcae.commonFunction;
+
+import com.att.nsa.clock.SaClock;
+import com.att.nsa.logging.LoggingContext;
+import com.att.nsa.logging.log4j.EcompFields;
+import com.google.common.reflect.TypeToken;
+import com.google.gson.Gson;
+import org.json.JSONObject;
+import org.onap.dcae.commonFunction.event.publishing.EventPublisher;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.FileReader;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+class EventProcessor implements Runnable {
+
+ private static final Logger log = LoggerFactory.getLogger(EventProcessor.class);
+ private static final String EVENT_LITERAL = "event";
+ private static final String COMMON_EVENT_HEADER = "commonEventHeader";
+ static final Type EVENT_LIST_TYPE = new TypeToken<List<Event>>() {}.getType();
+ private final SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, MM dd yyyy hh:mm:ss z");
+
+ static Map<String, String[]> streamidHash = new HashMap<>();
+ public JSONObject event;
+ private EventPublisher eventPublisher;
+
+ public EventProcessor(EventPublisher eventPublisher) {
+ this.eventPublisher = eventPublisher;
+ streamidHash = CommonStartup.streamID.toJavaMap();
+ }
+
+ @Override
+ public void run() {
+ try {
+ while (true) {
+ event = CommonStartup.fProcessingInputQueue.take();
+ // As long as the producer is running we remove elements from
+ // the queue.
+ log.info("QueueSize:" + CommonStartup.fProcessingInputQueue.size() + "\tEventProcessor\tRemoving element: " + event);
+
+ String uuid = event.get("VESuniqueId").toString();
+ LoggingContext localLC = VESLogger.getLoggingContextForThread(uuid);
+ localLC.put(EcompFields.kBeginTimestampMs, SaClock.now());
+
+ String domain = event.getJSONObject(EVENT_LITERAL).getJSONObject(COMMON_EVENT_HEADER).getString("domain");
+ log.debug("event.VESuniqueId" + event.get("VESuniqueId") + "event.commonEventHeader.domain:" + domain);
+ String[] streamIdList = streamidHash.get(domain);
+ log.debug("streamIdList:" + Arrays.toString(streamIdList));
+
+ if (streamIdList.length == 0) {
+ log.error("No StreamID defined for publish - Message dropped" + event);
+ } else {
+ sendEventsToStreams(streamIdList);
+ }
+ log.debug("Message published" + event);
+ }
+ } catch (InterruptedException e) {
+ log.error("EventProcessor InterruptedException" + e.getMessage());
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ public void overrideEvent() {
+ // Set collector timestamp in event payload before publish
+ addCurrentTimeToEvent(event);
+
+ if (CommonStartup.eventTransformFlag) {
+ // read the mapping json file
+ try (FileReader fr = new FileReader("./etc/eventTransform.json")) {
+ log.info("parse eventTransform.json");
+ List<Event> events = new Gson().fromJson(fr, EVENT_LIST_TYPE);
+ parseEventsJson(events, new ConfigProcessorAdapter(new ConfigProcessors(event)));
+ } catch (IOException e) {
+ log.error("Couldn't find file ./etc/eventTransform.json" + e.toString());
+ }
+ }
+ // Remove VESversion from event. This field is for internal use and must be removed after use.
+ if (event.has("VESversion"))
+ event.remove("VESversion");
+
+ log.debug("Modified event:" + event);
+ }
+
+ private void sendEventsToStreams(String[] streamIdList) {
+ for (String aStreamIdList : streamIdList) {
+ log.info("Invoking publisher for streamId:" + aStreamIdList);
+ this.overrideEvent();
+ eventPublisher.sendEvent(event, aStreamIdList);
+ }
+ }
+
+ private void addCurrentTimeToEvent(JSONObject event) {
+ final Date currentTime = new Date();
+ JSONObject collectorTimeStamp = new JSONObject().put("collectorTimeStamp", dateFormat.format(currentTime));
+ JSONObject commonEventHeaderkey = event.getJSONObject(EVENT_LITERAL).getJSONObject(COMMON_EVENT_HEADER);
+ commonEventHeaderkey.put("internalHeaderFields", collectorTimeStamp);
+ event.getJSONObject(EVENT_LITERAL).put(COMMON_EVENT_HEADER, commonEventHeaderkey);
+ }
+
+ void parseEventsJson(List<Event> eventsTransform, ConfigProcessorAdapter configProcessorAdapter) {
+ // load VESProcessors class at runtime
+ for (Event eventTransform : eventsTransform) {
+ JSONObject filterObj = new JSONObject(eventTransform.filter.toString());
+ if (configProcessorAdapter.isFilterMet(filterObj)) {
+ callProcessorsMethod(configProcessorAdapter, eventTransform.processors);
+ }
+ }
+ }
+
+ private void callProcessorsMethod(ConfigProcessorAdapter configProcessorAdapter, List<Processor> processors) {
+ // call the processor method
+ for (Processor processor : processors) {
+ final String functionName = processor.functionName;
+ final JSONObject args = new JSONObject(processor.args.toString());
+
+ log.info(String.format("functionName==%s | args==%s", functionName, args));
+ // reflect method call
+ try {
+ configProcessorAdapter.runConfigProcessorFunctionByName(functionName, args);
+ } catch (ReflectiveOperationException e) {
+ log.error("EventProcessor Exception" + e.getMessage() + e + e.getCause());
+ }
+ }
+ }
+
+ static class ConfigProcessorAdapter {
+ private final ConfigProcessors configProcessors;
+
+ ConfigProcessorAdapter(ConfigProcessors configProcessors) {
+ this.configProcessors = configProcessors;
+ }
+
+ boolean isFilterMet(JSONObject parameter) {
+ return configProcessors.isFilterMet(parameter);
+ }
+
+ void runConfigProcessorFunctionByName(String functionName, JSONObject parameter) throws ReflectiveOperationException {
+ Method method = configProcessors.getClass().getDeclaredMethod(functionName, parameter.getClass());
+ method.invoke(configProcessors, parameter);
+ }
+ }
+}
+
diff --git a/src/main/java/org/onap/dcae/commonFunction/EventPublisher.java b/src/main/java/org/onap/dcae/commonFunction/EventPublisher.java
deleted file mode 100644
index d76299df..00000000
--- a/src/main/java/org/onap/dcae/commonFunction/EventPublisher.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.dcae.commonFunction;
-
-import com.att.nsa.cambria.client.CambriaBatchingPublisher;
-import com.att.nsa.cambria.client.CambriaClientBuilders;
-import com.att.nsa.clock.SaClock;
-import com.att.nsa.logging.LoggingContext;
-import com.att.nsa.logging.log4j.EcompFields;
-import org.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.security.GeneralSecurityException;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-
-public class EventPublisher {
-
- private static final String VES_UNIQUE_ID = "VESuniqueId";
- private static EventPublisher instance;
- private static CambriaBatchingPublisher pub;
-
- private String streamid = "";
- private String ueburl = "";
- private String topic = "";
- private String authuser = "";
- private String authpwd = "";
-
- private static Logger log = LoggerFactory.getLogger(EventPublisher.class);
-
-
- private EventPublisher(String newstreamid) {
-
- streamid = newstreamid;
- try {
- ueburl = DmaapPropertyReader.getInstance(CommonStartup.cambriaConfigFile).dmaap_hash
- .get(streamid + ".cambria.url");
-
- if (ueburl == null) {
- ueburl = DmaapPropertyReader.getInstance(CommonStartup.cambriaConfigFile).dmaap_hash
- .get(streamid + ".cambria.hosts");
- }
- topic = DmaapPropertyReader.getInstance(CommonStartup.cambriaConfigFile)
- .getKeyValue(streamid + ".cambria.topic");
- authuser = DmaapPropertyReader.getInstance(CommonStartup.cambriaConfigFile)
- .getKeyValue(streamid + ".basicAuthUsername");
-
- if (authuser != null) {
- authpwd = DmaapPropertyReader
- .getInstance(CommonStartup.cambriaConfigFile).dmaap_hash
- .get(streamid + ".basicAuthPassword");
- }
- } catch (Exception e) {
- log.error("CambriaClientBuilders connection reader exception : " + e.getMessage());
-
- }
-
- }
-
-
- /**
- * Returns event publisher
- *
- * @param streamid stream id
- * @return event publisher
- */
- public static synchronized EventPublisher getInstance(String streamid) {
- if (instance == null) {
- instance = new EventPublisher(streamid);
- }
- if (!instance.streamid.equals(streamid)) {
- instance.closePublisher();
- instance = new EventPublisher(streamid);
- }
- return instance;
-
- }
-
-
- /**
- *
- * @param event json object for event
- */
- public synchronized void sendEvent(JSONObject event) {
-
- log.debug("EventPublisher.sendEvent: instance for publish is ready");
-
- if (event.has(VES_UNIQUE_ID)) {
- String uuid = event.get(VES_UNIQUE_ID).toString();
- LoggingContext localLC = VESLogger.getLoggingContextForThread(uuid);
- localLC.put(EcompFields.kBeginTimestampMs, SaClock.now());
- log.debug("Removing VESuniqueid object from event");
- event.remove(VES_UNIQUE_ID);
- }
-
- try {
-
- if (authuser != null) {
- log.debug(String.format("URL:%sTOPIC:%sAuthUser:%sAuthpwd:%s", ueburl, topic,
- authuser, authpwd));
- pub = new CambriaClientBuilders.PublisherBuilder()
- .usingHosts(ueburl)
- .onTopic(topic)
- .usingHttps()
- .authenticatedByHttp(authuser, authpwd)
- .logSendFailuresAfter(5)
- // .logTo(log)
- // .limitBatch(100, 10)
- .build();
- } else {
-
- log.debug(String.format("URL:%sTOPIC:%s", ueburl, topic));
- pub = new CambriaClientBuilders.PublisherBuilder()
- .usingHosts(ueburl)
- .onTopic(topic)
- // .logTo(log)
- .logSendFailuresAfter(5)
- // .limitBatch(100, 10)
- .build();
-
- }
-
- int pendingMsgs = pub.send("MyPartitionKey", event.toString());
- //this.wait(2000);
-
- if (pendingMsgs > 100) {
- log.info("Pending Message Count=" + pendingMsgs);
- }
-
- closePublisher();
- log.info("pub.send invoked - no error");
- CommonStartup.oplog.info(String.format("URL:%sTOPIC:%sEvent Published:%s",
- ueburl, topic, event));
-
- } catch (IOException | GeneralSecurityException | IllegalArgumentException e) {
- log.error("Unable to publish event: {} streamid: {}. Exception: {}", event, streamid, e);
- }
- finally {
- closePublisher();
- }
-
- }
-
-
- public synchronized void closePublisher() {
-
- try {
- if (pub != null) {
- final List<?> stuck = pub.close(20, TimeUnit.SECONDS);
- if (!stuck.isEmpty()) {
- log.error(stuck.size() + " messages unsent");
- }
- }
- } catch (InterruptedException | IOException e) {
- log.error("Caught Exception on Close event: {}", e);
- }
-
- }
-}
diff --git a/src/main/java/org/onap/dcae/commonFunction/Processor.java b/src/main/java/org/onap/dcae/commonFunction/Processor.java
new file mode 100644
index 00000000..ea79f1d3
--- /dev/null
+++ b/src/main/java/org/onap/dcae/commonFunction/Processor.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dcae.commonFunction;
+
+import com.google.gson.JsonObject;
+
+class Processor {
+ final String functionName;
+ final JsonObject args;
+
+ Processor(String functionName, JsonObject args) {
+ this.functionName = functionName;
+ this.args = args;
+ }
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/VESLogger.java b/src/main/java/org/onap/dcae/commonFunction/VESLogger.java
index 79108443..a967327e 100644
--- a/src/main/java/org/onap/dcae/commonFunction/VESLogger.java
+++ b/src/main/java/org/onap/dcae/commonFunction/VESLogger.java
@@ -33,126 +33,130 @@ import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.UUID;
-
public class VESLogger {
- public static final String VES_AGENT = "VES_AGENT";
- private static final String REQUEST_ID = "requestId";
- private static final String IP_ADDRESS ="127.0.0.1";
- private static final String HOST_NAME="localhost";
-
- public static Logger auditLog;
- public static Logger metricsLog;
- public static Logger errorLog;
- public static Logger debugLog;
-
- // Common LoggingContext
- private static LoggingContext commonLC;
- // Thread-specific LoggingContext
- private static LoggingContext threadLC;
- public LoggingContext lc;
-
-
- /**
- * Returns the common LoggingContext instance that is the base context
- * for all subsequent instances.
- *
- * @return the common LoggingContext
- */
- public static LoggingContext getCommonLoggingContext() {
- if (commonLC == null) {
- commonLC = new LoggingContextFactory.Builder().build();
- final UUID uuid = UUID.randomUUID();
-
- commonLC.put(REQUEST_ID, uuid.toString());
- }
- return commonLC;
- }
-
- /**
- * Get a logging context for the current thread that's based on the common logging context.
- * Populate the context with context-specific values.
- *
- * @param aUuid uuid for request id
- * @return a LoggingContext for the current thread
- */
- public static LoggingContext getLoggingContextForThread(UUID aUuid) {
- // note that this operation requires everything from the common context
- // to be (re)copied into the target context. That seems slow, but it actually
- // helps prevent the thread from overwriting supposedly common data. It also
- // should be fairly quick compared with the overhead of handling the actual
- // service call.
-
- threadLC = new LoggingContextFactory.Builder().
- withBaseContext(getCommonLoggingContext()).
- build();
- // Establish the request-specific UUID, as long as we are here...
- threadLC.put(REQUEST_ID, aUuid.toString());
- threadLC.put(EcompFields.kEndTimestamp, SaClock.now());
-
- return threadLC;
- }
-
- /**
- * Get a logging context for the current thread that's based on the common logging context.
- * Populate the context with context-specific values.
- *
- * @param aUuid uuid for request id
- * @return a LoggingContext for the current thread
- */
- public static LoggingContext getLoggingContextForThread(String aUuid) {
- // note that this operation requires everything from the common context
- // to be (re)copied into the target context. That seems slow, but it actually
- // helps prevent the thread from overwriting supposedly common data. It also
- // should be fairly quick compared with the overhead of handling the actual
- // service call.
-
- threadLC = new LoggingContextFactory.Builder().
- withBaseContext(getCommonLoggingContext()).
- build();
- // Establish the request-specific UUID, as long as we are here...
- threadLC.put(REQUEST_ID, aUuid);
- threadLC.put("statusCode", "COMPLETE");
- threadLC.put(EcompFields.kEndTimestamp, SaClock.now());
- return threadLC;
- }
-
- public static void setUpEcompLogging() {
-
- // Create ECOMP Logger instances
- auditLog = LoggerFactory.getLogger("com.att.ecomp.audit");
- metricsLog = LoggerFactory.getLogger("com.att.ecomp.metrics");
- debugLog = LoggerFactory.getLogger("com.att.ecomp.debug");
- errorLog = LoggerFactory.getLogger("com.att.ecomp.error");
-
- final LoggingContext lc = getCommonLoggingContext();
-
- String ipAddr = IP_ADDRESS;
- String hostname = HOST_NAME;
- try {
- final InetAddress ip = InetAddress.getLocalHost();
- hostname = ip.getCanonicalHostName();
- ipAddr = ip.getHostAddress();
- } catch (UnknownHostException x) {
- Log.debug(x.getMessage());
- }
-
- lc.put("serverName", hostname);
- lc.put("serviceName", "VESCollecor");
- lc.put("statusCode", "RUNNING");
- lc.put("targetEntity", "NULL");
- lc.put("targetServiceName", "NULL");
- lc.put("server", hostname);
- lc.put("serverIpAddress", ipAddr);
-
- // instance UUID is meaningless here, so we just create a new one each time the
- // server starts. One could argue each new instantiation of the service should
- // have a new instance ID.
- lc.put("instanceUuid", "");
- lc.put("severity", "");
- lc.put(EcompFields.kEndTimestamp, SaClock.now());
- lc.put("EndTimestamp", SaClock.now());
- lc.put("partnerName", "NA");
- }
+ public static final String VES_AGENT = "VES_AGENT";
+ public static final String REQUEST_ID = "requestId";
+ private static final String IP_ADDRESS = "127.0.0.1";
+ private static final String HOST_NAME = "localhost";
+
+ public static Logger auditLog;
+ public static Logger metricsLog;
+ public static Logger errorLog;
+ public static Logger debugLog;
+
+ // Common LoggingContext
+ private static LoggingContext commonLC;
+ // Thread-specific LoggingContext
+ private static LoggingContext threadLC;
+ public LoggingContext lc;
+
+ /**
+ * Returns the common LoggingContext instance that is the base context for
+ * all subsequent instances.
+ *
+ * @return the common LoggingContext
+ */
+ public static LoggingContext getCommonLoggingContext() {
+ if (commonLC == null) {
+ commonLC = new LoggingContextFactory.Builder().build();
+ final UUID uuid = UUID.randomUUID();
+
+ commonLC.put(REQUEST_ID, uuid.toString());
+ }
+ return commonLC;
+ }
+
+ /**
+ * Get a logging context for the current thread that's based on the common
+ * logging context. Populate the context with context-specific values.
+ *
+ * @param aUuid
+ * uuid for request id
+ * @return a LoggingContext for the current thread
+ */
+ public static LoggingContext getLoggingContextForThread(UUID aUuid) {
+ // note that this operation requires everything from the common context
+ // to be (re)copied into the target context. That seems slow, but it
+ // actually
+ // helps prevent the thread from overwriting supposedly common data. It
+ // also
+ // should be fairly quick compared with the overhead of handling the
+ // actual
+ // service call.
+
+ threadLC = new LoggingContextFactory.Builder().withBaseContext(getCommonLoggingContext()).build();
+ // Establish the request-specific UUID, as long as we are here...
+ threadLC.put(REQUEST_ID, aUuid.toString());
+ threadLC.put(EcompFields.kEndTimestamp, SaClock.now());
+
+ return threadLC;
+ }
+
+ /**
+ * Get a logging context for the current thread that's based on the common
+ * logging context. Populate the context with context-specific values.
+ *
+ * @param aUuid
+ * uuid for request id
+ * @return a LoggingContext for the current thread
+ */
+ public static LoggingContext getLoggingContextForThread(String aUuid) {
+ // note that this operation requires everything from the common context
+ // to be (re)copied into the target context. That seems slow, but it
+ // actually
+ // helps prevent the thread from overwriting supposedly common data. It
+ // also
+ // should be fairly quick compared with the overhead of handling the
+ // actual
+ // service call.
+
+ threadLC = new LoggingContextFactory.Builder().withBaseContext(getCommonLoggingContext()).build();
+ // Establish the request-specific UUID, as long as we are here...
+ threadLC.put(REQUEST_ID, aUuid);
+ threadLC.put("statusCode", "COMPLETE");
+ threadLC.put(EcompFields.kEndTimestamp, SaClock.now());
+ return threadLC;
+ }
+
+ public static void setUpEcompLogging() {
+
+ // Create ECOMP Logger instances
+ auditLog = LoggerFactory.getLogger("com.att.ecomp.audit");
+ metricsLog = LoggerFactory.getLogger("com.att.ecomp.metrics");
+ debugLog = LoggerFactory.getLogger("com.att.ecomp.debug");
+ errorLog = LoggerFactory.getLogger("com.att.ecomp.error");
+
+ final LoggingContext lc = getCommonLoggingContext();
+
+ String ipAddr = IP_ADDRESS;
+ String hostname = HOST_NAME;
+ try {
+ final InetAddress ip = InetAddress.getLocalHost();
+ hostname = ip.getCanonicalHostName();
+ ipAddr = ip.getHostAddress();
+ } catch (UnknownHostException x) {
+ Log.debug(x.getMessage());
+ }
+
+ lc.put("serverName", hostname);
+ lc.put("serviceName", "VESCollecor");
+ lc.put("statusCode", "RUNNING");
+ lc.put("targetEntity", "NULL");
+ lc.put("targetServiceName", "NULL");
+ lc.put("server", hostname);
+ lc.put("serverIpAddress", ipAddr);
+
+ // instance UUID is meaningless here, so we just create a new one each
+ // time the
+ // server starts. One could argue each new instantiation of the service
+ // should
+ // have a new instance ID.
+ lc.put("instanceUuid", "");
+ lc.put("severity", "");
+ lc.put(EcompFields.kEndTimestamp, SaClock.now());
+ lc.put("EndTimestamp", SaClock.now());
+ lc.put("partnerName", "NA");
+ }
}
diff --git a/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPConfigurationParser.java b/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPConfigurationParser.java
new file mode 100644
index 00000000..5865b12c
--- /dev/null
+++ b/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPConfigurationParser.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction.event.publishing;
+
+import static io.vavr.API.List;
+import static io.vavr.API.Try;
+import static io.vavr.API.Tuple;
+import static io.vavr.API.unchecked;
+import static org.onap.dcae.commonFunction.event.publishing.VavrUtils.enhanceError;
+import static org.onap.dcae.commonFunction.event.publishing.VavrUtils.f;
+
+import io.vavr.collection.List;
+import io.vavr.collection.Map;
+import io.vavr.control.Option;
+import io.vavr.control.Try;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import org.onap.dcae.commonFunction.AnyNode;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+@SuppressWarnings("mapFailure takes a generic varargs, unchecked because of Javas type system limitation, actually safe to do")
+public final class DMaaPConfigurationParser {
+
+ public static Try<Map<String, PublisherConfig>> parseToDomainMapping(Path configLocation) {
+ return readFromFile(configLocation)
+ .flatMap(DMaaPConfigurationParser::toJSON)
+ .flatMap(DMaaPConfigurationParser::toConfigMap);
+ }
+
+ private static Try<String> readFromFile(Path configLocation) {
+ return Try(() -> new String(Files.readAllBytes(configLocation)))
+ .mapFailure(enhanceError(f("Could not read DMaaP configuration from location: '%s'", configLocation)));
+ }
+
+ private static Try<AnyNode> toJSON(String config) {
+ return Try(() -> AnyNode.fromString(config))
+ .mapFailure(enhanceError(f("DMaaP configuration '%s' is not a valid JSON document", config)));
+ }
+
+ private static Try<Map<String, PublisherConfig>> toConfigMap(AnyNode config) {
+ return Try(() -> usesLegacyFormat(config) ? parseLegacyFormat(config) : parseNewFormat(config))
+ .mapFailure(enhanceError(f("Parsing DMaaP configuration: '%s' failed, probably it is in unexpected format", config)));
+ }
+
+ private static boolean usesLegacyFormat(AnyNode dMaaPConfig) {
+ return dMaaPConfig.has("channels");
+ }
+
+ private static Map<String, PublisherConfig> parseLegacyFormat(AnyNode root) {
+ return root.get("channels").toList().toMap(
+ channel -> channel.get("name").toString(),
+ channel -> {
+ String destinationsStr = channel.getAsOption("cambria.url")
+ .getOrElse(channel.getAsOption("cambria.hosts").get())
+ .toString();
+ String topic = channel.get("cambria.topic").toString();
+ Option<String> maybeUser = channel.getAsOption("basicAuthUsername").map(AnyNode::toString);
+ Option<String> maybePassword = channel.getAsOption("basicAuthPassword").map(AnyNode::toString);
+ List<String> destinations = List(destinationsStr.split(","));
+ return buildBasedOnAuth(maybeUser, maybePassword, topic, destinations);
+ });
+ }
+
+ private static Map<String, PublisherConfig> parseNewFormat(AnyNode root) {
+ return root.keys().toMap(
+ channelName -> channelName,
+ channelName -> {
+ AnyNode channelConfig = root.get(channelName);
+ Option<String> maybeUser = channelConfig.getAsOption("aaf_username").map(AnyNode::toString);
+ Option<String> maybePassword = channelConfig.getAsOption("aaf_password").map(AnyNode::toString);
+ URL topicURL = unchecked(
+ () -> new URL(channelConfig.get("dmaap_info").get("topic_url").toString())).apply();
+ String[] pathSegments = topicURL.getPath().substring(1).split("/");
+ String topic = pathSegments[1];
+ String destination = "events".equals(pathSegments[0]) ? topicURL.getAuthority() : topicURL.getHost();
+ List<String> destinations = List(destination);
+ return buildBasedOnAuth(maybeUser, maybePassword, topic, destinations);
+ });
+ }
+
+ private static PublisherConfig buildBasedOnAuth(Option<String> maybeUser, Option<String> maybePassword,
+ String topic, List<String> destinations) {
+ return maybeUser.flatMap(user -> maybePassword.map(password -> Tuple(user, password)))
+ .map(credentials -> new PublisherConfig(destinations, topic, credentials._1, credentials._2))
+ .getOrElse(new PublisherConfig(destinations, topic));
+ }
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPEventPublisher.java b/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPEventPublisher.java
new file mode 100644
index 00000000..fd9b3ae1
--- /dev/null
+++ b/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPEventPublisher.java
@@ -0,0 +1,99 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dcae.commonFunction.event.publishing;
+
+import static org.onap.dcae.commonFunction.event.publishing.VavrUtils.f;
+
+import com.att.nsa.cambria.client.CambriaBatchingPublisher;
+import com.att.nsa.clock.SaClock;
+import com.att.nsa.logging.LoggingContext;
+import com.att.nsa.logging.log4j.EcompFields;
+import io.vavr.collection.Map;
+import io.vavr.control.Try;
+import java.io.IOException;
+import org.json.JSONObject;
+import org.onap.dcae.commonFunction.VESLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+class DMaaPEventPublisher implements EventPublisher {
+ private static final int PENDING_MESSAGE_LOG_THRESHOLD = 100;
+ private static final String VES_UNIQUE_ID = "VESuniqueId";
+ private static final Logger log = LoggerFactory.getLogger(DMaaPEventPublisher.class);
+ private final DMaaPPublishersCache publishersCache;
+ private final Logger outputLogger;
+
+ DMaaPEventPublisher(DMaaPPublishersCache DMaaPPublishersCache,
+ Logger outputLogger) {
+ this.publishersCache = DMaaPPublishersCache;
+ this.outputLogger = outputLogger;
+ }
+
+ @Override
+ public void sendEvent(JSONObject event, String domain) {
+ clearVesUniqueIdFromEvent(event);
+ publishersCache.getPublisher(domain)
+ .onEmpty(() ->
+ log.warn(f("Could not find event publisher for domain: '%s', dropping message: '%s'", domain, event)))
+ .forEach(publisher -> sendEvent(event, domain, publisher));
+ }
+
+ @Override
+ public void reconfigure(Map<String, PublisherConfig> dMaaPConfig) {
+ publishersCache.reconfigure(dMaaPConfig);
+ }
+
+ private void sendEvent(JSONObject event, String domain, CambriaBatchingPublisher publisher) {
+ Try.run(() -> uncheckedSendEvent(event, domain, publisher))
+ .onFailure(exc -> closePublisher(event, domain, exc));
+ }
+
+ private void uncheckedSendEvent(JSONObject event, String domain, CambriaBatchingPublisher publisher)
+ throws IOException {
+ int pendingMsgs = publisher.send("MyPartitionKey", event.toString());
+ if (pendingMsgs > PENDING_MESSAGE_LOG_THRESHOLD) {
+ log.info("Pending messages count: " + pendingMsgs);
+ }
+ String infoMsg = f("Event: '%s' scheduled to be send asynchronously on domain: '%s'", event, domain);
+ log.info(infoMsg);
+ outputLogger.info(infoMsg);
+ }
+
+ private void closePublisher(JSONObject event, String domain, Throwable e) {
+ log.error(f("Unable to schedule event: '%s' on domain: '%s'. Closing publisher and dropping message.",
+ event, domain), e);
+ publishersCache.closePublisherFor(domain);
+ }
+
+ private void clearVesUniqueIdFromEvent(JSONObject event) {
+ if (event.has(VES_UNIQUE_ID)) {
+ String uuid = event.get(VES_UNIQUE_ID).toString();
+ LoggingContext localLC = VESLogger.getLoggingContextForThread(uuid);
+ localLC.put(EcompFields.kBeginTimestampMs, SaClock.now());
+ log.debug("Removing VESuniqueid object from event");
+ event.remove(VES_UNIQUE_ID);
+ }
+ }
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersBuilder.java b/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersBuilder.java
new file mode 100644
index 00000000..a7865a45
--- /dev/null
+++ b/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersBuilder.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction.event.publishing;
+
+import static io.vavr.API.Try;
+import static org.onap.dcae.commonFunction.event.publishing.VavrUtils.enhanceError;
+import static org.onap.dcae.commonFunction.event.publishing.VavrUtils.f;
+
+import com.att.nsa.cambria.client.CambriaBatchingPublisher;
+import com.att.nsa.cambria.client.CambriaClientBuilders;
+import com.att.nsa.cambria.client.CambriaClientBuilders.PublisherBuilder;
+import io.vavr.control.Try;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+final class DMaaPPublishersBuilder {
+
+ @SuppressWarnings("mapFailure takes a generic varargs, unchecked because of Javas type system limitation, actually safe to do")
+ static Try<CambriaBatchingPublisher> buildPublisher(PublisherConfig config) {
+ return Try(() -> builder(config).build())
+ .mapFailure(enhanceError(f("DMaaP client builder throws exception for this configuration: '%s'", config)));
+ }
+
+ private static PublisherBuilder builder(PublisherConfig config) {
+ if (config.isSecured()) {
+ return authenticatedBuilder(config);
+ } else {
+ return unAuthenticatedBuilder(config);
+ }
+ }
+
+ private static PublisherBuilder authenticatedBuilder(PublisherConfig config) {
+ return unAuthenticatedBuilder(config)
+ .usingHttps()
+ .authenticatedByHttp(config.userName().get(), config.password().get());
+ }
+
+ private static PublisherBuilder unAuthenticatedBuilder(PublisherConfig config) {
+ return new CambriaClientBuilders.PublisherBuilder()
+ .usingHosts(config.destinations().mkString(","))
+ .onTopic(config.topic())
+ .logSendFailuresAfter(5);
+ }
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersCache.java b/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersCache.java
new file mode 100644
index 00000000..102d2774
--- /dev/null
+++ b/src/main/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersCache.java
@@ -0,0 +1,124 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction.event.publishing;
+
+import static io.vavr.API.Option;
+import static org.onap.dcae.commonFunction.event.publishing.VavrUtils.f;
+
+import com.att.nsa.cambria.client.CambriaBatchingPublisher;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.common.cache.RemovalListener;
+import com.google.common.cache.RemovalNotification;
+import io.vavr.collection.Map;
+import io.vavr.control.Option;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+import javax.annotation.Nonnull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+class DMaaPPublishersCache {
+
+ private static final Logger log = LoggerFactory.getLogger(DMaaPPublishersCache.class);
+ private final LoadingCache<String, CambriaBatchingPublisher> publishersCache;
+ private AtomicReference<Map<String, PublisherConfig>> dMaaPConfiguration;
+
+ DMaaPPublishersCache(Map<String, PublisherConfig> dMaaPConfiguration) {
+ this.dMaaPConfiguration = new AtomicReference<>(dMaaPConfiguration);
+ this.publishersCache = CacheBuilder.newBuilder()
+ .removalListener(new OnPublisherRemovalListener())
+ .build(new CambriaPublishersCacheLoader());
+ }
+
+ DMaaPPublishersCache(CambriaPublishersCacheLoader dMaaPPublishersCacheLoader,
+ OnPublisherRemovalListener onPublisherRemovalListener,
+ Map<String, PublisherConfig> dMaaPConfiguration) {
+ this.dMaaPConfiguration = new AtomicReference<>(dMaaPConfiguration);
+ this.publishersCache = CacheBuilder.newBuilder()
+ .removalListener(onPublisherRemovalListener)
+ .build(dMaaPPublishersCacheLoader);
+ }
+
+ Option<CambriaBatchingPublisher> getPublisher(String streamID) {
+ try {
+ return Option(publishersCache.getUnchecked(streamID));
+ } catch (Exception e) {
+ log.warn("Could not create / load Cambria Publisher for streamID", e);
+ return Option.none();
+ }
+ }
+
+ void closePublisherFor(String streamId) {
+ publishersCache.invalidate(streamId);
+ }
+
+ synchronized void reconfigure(Map<String, PublisherConfig> newConfig) {
+ Map<String, PublisherConfig> currentConfig = dMaaPConfiguration.get();
+ Map<String, PublisherConfig> removedConfigurations = currentConfig
+ .filterKeys(domain -> !newConfig.containsKey(domain));
+ Map<String, PublisherConfig> changedConfigurations = newConfig
+ .filterKeys(e -> currentConfig.containsKey(e) && !currentConfig.get(e).equals(newConfig.get(e)));
+ dMaaPConfiguration.set(newConfig);
+ removedConfigurations.merge(changedConfigurations).forEach(e -> publishersCache.invalidate(e._1));
+ }
+
+ static class OnPublisherRemovalListener implements RemovalListener<String, CambriaBatchingPublisher> {
+
+ @Override
+ public void onRemoval(@Nonnull RemovalNotification<String, CambriaBatchingPublisher> notification) {
+ CambriaBatchingPublisher publisher = notification.getValue();
+ if (publisher != null) { // The value might get Garbage Collected at this moment, regardless of @Nonnull
+ try {
+ int timeout = 20;
+ TimeUnit unit = TimeUnit.SECONDS;
+ java.util.List<?> stuck = publisher.close(timeout, unit);
+ if (!stuck.isEmpty()) {
+ log.error(f("Publisher got stuck and did not manage to close in '%s' '%s', "
+ + "%s messages were dropped", stuck.size(), timeout, unit));
+ }
+ } catch (InterruptedException | IOException e) {
+ log.error("Could not close Cambria publisher, some messages might have been dropped", e);
+ }
+ }
+ }
+ }
+
+ class CambriaPublishersCacheLoader extends CacheLoader<String, CambriaBatchingPublisher> {
+
+ @Override
+ public CambriaBatchingPublisher load(@Nonnull String domain) {
+ return dMaaPConfiguration.get()
+ .get(domain)
+ .toTry(() -> new RuntimeException(
+ f("DMaaP configuration contains no configuration for domain: '%s'", domain)))
+ .flatMap(DMaaPPublishersBuilder::buildPublisher)
+ .get();
+ }
+ }
+
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/event/publishing/EventPublisher.java b/src/main/java/org/onap/dcae/commonFunction/event/publishing/EventPublisher.java
new file mode 100644
index 00000000..9cd718f8
--- /dev/null
+++ b/src/main/java/org/onap/dcae/commonFunction/event/publishing/EventPublisher.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction.event.publishing;
+
+import io.vavr.collection.Map;
+import org.json.JSONObject;
+import org.slf4j.Logger;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+public interface EventPublisher {
+
+ static EventPublisher createPublisher(Logger outputLogger, Map<String, PublisherConfig> dMaaPConfig) {
+ return new DMaaPEventPublisher(new DMaaPPublishersCache(dMaaPConfig), outputLogger);
+ }
+
+ void sendEvent(JSONObject event, String domain);
+
+ void reconfigure(Map<String, PublisherConfig> dMaaPConfig);
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/event/publishing/PublisherConfig.java b/src/main/java/org/onap/dcae/commonFunction/event/publishing/PublisherConfig.java
new file mode 100644
index 00000000..4a056778
--- /dev/null
+++ b/src/main/java/org/onap/dcae/commonFunction/event/publishing/PublisherConfig.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction.event.publishing;
+
+import io.vavr.collection.List;
+import io.vavr.control.Option;
+import java.util.Objects;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+public final class PublisherConfig {
+
+ private final List<String> destinations;
+ private final String topic;
+ private String userName;
+ private String password;
+
+ PublisherConfig(List<String> destinations, String topic) {
+ this.destinations = destinations;
+ this.topic = topic;
+ }
+
+ PublisherConfig(List<String> destinations, String topic, String userName, String password) {
+ this.destinations = destinations;
+ this.topic = topic;
+ this.userName = userName;
+ this.password = password;
+ }
+
+ List<String> destinations() {
+ return destinations;
+ }
+
+ String topic() {
+ return topic;
+ }
+
+ Option<String> userName() {
+ return Option.of(userName);
+ }
+
+ Option<String> password() {
+ return Option.of(password);
+ }
+
+ boolean isSecured() {
+ return userName().isDefined() && password().isDefined();
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ PublisherConfig that = (PublisherConfig) o;
+ return Objects.equals(destinations, that.destinations) &&
+ Objects.equals(topic, that.topic) &&
+ Objects.equals(userName, that.userName) &&
+ Objects.equals(password, that.password);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(destinations, topic, userName, password);
+ }
+
+ @Override
+ public String toString() {
+ return "PublisherConfig{" +
+ "destinations=" + destinations +
+ ", topic='" + topic + '\'' +
+ ", userName='" + userName + '\'' +
+ ", password='" + password + '\'' +
+ '}';
+ }
+}
diff --git a/src/main/java/org/onap/dcae/commonFunction/event/publishing/VavrUtils.java b/src/main/java/org/onap/dcae/commonFunction/event/publishing/VavrUtils.java
new file mode 100644
index 00000000..9bf3ef8c
--- /dev/null
+++ b/src/main/java/org/onap/dcae/commonFunction/event/publishing/VavrUtils.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction.event.publishing;
+
+import static io.vavr.API.$;
+
+import io.vavr.API;
+import io.vavr.API.Match.Case;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+final class VavrUtils {
+
+ private VavrUtils() {
+ // utils aggregator
+ }
+
+ /**
+ * Shortcut for 'string interpolation'
+ */
+ static String f(String msg, Object... args) {
+ return String.format(msg, args);
+ }
+
+ /**
+ * Wrap failure with a more descriptive message of what has failed and chain original cause. Used to provide a
+ * context for errors instead of raw exception.
+ */
+ static Case<Throwable, Throwable> enhanceError(String msg) {
+ return API.Case($(), e -> new RuntimeException(msg, e));
+ }
+
+}
diff --git a/src/main/java/org/onap/dcae/controller/FetchDynamicConfig.java b/src/main/java/org/onap/dcae/controller/FetchDynamicConfig.java
index 5ef44f5c..99e269c1 100644
--- a/src/main/java/org/onap/dcae/controller/FetchDynamicConfig.java
+++ b/src/main/java/org/onap/dcae/controller/FetchDynamicConfig.java
@@ -1,118 +1,190 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.dcae.controller;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.Map;
-
-public class FetchDynamicConfig {
-
- private static final Logger log = LoggerFactory.getLogger(FetchDynamicConfig.class);
-
- static String configFile = "/opt/app/KV-Configuration.json";
- static String url;
- static String retString;
-
- public FetchDynamicConfig() {
- }
-
- public static void main(String[] args) {
- Map<String, String> env = System.getenv();
- for (Map.Entry<String, String> entry : env.entrySet()) {
- log.info("%s=%s%n", entry.getKey(), entry.getValue());
- }
-
- if (env.containsKey("CONSUL_HOST") && env.containsKey("CONFIG_BINDING_SERVICE")
- && env.containsKey("HOSTNAME")) {
- log.info(">>>Dynamic configuration to be fetched from ConfigBindingService");
- url = env.get("CONSUL_HOST") + ":8500/v1/catalog/service/" + env
- .get("CONFIG_BINDING_SERVICE");
-
- retString = executecurl(url);
- // consul return as array
- JSONTokener temp = new JSONTokener(retString);
- JSONObject cbsjobj = (JSONObject) new JSONArray(temp).get(0);
-
- String urlPart1 = null;
- if (cbsjobj.has("ServiceAddress") && cbsjobj.has("ServicePort")) {
- urlPart1 =
- cbsjobj.getString("ServiceAddress") + ":" + cbsjobj.getInt("ServicePort");
- }
-
- log.info("CONFIG_BINDING_SERVICE DNS RESOLVED:" + urlPart1);
- url = urlPart1 + "/service_component/" + env.get("HOSTNAME");
- retString = executecurl(url);
-
- JSONObject jsonObject = new JSONObject(new JSONTokener(retString));
- try (FileWriter file = new FileWriter(configFile)) {
- file.write(jsonObject.toString());
-
- log.info(
- "Successfully Copied JSON Object to file /opt/app/KV-Configuration.json");
- } catch (IOException e) {
- log.error(
- "Error in writing configuration into file /opt/app/KV-Configuration.json "
- + jsonObject, e);
- }
- } else {
- log.info(">>>Static configuration to be used");
- }
-
- }
-
- public static String executecurl(String url) {
-
- String[] command = {"curl", "-v", url};
- ProcessBuilder process = new ProcessBuilder(command);
- Process p;
- String result = null;
- try {
- p = process.start();
- InputStreamReader ipr = new InputStreamReader(p.getInputStream());
- BufferedReader reader = new BufferedReader(ipr);
- StringBuilder builder = new StringBuilder();
- String line;
-
- while ((line = reader.readLine()) != null) {
- builder.append(line);
- }
- result = builder.toString();
- log.info(result);
-
- reader.close();
- ipr.close();
- } catch (IOException e) {
- log.error("error", e);
- }
- return result;
-
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dcae.controller;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.Map;
+
+public class FetchDynamicConfig {
+
+ private static final Logger log = LoggerFactory.getLogger(FetchDynamicConfig.class);
+
+ public static String configFile = "/opt/app/KV-Configuration.json";
+ private static String url;
+ public static String retString;
+ public static String retCBSString;
+ private static Map<String, String> env;
+
+ public FetchDynamicConfig() {
+ }
+
+ public static void main(String[] args) {
+ Boolean areEqual;
+ // Call consul api and identify the CBS Service address and port
+ getconsul();
+ // Construct and invoke CBS API to get application Configuration
+ getCBS();
+ // Verify if data has changed
+ areEqual = verifyConfigChange();
+ // If new config then write data returned into configFile for
+ // LoadDynamicConfig process
+ if (! areEqual) {
+ FetchDynamicConfig fc = new FetchDynamicConfig();
+ fc.writefile(retCBSString);
+ } else {
+ log.info("New config pull results identical - " + configFile + " NOT refreshed");
+ }
+ }
+
+ private static void getconsul() {
+
+ env = System.getenv();
+ for (Map.Entry<String, String> entry : env.entrySet()) {
+ log.info(entry.getKey() + ":" + entry.getValue());
+ }
+
+ if (env.containsKey("CONSUL_HOST") && env.containsKey("CONFIG_BINDING_SERVICE")) {
+ // && env.containsKey("HOSTNAME")) {
+ log.info(">>>Dynamic configuration to be fetched from ConfigBindingService");
+ url = env.get("CONSUL_HOST") + ":8500/v1/catalog/service/" + env.get("CONFIG_BINDING_SERVICE");
+
+ retString = executecurl(url);
+
+ } else {
+ log.info(">>>Static configuration to be used");
+ }
+
+ }
+
+ public static boolean verifyConfigChange() {
+
+ boolean areEqual = false;
+ // Read current data
+ try {
+ File f = new File(configFile);
+ if (f.exists() && !f.isDirectory()) {
+
+ String jsonData = LoadDynamicConfig.readFile(configFile);
+ JSONObject jsonObject = new JSONObject(jsonData);
+
+ ObjectMapper mapper = new ObjectMapper();
+
+ JsonNode tree1 = mapper.readTree(jsonObject.toString());
+ JsonNode tree2 = mapper.readTree(retCBSString);
+ areEqual = tree1.equals(tree2);
+ log.info("Comparison value:" + areEqual);
+ } else {
+ log.info("First time config file read: " + configFile);
+ }
+
+ } catch (IOException e) {
+ log.error("Comparison with new fetched data failed" + e.getMessage());
+
+ }
+
+ return areEqual;
+
+ }
+
+ public static void getCBS() {
+
+ env = System.getenv();
+ // consul return as array
+ JSONTokener temp = new JSONTokener(retString);
+ JSONObject cbsjobj = (JSONObject) new JSONArray(temp).get(0);
+
+ String urlPart1 = null;
+ if (cbsjobj.has("ServiceAddress") && cbsjobj.has("ServicePort")) {
+ urlPart1 = cbsjobj.getString("ServiceAddress") + ":" + cbsjobj.getInt("ServicePort");
+ }
+
+ log.info("CONFIG_BINDING_SERVICE DNS RESOLVED:" + urlPart1);
+
+ if (env.containsKey("HOSTNAME")) {
+ url = urlPart1 + "/service_component/" + env.get("HOSTNAME");
+ retCBSString = executecurl(url);
+ } else if (env.containsKey("SERVICE_NAME")) {
+ url = urlPart1 + "/service_component/" + env.get("SERVICE_NAME");
+ retCBSString = executecurl(url);
+ } else {
+ log.error("Service name environment variable - HOSTNAME/SERVICE_NAME not found within container ");
+ }
+
+ }
+
+ public void writefile(String retCBSString) {
+ log.info("URL to fetch configuration:" + url + " Return String:" + retCBSString);
+
+ String indentedretstring = (new JSONObject(retCBSString)).toString(4);
+
+ try (FileWriter file = new FileWriter(FetchDynamicConfig.configFile)) {
+ file.write(indentedretstring);
+
+ log.info("Successfully Copied JSON Object to file " + configFile);
+ } catch (IOException e) {
+ log.error("Error in writing configuration into file " + configFile + retString + e.getMessage());
+ e.printStackTrace();
+ }
+
+ }
+
+ private static String executecurl(String url) {
+
+ String[] command = { "curl", "-v", url };
+ ProcessBuilder process = new ProcessBuilder(command);
+ Process p;
+ String result = null;
+ try {
+ p = process.start();
+ InputStreamReader ipr = new InputStreamReader(p.getInputStream());
+ BufferedReader reader = new BufferedReader(ipr);
+ StringBuilder builder = new StringBuilder();
+ String line;
+
+ while ((line = reader.readLine()) != null) {
+ builder.append(line);
+ }
+ result = builder.toString();
+ log.info(result);
+
+ reader.close();
+ ipr.close();
+ } catch (IOException e) {
+ log.error("error", e);
+ e.printStackTrace();
+ }
+ return result;
+
+ }
+
+}
diff --git a/src/main/java/org/onap/dcae/controller/LoadDynamicConfig.java b/src/main/java/org/onap/dcae/controller/LoadDynamicConfig.java
index a28bca86..a8ecaba0 100644
--- a/src/main/java/org/onap/dcae/controller/LoadDynamicConfig.java
+++ b/src/main/java/org/onap/dcae/controller/LoadDynamicConfig.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* PROJECT
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,96 +30,100 @@ import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
-import java.io.InputStreamReader;
import java.util.Iterator;
import java.util.Map;
-
public class LoadDynamicConfig {
- private static final Logger log = LoggerFactory.getLogger(LoadDynamicConfig.class);
-
- public String propFile = "collector.properties";
- public String configFile = "/opt/app/KV-Configuration.json";
- static String url;
- static String retString;
-
- public LoadDynamicConfig() {
-
- }
-
- public static void main(String[] args) {
- Map<String, String> env = System.getenv();
- /*for (String envName : env.keySet()) {
- System.out.format("%s=%s%n", envName, env.get(envName));
- }*/
-
- //Check again to ensure new controller deployment related config
- if (env.containsKey("CONSUL_HOST") &&
- env.containsKey("CONFIG_BINDING_SERVICE") && env.containsKey("HOSTNAME")) {
-
- try {
-
- LoadDynamicConfig lc = new LoadDynamicConfig();
- String jsonData = readFile(lc.configFile);
- JSONObject jsonObject = new JSONObject(jsonData);
-
- PropertiesConfiguration conf;
- conf = new PropertiesConfiguration(lc.propFile);
- conf.setEncoding(null);
-
- // update properties based on consul dynamic configuration
- Iterator<?> keys = jsonObject.keys();
-
- while (keys.hasNext()) {
- String key = (String) keys.next();
- // check if any configuration is related to dmaap
- // and write into dmaapconfig.json
- if (key.startsWith("streams_publishes")) {
- //VESCollector only have publish streams
- try (FileWriter file = new FileWriter("./etc/DmaapConfig.json")) {
- file.write(jsonObject.get(key).toString());
- log.info("Successfully written JSON Object to DmaapConfig.json");
- file.close();
- } catch (IOException e) {
- log.info(
- "Error in writing dmaap configuration into DmaapConfig.json",
- e);
- }
- } else {
- conf.setProperty(key, jsonObject.get(key).toString());
- }
-
- }
- conf.save();
-
- } catch (ConfigurationException e) {
- log.error(e.getLocalizedMessage(), e);
-
- }
-
- } else {
- log.info(">>>Static configuration to be used");
- }
-
- }
-
- public static String readFile(String filename) {
- String result = "";
- try (BufferedReader br = new BufferedReader(new FileReader(filename))) {
- StringBuilder sb = new StringBuilder();
- String line = br.readLine();
- while (line != null) {
- sb.append(line);
- line = br.readLine();
- }
- result = sb.toString();
- br.close();
- } catch (Exception e) {
- log.error(e.getLocalizedMessage(), e);
- }
- return result;
- }
-
+ private static final Logger log = LoggerFactory.getLogger(LoadDynamicConfig.class);
+
+ public String propFile = "collector.properties";
+ public String configFile = "/opt/app/KV-Configuration.json";
+ public String dMaaPOutputFile = "./etc/DmaapConfig.json";
+
+ public LoadDynamicConfig() {
+
+ }
+
+ public static void main(String[] args) {
+ Map<String, String> env = System.getenv();
+
+ // Check again to ensure new controller deployment related config
+ if (env.containsKey("CONSUL_HOST") && env.containsKey("CONFIG_BINDING_SERVICE")
+ && env.containsKey("HOSTNAME")) {
+
+ try {
+
+ LoadDynamicConfig lc = new LoadDynamicConfig();
+ String jsonData = readFile(lc.configFile);
+ JSONObject jsonObject = new JSONObject(jsonData);
+ lc.writeconfig(jsonObject);
+
+
+ } catch (Exception e) {
+ log.error(e.getLocalizedMessage(), e);
+ e.printStackTrace();
+
+ }
+
+ } else {
+ log.info(">>>Static configuration to be used");
+ }
+
+ }
+
+ public void writeconfig (JSONObject jsonObject)
+ {
+
+ PropertiesConfiguration conf;
+ try {
+ conf = new PropertiesConfiguration(propFile);
+
+ conf.setEncoding(null);
+
+ // update properties based on consul dynamic configuration
+ Iterator<?> keys = jsonObject.keys();
+
+ while (keys.hasNext()) {
+ String key = (String) keys.next();
+ // check if any configuration is related to dmaap
+ // and write into dmaapconfig.json
+ if (key.startsWith("streams_publishes")) {
+ // VESCollector only have publish streams
+ try (FileWriter file = new FileWriter(dMaaPOutputFile)) {
+ String indentedretstring=(new JSONObject(jsonObject.get(key).toString())).toString(4);
+ file.write(indentedretstring);
+ log.info("Successfully written JSON Object to DmaapConfig.json");
+ } catch (IOException e) {
+ log.info("Error in writing dmaap configuration into DmaapConfig.json", e);
+ }
+ } else {
+ conf.setProperty(key, jsonObject.get(key).toString());
+ }
+
+ }
+ conf.save();
+ } catch (ConfigurationException e) {
+ log.error(e.getLocalizedMessage(), e);
+ e.printStackTrace();
+ }
+ }
+
+ public static String readFile(String filename) {
+ String result = "";
+ try (BufferedReader br = new BufferedReader(new FileReader(filename))) {
+ StringBuilder sb = new StringBuilder();
+ String line = br.readLine();
+ while (line != null) {
+ sb.append(line);
+ line = br.readLine();
+ }
+ result = sb.toString();
+ } catch (Exception e) {
+ log.error(e.getLocalizedMessage(), e);
+ e.printStackTrace();
+ }
+ return result;
+ }
}
diff --git a/src/main/java/org/onap/dcae/restapi/ApiException.java b/src/main/java/org/onap/dcae/restapi/ApiException.java
new file mode 100644
index 00000000..0f922678
--- /dev/null
+++ b/src/main/java/org/onap/dcae/restapi/ApiException.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.restapi;
+
+import com.google.common.base.CaseFormat;
+import org.json.JSONObject;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+public enum ApiException {
+
+ INVALID_JSON_INPUT(ExceptionType.SERVICE_EXCEPTION, "SVC0002", "Incorrect JSON payload", 400),
+ SCHEMA_VALIDATION_FAILED(ExceptionType.SERVICE_EXCEPTION, "SVC0002", "Bad Parameter (JSON does not conform to schema)", 400),
+ INVALID_CONTENT_TYPE(ExceptionType.SERVICE_EXCEPTION, "SVC0002", "Bad Parameter (Incorrect request Content-Type)", 400),
+ UNAUTHORIZED_USER(ExceptionType.POLICY_EXCEPTION, "POL2000", "Unauthorized user", 401),
+ NO_SERVER_RESOURCES(ExceptionType.SERVICE_EXCEPTION, "SVC1000", "No server resources (internal processing queue full)", 503);
+
+ private final ExceptionType type;
+ private final String code;
+ private final String details;
+ public final int httpStatusCode;
+
+ ApiException(ExceptionType type, String code, String details, int httpStatusCode) {
+ this.type = type;
+ this.code = code;
+ this.details = details;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public enum ExceptionType {
+ SERVICE_EXCEPTION, POLICY_EXCEPTION;
+
+ @Override
+ public String toString() {
+ return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, this.name());
+ }
+ }
+
+ public JSONObject toJSON() {
+ JSONObject exceptionTypeNode = new JSONObject();
+ exceptionTypeNode.put("messageId", code );
+ exceptionTypeNode.put("text", details);
+
+ JSONObject requestErrorNode = new JSONObject();
+ requestErrorNode.put(type.toString(), exceptionTypeNode);
+
+ JSONObject rootNode = new JSONObject();
+ rootNode.put("requestError", requestErrorNode);
+ return rootNode;
+ }
+
+}
diff --git a/src/main/java/org/onap/dcae/restapi/RestfulCollectorServlet.java b/src/main/java/org/onap/dcae/restapi/RestfulCollectorServlet.java
index a8bfc24e..e5a29e9f 100644
--- a/src/main/java/org/onap/dcae/restapi/RestfulCollectorServlet.java
+++ b/src/main/java/org/onap/dcae/restapi/RestfulCollectorServlet.java
@@ -1,161 +1,127 @@
-
-/*
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.dcae.restapi;
-
-import java.io.IOException;
-import java.net.URL;
-
-import javax.servlet.ServletException;
-
-import org.apache.tomcat.util.codec.binary.Base64;
-import org.onap.dcae.commonFunction.CommonStartup;
-import org.onap.dcae.commonFunction.VESLogger;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.att.nsa.apiServer.CommonServlet;
-import com.att.nsa.configs.ConfigDbException;
-import com.att.nsa.drumlin.service.framework.DrumlinErrorHandler;
-import com.att.nsa.drumlin.service.framework.context.DrumlinRequestContext;
-import com.att.nsa.drumlin.service.framework.routing.DrumlinRequestRouter;
-import com.att.nsa.drumlin.service.framework.routing.playish.DrumlinPlayishRoutingFileSource;
-import com.att.nsa.drumlin.service.standards.HttpStatusCodes;
-import com.att.nsa.drumlin.till.nv.rrNvReadable;
-import com.att.nsa.drumlin.till.nv.rrNvReadable.loadException;
-import com.att.nsa.drumlin.till.nv.rrNvReadable.missingReqdSetting;
-import com.att.nsa.security.NsaAuthenticator;
-
-import com.att.nsa.security.authenticators.SimpleAuthenticator;
-import com.att.nsa.security.db.simple.NsaSimpleApiKey;
-
-
-public class RestfulCollectorServlet extends CommonServlet
-{
- String authid=null;
- String authpwd=null;
- public String authlist;
-
- public RestfulCollectorServlet ( rrNvReadable settings ) throws loadException, missingReqdSetting
- {
- super ( settings, "collector", false );
- //authid = settings.getString(CommonStartup.kSetting_authid,null);
- /*if (authid != null)
- {
- String authpwdtemp = settings.getString(CommonStartup.kSetting_authpwd,null);
- authpwd = new String(Base64.decodeBase64(authpwdtemp));
- }*/
- authlist = settings.getString(CommonStartup.kSetting_authlist,null);
- }
-
-
-
-
- /**
- * This is called once at server start. Use it to init any shared objects and setup the route mapping.
- */
- @Override
- protected void servletSetup () throws rrNvReadable.missingReqdSetting, rrNvReadable.invalidSettingValue, ServletException
- {
- super.servletSetup ();
-
- try
- {
- // the base class provides a bunch of things like API authentication and ECOMP compliant
- // logging. The Restful Collector likely doesn't need API authentication, so for now,
- // we init the base class services with an in-memory (and empty!) config DB.
- commonServletSetup ( ConfigDbType.MEMORY );
-
- VESLogger.setUpEcompLogging();
-
- // setup the servlet routing and error handling
- final DrumlinRequestRouter drr = getRequestRouter ();
-
- // you can tell the request router what to do when a particular kind of exception is thrown.
- drr.setHandlerForException( IllegalArgumentException.class, new DrumlinErrorHandler()
- {
- @Override
- public void handle ( DrumlinRequestContext ctx, Throwable cause )
- {
- sendJsonReply ( ctx, HttpStatusCodes.k400_badRequest, cause.getMessage() );
- }
- });
-
- // load the routes from the config file
- final URL routes = findStream ( "routes.conf" );
- if ( routes == null ) throw new rrNvReadable.missingReqdSetting ( "No routing configuration." );
- final DrumlinPlayishRoutingFileSource drs = new DrumlinPlayishRoutingFileSource ( routes );
- drr.addRouteSource ( drs );
-
- if (CommonStartup.authflag > 0) {
- NsaAuthenticator<NsaSimpleApiKey> NsaAuth;
- NsaAuth = AuthlistHandler(authlist);
-
- this.getSecurityManager().addAuthenticator(NsaAuth);
- }
-
- log.info ( "Restful Collector Servlet is up." );
- }
- catch ( SecurityException e )
- {
- throw new ServletException ( e );
- }
- catch ( IOException e )
- {
- throw new ServletException ( e );
- }
- catch ( ConfigDbException e )
- {
- throw new ServletException ( e );
- }
- }
-
- public NsaAuthenticator<NsaSimpleApiKey> AuthlistHandler (String authlist)
- {
- NsaAuthenticator<NsaSimpleApiKey> NsaAuth = new SimpleAuthenticator ();
- if (authlist != null)
- {
- String authpair[] = authlist.split("\\|");
- for (String pair: authpair) {
- String lineid[] = pair.split(",");
- String listauthid = lineid[0];
- String listauthpwd = new String(Base64.decodeBase64(lineid[1]));
- ((SimpleAuthenticator) NsaAuth).add(listauthid,listauthpwd);
- }
-
- }
- else if (authid != null)
- {
- ((SimpleAuthenticator) NsaAuth).add(authid,authpwd);
- }
- else
- {
- //add a default test account
- ((SimpleAuthenticator) NsaAuth).add("admin","collectorpasscode");
- }
- return NsaAuth;
-
- }
-
-
- private static final long serialVersionUID = 1L;
- private static final Logger log = LoggerFactory.getLogger ( RestfulCollectorServlet.class );
-}
+
+/*
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dcae.restapi;
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.servlet.ServletException;
+
+import org.apache.tomcat.util.codec.binary.Base64;
+import org.onap.dcae.ApplicationSettings;
+import org.onap.dcae.commonFunction.CommonStartup;
+import org.onap.dcae.commonFunction.VESLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.att.nsa.apiServer.CommonServlet;
+import com.att.nsa.configs.ConfigDbException;
+import com.att.nsa.drumlin.service.framework.routing.DrumlinRequestRouter;
+import com.att.nsa.drumlin.service.framework.routing.playish.DrumlinPlayishRoutingFileSource;
+import com.att.nsa.drumlin.service.standards.HttpStatusCodes;
+import com.att.nsa.drumlin.till.nv.rrNvReadable;
+import com.att.nsa.drumlin.till.nv.rrNvReadable.loadException;
+import com.att.nsa.drumlin.till.nv.rrNvReadable.missingReqdSetting;
+import com.att.nsa.security.NsaAuthenticator;
+
+import com.att.nsa.security.authenticators.SimpleAuthenticator;
+import com.att.nsa.security.db.simple.NsaSimpleApiKey;
+
+public class RestfulCollectorServlet extends CommonServlet
+{
+
+ private static final long serialVersionUID = 1L;
+ private static final Logger log = LoggerFactory.getLogger ( RestfulCollectorServlet.class );
+
+ private static String authCredentialsList;
+
+ public RestfulCollectorServlet ( ApplicationSettings settings ) throws loadException, missingReqdSetting
+ {
+ super ( settings.torrNvReadable(), "collector", false );
+ authCredentialsList = settings.validAuthorizationCredentials();
+ }
+
+
+
+
+ /**
+ * This is called once at server start. Use it to init any shared objects and setup the route mapping.
+ */
+ @Override
+ protected void servletSetup () throws rrNvReadable.missingReqdSetting, rrNvReadable.invalidSettingValue, ServletException
+ {
+ super.servletSetup ();
+
+ try {
+ // the base class provides a bunch of things like API authentication and ECOMP compliant
+ // logging. The Restful Collector likely doesn't need API authentication, so for now,
+ // we init the base class services with an in-memory (and empty!) config DB.
+ commonServletSetup ( ConfigDbType.MEMORY );
+
+ VESLogger.setUpEcompLogging();
+
+ // setup the servlet routing and error handling
+ final DrumlinRequestRouter drr = getRequestRouter ();
+
+ // you can tell the request router what to do when a particular kind of exception is thrown.
+ drr.setHandlerForException(IllegalArgumentException.class,
+ (ctx, cause) -> sendJsonReply (ctx, HttpStatusCodes.k400_badRequest, cause.getMessage() ));
+
+ // load the routes from the config file
+ final URL routes = findStream ( "routes.conf" );
+ if ( routes == null ) throw new rrNvReadable.missingReqdSetting ( "No routing configuration." );
+ final DrumlinPlayishRoutingFileSource drs = new DrumlinPlayishRoutingFileSource ( routes );
+ drr.addRouteSource ( drs );
+
+ if (CommonStartup.authflag) {
+ NsaAuthenticator<NsaSimpleApiKey> NsaAuth;
+ NsaAuth = createAuthenticator(authCredentialsList);
+
+ this.getSecurityManager().addAuthenticator(NsaAuth);
+ }
+
+ log.info ( "Restful Collector Servlet is up." );
+ }
+ catch ( SecurityException | IOException | ConfigDbException e ) {
+ throw new ServletException ( e );
+ }
+ }
+
+ public NsaAuthenticator<NsaSimpleApiKey> createAuthenticator(String authCredentials) {
+ NsaAuthenticator<NsaSimpleApiKey> authenticator = new SimpleAuthenticator();
+ if (authCredentials != null) {
+ String authpair[] = authCredentials.split("\\|");
+ for (String pair : authpair) {
+ String lineid[] = pair.split(",");
+ String listauthid = lineid[0];
+ String listauthpwd = new String(Base64.decodeBase64(lineid[1]));
+ ((SimpleAuthenticator) authenticator).add(listauthid, listauthpwd);
+ }
+
+ } else {
+ ((SimpleAuthenticator) authenticator).add("admin", "collectorpasscode");
+ }
+ return authenticator;
+ }
+
+}
+
diff --git a/src/main/java/org/onap/dcae/restapi/endpoints/EventReceipt.java b/src/main/java/org/onap/dcae/restapi/endpoints/EventReceipt.java
index e6b7d20c..d60e2a11 100644
--- a/src/main/java/org/onap/dcae/restapi/endpoints/EventReceipt.java
+++ b/src/main/java/org/onap/dcae/restapi/endpoints/EventReceipt.java
@@ -1,278 +1,247 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.dcae.restapi.endpoints;
-
-import com.att.nsa.apiServer.endpoints.NsaBaseEndpoint;
-import com.att.nsa.clock.SaClock;
-import com.att.nsa.drumlin.service.framework.context.DrumlinRequestContext;
-import com.att.nsa.drumlin.service.standards.HttpStatusCodes;
-import com.att.nsa.drumlin.service.standards.MimeTypes;
-import com.att.nsa.logging.LoggingContext;
-import com.att.nsa.logging.log4j.EcompFields;
-import com.att.nsa.security.db.simple.NsaSimpleApiKey;
-import com.google.gson.JsonParser;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-import org.onap.dcae.commonFunction.CommonStartup;
-import org.onap.dcae.commonFunction.CommonStartup.QueueFullException;
-import org.onap.dcae.commonFunction.CustomExceptionLoader;
-import org.onap.dcae.commonFunction.VESLogger;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.UUID;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class EventReceipt extends NsaBaseEndpoint {
-
- private static final Logger log = LoggerFactory.getLogger(EventReceipt.class);
- private static final String MESSAGE = " Message:";
- static String valresult;
- static JSONObject customerror;
-
-
- public static void receiveVESEvent(DrumlinRequestContext ctx) {
- // the request body carries events. assume for now it's an array
- // of json objects that fits in memory. (See cambria's parsing for
- // handling large messages)
-
- NsaSimpleApiKey retkey = null;
-
- JSONArray jsonArray;
- JSONArray jsonArrayMod = new JSONArray();
- JSONObject event;
- JSONObject jsonObject;
- FileReader fr = null;
- InputStream istr = null;
- int arrayFlag = 0;
- String vesVersion = null;
-
- try {
- //System.out.print("Version string:" + version);
-
- // String br = new BufferedReader(new InputStreamReader(ctx.request().getBodyStream())).readLine();
- // JsonElement msg = new JsonParser().parse(new BufferedReader(new InputStreamReader(ctx.request().getBodyStream())).readLine());
- // jsonArray = new JSONArray ( new JSONTokener ( ctx.request().getBodyStream () ) );
-
- log.debug("Request recieved :" + ctx.request().getRemoteAddress());
- istr = ctx.request().getBodyStream();
- jsonObject = new JSONObject(new JSONTokener(istr));
-
- log.info("ctx getPathInContext: " + ctx.request().getPathInContext());
- Pattern p = Pattern.compile("(v\\d+)");
- Matcher m = p.matcher(ctx.request().getPathInContext());
-
- if (m.find()) {
- log.info("VES version:" + m.group());
- vesVersion = m.group();
- }
- if (ctx.request().getPathInContext().contains("eventBatch")) {
- CommonStartup.inlog.info(
- ctx.request().getRemoteAddress() + "VES Batch Input Messsage: " + jsonObject);
- log.info(
- ctx.request().getRemoteAddress() + "VES Batch Input Messsage: " + jsonObject);
- arrayFlag = 1;
- } else {
- CommonStartup.inlog
- .info(ctx.request().getRemoteAddress() + "Input Messsage: " + jsonObject);
- log.info(ctx.request().getRemoteAddress() + "Input Messsage: " + jsonObject);
-
- }
-
- UUID uuid = UUID.randomUUID();
- LoggingContext localLC = VESLogger.getLoggingContextForThread(uuid);
- localLC.put(EcompFields.kBeginTimestampMs, SaClock.now());
-
- try {
- if (CommonStartup.authflag == 1) {
- retkey = NsaBaseEndpoint.getAuthenticatedUser(ctx);
- }
- } catch (NullPointerException x) {
- log.info(
- "Invalid user request " + ctx.request().getContentType() + MESSAGE
- + jsonObject);
- CommonStartup.eplog.info("EVENT_RECEIPT_FAILURE: Unauthorized user" + x);
- respondWithCustomMsginJson(ctx, HttpStatusCodes.k401_unauthorized, "Invalid user");
- return;
- }
-
- if (retkey != null || CommonStartup.authflag == 0) {
- if (CommonStartup.schema_Validatorflag > 0) {
-
- //fr = new FileReader(CommonStartup.schemaFile);
- fr = new FileReader(schemaFileVersion(vesVersion));
- String schema = new JsonParser().parse(fr).toString();
-
- valresult = CommonStartup.schemavalidate(jsonObject.toString(), schema);
- if ("true".equals(valresult)) {
- log.info("Validation successful");
- } else if ("false".equals(valresult)) {
- log.info("Validation failed");
- respondWithCustomMsginJson(ctx, HttpStatusCodes.k400_badRequest,
- "Schema validation failed");
-
- return;
- } else {
- log.error("Validation errored" + valresult);
- respondWithCustomMsginJson(ctx, HttpStatusCodes.k400_badRequest,
- "Couldn't parse JSON object");
- return;
-
- }
-
- if (arrayFlag == 1) {
- jsonArray = jsonObject.getJSONArray("eventList");
- log.info("Validation successful for all events in batch");
- for (int i = 0; i < jsonArray.length(); i++) {
- event = new JSONObject().put("event", jsonArray.getJSONObject(i));
- event.put("VESuniqueId", uuid + "-" + i);
- event.put("VESversion", vesVersion);
- jsonArrayMod.put(event);
- }
-
- log.info("Modified jsonarray:" + jsonArrayMod);
-
- } else {
-
- jsonObject.put("VESuniqueId", uuid);
- jsonObject.put("VESversion", vesVersion);
- jsonArrayMod = new JSONArray().put(jsonObject);
- }
-
- }
- // reject anything that's not JSON
- if (!ctx.request().getContentType().equalsIgnoreCase("application/json")) {
- log.info(String.format("Rejecting request with content type %s Message:%s",
- ctx.request().getContentType(), jsonObject));
- respondWithCustomMsginJson(ctx, HttpStatusCodes.k400_badRequest,
- "Incorrect message content-type; only accepts application/json messages");
- return;
- }
-
- CommonStartup.handleEvents(jsonArrayMod);
- } else {
- log.info(
- String.format("Unauthorized request %s%s%s", ctx.request().getContentType(),
- MESSAGE, jsonObject));
- respondWithCustomMsginJson(ctx, HttpStatusCodes.k401_unauthorized,
- "Unauthorized user");
- return;
- }
- } catch (JSONException | NullPointerException | IOException x) {
- log.error(String
- .format("Couldn't parse JSON Array - HttpStatusCodes.k400_badRequest%d%s%s",
- HttpStatusCodes.k400_badRequest, MESSAGE, x.getMessage()));
- CommonStartup.eplog.info("EVENT_RECEIPT_FAILURE: Invalid user request " + x);
- respondWithCustomMsginJson(ctx, HttpStatusCodes.k400_badRequest,
- "Couldn't parse JSON object");
- return;
- } catch (QueueFullException e) {
- log.error("Collector internal queue full :" + e.getMessage(), e);
- CommonStartup.eplog.info("EVENT_RECEIPT_FAILURE: QueueFull" + e);
- respondWithCustomMsginJson(ctx, HttpStatusCodes.k503_serviceUnavailable, "Queue full");
- return;
- } finally {
- if (fr != null) {
- safeClose(fr);
- }
-
- if (istr != null) {
- safeClose(istr);
- }
- }
- log.info("MessageAccepted and k200_ok to be sent");
- ctx.response()
- .sendErrorAndBody(HttpStatusCodes.k200_ok, "Message Accepted", MimeTypes.kAppJson);
- }
-
-
- public static void respondWithCustomMsginJson(DrumlinRequestContext ctx, int sc, String msg) {
- String[] str;
- String exceptionType = "GeneralException";
-
- str = CustomExceptionLoader.LookupMap(String.valueOf(sc), msg);
- log.info("Post CustomExceptionLoader.LookupMap" + str);
-
- if (str != null) {
-
- if (str[0].matches("SVC")) {
- exceptionType = "ServiceException";
- } else if (str[1].matches("POL")) {
- exceptionType = "PolicyException";
- }
-
- JSONObject jb = new JSONObject().put("requestError",
- new JSONObject().put(exceptionType,
- new JSONObject().put("MessagID", str[0]).put("text", str[1])));
-
- log.debug("Constructed json error : " + jb);
- ctx.response().sendErrorAndBody(sc, jb.toString(), MimeTypes.kAppJson);
- } else {
- JSONObject jb = new JSONObject().put("requestError",
- new JSONObject()
- .put(exceptionType, new JSONObject().put("Status", sc).put("Error", msg)));
- ctx.response().sendErrorAndBody(sc, jb.toString(), MimeTypes.kAppJson);
- }
-
- }
-
- public static void safeClose(FileReader fr) {
- if (fr != null) {
- try {
- fr.close();
- } catch (IOException e) {
- log.error("Error closing file reader stream : " + e);
- }
- }
-
- }
-
- public static void safeClose(InputStream is) {
- if (is != null) {
- try {
- is.close();
- } catch (IOException e) {
- log.error("Error closing Input stream : " + e);
- }
- }
-
- }
-
- public static String schemaFileVersion(String version) {
- String filename = null;
-
- if (CommonStartup.schemaFileJson.has(version)) {
- filename = CommonStartup.schemaFileJson.getString(version);
- } else {
- filename = CommonStartup.schemaFile;
- }
- log.info(String.format("VESversion: %s Schema File:%s", version, filename));
- return filename;
-
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dcae.restapi.endpoints;
+
+import com.att.nsa.apiServer.endpoints.NsaBaseEndpoint;
+import com.att.nsa.clock.SaClock;
+import com.att.nsa.drumlin.service.framework.context.DrumlinRequestContext;
+import com.att.nsa.drumlin.service.standards.HttpStatusCodes;
+import com.att.nsa.drumlin.service.standards.MimeTypes;
+import com.att.nsa.logging.LoggingContext;
+import com.att.nsa.logging.log4j.EcompFields;
+import com.att.nsa.security.db.simple.NsaSimpleApiKey;
+import com.google.gson.JsonParser;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+import java.util.Base64;
+import java.util.UUID;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+import org.onap.dcae.commonFunction.CommonStartup;
+import org.onap.dcae.commonFunction.CommonStartup.QueueFullException;
+import org.onap.dcae.commonFunction.VESLogger;
+import org.onap.dcae.restapi.ApiException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class EventReceipt extends NsaBaseEndpoint {
+
+ private static final Logger log = LoggerFactory.getLogger(EventReceipt.class);
+ private static final String MESSAGE = " Message:";
+
+ public static void receiveVESEvent(DrumlinRequestContext ctx) {
+ // the request body carries events. assume for now it's an array
+ // of json objects that fits in memory. (See cambria's parsing for
+ // handling large messages)
+
+ NsaSimpleApiKey retkey = null;
+
+
+ JSONObject jsonObject;
+ InputStream istr = null;
+ int arrayFlag = 0;
+ String vesVersion = null;
+ String userId=null;
+
+ try {
+
+
+ istr = ctx.request().getBodyStream();
+ jsonObject = new JSONObject(new JSONTokener(istr));
+
+ log.info("ctx getPathInContext: " + ctx.request().getPathInContext());
+ Pattern p = Pattern.compile("(v\\d+)");
+ Matcher m = p.matcher(ctx.request().getPathInContext());
+
+ if (m.find()) {
+ log.info("VES version:" + m.group());
+ vesVersion = m.group();
+ }
+
+ final UUID uuid = UUID.randomUUID();
+ LoggingContext localLC = VESLogger.getLoggingContextForThread(uuid);
+ localLC.put(EcompFields.kBeginTimestampMs, SaClock.now());
+
+ if (ctx.request().getPathInContext().contains("eventBatch")) {
+ CommonStartup.inlog.info(ctx.request().getRemoteAddress() + "VESUniqueID-Prefix:" + uuid
+ + " VES Batch Input Messsage: " + jsonObject);
+ log.info(ctx.request().getRemoteAddress() + "VESUniqueID-Prefix:" + uuid + " VES Batch Input Messsage: "
+ + jsonObject);
+ arrayFlag = 1;
+ } else {
+ CommonStartup.inlog.info(
+ ctx.request().getRemoteAddress() + "VESUniqueID:" + uuid + " Input Messsage: " + jsonObject);
+ log.info(ctx.request().getRemoteAddress() + "VESUniqueID:" + uuid + " Input Messsage: " + jsonObject);
+
+ }
+
+ try {
+ if (CommonStartup.authflag) {
+ userId = getUser (ctx);
+ retkey = NsaBaseEndpoint.getAuthenticatedUser(ctx);
+ }
+ } catch (NullPointerException x) {
+ //log.info("Invalid user request :" + userId + " FROM " + ctx.request().getRemoteAddress() + " " + ctx.request().getContentType() + MESSAGE + jsonObject);
+ log.info(String.format("Unauthorized request %s FROM %s %s %s %s", getUser(ctx), ctx.request().getRemoteAddress(), ctx.request().getContentType(), MESSAGE, jsonObject));
+ CommonStartup.eplog.info("EVENT_RECEIPT_FAILURE: Unauthorized user" + userId + x);
+ respondWithCustomMsginJson(ctx, ApiException.UNAUTHORIZED_USER);
+ return;
+ }
+
+ if (schemaCheck(retkey, arrayFlag, jsonObject, vesVersion, ctx, uuid)) {
+ return;
+ }
+
+ } catch (JSONException | NullPointerException | IOException x) {
+ log.error(String.format("Couldn't parse JSON Array - HttpStatusCodes.k400_badRequest%d%s%s",
+ HttpStatusCodes.k400_badRequest, MESSAGE, x.getMessage()));
+ CommonStartup.eplog.info("EVENT_RECEIPT_FAILURE: Invalid user request " + x);
+ respondWithCustomMsginJson(ctx, ApiException.INVALID_JSON_INPUT);
+ return;
+ } catch (QueueFullException e) {
+ log.error("Collector internal queue full :" + e.getMessage(), e);
+ CommonStartup.eplog.info("EVENT_RECEIPT_FAILURE: QueueFull" + e);
+ respondWithCustomMsginJson(ctx, ApiException.NO_SERVER_RESOURCES);
+ return;
+ } finally {
+ if (istr != null) {
+ safeClose(istr);
+ }
+ }
+ log.info("MessageAccepted and k200_ok to be sent");
+ ctx.response().sendErrorAndBody(HttpStatusCodes.k200_ok, "Message Accepted", MimeTypes.kAppJson);
+ }
+
+
+ private static String getUser(DrumlinRequestContext ctx){
+ String authorization = ctx.request().getFirstHeader("Authorization");
+ if (authorization != null && authorization.startsWith("Basic")) {
+ String base64Credentials = authorization.substring("Basic".length()).trim();
+ String credentials = new String(Base64.getDecoder().decode(base64Credentials),
+ Charset.forName("UTF-8"));
+ final String[] values = credentials.split(":",2);
+ log.debug("User:" + values[0] + " Pwd:" + values[1]);
+ return values[0];
+ }
+ return null;
+
+ }
+
+ private static Boolean schemaCheck(NsaSimpleApiKey retkey, int arrayFlag,
+ JSONObject jsonObject, String vesVersion,
+ DrumlinRequestContext ctx, UUID uuid)
+ throws JSONException, QueueFullException, IOException {
+
+ JSONArray jsonArray;
+ JSONArray jsonArrayMod = new JSONArray();
+ JSONObject event;
+ FileReader fr;
+ if (retkey != null || !CommonStartup.authflag) {
+ if (CommonStartup.schemaValidatorflag) {
+ if ((arrayFlag == 1) && (jsonObject.has("eventList") && (!jsonObject.has("event")))
+ || ((arrayFlag == 0) && (!jsonObject.has("eventList") && (jsonObject.has("event"))))) {
+ fr = new FileReader(schemaFileVersion(vesVersion));
+ String schema = new JsonParser().parse(fr).toString();
+
+ String valresult = CommonStartup.validateAgainstSchema(jsonObject.toString(), schema);
+ switch (valresult) {
+ case "true":
+ log.info("Validation successful");
+ break;
+ case "false":
+ log.info("Validation failed");
+ respondWithCustomMsginJson(ctx, ApiException.SCHEMA_VALIDATION_FAILED);
+ return true;
+ default:
+ log.error("Validation errored" + valresult);
+ respondWithCustomMsginJson(ctx, ApiException.INVALID_JSON_INPUT);
+ return true;
+ }
+ } else {
+ log.info("Validation failed");
+ respondWithCustomMsginJson(ctx, ApiException.SCHEMA_VALIDATION_FAILED);
+ return true;
+ }
+ if (arrayFlag == 1) {
+ jsonArray = jsonObject.getJSONArray("eventList");
+ log.info("Validation successful for all events in batch");
+ for (int i = 0; i < jsonArray.length(); i++) {
+ event = new JSONObject().put("event", jsonArray.getJSONObject(i));
+ event.put("VESuniqueId", uuid + "-" + i);
+ event.put("VESversion", vesVersion);
+ jsonArrayMod.put(event);
+ }
+ log.info("Modified jsonarray:" + jsonArrayMod.toString());
+ } else {
+ jsonObject.put("VESuniqueId", uuid);
+ jsonObject.put("VESversion", vesVersion);
+ jsonArrayMod = new JSONArray().put(jsonObject);
+ }
+ }
+
+ // reject anything that's not JSON
+ if (!ctx.request().getContentType().equalsIgnoreCase("application/json")) {
+ log.info(String.format("Rejecting request with content type %s Message:%s",
+ ctx.request().getContentType(), jsonObject));
+ respondWithCustomMsginJson(ctx, ApiException.INVALID_CONTENT_TYPE);
+ return true;
+ }
+
+ CommonStartup.handleEvents(jsonArrayMod);
+ } else {
+ log.info(String.format("Unauthorized request %s FROM %s %s %s %s", getUser(ctx), ctx.request().getRemoteAddress(), ctx.request().getContentType(), MESSAGE,
+ jsonObject));
+ respondWithCustomMsginJson(ctx, ApiException.UNAUTHORIZED_USER);
+ return true;
+ }
+ return false;
+ }
+
+ private static void respondWithCustomMsginJson(DrumlinRequestContext ctx, ApiException apiException) {
+ ctx.response()
+ .sendErrorAndBody(apiException.httpStatusCode,
+ apiException.toJSON().toString(), MimeTypes.kAppJson);
+ }
+
+ private static void safeClose(InputStream is) {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ log.error("Error closing Input stream : " + e);
+ }
+ }
+
+ }
+
+ public static String schemaFileVersion(String version) {
+ return CommonStartup.schemaFileJson.has(version) ?
+ CommonStartup.schemaFileJson.getString(version) : CommonStartup.schemaFileJson.getString("v5");
+ }
+
+}
+
diff --git a/src/main/resources/seclogger.yaml b/src/main/resources/seclogger.yaml
index b5dd177c..aeac4270 100644
--- a/src/main/resources/seclogger.yaml
+++ b/src/main/resources/seclogger.yaml
@@ -1,3 +1,20 @@
+# ================================================================================
+# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed 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.
+# ============LICENSE_END=========================================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
package-name: org.onap.dcae.ecomplog
java-root: src/main/java
@@ -62,4 +79,4 @@ operations:
SECPublishOperation:
description: SEC Publish
SECAuthenticationOperation:
- description: SEC Authentication \ No newline at end of file
+ description: SEC Authentication
diff --git a/src/main/scripts/VESConfigPoller.sh b/src/main/scripts/VESConfigPoller.sh
new file mode 100644
index 00000000..75c2b585
--- /dev/null
+++ b/src/main/scripts/VESConfigPoller.sh
@@ -0,0 +1,125 @@
+#!/bin/sh -x
+###
+# ============LICENSE_START=======================================================
+# PROJECT
+# ================================================================================
+# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed 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.
+# ============LICENSE_END=========================================================
+###
+# redirect stdout/stderr to a file
+#exec &> /opt/app/VESCollector/logs/console.txt
+
+usage() {
+ echo "VESConfigPoller.sh"
+}
+
+
+## Remove singel execution logic (loop 0)
+## On configupdate function, remove LoadDynamicConfig and invoke VESrestfulCollector stop/start
+
+BASEDIR=/opt/app/VESCollector/
+CONFIGFILENAME=/opt/app/KV-Configuration.json
+
+
+collector_configupdate() {
+
+ echo `date +"%Y%m%d.%H%M%S%3N"` - VESConfigPoller.sh:collector_configupdate
+ if [ -z "$CONSUL_HOST" ] || [ -z "$CONFIG_BINDING_SERVICE" ] || [ -z "$HOSTNAME" ]; then
+ echo "INFO: USING STANDARD CONTROLLER CONFIGURATION"
+ else
+ # move into base directory
+ cd $BASEDIR
+
+ CONFIG_FETCH=org.onap.dcae.controller.FetchDynamicConfig
+ $JAVA -cp "etc${PATHSEP}lib/*" $CONFIG_FETCH $*
+ if [ $? -ne 0 ]; then
+ echo "ERROR: Failed to fetch dynamic configuration from consul into container $CONFIGFILENAME"
+ else
+ echo "INFO: Dynamic config fetched successfully"
+ fi
+ sleep 10s
+ FLAG=0
+
+ if [ -f $CONFIGFILENAME ]; then
+ if [[ $(find $CONFIGFILENAME -mmin -$CBSPOLLTIMER -print) ]]; then
+ echo "File $CONFIGFILENAME is updated under $CBSPOLLTIMER minutes; Loader to be invoked"
+ FLAG=1
+ else
+ echo "File $CONFIGFILENAME NOT updated in last $CBSPOLLTIMER minutes; no configuration update!"
+ FLAG=0
+ fi
+
+ if [ $FLAG -eq 1 ]; then
+ echo "INFO: CONFIGFILE updated; triggering restart"
+ /opt/app/VESCollector/bin/VESrestfulCollector.sh stop
+ /opt/app/VESCollector/bin/VESrestfulCollector.sh start &
+ else
+ echo "INFO: CONFIGFILE load skipped"
+ fi
+ else
+ echo "ERROR: Configuration file $CONFIGFILENAME missing"
+ fi
+ fi
+}
+
+
+
+if [ -z "$CBSPOLLTIMER" ]; then
+ echo "CBSPOLLTIMER not set; set this to polling frequency in minutes"
+ exit 1
+fi
+
+
+## Pre-setting
+
+# use JAVA_HOME if provided
+if [ -z "$JAVA_HOME" ]; then
+ echo "ERROR: JAVA_HOME not setup"
+ echo "Startup Aborted!!"
+ exit 1
+ #JAVA=java
+else
+ JAVA=$JAVA_HOME/bin/java
+fi
+
+
+
+# determine a path separator that works for this platform
+PATHSEP=":"
+case "$(uname -s)" in
+
+ Darwin)
+ ;;
+
+ Linux)
+ ;;
+
+ CYGWIN*|MINGW32*|MSYS*)
+ PATHSEP=";"
+ ;;
+
+ *)
+ ;;
+esac
+
+
+
+##Run in loop the config pull and check
+while true
+do
+ sleep $(echo $CBSPOLLTIMER)m
+ collector_configupdate | tee -a ${BASEDIR}/logs/console.txt
+done
+
diff --git a/src/main/scripts/VESrestfulCollector.sh b/src/main/scripts/VESrestfulCollector.sh
index fc6cd22f..8462f4e2 100644
--- a/src/main/scripts/VESrestfulCollector.sh
+++ b/src/main/scripts/VESrestfulCollector.sh
@@ -1,173 +1,102 @@
-#!/bin/sh
-
-###
-# ============LICENSE_START=======================================================
-# PROJECT
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed 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.
-# ============LICENSE_END=========================================================
-###
-
-# redirect stdout/stderr to a file
-#exec &> /opt/app/VESCollector/logs/console.txt
-
-usage() {
- echo "VESrestfulCollector.sh <start/stop>"
-}
-
-
-#BASEDIR=/opt/app/d1gfp1m7/extra/VES/VESCollector-1.1.4-SNAPSHOT/
-BASEDIR=/opt/app/VESCollector/
-
-collector_start() {
- echo `date +"%Y%m%d.%H%M%S%3N"` - collector_start | tee -a ${BASEDIR}/logs/console.txt
- collectorPid=`pgrep -f org.onap.dcae.commonFunction`
-
- if [ ! -z "$collectorPid" ]; then
- echo "WARNING: VES Restful Collector already running as PID $collectorPid" | tee -a ${BASEDIR}/logs/console.txt
- echo "Startup Aborted!!!" | tee -a ${BASEDIR}/logs/console.txt
- exit 1
- fi
-
-
- # run java. The classpath is the etc dir for config files, and the lib dir
- # for all the jars.
- #cd /opt/app/VESCollector/
- cd ${BASEDIR}
- nohup $JAVA -cp "etc${PATHSEP}lib/*" $JAVA_OPTS -Dhttps.protocols=TLSv1.1,TLSv1.2 $MAINCLASS $* &
- if [ $? -ne 0 ]; then
- echo "VES Restful Collector has been started!!!" | tee -a ${BASEDIR}/logs/console.txt
- fi
-
-
-}
-
-collector_stop() {
- echo `date +"%Y%m%d.%H%M%S%3N"` - collector_stop
- collectorPid=`pgrep -f org.onap.dcae.commonFunction`
- if [ ! -z "$collectorPid" ]; then
- echo "Stopping PID $collectorPid"
-
- kill -9 $collectorPid
- sleep 5
- if [ ! "$(pgrep -f org.onap.dcae.commonFunction)" ]; then
- echo "VES Restful Collector has been stopped!!!"
- else
- echo "VES Restful Collector is being stopped!!!"
- fi
- else
- echo "WARNING: No VES Collector instance is currently running";
- exit 1
- fi
-
-
-}
-
-collector_configupdate() {
-
- echo `date +"%Y%m%d.%H%M%S%3N"` - collector_configupdate
- if [ -z "$CONSUL_HOST" ] || [ -z "$CONFIG_BINDING_SERVICE" ] || [ -z "$HOSTNAME" ]; then
- echo "INFO: USING STANDARD CONTROLLER CONFIGURATION"
- else
-
- echo "INFO: DYNAMIC CONFIG INTERFACE SUPPORTED"
- # move into base directory
-
- #BASEDIR=`dirname $0`
- #cd $BASEDIR/..
- cd /opt/app/VESCollector
-
- CONFIG_FETCH=org.onap.dcae.controller.FetchDynamicConfig
- $JAVA -cp "etc${PATHSEP}lib/*" $CONFIG_FETCH $*
- if [ $? -ne 0 ]; then
- echo "ERROR: Failed to fetch dynamic configuration from consul into container /opt/app/KV-Configuration.json"
- else
- echo "INFO: Dynamic config fetched and written successfully into container /opt/app/KV-Configuration.json"
- fi
-
-
- if [ -f /opt/app/KV-Configuration.json ]; then
-
- CONFIG_UPDATER=org.onap.dcae.controller.LoadDynamicConfig
- $JAVA -cp "etc${PATHSEP}lib/*" $CONFIG_UPDATER $*
- if [ $? -ne 0 ]; then
- echo "ERROR: Failed to update dynamic configuration into Application"
- else
- echo "INFO: Dynamic config updated successfully into VESCollector configuration!"
- fi
- else
- echo "ERROR: Configuration file /opt/app/KV-Configuration.json missing"
- fi
-
- fi
-}
-
-
-## Check usage
-if [ $# -ne 1 ]; then
- usage
- exit
-fi
-
-
-## Pre-setting
-
-# use JAVA_HOME if provided
-if [ -z "$JAVA_HOME" ]; then
- echo "ERROR: JAVA_HOME not setup"
- echo "Startup Aborted!!"
- exit 1
- #JAVA=java
-else
- JAVA=$JAVA_HOME/bin/java
-fi
-
-
-MAINCLASS=org.onap.dcae.commonFunction.CommonStartup
-
-# determine a path separator that works for this platform
-PATHSEP=":"
-case "$(uname -s)" in
-
- Darwin)
- ;;
-
- Linux)
- ;;
-
- CYGWIN*|MINGW32*|MSYS*)
- PATHSEP=";"
- ;;
-
- *)
- ;;
-esac
-
-
-
-
-case $1 in
- "start")
- collector_configupdate | tee -a ${BASEDIR}/logs/console.txt
- collector_start
- ;;
- "stop")
- collector_stop | tee -a ${BASEDIR}/logs/console.txt
- ;;
- *)
- usage
- ;;
-esac
-
+#!/bin/bash
+
+###
+# ============LICENSE_START=======================================================
+# PROJECT
+# ================================================================================
+# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2018 Nokia Networks Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed 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.
+# ============LICENSE_END=========================================================
+###
+source bin/logger.sh
+
+start() {
+ log "Starting application"
+ appPids=`pidof java`
+
+ if [ ! -z ${appPids} ]; then
+ logWarn "Tried to start an application, but it is already running on PID(s): ${appPids}. Startup aborted."
+ exit 1
+ fi
+
+ ${JAVA_HOME}/bin/java -cp "etc:lib/*" \
+ -Xms256m -Xmx512m \
+ -XX:ErrorFile=logs/java_error%p.log \
+ -XX:+HeapDumpOnOutOfMemoryError \
+ -Dhttps.protocols=TLSv1.1,TLSv1.2 \
+ org.onap.dcae.commonFunction.CommonStartup $* & &>> logs/collector.log
+}
+
+stop() {
+ log "Stopping application"
+ appPids=`pidof java`
+
+ if [ ! -z ${appPids} ]; then
+ echo "Killing java PID(s): ${appPids}"
+ kill -9 ${appPids}
+ sleep 5
+ if [ ! $(pidof java) ]; then
+ log "Application stopped"
+ else
+ logWarn "Application did not stop after 5 seconds"
+ fi
+ else
+ logWarn "Tried to stop an application, but it was not running";
+ fi
+}
+
+collector_configupdate() {
+ if [ -z ${CONSUL_HOST} ] || [ -z ${CONFIG_BINDING_SERVICE} ] || [ -z ${HOSTNAME} ]; then
+ log "Using standard controller configuration (no dynamic configuration done)"
+ else
+ ${JAVA_HOME}/bin/java -cp "etc:lib/*" org.onap.dcae.controller.FetchDynamicConfig $*
+
+ if [ $? -ne 0 ]; then
+ logWarn "Failed to fetch dynamic configuration from consul into container /opt/app/KV-Configuration.json"
+ else
+ log "Dynamic config fetched and written successfully into container /opt/app/KV-Configuration.json"
+ fi
+
+ if [ -f /opt/app/KV-Configuration.json ]; then
+ ${JAVA_HOME}/bin/java -cp "etc:lib/*" org.onap.dcae.controller.LoadDynamicConfig $*
+ if [ $? -ne 0 ]; then
+ echo "ERROR: Failed to update dynamic configuration into Application"
+ else
+ echo "INFO: Dynamic config updated successfully into VESCollector configuration!"
+ fi
+ paramName="collector.keystore.alias"
+ localpropertyfile="etc/collector.properties"
+ tmpfile="etc/collector.properties.tmp"
+ keystore=`grep collector.keystore.file.location $localpropertyfile | tr -d '[:space:]' | cut -d"=" -f2`
+ keypwdfile=`grep collector.keystore.passwordfile $localpropertyfile | tr -d '[:space:]' | cut -d"=" -f2`
+ echo "/usr/bin/keytool -list -keystore $keystore < $keypwdfile | grep "PrivateKeyEntry" | cut -d"," -f1"
+ tmpalias=`/usr/bin/keytool -list -keystore $keystore < $keypwdfile | grep "PrivateKeyEntry" | cut -d"," -f1`
+ alias=`echo $tmpalias | cut -d":" -f2`
+ sed "s~$paramName=.*~$paramName=$alias~g" $localpropertyfile > $tmpfile
+ echo `cat $tmpfile > $localpropertyfile`
+ rm $tmpfile
+ log "Keystore alias updated"
+ else
+ logWarn "Configuration file /opt/app/KV-Configuration.json missing"
+ fi
+ fi
+}
+
+case $1 in
+ "start") collector_configupdate; start ;;
+ "stop") stop ;;
+ *) echo "Bad usage. Should be: /bin/bash <this> start/stop"
+esac
+
diff --git a/src/main/scripts/VESrestfulCollector_Status.sh b/src/main/scripts/VESrestfulCollector_Status.sh
deleted file mode 100644
index 47be7a14..00000000
--- a/src/main/scripts/VESrestfulCollector_Status.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-###
-# ============LICENSE_START=======================================================
-# PROJECT
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed 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.
-# ============LICENSE_END=========================================================
-###
-
-#!/bin/sh
-
-#secPid=`pgrep -f com.att.dcae.commonFunction.CommonStartup` --> master
-secPid=`pgrep -f org.onap.dcae.commonFunction.CommonStartup`
-
-
-if [ "${secPid}" ]
-then
- #errorcnt = `grep -c "CambriaSimplerBatchPublisher - Send failed" ../logs/collector.log`
- errorcnt=`tail -1000 ../logs/collector.log | grep -c "CambriaSimplerBatchPublisher - Send failed"`
-
- if [ $errorcnt -gt 10 ]
- then
- echo "VESCollecter_Is_HavingError to publish"
- else
- echo "VESCollecter_Is_Running as PID $secPid"
- fi
-else
- echo "VESCollecter_Is_Not_Running"
-fi
-exit
diff --git a/src/main/scripts/docker-entry.sh b/src/main/scripts/docker-entry.sh
index 34cbe4cb..0aad7584 100644
--- a/src/main/scripts/docker-entry.sh
+++ b/src/main/scripts/docker-entry.sh
@@ -1,41 +1,66 @@
-#!/bin/sh
-###
-# ============LICENSE_START=======================================================
-# PROJECT
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed 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.
-# ============LICENSE_END=========================================================
-###
-
-if [ ! -z "$COLLECTOR_IP" ]; then
- echo $COLLECTOR_IP $(hostname).dcae.simpledemo.onap.org >> /etc/hosts
-fi
-
-if [ ! -z "$DMAAPHOST" ]; then
- echo $DMAAPHOST onap.dmaap.org >> /etc/hosts
-else
- echo "DMAAPHOST ENV NOT SET!! PUBLISH WILL NOT BE SUPPORTED"
-fi
-
-if [ -z "$CONSUL_HOST" ] || [ -z "$CONFIG_BINDING_SERVICE" ] || [ -z "$HOSTNAME" ]; then
- echo "INFO: USING STANDARD ALONE CONFIGURATION SETUP"
-else
- echo "INFO: USING DCAEGEN2 CONTROLLER"
-fi
-
-/opt/app/VESCollector/bin/VESrestfulCollector.sh stop
-/opt/app/VESCollector/bin/VESrestfulCollector.sh start &
-
-while true; do sleep 1000; done
+#!/bin/bash
+###
+# ============LICENSE_START=======================================================
+# PROJECT
+# ================================================================================
+# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2018 Nokia Networks Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed 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.
+# ============LICENSE_END=========================================================
+###
+source bin/logger.sh
+
+# Redirect all stdout & stderr to a main log file, but also let it print into the console
+# At the time this script is invoked, these directories and files do not exist yet, so we need to create them
+mkdir -p logs
+touch logs/collector.log
+exec &> >(tee -a logs/collector.log)
+
+log "Enabling log rotation for collector.log"
+loggedCommand "cp etc/logrotate.conf /etc/logrotate.d"
+echo "* * * * * root logrotate /etc/logrotate.conf" >> /etc/crontab
+log "Restarting cron"
+loggedCommand "service cron reload"
+loggedCommand "service cron start"
+
+log "Main application entry-point invoked"
+
+if [ ! -z ${COLLECTOR_IP} ]; then
+ log "Collector ip (${COLLECTOR_IP}) (env var 'COLLECTOR_IP') found, adding entry to /etc/hosts"
+ echo ${COLLECTOR_IP} $(hostname).dcae.simpledemo.onap.org >> /etc/hosts
+fi
+
+if [ ! -z ${DMAAPHOST} ]; then
+ if [ -z "$(echo ${DMAAPHOST} | sed -e 's/[0-9\.]//g')" ]; then
+ log "DMaaP host (${DMAAPHOST}) (env var 'DMAAPHOST') found, adding entry to /etc/hosts"
+ echo "${DMAAPHOST} onap-dmaap" >> /etc/hosts
+ else
+ log "DMaaP host (${DMAAPHOST}) (env var 'DMAAPHOST') found, adding entry to /etc/host.aliases"
+ echo "onap-dmaap ${DMAAPHOST}" >> /etc/host.aliases
+ fi
+else
+ logWarn "DMaaP host (env var 'DMAAPHOST') is missing. Events will not be published to DMaaP"
+fi
+
+log "Scheduling application to be started, looping indefinitely to hold the docker process"
+bin/VESrestfulCollector.sh stop
+bin/VESrestfulCollector.sh start &
+
+# Add below if config polling should be enabled. More specific to K8 deployment in ONAP
+if [ ! -z ${CBSPOLLTIMER} ]; then
+ log "Configuration poll time (${CBSPOLLTIMER}) (env var 'CBSPOLLTIMER') found, enabling configuration polling from CBS"
+ bin/VESConfigPoller.sh &
+fi
+
+while true; do sleep 1000; done
diff --git a/src/main/scripts/logger.sh b/src/main/scripts/logger.sh
new file mode 100644
index 00000000..0c56aef0
--- /dev/null
+++ b/src/main/scripts/logger.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+###
+# ============LICENSE_START=======================================================
+# PROJECT
+# ================================================================================
+# Copyright (C) 2018 Nokia Networks Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed 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.
+# ============LICENSE_END=========================================================
+###
+
+log() {
+ logMessage "INFO " "$1"
+}
+
+logWarn() {
+ logMessage "WARN " "$1"
+}
+
+logError() {
+ logMessage "ERROR" "$1"
+}
+
+# Mimics log4j formatter so log files are consistent
+logMessage() {
+ echo "[$(date -u +'%Y-%m-%d %H:%M:%S,%3N')][$1][$(printf "%-9s %s\n" "PID $$")][$0] - $2"
+}
+
+# Run command, catch all the stdout and stderr and based on whether it succeeded, take the output,
+# and log them using common formatter.
+# It is done, so that the log files could be consistent and not look like swiss cheese having
+# nicely formatted lines surrounded with raw command outputs
+# All log lines that are logged by those external comments are prepended with (ext process) so they
+# can be distinguished from hand-rolled messages
+loggedCommand() {
+ output=$($1 2>&1)
+ if [ ! -z "${output}" ]; then
+ if [ $? -eq 0 ]; then
+ while read -r line; do
+ log "(ext process) $line"
+ done <<< "$output"
+ else
+ while read -r line; do
+ logError "(ext process) $line"
+ done <<< "$output"
+ fi
+ fi
+} \ No newline at end of file
diff --git a/src/main/scripts/reconfigure.sh b/src/main/scripts/reconfigure.sh
index e8766d6f..b68ad000 100644
--- a/src/main/scripts/reconfigure.sh
+++ b/src/main/scripts/reconfigure.sh
@@ -5,6 +5,7 @@
# PROJECT
# ================================================================================
# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2018 Nokia Networks Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,14 +20,13 @@
# limitations under the License.
# ============LICENSE_END=========================================================
###
+source bin/logger.sh
-
-if [ -z "$CONSUL_HOST" ] || [ -z "$CONFIG_BINDING_SERVICE" ] || [ -z "$HOSTNAME" ]; then
- echo "INFO: USING STANDARD CONTROLLER"
- /opt/app/manager/start-manager.sh
+if [ -z ${CONSUL_HOST} ] || [ -z ${CONFIG_BINDING_SERVICE} ] || [ -z ${HOSTNAME} ]; then
+ log "Using standard controller (start-manager.sh)"
+ /opt/app/manager/start-manager.sh
else
- echo "INFO: USING DCAEGEN2 CONTROLLER"
- /opt/app/VESCollector/bin/VESrestfulCollector.sh stop
- /opt/app/VESCollector/bin/VESrestfulCollector.sh start &
-fi
-#while true; do sleep 1000; done
+ log "Using DCAEGEN2 controller (VESrestfulCollector.sh)"
+ bin/VESrestfulCollector.sh stop
+ bin/VESrestfulCollector.sh start &
+fi \ No newline at end of file
diff --git a/src/main/scripts/run-dcae-controller-ves-collector-daemon.sh b/src/main/scripts/run-dcae-controller-ves-collector-daemon.sh
deleted file mode 100644
index 544bf3f6..00000000
--- a/src/main/scripts/run-dcae-controller-ves-collector-daemon.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-###
-# ============LICENSE_START=======================================================
-# PROJECT
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed 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.
-# ============LICENSE_END=========================================================
-###
-
-
-IMAGE="dcae-controller-ves-collector"
-VER="latest"
-HOST=$(hostname)
-NAME="ves-collector-$HOST"
-HOST=$(hostname -f)
-
-HOST_VM_LOGDIR="/var/log/${HOST}-docker"
-
-CMD="/bin/bash"
-# remove the imate, interactive terminal, map exposed port
-set -x
-#docker run -d -p 8080:8080/tcp -p 8443:8443/tcp -P --name ${NAME} ${IMAGE}:${VER}
-#docker run -td --name ${NAME} ${IMAGE}:${VER} ${CMD}
-#docker run -td --name ${NAME} ${IMAGE}:${VER}
-docker run -td -p 8080:8080/tcp -p 8443:8443/tcp -P --name ${NAME} ${IMAGE}:${VER} ${CMD}
-
diff --git a/src/main/scripts/run-dcae-controller-ves-collector-interactive.sh b/src/main/scripts/run-dcae-controller-ves-collector-interactive.sh
deleted file mode 100644
index e5759b10..00000000
--- a/src/main/scripts/run-dcae-controller-ves-collector-interactive.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-###
-# ============LICENSE_START=======================================================
-# PROJECT
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed 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.
-# ============LICENSE_END=========================================================
-###
-
-
-IMAGE="dcae-controller-ves-collector"
-VER="latest"
-HOST=$(hostname)
-NAME="ves-collector-$HOST"
-HOST=$(hostname -f)
-CMD="/bin/bash"
-
-HOST_VM_LOGDIR="/var/log/${HOST}-docker-${IMAGE}"
-
-# remove the imate, interactive terminal, map exposed port
-set -x
-docker run --rm -it -v ${HOST_VM_LOGDIR}/manager_ves-collector:/opt/app/manager/logs \
- -v ${HOST_VM_LOGDIR}/VEScollector:/opt/app/VEScollector/logs \
- -v /etc/dcae:/etc/dcae \
- --name ${NAME} ${IMAGE}:${VER} \
- ${CMD}
diff --git a/src/test/java/org/onap/dcae/ApplicationSettingsTest.java b/src/test/java/org/onap/dcae/ApplicationSettingsTest.java
new file mode 100644
index 00000000..b162cef2
--- /dev/null
+++ b/src/test/java/org/onap/dcae/ApplicationSettingsTest.java
@@ -0,0 +1,417 @@
+package org.onap.dcae;
+
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+import io.vavr.collection.HashMap;
+import io.vavr.collection.Map;
+import org.json.JSONObject;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.Arrays;
+import java.util.Objects;
+
+import static java.util.Collections.singletonList;
+import static org.junit.Assert.*;
+import static org.onap.dcae.CLIUtils.processCmdLine;
+
+public class ApplicationSettingsTest {
+
+ @Test
+ public void shouldMakeApplicationSettingsOutOfCLIArguments() {
+ // given
+ String[] cliArguments = {"-param1", "param1value", "-param2", "param2value"};
+
+ // when
+ ApplicationSettings configurationAccessor = new ApplicationSettings(cliArguments, CLIUtils::processCmdLine);
+ String param1value = configurationAccessor.getStringDirectly("param1");
+ String param2value = configurationAccessor.getStringDirectly("param2");
+
+ // then
+ assertEquals("param1value", param1value);
+ assertEquals("param2value", param2value);
+ }
+
+ @Test
+ public void shouldMakeApplicationSettingsOutOfCLIArgumentsAndAConfigurationFile()
+ throws IOException {
+ // given
+ File tempConfFile = File.createTempFile("doesNotMatter", "doesNotMatter");
+ Files.write(tempConfFile.toPath(), Arrays.asList("section.subSection1=abc", "section.subSection2=zxc"));
+ tempConfFile.deleteOnExit();
+ String[] cliArguments = {"-param1", "param1value", "-param2", "param2value", "-c", tempConfFile.toString()};
+
+ // when
+ ApplicationSettings configurationAccessor = new ApplicationSettings(cliArguments, CLIUtils::processCmdLine);
+ String param1value = configurationAccessor.getStringDirectly("param1");
+ String param2value = configurationAccessor.getStringDirectly("param2");
+ String fromFileParam1Value = configurationAccessor.getStringDirectly("section.subSection1");
+ String fromFileParam2Value = configurationAccessor.getStringDirectly("section.subSection2");
+
+ // then
+ assertEquals("param1value", param1value);
+ assertEquals("param2value", param2value);
+ assertEquals("abc", fromFileParam1Value);
+ assertEquals("zxc", fromFileParam2Value);
+ }
+
+ @Test
+ public void shouldCLIArgumentsOverrideConfigFileParameters() throws IOException {
+ // given
+ String[] cliArguments = {"-section.subSection1", "abc"};
+ File tempConfFile = File.createTempFile("doesNotMatter", "doesNotMatter");
+ Files.write(tempConfFile.toPath(), singletonList("section.subSection1=zxc"));
+ tempConfFile.deleteOnExit();
+
+ // when
+ ApplicationSettings configurationAccessor = new ApplicationSettings(cliArguments, CLIUtils::processCmdLine);
+ String actuallyOverridenByCLIParam = configurationAccessor.getStringDirectly("section.subSection1");
+
+ // then
+ assertEquals("abc", actuallyOverridenByCLIParam);
+ }
+
+ @Test
+ public void shouldReturnHTTPPort() throws IOException {
+ // when
+ int applicationPort = fromTemporaryConfiguration("collector.service.port=8090")
+ .httpPort();
+
+ // then
+ assertEquals(8090, applicationPort);
+ }
+
+ @Test
+ public void shouldReturnDefaultHTTPPort() throws IOException {
+ // when
+ int applicationPort = fromTemporaryConfiguration().httpPort();
+
+ // then
+ assertEquals(8080, applicationPort);
+ }
+
+ @Test
+ public void shouldReturnIfHTTPSIsEnabled() throws IOException {
+ // when
+ boolean httpsEnabled = fromTemporaryConfiguration("collector.service.secure.port=8443")
+ .httpsEnabled();
+
+ // then
+ assertTrue(httpsEnabled);
+ }
+
+ @Test
+ public void shouldReturnIfHTTPIsEnabled() throws IOException {
+ // when
+ boolean httpsEnabled = fromTemporaryConfiguration("collector.service.port=8080").httpsEnabled();
+ // then
+ assertTrue(httpsEnabled);
+ }
+
+ @Test
+ public void shouldByDefaultHTTPSBeDisabled() throws IOException {
+ // when
+ boolean httpsEnabled = fromTemporaryConfiguration().httpsEnabled();
+
+ // then
+ assertTrue(httpsEnabled);
+ }
+
+ @Test
+ public void shouldReturnHTTPSPort() throws IOException {
+ // when
+ int httpsPort = fromTemporaryConfiguration("collector.service.secure.port=8443")
+ .httpsPort();
+
+ // then
+ assertEquals(8443, httpsPort);
+ }
+
+ @Test
+ public void shouldReturnLocationOfThePasswordFile() throws IOException {
+ // when
+ String passwordFileLocation = fromTemporaryConfiguration("collector.keystore.passwordfile=/somewhere/password").keystorePasswordFileLocation();
+
+ // then
+ assertEquals("/somewhere/password", passwordFileLocation);
+ }
+
+ @Test
+ public void shouldReturnDefaultLocationOfThePasswordFile() throws IOException {
+ // when
+ String passwordFileLocation = fromTemporaryConfiguration().keystorePasswordFileLocation();
+
+ // then
+ assertEquals("./etc/passwordfile", passwordFileLocation);
+ }
+
+ @Test
+ public void shouldReturnLocationOfTheKeystoreFile() throws IOException {
+ // when
+ String keystoreFileLocation = fromTemporaryConfiguration("collector.keystore.file.location=/somewhere/keystore")
+ .keystoreFileLocation();
+
+ // then
+ assertEquals("/somewhere/keystore", keystoreFileLocation);
+ }
+
+ @Test
+ public void shouldReturnLocationOfTheDefaultKeystoreFile() throws IOException {
+ // when
+ String keystoreFileLocation = fromTemporaryConfiguration().keystoreFileLocation();
+
+ // then
+ assertEquals("../etc/keystore", keystoreFileLocation);
+ }
+
+
+ @Test
+ public void shouldReturnKeystoreAlias() throws IOException {
+ // when
+ String keystoreAlias = fromTemporaryConfiguration("collector.keystore.alias=alias").keystoreAlias();
+
+ // then
+ assertEquals("alias", keystoreAlias);
+ }
+
+ @Test
+ public void shouldReturnDefaultKeystoreAlias() throws IOException {
+ // when
+ String keystoreAlias = fromTemporaryConfiguration().keystoreAlias();
+
+ // then
+ assertEquals("tomcat", keystoreAlias);
+ }
+
+ @Test
+ public void shouldReturnDMAAPConfigFileLocation() throws IOException {
+ // when
+ String dmaapConfigFileLocation = fromTemporaryConfiguration("collector.dmaapfile=/somewhere/dmaapFile").cambriaConfigurationFileLocation();
+
+ // then
+ assertEquals("/somewhere/dmaapFile", dmaapConfigFileLocation);
+ }
+
+ @Test
+ public void shouldReturnDefaultDMAAPConfigFileLocation() throws IOException {
+ // when
+ String dmaapConfigFileLocation = fromTemporaryConfiguration().cambriaConfigurationFileLocation();
+
+ // then
+ assertEquals("./etc/DmaapConfig.json", dmaapConfigFileLocation);
+ }
+
+ @Test
+ public void shouldReturnMaximumAllowedQueuedEvents() throws IOException {
+ // when
+ int maximumAllowedQueuedEvents = fromTemporaryConfiguration("collector.inputQueue.maxPending=10000")
+ .maximumAllowedQueuedEvents();
+
+ // then
+ assertEquals(10000, maximumAllowedQueuedEvents);
+ }
+
+ @Test
+ public void shouldReturnDefaultMaximumAllowedQueuedEvents() throws IOException {
+ // when
+ int maximumAllowedQueuedEvents = fromTemporaryConfiguration().maximumAllowedQueuedEvents();
+
+ // then
+ assertEquals(1024 * 4, maximumAllowedQueuedEvents);
+ }
+
+ @Test
+ public void shouldTellIfSchemaValidationIsEnabled() throws IOException {
+ // when
+ boolean jsonSchemaValidationEnabled = fromTemporaryConfiguration("collector.schema.checkflag=1")
+ .jsonSchemaValidationEnabled();
+
+ // then
+ assertTrue(jsonSchemaValidationEnabled);
+ }
+
+ @Test
+ public void shouldByDefaultSchemaValidationBeDisabled() throws IOException {
+ // when
+ boolean jsonSchemaValidationEnabled = fromTemporaryConfiguration().jsonSchemaValidationEnabled();
+
+ // then
+ assertFalse(jsonSchemaValidationEnabled);
+ }
+
+ @Test
+ public void shouldReturnJSONSchema() throws IOException {
+ // when
+ JSONObject jsonSchema = fromTemporaryConfiguration("collector.schema.file={\"v1\": {}}")
+ .jsonSchema();
+
+ // then
+ assertEquals(new JSONObject("{\"v1\": {}}").toMap(), jsonSchema.toMap());
+ }
+
+ @Test
+ public void shouldReturnDefaultJSONSchema() throws IOException {
+ // when
+ JSONObject jsonSchema = fromTemporaryConfiguration().jsonSchema();
+
+ // then
+ assertEquals(new JSONObject("{\"v5\":\"./etc/CommonEventFormat_28.3.json\"}").toMap(), jsonSchema.toMap());
+ }
+
+ @Test
+ public void shouldReturnExceptionConfigFileLocation() throws IOException {
+ // when
+ String exceptionConfigFileLocation = fromTemporaryConfiguration("exceptionConfig=/somewhere/exceptionFile")
+ .exceptionConfigFileLocation();
+
+ // then
+ assertEquals("/somewhere/exceptionFile", exceptionConfigFileLocation);
+ }
+
+ @Test
+ public void shouldReturnDefaultExceptionConfigFileLocation() throws IOException {
+ // when
+ String exceptionConfigFileLocation = fromTemporaryConfiguration().exceptionConfigFileLocation();
+
+ // then
+ assertNull(exceptionConfigFileLocation);
+ }
+
+
+ @Test
+ public void shouldReturnDMAAPStreamId() throws IOException {
+ // given
+ Map<String, String[]> expected = HashMap.of(
+ "s", new String[]{"something", "something2"},
+ "s2", new String[]{"something3"}
+ );
+
+ // when
+ Map<String, String[]> dmaapStreamID = fromTemporaryConfiguration("collector.dmaap.streamid=s=something,something2|s2=something3")
+ .dMaaPStreamsMapping();
+
+ // then
+ assertArrayEquals(expected.get("s").get(), Objects.requireNonNull(dmaapStreamID).get("s").get());
+ assertArrayEquals(expected.get("s2").get(), Objects.requireNonNull(dmaapStreamID).get("s2").get());
+ assertEquals(expected.keySet(), dmaapStreamID.keySet());
+ }
+
+ @Test
+ public void shouldReturnDefaultDMAAPStreamId() throws IOException {
+ // when
+ Map<String, String[]> dmaapStreamID = fromTemporaryConfiguration().dMaaPStreamsMapping();
+
+ // then
+ assertEquals(dmaapStreamID, HashMap.empty());
+ }
+
+ @Test
+ public void shouldReturnIfAuthorizationIsEnabled() throws IOException {
+ // when
+ boolean authorizationEnabled = fromTemporaryConfiguration("header.authflag=1")
+ .authorizationEnabled();
+
+ // then
+ assertTrue(authorizationEnabled);
+ }
+
+ @Test
+ public void shouldAuthorizationBeDisabledByDefault() throws IOException {
+ // when
+ boolean authorizationEnabled = fromTemporaryConfiguration().authorizationEnabled();
+
+ // then
+ assertFalse(authorizationEnabled);
+ }
+
+ @Test
+ public void shouldReturnValidCredentials() throws IOException {
+ // when
+ String userToBase64PasswordDelimitedByCommaSeparatedByPipes = fromTemporaryConfiguration(
+ "header.authlist=pasza,123jsad1|someoneelse,12asd31"
+ ).validAuthorizationCredentials();
+
+ // then
+ assertEquals("pasza,123jsad1|someoneelse,12asd31", userToBase64PasswordDelimitedByCommaSeparatedByPipes);
+ }
+
+ @Test
+ public void shouldbyDefaultThereShouldBeNoValidCredentials() throws IOException {
+ // when
+ String userToBase64PasswordDelimitedByCommaSeparatedByPipes = fromTemporaryConfiguration().
+ validAuthorizationCredentials();
+
+ // then
+ assertNull(userToBase64PasswordDelimitedByCommaSeparatedByPipes);
+ }
+
+
+ @Test
+ public void shouldReturnIfEventTransformingIsEnabled() throws IOException {
+ // when
+ boolean isEventTransformingEnabled = fromTemporaryConfiguration("event.transform.flag=0")
+ .eventTransformingEnabled();
+
+ // then
+ assertFalse(isEventTransformingEnabled);
+ }
+
+ @Test
+ public void shouldEventTransformingBeEnabledByDefault() throws IOException {
+ // when
+ boolean isEventTransformingEnabled = fromTemporaryConfiguration().eventTransformingEnabled();
+
+ // then
+ assertTrue(isEventTransformingEnabled);
+ }
+
+ @Test
+ public void shouldReturnCambriaConfigurationFileLocation() throws IOException {
+ // when
+ String cambriaConfigurationFileLocation = fromTemporaryConfiguration("collector.dmaapfile=/somewhere/dmaapConfig")
+ .cambriaConfigurationFileLocation();
+
+ // then
+ assertEquals("/somewhere/dmaapConfig", cambriaConfigurationFileLocation);
+ }
+
+ @Test
+ public void shouldReturnDefaultCambriaConfigurationFileLocation() throws IOException {
+ // when
+ String cambriaConfigurationFileLocation = fromTemporaryConfiguration()
+ .cambriaConfigurationFileLocation();
+
+ // then
+ assertEquals("./etc/DmaapConfig.json", cambriaConfigurationFileLocation);
+ }
+
+ private static ApplicationSettings fromTemporaryConfiguration(String... fileLines)
+ throws IOException {
+ File tempConfFile = File.createTempFile("doesNotMatter", "doesNotMatter");
+ Files.write(tempConfFile.toPath(), Arrays.asList(fileLines));
+ tempConfFile.deleteOnExit();
+ return new ApplicationSettings(new String[]{"-c", tempConfFile.toString()}, args -> processCmdLine(args));
+ }
+
+
+} \ No newline at end of file
diff --git a/src/test/java/org/onap/dcae/commonFunction/ApiExceptionTest.java b/src/test/java/org/onap/dcae/commonFunction/ApiExceptionTest.java
new file mode 100644
index 00000000..ef5b477c
--- /dev/null
+++ b/src/test/java/org/onap/dcae/commonFunction/ApiExceptionTest.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction;
+
+import static org.junit.Assert.assertEquals;
+
+import org.json.JSONObject;
+import org.junit.Test;
+import org.onap.dcae.restapi.ApiException;
+import org.onap.dcae.restapi.ApiException.ExceptionType;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+public class ApiExceptionTest {
+
+ @Test
+ public void shouldStringifyServiceExceptionTypeAccordingToSpecification() {
+ assertEquals(ExceptionType.SERVICE_EXCEPTION.toString(), "ServiceException");
+ }
+
+ @Test
+ public void shouldStringifyPolicyExceptionTypeAccordingToSpecification() {
+ assertEquals(ExceptionType.POLICY_EXCEPTION.toString(), "PolicyException");
+ }
+
+ @Test
+ public void shouldConvertExceptionToBackwardCompatibleFormat() {
+ JSONObject responseBody = ApiException.UNAUTHORIZED_USER.toJSON();
+ assertEquals(responseBody.toString(), new JSONObject(""
+ + "{ "
+ + " 'requestError': { "
+ + " 'PolicyException': { "
+ + " 'messageId': 'POL2000', "
+ + " 'text': 'Unauthorized user' "
+ + " } "
+ + " } "
+ + "} "
+ .replace("'", "\"")
+ ).toString());
+ }
+}
diff --git a/src/test/java/org/onap/dcae/commonFunction/CommonStartupTest.java b/src/test/java/org/onap/dcae/commonFunction/CommonStartupTest.java
new file mode 100644
index 00000000..5a171484
--- /dev/null
+++ b/src/test/java/org/onap/dcae/commonFunction/CommonStartupTest.java
@@ -0,0 +1,127 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction;
+
+import static java.util.Base64.getDecoder;
+import static java.util.Base64.getEncoder;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import com.att.nsa.cmdLine.NsaCommandLineUtil;
+import com.att.nsa.drumlin.service.framework.context.DrumlinRequest;
+import com.att.nsa.drumlin.till.nv.impl.nvReadableStack;
+import com.att.nsa.drumlin.till.nv.impl.nvReadableTable;
+import com.att.nsa.drumlin.till.nv.rrNvReadable.loadException;
+import com.att.nsa.drumlin.till.nv.rrNvReadable.missingReqdSetting;
+import com.att.nsa.security.authenticators.SimpleAuthenticator;
+import com.att.nsa.security.db.simple.NsaSimpleApiKey;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.onap.dcae.ApplicationSettings;
+import org.onap.dcae.CLIUtils;
+import org.onap.dcae.commonFunction.CommonStartup.QueueFullException;
+import org.onap.dcae.commonFunction.event.publishing.EventPublisher;
+import org.onap.dcae.restapi.RestfulCollectorServlet;
+import org.onap.dcae.vestest.TestingUtilities;
+
+
+public class CommonStartupTest {
+
+ @Test
+ public void testParseCLIArguments() {
+ // given
+ String args[] = {"-a", "aa"};
+ Map<String, String> argMap = NsaCommandLineUtil.processCmdLine(args, true);
+ // when
+ nvReadableStack settings = new nvReadableStack();
+ settings.push(new nvReadableTable(argMap));
+
+ // then
+ assertEquals(settings.getString("a", "default"), "aa");
+ }
+
+ @Test
+ public void shouldPutValidVESEventOnProcessingQueueWithoutExceptions() throws IOException, QueueFullException {
+ // given
+ CommonStartup.fProcessingInputQueue = new LinkedBlockingQueue<>(
+ CommonStartup.maxQueueEvent);
+ JsonElement vesEvent = new JsonParser().parse(new FileReader("src/test/resources/VES_valid.txt"));
+ JSONObject validVESEvent = new JSONObject(vesEvent.toString());
+ JSONArray jsonArrayMod = new JSONArray().put(validVESEvent);
+
+ // then
+ CommonStartup.handleEvents(jsonArrayMod);
+ }
+
+
+ @Test
+ public void testParseStreamIdToStreamHashMapping() {
+ // given
+
+ CommonStartup.streamID = TestingUtilities.convertDMaaPStreamsPropertyToMap("fault=sec_fault|syslog=sec_syslog|heartbeat=sec_heartbeat|measurementsForVfScaling=sec_measurement|mobileFlow=sec_mobileflow|other=sec_other|stateChange=sec_statechange|thresholdCrossingAlert=sec_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling");
+ EventProcessor eventProcessor = new EventProcessor(mock(EventPublisher.class));
+ // when
+ Map<String, String[]> streamHashMapping = EventProcessor.streamidHash;
+
+ // then
+ assertEquals(streamHashMapping.get("fault")[0], "sec_fault");
+ assertEquals(streamHashMapping.get("measurementsForVfScaling")[0], "sec_measurement");
+ }
+
+ @Test
+ public void testAuthListHandler() throws loadException, missingReqdSetting {
+ // given
+ ApplicationSettings settings = new ApplicationSettings(new String[]{}, CLIUtils::processCmdLine);
+
+ String user1 = "secureid";
+ String password1Hashed = "IWRjYWVSb2FkbTEyMyEt";
+ String password1UnHashed = new String(getDecoder().decode("IWRjYWVSb2FkbTEyMyEt"));
+ String user2 = "sample1";
+ String password2Hashed = "c2FtcGxlMQ";
+
+ String authlist = user1 + "," + password1Hashed + "|" + user2 + "," + password2Hashed;
+
+ RestfulCollectorServlet rsv = new RestfulCollectorServlet(settings);
+
+ DrumlinRequest drumlinRequestMock = Mockito.mock(DrumlinRequest.class);
+
+ String basicHeaderForUser1 = "Basic " + getEncoder().encodeToString((user1 + ":" + password1UnHashed).getBytes());
+ when(drumlinRequestMock.getFirstHeader("Authorization")).thenReturn(basicHeaderForUser1);
+
+ // when
+ SimpleAuthenticator simpleAuthenticator = (SimpleAuthenticator) rsv.createAuthenticator(authlist);
+ NsaSimpleApiKey authentic = simpleAuthenticator.isAuthentic(drumlinRequestMock);
+
+ // then
+ assertEquals(authentic.getSecret(), password1UnHashed);
+ }
+}
+
+
diff --git a/src/test/java/org/onap/dcae/commonFunction/ConfigProcessorAdapterTest.java b/src/test/java/org/onap/dcae/commonFunction/ConfigProcessorAdapterTest.java
new file mode 100644
index 00000000..180dfcf1
--- /dev/null
+++ b/src/test/java/org/onap/dcae/commonFunction/ConfigProcessorAdapterTest.java
@@ -0,0 +1,66 @@
+//
+// ================================================================================
+// Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+// Copyright (c) 2018 Nokia. All rights reserved.
+// ================================================================================
+// Licensed 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.
+// ============LICENSE_END=========================================================
+//
+//
+package org.onap.dcae.commonFunction;
+
+import org.json.JSONObject;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ConfigProcessorAdapterTest {
+
+ @Mock
+ private ConfigProcessors configProcessors;
+
+ @InjectMocks
+ private EventProcessor.ConfigProcessorAdapter configProcessorAdapter;
+
+
+ @Test
+ public void shouldCallIsFilterMetOnAdapter() {
+ //given
+ JSONObject parameter = new JSONObject();
+ when(configProcessors.isFilterMet(parameter)).thenReturn(true);
+ //when
+ boolean actualReturn = configProcessorAdapter.isFilterMet(parameter);
+ //then
+ assertTrue(actualReturn);
+ verify(configProcessors, times(1)).isFilterMet(parameter);
+ }
+
+ @Test
+ public void shouldCallGivenMethodFromConfigProcessor() throws Exception {
+ JSONObject parameter = new JSONObject();
+ String exampleFunction = "concatenateValue";
+ //when
+ configProcessorAdapter.runConfigProcessorFunctionByName(exampleFunction, parameter);
+ //then
+ verify(configProcessors, times(1)).concatenateValue(parameter);
+ }
+
+} \ No newline at end of file
diff --git a/src/test/java/org/onap/dcae/commonFunction/EventProcessorTest.java b/src/test/java/org/onap/dcae/commonFunction/EventProcessorTest.java
new file mode 100644
index 00000000..77ef005f
--- /dev/null
+++ b/src/test/java/org/onap/dcae/commonFunction/EventProcessorTest.java
@@ -0,0 +1,90 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction;
+
+import com.google.gson.Gson;
+import java.util.concurrent.atomic.AtomicReference;
+
+import io.vavr.collection.HashMap;
+import org.json.JSONObject;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+
+import java.util.List;
+import org.onap.dcae.commonFunction.event.publishing.EventPublisher;
+import org.onap.dcae.vestest.TestingUtilities;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.onap.dcae.commonFunction.EventProcessor.EVENT_LIST_TYPE;
+
+public class EventProcessorTest {
+
+ private final String ev = "{\"event\": {\"commonEventHeader\": { \"reportingEntityName\": \"VM name will be provided by ECOMP\", \"startEpochMicrosec\": 1477012779802988,\"lastEpochMicrosec\": 1477012789802988,\"eventId\": \"83\",\"sourceName\": \"Dummy VM name - No Metadata available\",\"sequence\": 83,\"priority\": \"Normal\",\"functionalRole\": \"vFirewall\",\"domain\": \"measurementsForVfScaling\",\"reportingEntityId\": \"VM UUID will be provided by ECOMP\",\"sourceId\": \"Dummy VM UUID - No Metadata available\",\"version\": 1.1},\"measurementsForVfScalingFields\": {\"measurementInterval\": 10,\"measurementsForVfScalingVersion\": 1.1,\"vNicUsageArray\": [{\"multicastPacketsIn\": 0,\"bytesIn\": 3896,\"unicastPacketsIn\": 0, \"multicastPacketsOut\": 0,\"broadcastPacketsOut\": 0, \"packetsOut\": 28,\"bytesOut\": 12178,\"broadcastPacketsIn\": 0,\"packetsIn\": 58,\"unicastPacketsOut\": 0,\"vNicIdentifier\": \"eth0\"}]}}}";
+
+ @Before
+ public void setUp() {
+ CommonStartup.streamID = TestingUtilities.convertDMaaPStreamsPropertyToMap("fault=sec_fault|syslog=sec_syslog|heartbeat=sec_heartbeat|measurementsForVfScaling=sec_measurement|mobileFlow=sec_mobileflow|other=sec_other|stateChange=sec_statechange|thresholdCrossingAlert=sec_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling");
+ }
+
+ @Test
+ public void testLoad() {
+ //given
+ EventProcessor ec = new EventProcessor(mock(EventPublisher.class));
+ ec.event = new org.json.JSONObject(ev);
+ //when
+ ec.overrideEvent();
+
+ //then
+ Boolean hasSourceNameNode = ec.event.getJSONObject("event").getJSONObject("commonEventHeader").has("sourceName");
+ assertTrue(hasSourceNameNode);
+ }
+
+ @Test
+ public void shouldParseJsonEvents() throws ReflectiveOperationException {
+ //given
+ EventProcessor eventProcessor = new EventProcessor(mock(EventPublisher.class));
+ String event_json = "[{ \"filter\": {\"event.commonEventHeader.domain\":\"heartbeat\",\"VESversion\":\"v4\"},\"processors\":[" +
+ "{\"functionName\": \"concatenateValue\",\"args\":{\"field\":\"event.commonEventHeader.eventName\",\"concatenate\": [\"$event.commonEventHeader.domain\",\"$event.commonEventHeader.eventType\",\"$event.faultFields.alarmCondition\"], \"delimiter\":\"_\"}}" +
+ ",{\"functionName\": \"addAttribute\",\"args\":{\"field\": \"event.heartbeatFields.heartbeatFieldsVersion\",\"value\": \"1.0\",\"fieldType\": \"number\"}}" +
+ ",{\"functionName\": \"map\",\"args\":{\"field\": \"event.commonEventHeader.nfNamingCode\",\"oldField\": \"event.commonEventHeader.functionalRole\"}}]}]";
+ List<Event> events = new Gson().fromJson(event_json, EVENT_LIST_TYPE);
+ EventProcessor.ConfigProcessorAdapter configProcessorAdapter = mock(EventProcessor.ConfigProcessorAdapter.class);
+
+ when(configProcessorAdapter.isFilterMet(any(JSONObject.class))).thenReturn(true);
+ ArgumentCaptor<String> stringArgumentCaptor = ArgumentCaptor.forClass(String.class);
+ ArgumentCaptor<JSONObject> jsonObjectArgumentCaptor = ArgumentCaptor.forClass(JSONObject.class);
+ //when
+ eventProcessor.parseEventsJson(events, configProcessorAdapter);
+
+ //then
+ verify(configProcessorAdapter, times(3)).runConfigProcessorFunctionByName(stringArgumentCaptor.capture(), jsonObjectArgumentCaptor.capture());
+ assertThat(stringArgumentCaptor.getAllValues()).contains("concatenateValue", "addAttribute", "map");
+ }
+
+}
+
diff --git a/src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPConfigurationParserTest.java b/src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPConfigurationParserTest.java
new file mode 100644
index 00000000..5a94c662
--- /dev/null
+++ b/src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPConfigurationParserTest.java
@@ -0,0 +1,114 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction.event.publishing;
+
+import static io.vavr.API.List;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.onap.dcae.commonFunction.event.publishing.DMaaPConfigurationParser.parseToDomainMapping;
+
+import io.vavr.collection.Map;
+import io.vavr.control.Try;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import org.junit.Test;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+public class DMaaPConfigurationParserTest {
+
+ @Test
+ public void testParseCredentialsForGen2() {
+ Path path = Paths.get("src/test/resources/testParseDMaaPCredentialsGen2.json");
+ Try<Map<String, PublisherConfig>> publisherConfigs = parseToDomainMapping(path);
+
+ PublisherConfig authCredentialsNulls = publisherConfigs.get().get("auth-credentials-null").getOrNull();
+ assertThat(authCredentialsNulls.userName().isEmpty()).isTrue();
+ assertThat(authCredentialsNulls.password().isEmpty()).isTrue();
+ assertThat(authCredentialsNulls.isSecured()).isFalse();
+
+ PublisherConfig authCredentialsPresent = publisherConfigs.get().get("auth-credentials-present").getOrNull();
+ assertThat(authCredentialsPresent.userName().getOrNull()).isEqualTo("sampleUser");
+ assertThat(authCredentialsPresent.password().getOrNull()).isEqualTo("samplePassword");
+ assertThat(authCredentialsPresent.isSecured()).isTrue();
+
+ PublisherConfig authCredentialsKeysMissing = publisherConfigs.get().get("auth-credentials-missing").getOrNull();
+ assertThat(authCredentialsKeysMissing.userName().isEmpty()).isTrue();
+ assertThat(authCredentialsKeysMissing.password().isEmpty()).isTrue();
+ assertThat(authCredentialsKeysMissing.isSecured()).isFalse();
+ }
+
+
+ @Test
+ public void testParseCredentialsForLegacy() {
+ Path path = Paths.get("src/test/resources/testParseDMaaPCredentialsLegacy.json");
+ Try<Map<String, PublisherConfig>> publisherConfigs = parseToDomainMapping(path);
+
+ PublisherConfig authCredentialsNull = publisherConfigs.get().get("auth-credentials-null").getOrNull();
+ assertThat(authCredentialsNull.userName().isEmpty()).isTrue();
+ assertThat(authCredentialsNull.password().isEmpty()).isTrue();
+ assertThat(authCredentialsNull.isSecured()).isFalse();
+
+ PublisherConfig authCredentialsPresent = publisherConfigs.get().get("auth-credentials-present").getOrNull();
+ assertThat(authCredentialsPresent.userName().getOrNull()).isEqualTo("sampleUser");
+ assertThat(authCredentialsPresent.password().getOrNull()).isEqualTo("samplePassword");
+ assertThat(authCredentialsPresent.isSecured()).isTrue();
+
+ PublisherConfig authCredentialsMissing = publisherConfigs.get().get("auth-credentials-missing").getOrNull();
+ assertThat(authCredentialsMissing.userName().isEmpty()).isTrue();
+ assertThat(authCredentialsMissing.password().isEmpty()).isTrue();
+ assertThat(authCredentialsMissing.isSecured()).isFalse();
+ }
+
+
+ @Test
+ public void testParseGen2() {
+ Path path = Paths.get("src/test/resources/testParseDMaaPGen2.json");
+ Try<Map<String, PublisherConfig>> publisherConfigs = parseToDomainMapping(path);
+
+ PublisherConfig withEventsSegment = publisherConfigs.get().get("event-segments-with-port").getOrNull();
+ assertThat(withEventsSegment.destinations()).isEqualTo(List("UEBHOST:3904"));
+ assertThat(withEventsSegment.topic()).isEqualTo("DCAE-SE-COLLECTOR-EVENTS-DEV");
+
+ PublisherConfig withOtherSegment = publisherConfigs.get().get("other-segments-without-ports").getOrNull();
+ assertThat(withOtherSegment.destinations()).isEqualTo(List("UEBHOST"));
+ assertThat(withOtherSegment.topic()).isEqualTo("DCAE-SE-COLLECTOR-EVENTS-DEV");
+ }
+
+ @Test
+ public void testParseLegacy() {
+ Path exemplaryConfig = Paths.get("src/test/resources/testParseDMaaPLegacy.json");
+ Try<Map<String, PublisherConfig>> publisherConfigs = DMaaPConfigurationParser
+ .parseToDomainMapping(exemplaryConfig);
+
+ PublisherConfig urlFirstThenHosts = publisherConfigs.get().get("url-precedes-hosts").getOrNull();
+ assertThat(urlFirstThenHosts.destinations()).isEqualTo(List("127.0.0.1:3904"));
+ assertThat(urlFirstThenHosts.topic()).isEqualTo("DCAE-SE-COLLECTOR-EVENTS-DEV");
+
+ PublisherConfig urlKeyMissing = publisherConfigs.get().get("url-key-missing").getOrNull();
+ assertThat(urlKeyMissing.destinations()).isEqualTo(List("h1.att.com", "h2.att.com"));
+ assertThat(urlKeyMissing.topic()).isEqualTo("DCAE-SE-COLLECTOR-EVENTS-DEV");
+
+ PublisherConfig urlIsMissing = publisherConfigs.get().get("url-is-null").getOrNull();
+ assertThat(urlIsMissing.destinations()).isEqualTo(List("h1.att.com", "h2.att.com"));
+ assertThat(urlIsMissing.topic()).isEqualTo("DCAE-SE-COLLECTOR-EVENTS-DEV");
+ }
+} \ No newline at end of file
diff --git a/src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPEventPublisherTest.java b/src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPEventPublisherTest.java
new file mode 100644
index 00000000..bbe5079e
--- /dev/null
+++ b/src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPEventPublisherTest.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction.event.publishing;
+
+import static io.vavr.API.Option;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import com.att.nsa.cambria.client.CambriaBatchingPublisher;
+import java.io.IOException;
+import org.json.JSONObject;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+
+public class DMaaPEventPublisherTest {
+
+ private static final String STREAM_ID = "sampleStreamId";
+
+ private DMaaPEventPublisher eventPublisher;
+ private CambriaBatchingPublisher cambriaPublisher;
+ private DMaaPPublishersCache DMaaPPublishersCache;
+
+ @Before
+ public void setUp() {
+ cambriaPublisher = mock(CambriaBatchingPublisher.class);
+ DMaaPPublishersCache = mock(DMaaPPublishersCache.class);
+ when(DMaaPPublishersCache.getPublisher(anyString())).thenReturn(Option(cambriaPublisher));
+ eventPublisher = new DMaaPEventPublisher(DMaaPPublishersCache, mock(Logger.class));
+ }
+
+ @Test
+ public void shouldSendEventToTopic() throws Exception {
+ // given
+ JSONObject event = new JSONObject("{}");
+
+ // when
+ eventPublisher.sendEvent(event, STREAM_ID);
+
+ // then
+ verify(cambriaPublisher).send("MyPartitionKey", event.toString());
+ }
+
+ @Test
+ public void shouldRemoveInternalVESUIDBeforeSending() throws Exception {
+ // given
+ JSONObject event = new JSONObject(
+ "{\"VESuniqueId\": \"362e0146-ec5f-45f3-8d8f-bfe877c3f58e\", \"another\": 8}");
+
+ // when
+ eventPublisher.sendEvent(event, STREAM_ID);
+
+ // then
+ verify(cambriaPublisher).send("MyPartitionKey", new JSONObject("{\"another\": 8}").toString());
+ }
+
+ @Test
+ public void shouldCloseConnectionWhenExceptionOccurred() throws Exception {
+ // given
+ JSONObject event = new JSONObject("{}");
+ given(cambriaPublisher.send(anyString(), anyString())).willThrow(new IOException("epic fail"));
+
+ // when
+ eventPublisher.sendEvent(event, STREAM_ID);
+
+ // then
+ verify(DMaaPPublishersCache).closePublisherFor(STREAM_ID);
+ }
+} \ No newline at end of file
diff --git a/src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersCacheTest.java b/src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersCacheTest.java
new file mode 100644
index 00000000..8dc69f62
--- /dev/null
+++ b/src/test/java/org/onap/dcae/commonFunction/event/publishing/DMaaPPublishersCacheTest.java
@@ -0,0 +1,126 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.commonFunction.event.publishing;
+
+import static io.vavr.API.List;
+import static io.vavr.API.Map;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
+import com.att.nsa.cambria.client.CambriaBatchingPublisher;
+import io.vavr.collection.Map;
+import io.vavr.control.Option;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.dcae.commonFunction.event.publishing.DMaaPPublishersCache.CambriaPublishersCacheLoader;
+import org.onap.dcae.commonFunction.event.publishing.DMaaPPublishersCache.OnPublisherRemovalListener;
+
+
+public class DMaaPPublishersCacheTest {
+
+ private String streamId1;
+ private Map<String, PublisherConfig> dMaaPConfigs;
+
+ @Before
+ public void setUp() {
+ streamId1 = "sampleStream1";
+ dMaaPConfigs = Map("sampleStream1", new PublisherConfig(List("destination1"), "topic1"));
+ }
+
+ @Test
+ public void shouldReturnTheSameCachedInstanceOnConsecutiveRetrievals() {
+ // given
+ DMaaPPublishersCache dMaaPPublishersCache = new DMaaPPublishersCache(dMaaPConfigs);
+
+ // when
+ Option<CambriaBatchingPublisher> firstPublisher = dMaaPPublishersCache.getPublisher(streamId1);
+ Option<CambriaBatchingPublisher> secondPublisher = dMaaPPublishersCache.getPublisher(streamId1);
+
+ // then
+ assertSame("should return same instance", firstPublisher.get(), secondPublisher.get());
+ }
+
+ @Test
+ public void shouldCloseCambriaPublisherOnCacheInvalidate() throws IOException, InterruptedException {
+ // given
+ CambriaBatchingPublisher cambriaPublisherMock1 = mock(CambriaBatchingPublisher.class);
+ CambriaPublishersCacheLoader cacheLoaderMock = mock(CambriaPublishersCacheLoader.class);
+ DMaaPPublishersCache dMaaPPublishersCache = new DMaaPPublishersCache(cacheLoaderMock,
+ new OnPublisherRemovalListener(),
+ dMaaPConfigs);
+ when(cacheLoaderMock.load(streamId1)).thenReturn(cambriaPublisherMock1);
+
+ // when
+ dMaaPPublishersCache.getPublisher(streamId1);
+ dMaaPPublishersCache.closePublisherFor(streamId1);
+
+ // then
+ verify(cambriaPublisherMock1).close(20, TimeUnit.SECONDS);
+
+ }
+
+ @Test
+ public void shouldReturnNoneIfThereIsNoDMaaPConfigurationForGivenStreamID() {
+ // given
+ DMaaPPublishersCache dMaaPPublishersCache = new DMaaPPublishersCache(dMaaPConfigs);
+
+ // then
+ assertTrue("should not exist", dMaaPPublishersCache.getPublisher("non-existing").isEmpty());
+ }
+
+
+ @Test
+ public void shouldCloseOnlyChangedPublishers() throws IOException, InterruptedException {
+ // given
+ CambriaBatchingPublisher cambriaPublisherMock1 = mock(CambriaBatchingPublisher.class);
+ CambriaBatchingPublisher cambriaPublisherMock2 = mock(CambriaBatchingPublisher.class);
+ CambriaPublishersCacheLoader cacheLoaderMock = mock(CambriaPublishersCacheLoader.class);
+ String firstDomain = "domain1";
+ String secondDomain = "domain2";
+ Map<String, PublisherConfig> oldConfig = Map(firstDomain,
+ new PublisherConfig(List("destination1"), "topic1"),
+ secondDomain,
+ new PublisherConfig(List("destination2"), "topic2",
+ "user", "pass"));
+ Map<String, PublisherConfig> newConfig = Map(firstDomain, new PublisherConfig(List("destination1"), "topic1"),
+ secondDomain, new PublisherConfig(List("destination2"), "topic2"));
+ DMaaPPublishersCache dMaaPPublishersCache = new DMaaPPublishersCache(cacheLoaderMock,
+ new OnPublisherRemovalListener(),
+ oldConfig);
+ when(cacheLoaderMock.load(firstDomain)).thenReturn(cambriaPublisherMock1);
+ when(cacheLoaderMock.load(secondDomain)).thenReturn(cambriaPublisherMock2);
+
+ dMaaPPublishersCache.getPublisher(firstDomain);
+ dMaaPPublishersCache.getPublisher(secondDomain);
+
+ // when
+ dMaaPPublishersCache.reconfigure(newConfig);
+
+ // then
+ verify(cambriaPublisherMock2).close(20, TimeUnit.SECONDS);
+ verifyZeroInteractions(cambriaPublisherMock1);
+ }
+} \ No newline at end of file
diff --git a/src/test/java/org/onap/dcae/vestest/AnyNodeTest.java b/src/test/java/org/onap/dcae/vestest/AnyNodeTest.java
new file mode 100644
index 00000000..9400e46d
--- /dev/null
+++ b/src/test/java/org/onap/dcae/vestest/AnyNodeTest.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2018 Nokia Networks Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.vestest;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import com.google.common.collect.Sets;
+import java.util.Set;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.onap.dcae.commonFunction.AnyNode;
+
+/**
+ * Created by koblosz on 07.06.18.
+ */
+public class AnyNodeTest {
+
+ private static final String SAMPLE_JSON_FILEPATH = "{\n"
+ + " \"channels\": [{\n"
+ + " \"one\": \"number1\", \"two\": \"number2\", \"three\": \"number3\"}],\n"
+ + " \"sampleStrList\": [\"1\", \"2\", \"3\", \"4\", \"5\"],\n"
+ + " \"sampleNestedObject\": {\"a\": 1, \"b\": 2},\n"
+ + " \"sampleInt\": 1,\n"
+ + " \"sampleString\": \"str\",\n"
+ + " \"sampleNull\": null\n"
+ + "}\n";
+ private static final Set<String> EXPECTED_JSON_KEYS = Sets
+ .newHashSet("channels", "sampleStrList", "sampleNestedObject", "sampleInt", "sampleString", "sampleNull");
+ private static AnyNode node;
+
+
+ @BeforeClass
+ public static void setUpClass() {
+ node = AnyNode.fromString(SAMPLE_JSON_FILEPATH);
+ }
+
+ @Test
+ public void testShouldReturnJsonObjectKeySet() {
+ assertThat(node.keys()).containsOnlyElementsOf(EXPECTED_JSON_KEYS);
+ }
+
+ @Test(expected = ClassCastException.class)
+ public void whenInvokedOnJsonObjInsteadOfJsonArrShouldRaiseRuntimeEx() {
+ node.toList();
+ }
+} \ No newline at end of file
diff --git a/src/test/java/org/onap/dcae/vestest/EventTransformTest.java b/src/test/java/org/onap/dcae/vestest/EventTransformTest.java
deleted file mode 100644
index 96e965cf..00000000
--- a/src/test/java/org/onap/dcae/vestest/EventTransformTest.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-package org.onap.dcae.vestest;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.FileReader;
-import java.io.IOException;
-import org.json.JSONObject;
-import com.google.gson.JsonParser;
-import com.google.gson.JsonObject;
-import org.junit.Test;
-
-import org.onap.dcae.commonFunction.ConfigProcessors;
-
-
-
-public class EventTransformTest {
- public JSONObject getFileAsJsonObject()
- {
- JSONObject jsonObject = null;
- FileReader fr = null;
- final JsonParser parser = new JsonParser();
- String jsonfilepath="src/test/resources/event4xjson.txt";
- try{
- fr = new FileReader ( jsonfilepath );
- final JsonObject jo = (JsonObject) parser.parse (fr);
- final String jsonText = jo.toString ();
- jsonObject = new JSONObject ( jsonText );
- }
- catch(Exception e){
- System.out.println("Exception while opening the file");
- e.printStackTrace();
- }
- finally {
- //close the file
- if (fr != null) {
- try {
- fr.close();
- } catch (IOException e) {
- System.out.println("Error closing file reader stream : " +e.toString());
- }
- }
- }
- return jsonObject;
- }
- @Test
- public void testAttrMap(){
-
- final JSONObject jsonObject = getFileAsJsonObject();
- final String functionRole = (jsonObject.getJSONObject("event")).getJSONObject("commonEventHeader").get("functionalRole").toString();
- System.out.println("event==" + jsonObject.toString());
- System.out.println("functionRole==" + functionRole);
- final JSONObject jsonArgs = new JSONObject ( "{\"field\": \"event.commonEventHeader.nfNamingCode\",\"oldField\": \"event.commonEventHeader.functionalRole\"}" );
- ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
- cpEvent.map(jsonArgs);
- final String responseData = cpEvent.getEventObjectVal("event.commonEventHeader.nfNamingCode").toString();
- System.out.println("modified event==" + jsonObject.toString());
- System.out.println("responseData==" + responseData);
- assertEquals (functionRole, responseData);
- }
-
- @Test
- public void testArrayMap(){
-
- final JSONObject jsonObject = getFileAsJsonObject();
- final String alarmAdditionalInformation = (jsonObject.getJSONObject("event")).getJSONObject("faultFields").get("alarmAdditionalInformation").toString();
- System.out.println("event==" + jsonObject.toString());
- System.out.println("alarmAdditionalInformation==" + alarmAdditionalInformation);
- final JSONObject jsonArgs = new JSONObject ( "{\"field\": \"event.faultFields.eventAdditionalInformation\",\"oldField\": \"event.faultFields.alarmAdditionalInformation\"}" );
- ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
- cpEvent.map(jsonArgs);
- final String responseData = cpEvent.getEventObjectVal("event.faultFields.eventAdditionalInformation").toString();
- System.out.println("modified event==" + jsonObject.toString());
- System.out.println("responseData==" + responseData);
- assertEquals (alarmAdditionalInformation, responseData);
- }
- @Test
- public void testJobjMaptoArray(){
-
- final JSONObject jsonObject = getFileAsJsonObject();
- //final String receiveDiscards = (((jsonObject.getJSONObject("event")).getJSONObject("faultFields")).get("errors")).get("receiveDiscards").toString();
- System.out.println("event==" + jsonObject.toString());
- //System.out.println("alarmAdditionalInformation==" + alarmAdditionalInformation);
- final JSONObject jsonArgs = new JSONObject ( "{\"field\": \"event.faultFields.vNicPerformanceArray[]\",\"oldField\": \"event.faultFields.errors\",\"attrMap\":{\"receiveDiscards\":\"receivedDiscardedPacketsAccumulated\"}}" );
- ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
- final String receiveDiscards = cpEvent.getEventObjectVal("event.faultFields.errors.receiveDiscards").toString();
- System.out.println("receiveDiscards==" + receiveDiscards);
- cpEvent.map(jsonArgs);
- final String responseData = cpEvent.getEventObjectVal("event.faultFields.vNicPerformanceArray[0].receivedDiscardedPacketsAccumulated").toString();
- System.out.println("modified event==" + jsonObject.toString());
- System.out.println("responseData==" + responseData);
- assertEquals (receiveDiscards, responseData);
- }
- @Test
- public void testAttrAdd(){
-
- final JSONObject jsonObject = getFileAsJsonObject();
- //final String functionRole = (jsonObject.getJSONObject("event")).getJSONObject("commonEventHeader").get("functionalRole").toString();
- System.out.println("event==" + jsonObject.toString());
- //System.out.println("functionRole==" + functionRole);
- final JSONObject jsonArgs = new JSONObject ( "{\"field\": \"event.faultFields.version\",\"value\": \"2.0\",\"fieldType\": \"number\"}" );
- ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
- cpEvent.addAttribute(jsonArgs);
- final String responseData = cpEvent.getEventObjectVal("event.faultFields.version").toString();
- System.out.println("modified event==" + jsonObject.toString());
- System.out.println("responseData==" + responseData);
- assertEquals ("2.0", responseData);
- }
-
- @Test
- public void testAttrUpdate(){
-
- final JSONObject jsonObject = getFileAsJsonObject();
- //final String functionRole = (jsonObject.getJSONObject("event")).getJSONObject("commonEventHeader").get("functionalRole").toString();
- System.out.println("event==" + jsonObject.toString());
- //System.out.println("functionRole==" + functionRole);
- final JSONObject jsonArgs = new JSONObject ( "{\"field\": \"event.faultFields.version\",\"value\": \"2.0\",\"fieldType\": \"number\"}" );
- ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
- cpEvent.updateAttribute(jsonArgs);
- final String responseData = cpEvent.getEventObjectVal("event.faultFields.version").toString();
- System.out.println("modified event==" + jsonObject.toString());
- System.out.println("responseData==" + responseData);
- assertEquals ("2.0", responseData);
- }
-
- @Test
- public void testAttrConcatenate(){
-
- final JSONObject jsonObject = getFileAsJsonObject();
- final String eventType = (jsonObject.getJSONObject("event")).getJSONObject("commonEventHeader").get("eventType").toString();
- final String domain = (jsonObject.getJSONObject("event")).getJSONObject("commonEventHeader").get("domain").toString();
- final String alarmCondition = (jsonObject.getJSONObject("event")).getJSONObject("faultFields").get("alarmCondition").toString();
- System.out.println("event==" + jsonObject.toString());
- final String eventName = domain + "_" + eventType + "_" + alarmCondition;
- System.out.println("eventName==" + eventName);
- final JSONObject jsonArgs = new JSONObject ( "{\"field\":\"event.commonEventHeader.eventName\",\"concatenate\": [\"$event.commonEventHeader.domain\",\"$event.commonEventHeader.eventType\",\"$event.faultFields.alarmCondition\"],\"delimiter\":\"_\"}");
- ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
- cpEvent.concatenateValue(jsonArgs);
- final String responseData = cpEvent.getEventObjectVal("event.commonEventHeader.eventName").toString();
- System.out.println("modified event==" + jsonObject.toString());
- System.out.println("responseData==" + responseData);
- assertEquals (eventName, responseData);
- }
-
- @Test
- public void testAttrSubtract(){
-
- final JSONObject jsonObject = getFileAsJsonObject();
- final String memoryConfigured = (jsonObject.getJSONObject("event")).getJSONObject("faultFields").get("memoryConfigured").toString();
- final String memoryUsed = (jsonObject.getJSONObject("event")).getJSONObject("faultFields").get("memoryUsed").toString();
- System.out.println("event==" + jsonObject.toString());
- System.out.println("memoryConfigured==" + memoryConfigured);
- System.out.println("memoryUsed==" + memoryUsed);
- final JSONObject jsonArgs = new JSONObject ( "{\"field\": \"event.faultFields.memoryFree\",\"subtract\": [\"$event.faultFields.memoryConfigured\",\"$event.faultFields.memoryUsed\"]}" );
- ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
- cpEvent.subtractValue(jsonArgs);
- final String responseData = cpEvent.getEventObjectVal("event.faultFields.memoryFree").toString();
- System.out.println("modified event==" + jsonObject.toString());
- System.out.println("responseData==" + responseData);
- assertEquals ("1980.0", responseData);
- }
-}
-
diff --git a/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java b/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java
deleted file mode 100644
index 72ebdea3..00000000
--- a/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.dcae.vestest;
-
-import com.google.gson.JsonIOException;
-import com.google.gson.JsonParser;
-import com.google.gson.JsonSyntaxException;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-import org.junit.Test;
-import org.onap.dcae.commonFunction.CommonStartup;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class InputJsonValidation {
-
- private static final Logger log = LoggerFactory.getLogger(InputJsonValidation.class);
- static String valresult;
-
-
- @Test
- public void nonValidJsonValidation() {
-
- JSONObject jsonObject;
- JSONParser parser = new JSONParser();
- Object obj = null;
- //String jsonfilepath="C:/Users/vv770d/git/restfulcollector/src/test/resources/fujistu_non_valid_json.txt";
- String jsonfilepath = "src/test/resources/VES_invalid.txt";
- String retValue = "false";
- try {
-
- obj = parser.parse(new FileReader(jsonfilepath));
- } catch (Exception e) {
-
- log.info("Exception while opening the file");
- }
- jsonObject = (JSONObject) obj;
-
- String schema = null;
- try {
- schema = new JsonParser().parse(new FileReader("etc/CommonEventFormat_27.2.json"))
- .toString();
- //log.info("Schema value: " + schema.toString());
- } catch (JsonIOException | JsonSyntaxException | FileNotFoundException e) {
- // TODO Auto-generated catch block
- log.error(e.getLocalizedMessage(), e);
- }
-
- if (schema != null) {
- retValue = CommonStartup.schemavalidate(jsonObject.toString(), schema);
- }
- //return retValue;
- VesCollectorJunitTest.output = retValue;
- }
-
-
- // The below test case meant for verifying json schema on provided json file
- @Test
- public void validJsonValidation() {
-
- JSONObject jsonObject;
- JSONParser parser = new JSONParser();
- Object obj = null;
-
- String jsonfilepath = "src/test/resources/VES_valid.txt";
- String retValue = "false";
- try {
-
- obj = parser.parse(new FileReader(jsonfilepath));
- } catch (Exception e) {
- log.info("Exception while opening the file");
- }
- jsonObject = (JSONObject) obj;
- String schema = null;
- try {
-
- log.info("XX debug" + VesCollectorJunitTest.schemaFile);
- schema = new JsonParser().parse(new FileReader("etc/CommonEventFormat_27.2.json"))
- .toString();
- } catch (JsonIOException | JsonSyntaxException | FileNotFoundException e) {
- // TODO Auto-generated catch block
- log.error(e.getLocalizedMessage(), e);
- }
-
- if (schema != null) {
- retValue = CommonStartup.schemavalidate(jsonObject.toString(), schema);
- }
- VesCollectorJunitTest.output = retValue;
- //return retValue;
- }
-
-
- //validating valid json reception and its posting to DMAP.
- @Test
- public void eventReception() {
-
- String testCurlCommand = "curl -i -X POST -d @C:/Users/vv770d/git/restfulcollector/src/test/resources/fujistu-3.txt --header \"Content-Type: application/json\" http://localhost:8080/eventListener/v1";
-
- //final Process terminal = curlCommand.start();
- try {
- Process process = Runtime.getRuntime().exec(testCurlCommand);
- BufferedReader stdInput = new BufferedReader(new
- InputStreamReader(process.getInputStream()));
-
- BufferedReader stdError = new BufferedReader(new
- InputStreamReader(process.getErrorStream()));
-
- // read the output from the command
-
- String str;
- while ((str = stdInput.readLine()) != null) {
- if (str.contains("HTTP/1.1 200 OK")) {
-
- //return "true";
- VesCollectorJunitTest.output = "true";
- }
- }
- } catch (IOException e) {
- // TODO Auto-generated catch block
- log.error(e.getLocalizedMessage(), e);
- }
-
- //return "false";
- }
-}
-
diff --git a/src/test/java/org/onap/dcae/vestest/TestCommonStartup.java b/src/test/java/org/onap/dcae/vestest/TestCommonStartup.java
deleted file mode 100644
index 0cf90759..00000000
--- a/src/test/java/org/onap/dcae/vestest/TestCommonStartup.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-package org.onap.dcae.vestest;
-
-import java.io.FileReader;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Map;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.dcae.commonFunction.CommonStartup;
-import org.onap.dcae.commonFunction.EventProcessor;
-import org.onap.dcae.commonFunction.CommonStartup.QueueFullException;
-import org.onap.dcae.restapi.RestfulCollectorServlet;
-
-import com.att.nsa.cmdLine.NsaCommandLineUtil;
-import com.att.nsa.drumlin.service.framework.DrumlinServlet;
-import com.att.nsa.drumlin.till.nv.rrNvReadable.loadException;
-import com.att.nsa.drumlin.till.nv.rrNvReadable.missingReqdSetting;
-import com.att.nsa.security.NsaAuthenticator;
-import com.att.nsa.security.authenticators.SimpleAuthenticator;
-import com.att.nsa.security.db.simple.NsaSimpleApiKey;
-import com.google.gson.JsonParser;
-import com.att.nsa.drumlin.till.nv.impl.nvPropertiesFile;
-import com.att.nsa.drumlin.till.nv.impl.nvReadableStack;
-import com.att.nsa.drumlin.till.nv.impl.nvReadableTable;
-
-
-public class TestCommonStartup {
-
- String payload = null;
- @Before
- public void setUp() throws Exception {
-
- // process command line arguments
- payload = new JsonParser().parse(new FileReader("src/test/resources/VES_valid.txt")).toString();
- CommonStartup.fProcessingInputQueue = new LinkedBlockingQueue<JSONObject> (CommonStartup.KDEFAULT_MAXQUEUEDEVENTS);
- }
-
- @After
- public void tearDown() throws Exception {
-
- }
-
- @Test
- public void testCommonStartupload() {
-
- String args[] = { "junittest" };
- final Map<String, String> argMap = NsaCommandLineUtil.processCmdLine(args, true);
- final String config = NsaCommandLineUtil.getSetting(argMap, "c", "collector.properties");
- final URL settingStream = DrumlinServlet.findStream(config, CommonStartup.class);
-
- final nvReadableStack settings = new nvReadableStack();
- try {
- settings.push(new nvPropertiesFile(settingStream));
- } catch (loadException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- settings.push(new nvReadableTable(argMap));
- Assert.assertEquals("true", "true");
- }
-
- @Test
- public void testhandleevent() {
- JSONArray jsonArrayMod = new JSONArray().put(new JSONObject(payload));
- try {
-
-
- CommonStartup.handleEvents (jsonArrayMod);
- } catch ( JSONException | QueueFullException | IOException e) {
- // TODO Auto-generated catch block
- //e.printStackTrace();
- System.out.println("junit reported:" + e.getMessage());
- }
- Assert.assertEquals("true", "true");
- }
-
-
-/*
- @Test
- public void testServlet() {
- try
- {
- RestfulCollectorServlet rsv = new RestfulCollectorServlet(null);
- }
- catch (NullPointerException|loadException| missingReqdSetting e){
- System.out.println("junit reported:" + e.getMessage());
- }
- Assert.assertEquals("true", "true");
- }
-*/
-
-
- @Test
- public void testEventProcessorinstantiation()
- {
- CommonStartup.streamid="fault=sec_fault|syslog=sec_syslog|heartbeat=sec_heartbeat|measurementsForVfScaling=sec_measurement|mobileFlow=sec_mobileflow|other=sec_other|stateChange=sec_statechange|thresholdCrossingAlert=sec_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling";
- EventProcessor ep = new EventProcessor ();
- Thread epThread=new Thread(ep);
- epThread.start();
- Assert.assertEquals("true", "true");
- epThread.stop();
-
- }
-
- @Test
- public void testAuthListHandler()
- {
-
- final Map<String, String> argMap = NsaCommandLineUtil.processCmdLine ( new String[0], true );
- final String config = NsaCommandLineUtil.getSetting ( argMap, "c", "collector.properties" );
- final URL settingStream = DrumlinServlet.findStream ( config, CommonStartup.class );
-
- final nvReadableStack settings = new nvReadableStack ();
- try {
- settings.push ( new nvPropertiesFile ( settingStream ) );
- settings.push ( new nvReadableTable ( argMap ) );
- } catch (loadException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
-
-
- RestfulCollectorServlet rsv = null;
- NsaAuthenticator<NsaSimpleApiKey> NsaAuth = null;
- Boolean flag = false;
- try
- {
- rsv = new RestfulCollectorServlet(settings);
- }
- catch (NullPointerException|loadException| missingReqdSetting e){
- System.out.println("junit reported:" + e.getMessage());
- }
- String authlist = "secureid,IWRjYWVSb2FkbTEyMyEt|sample1,c2FtcGxlMQ==|vdnsagg,dmRuc2FnZw==";
- NsaAuth = rsv.AuthlistHandler(authlist);
- if (NsaAuth != null)
- {
- flag = true;
- }
- Assert.assertEquals(true, flag);
-
-
- }
-}
-
-
diff --git a/src/test/java/org/onap/dcae/vestest/TestConfigProcessor.java b/src/test/java/org/onap/dcae/vestest/TestConfigProcessor.java
new file mode 100644
index 00000000..49b53d24
--- /dev/null
+++ b/src/test/java/org/onap/dcae/vestest/TestConfigProcessor.java
@@ -0,0 +1,309 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.vestest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.FileReader;
+import java.io.IOException;
+import org.json.JSONObject;
+import com.google.gson.JsonParser;
+import com.google.gson.JsonObject;
+import org.junit.Test;
+
+import org.onap.dcae.commonFunction.ConfigProcessors;
+
+
+public class TestConfigProcessor {
+
+ private JSONObject getFileAsJsonObject() {
+ JSONObject jsonObject = null;
+ FileReader fr = null;
+ final JsonParser parser = new JsonParser();
+ String jsonFilePath = "src/test/resources/event4xjson.txt";
+ try {
+ fr = new FileReader(jsonFilePath);
+ final JsonObject jo = (JsonObject) parser.parse(fr);
+ final String jsonText = jo.toString();
+ jsonObject = new JSONObject(jsonText);
+ } catch (Exception e) {
+ System.out.println("Exception while opening the file");
+ e.printStackTrace();
+ } finally {
+ //close the file
+ if (fr != null) {
+ try {
+ fr.close();
+ } catch (IOException e) {
+ System.out.println("Error closing file reader stream : " + e.toString());
+ }
+ }
+ }
+ return jsonObject;
+ }
+
+ @Test
+ public void testAttrMap() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ final String functionRole = (jsonObject.getJSONObject("event")).getJSONObject("commonEventHeader")
+ .get("functionalRole").toString();
+ System.out.println("event==" + jsonObject.toString());
+ System.out.println("functionRole==" + functionRole);
+ final JSONObject jsonArgs = new JSONObject(
+ "{\"field\": \"event.commonEventHeader.nfNamingCode\",\"oldField\": \"event.commonEventHeader.functionalRole\"}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.map(jsonArgs);
+ final String responseData = cpEvent.getEventObjectVal("event.commonEventHeader.nfNamingCode").toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals(functionRole, responseData);
+ }
+
+ @Test
+ public void testArrayMap() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ final String alarmAdditionalInformation = (jsonObject.getJSONObject("event")).getJSONObject("faultFields")
+ .get("alarmAdditionalInformation").toString();
+ System.out.println("event==" + jsonObject.toString());
+ System.out.println("alarmAdditionalInformation==" + alarmAdditionalInformation);
+ final JSONObject jsonArgs = new JSONObject(
+ "{\"field\": \"event.faultFields.eventAdditionalInformation\",\"oldField\": \"event.faultFields.alarmAdditionalInformation\"}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.map(jsonArgs);
+ final String responseData = cpEvent.getEventObjectVal("event.faultFields.eventAdditionalInformation")
+ .toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals(alarmAdditionalInformation, responseData);
+ }
+
+ @Test
+ public void testJSONObjectMapToArray() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ //final String receiveDiscards = (((jsonObject.getJSONObject("event")).getJSONObject("faultFields")).get("errors")).get("receiveDiscards").toString();
+ System.out.println("event==" + jsonObject.toString());
+ //System.out.println("alarmAdditionalInformation==" + alarmAdditionalInformation);
+ final JSONObject jsonArgs = new JSONObject(
+ "{\"field\": \"event.faultFields.vNicPerformanceArray[]\",\"oldField\": \"event.faultFields.errors\",\"attrMap\":{\"receiveDiscards\":\"receivedDiscardedPacketsAccumulated\"}}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ final String receiveDiscards = cpEvent.getEventObjectVal("event.faultFields.errors.receiveDiscards").toString();
+ System.out.println("receiveDiscards==" + receiveDiscards);
+ cpEvent.map(jsonArgs);
+ final String responseData = cpEvent
+ .getEventObjectVal("event.faultFields.vNicPerformanceArray[0].receivedDiscardedPacketsAccumulated")
+ .toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals(receiveDiscards, responseData);
+ }
+
+ @Test
+ public void testAttrAdd() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ //final String functionRole = (jsonObject.getJSONObject("event")).getJSONObject("commonEventHeader").get("functionalRole").toString();
+ System.out.println("event==" + jsonObject.toString());
+ //System.out.println("functionRole==" + functionRole);
+ final JSONObject jsonArgs = new JSONObject(
+ "{\"field\": \"event.faultFields.version\",\"value\": \"2.0\",\"fieldType\": \"number\"}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.addAttribute(jsonArgs);
+ final String responseData = cpEvent.getEventObjectVal("event.faultFields.version").toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals("2.0", responseData);
+ }
+
+ @Test
+ public void testAttrUpdate() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ //final String functionRole = (jsonObject.getJSONObject("event")).getJSONObject("commonEventHeader").get("functionalRole").toString();
+ System.out.println("event==" + jsonObject.toString());
+ //System.out.println("functionRole==" + functionRole);
+ final JSONObject jsonArgs = new JSONObject(
+ "{\"field\": \"event.faultFields.version\",\"value\": \"2.0\",\"fieldType\": \"number\"}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.updateAttribute(jsonArgs);
+ final String responseData = cpEvent.getEventObjectVal("event.faultFields.version").toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals("2.0", responseData);
+ }
+
+ @Test
+ public void testAttrConcatenate() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ final String eventType = (jsonObject.getJSONObject("event")).getJSONObject("commonEventHeader").get("eventType")
+ .toString();
+ final String domain = (jsonObject.getJSONObject("event")).getJSONObject("commonEventHeader").get("domain")
+ .toString();
+ final String alarmCondition = (jsonObject.getJSONObject("event")).getJSONObject("faultFields")
+ .get("alarmCondition").toString();
+ System.out.println("event==" + jsonObject.toString());
+ final String eventName = domain + "_" + eventType + "_" + alarmCondition;
+ System.out.println("eventName==" + eventName);
+ final JSONObject jsonArgs = new JSONObject(
+ "{\"field\":\"event.commonEventHeader.eventName\",\"concatenate\": [\"$event.commonEventHeader.domain\",\"$event.commonEventHeader.eventType\",\"$event.faultFields.alarmCondition\"],\"delimiter\":\"_\"}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.concatenateValue(jsonArgs);
+ final String responseData = cpEvent.getEventObjectVal("event.commonEventHeader.eventName").toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals(eventName, responseData);
+ }
+
+ @Test
+ public void testAttrSubtract() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ final String memoryConfigured = (jsonObject.getJSONObject("event")).getJSONObject("faultFields")
+ .get("memoryConfigured").toString();
+ final String memoryUsed = (jsonObject.getJSONObject("event")).getJSONObject("faultFields").get("memoryUsed")
+ .toString();
+ System.out.println("event==" + jsonObject.toString());
+ System.out.println("memoryConfigured==" + memoryConfigured);
+ System.out.println("memoryUsed==" + memoryUsed);
+ final JSONObject jsonArgs = new JSONObject(
+ "{\"field\": \"event.faultFields.memoryFree\",\"subtract\": [\"$event.faultFields.memoryConfigured\",\"$event.faultFields.memoryUsed\"]}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.subtractValue(jsonArgs);
+ final String responseData = cpEvent.getEventObjectVal("event.faultFields.memoryFree").toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals("1980.0", responseData);
+ }
+
+ @Test
+ public void testSetValue() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ System.out.println("event==" + jsonObject.toString());
+ System.out.println("Testing SetValue");
+ final JSONObject jsonArgs = new JSONObject(
+ "{\"field\": \"event.faultFields.version\",\"value\": \"2.0\",\"fieldType\": \"number\"}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.setValue(jsonArgs);
+ final String responseData = cpEvent.getEventObjectVal("event.faultFields.version").toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals("2.0", responseData);
+ }
+
+ @Test
+ public void testSetEventObjectVal() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ System.out.println("event==" + jsonObject.toString());
+ System.out.println("Testing SetEventObjectVal");
+ //final JSONObject jsonArgs = new JSONObject ( "{\"field\": \"event.faultFields.version\",\"value\": \"2.0\",\"fieldType\": \"number\"}" );
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.setEventObjectVal("event.faultFields.version", "2.0", "number");
+ final String responseData = cpEvent.getEventObjectVal("event.faultFields.version").toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals("2.0", responseData);
+ }
+
+ @Test
+ public void testGetValue() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ System.out.println("event==" + jsonObject.toString());
+ System.out.println("Testing GetValue");
+ final JSONObject jsonArgs = new JSONObject("{\"field\": \"event.faultFields.eventSeverity\"}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.getValue(jsonArgs);
+ final String responseData = cpEvent.getEventObjectVal("event.faultFields.eventSeverity").toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals("CRITICAL", responseData);
+ }
+
+ @Test
+ public void testGetEventObjectVal() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ System.out.println("event==" + jsonObject.toString());
+ System.out.println("Testing GetEventObjectVal");
+ //final JSONObject jsonArgs = new JSONObject ( "{\"field\": \"event.faultFields.eventSeverity\"}" );
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.getEventObjectVal("event.faultFields.eventSeverity");
+ final String responseData = cpEvent.getEventObjectVal("event.faultFields.eventSeverity").toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals("CRITICAL", responseData);
+ }
+
+ @Test
+ public void testRemoveAttribute() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ System.out.println("event==" + jsonObject.toString());
+ System.out.println("Testing removeAttribute");
+ final JSONObject jsonArgs = new JSONObject("{\"field\": \"event.faultFields.memoryUsed\"}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+ cpEvent.removeAttribute(jsonArgs);
+ final String responseData = cpEvent.getEventObjectVal("event.faultFields.memoryUsed").toString();
+ System.out.println("modified event==" + jsonObject.toString());
+ System.out.println("responseData==" + responseData);
+ assertEquals("ObjectNotFound", responseData);
+ }
+
+ @Test
+ public void testIsFilterMet() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ System.out.println("event==" + jsonObject.toString());
+ System.out.println("Testing isFilterMet");
+ final JSONObject jsonArgs = new JSONObject("{\"event.faultFields.eventSeverity\":\"CRITICAL\"}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+
+ final boolean response = cpEvent.isFilterMet(jsonArgs);
+ String responseData = "CRITICAL";
+ if (!response) {
+ responseData = "notCRITICAL";
+ }
+
+ System.out.println("responseData==" + responseData);
+ assertEquals("CRITICAL", responseData);
+ }
+
+ @Test
+ public void testSuppressEvent() {
+
+ final JSONObject jsonObject = getFileAsJsonObject();
+ System.out.println("event==" + jsonObject.toString());
+ System.out.println("Testing SuppressEvent");
+ final JSONObject jsonArgs = new JSONObject("{\"event.faultFields.eventSeverity\":\"CRITICAL\"}");
+ ConfigProcessors cpEvent = new ConfigProcessors(jsonObject);
+
+ cpEvent.suppressEvent(jsonArgs);
+ String responseData = cpEvent.getEventObjectVal("suppressEvent").toString();
+
+ System.out.println("responseData==" + responseData);
+ assertEquals("true", responseData);
+ }
+}
+
diff --git a/src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java b/src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java
deleted file mode 100644
index 1cbd6c43..00000000
--- a/src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.dcae.vestest;
-
-import static org.junit.Assert.assertEquals;
-
-import com.att.nsa.drumlin.service.standards.HttpStatusCodes;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.dcae.commonFunction.CommonStartup;
-import org.onap.dcae.commonFunction.CustomExceptionLoader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class TestCustomExceptionLoader {
-
- private static final Logger log = LoggerFactory.getLogger(TestCustomExceptionLoader.class);
- private CustomExceptionLoader cl;
-
- @Before
- public void setUp() throws Exception {
- cl = new CustomExceptionLoader();
- CommonStartup.exceptionConfig = "./etc/ExceptionConfig.json";
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
- @Test
- public void testLoad() {
- String op;
- CustomExceptionLoader.LoadMap();
- op = "dataloaded";
- assertEquals("dataloaded", op);
- }
-
- @Test
- public void testLookup() {
- String[] retarray;
-
- CommonStartup.exceptionConfig = "./etc/ExceptionConfig.json";
- CustomExceptionLoader.LoadMap();
- retarray = CustomExceptionLoader
- .LookupMap(String.valueOf(HttpStatusCodes.k401_unauthorized), "Unauthorized user");
- if (retarray == null) {
- log.info("Lookup failed");
- } else {
- assertEquals("\"POL2000\"", retarray[0]);
- }
- }
-}
-
diff --git a/src/test/java/org/onap/dcae/vestest/VesCollectorJunitTestRunner.java b/src/test/java/org/onap/dcae/vestest/TestDefaultConfiguration.java
index 04f04ec8..826d26d5 100644
--- a/src/test/java/org/onap/dcae/vestest/VesCollectorJunitTestRunner.java
+++ b/src/test/java/org/onap/dcae/vestest/TestDefaultConfiguration.java
@@ -7,9 +7,9 @@
* Licensed 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.
@@ -19,38 +19,30 @@
*/
/*
- * Purpose: CommonCollectorJunitTestRunner is the main class where test suit execution starts its
- * test cases execution the common collector test suit has been written in order to incorporate
- * functional and logical testing of collector features.
+ *
+ * Purpose: CommonCollectorJunitTest is the wrapper class to invoke all prescribed Junit test cases.
+ *
*/
package org.onap.dcae.vestest;
-import org.junit.runner.JUnitCore;
-import org.junit.runner.Result;
-import org.junit.runner.notification.Failure;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class VesCollectorJunitTestRunner {
-
- private static final Logger log = LoggerFactory.getLogger(VesCollectorJunitTestRunner.class);
-
- /**
- * Runner for test case.
- *
- * @param args command line arguments
- */
- public static void main(String[] args) {
-
- log.info("STARTING TEST SUITE EXECUTION.....");
-
- Result result = JUnitCore.runClasses(VesCollectorJunitTest.class);
-
- for (Failure failure : result.getFailures()) {
- log.info(failure.toString());
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Properties;
+import org.json.JSONObject;
+import org.junit.Test;
+
+public class TestDefaultConfiguration {
+
+ @Test
+ public void shouldDefaultCollectorSchemaFileBeAValidJson() throws IOException {
+ try (BufferedReader bufferedReader = Files.newBufferedReader(Paths.get("etc/collector.properties"))) {
+ Properties properties = new Properties();
+ properties.load(bufferedReader);
+ new JSONObject(properties.getProperty("collector.schema.file"));
}
-
- log.info("Execution Final result : " + result.wasSuccessful());
}
}
+
diff --git a/src/test/java/org/onap/dcae/vestest/TestEventProcessor.java b/src/test/java/org/onap/dcae/vestest/TestEventProcessor.java
deleted file mode 100644
index 31807dba..00000000
--- a/src/test/java/org/onap/dcae/vestest/TestEventProcessor.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-package org.onap.dcae.vestest;
-
-import static org.junit.Assert.*;
-
-
-import java.io.File;
-import java.io.FileReader;
-import java.net.URL;
-import java.util.Map;
-
-import org.json.simple.JSONObject;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.dcae.commonFunction.CommonStartup;
-import org.onap.dcae.commonFunction.EventProcessor;
-import org.onap.dcae.commonFunction.EventPublisher;
-import org.onap.dcae.controller.LoadDynamicConfig;
-import org.onap.dcae.commonFunction.DmaapPropertyReader;
-
-
-import com.google.gson.JsonParser;
-
-public class TestEventProcessor {
-
- EventProcessor ec;
- String ev= "{\"event\": {\"commonEventHeader\": { \"reportingEntityName\": \"VM name will be provided by ECOMP\", \"startEpochMicrosec\": 1477012779802988,\"lastEpochMicrosec\": 1477012789802988,\"eventId\": \"83\",\"sourceName\": \"Dummy VM name - No Metadata available\",\"sequence\": 83,\"priority\": \"Normal\",\"functionalRole\": \"vFirewall\",\"domain\": \"measurementsForVfScaling\",\"reportingEntityId\": \"VM UUID will be provided by ECOMP\",\"sourceId\": \"Dummy VM UUID - No Metadata available\",\"version\": 1.1},\"measurementsForVfScalingFields\": {\"measurementInterval\": 10,\"measurementsForVfScalingVersion\": 1.1,\"vNicUsageArray\": [{\"multicastPacketsIn\": 0,\"bytesIn\": 3896,\"unicastPacketsIn\": 0, \"multicastPacketsOut\": 0,\"broadcastPacketsOut\": 0, \"packetsOut\": 28,\"bytesOut\": 12178,\"broadcastPacketsIn\": 0,\"packetsIn\": 58,\"unicastPacketsOut\": 0,\"vNicIdentifier\": \"eth0\"}]}}}";
-
-
- @Before
- public void setUp() throws Exception {
- CommonStartup.streamid="fault=sec_fault|syslog=sec_syslog|heartbeat=sec_heartbeat|measurementsForVfScaling=sec_measurement|mobileFlow=sec_mobileflow|other=sec_other|stateChange=sec_statechange|thresholdCrossingAlert=sec_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling";
- CommonStartup.eventTransformFlag = 1;
-
-
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
- @Test
- public void testLoad() {
-
-
- EventProcessor ec = new EventProcessor();
-
- ec.event=new org.json.JSONObject(ev);
-
- ec.overrideEvent();
- //event.commonEventHeader.sourceName
- Boolean flag = ec.event.getJSONObject("event").getJSONObject("commonEventHeader").has("sourceName");
- assertEquals(true, flag);
- }
-
-
- @Test
- public void testpublisher() {
-
- DmaapPropertyReader dr;
- EventPublisher ep = null;
- String testinput = "src/test/resources/testDmaapConfig.json";
- Boolean flag = false;
- dr = new DmaapPropertyReader(testinput);
-
- //new EventPublisher("sec_fault_ueb");
- ep = EventPublisher.getInstance("sec_fault_ueb");
- //event.commonEventHeader.sourceName
-
- if (ep.equals(null))
- {
- flag = false;
- }
- else
- {
- flag = true;
- }
- assertEquals(true, flag);
- }
-
-
-}
-
diff --git a/src/test/java/org/onap/dcae/vestest/TestEventReceipt.java b/src/test/java/org/onap/dcae/vestest/TestEventReceipt.java
new file mode 100644
index 00000000..a3893eaa
--- /dev/null
+++ b/src/test/java/org/onap/dcae/vestest/TestEventReceipt.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.vestest;
+
+import static org.junit.Assert.assertEquals;
+
+import org.json.JSONObject;
+import org.junit.Test;
+import org.onap.dcae.commonFunction.CommonStartup;
+import org.onap.dcae.restapi.endpoints.EventReceipt;
+
+public class TestEventReceipt {
+
+
+ @Test
+ public void shouldGetSchemaFileLocationBasedOnVersion() {
+ CommonStartup.schemaFileJson = new JSONObject("{\"v1\":\"filePath1\", \"v5\":\"filePath2\"}");
+ String schemaFilePath = EventReceipt.schemaFileVersion("v5");
+ assertEquals(schemaFilePath, "filePath2");
+ }
+
+ @Test
+ public void shouldByDefaultReturnV5SchemaFileLocation() {
+ CommonStartup.schemaFileJson = new JSONObject("{\"v1\":\"filePath1\", \"v5\":\"filePath2\"}");
+ String schemaFilePath = EventReceipt.schemaFileVersion("v2");
+ assertEquals(schemaFilePath, "filePath2");
+ }
+
+}
diff --git a/src/test/java/org/onap/dcae/vestest/TestFetchConfig.java b/src/test/java/org/onap/dcae/vestest/TestFetchConfig.java
new file mode 100644
index 00000000..0b6b5027
--- /dev/null
+++ b/src/test/java/org/onap/dcae/vestest/TestFetchConfig.java
@@ -0,0 +1,81 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.vestest;
+
+import static org.junit.Assert.assertTrue;
+import static org.onap.dcae.vestest.TestingUtilities.createTemporaryFile;
+
+import com.google.gson.JsonObject;
+import java.nio.file.Path;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.dcae.controller.FetchDynamicConfig;
+import org.onap.dcae.controller.LoadDynamicConfig;
+
+
+public class TestFetchConfig {
+
+ private Path temporaryFile;
+
+ @Before
+ public void setUp() {
+ temporaryFile = createTemporaryFile();
+ }
+
+ @Test
+ public void shouldWriteFileAndAttachDMaaPStreamsPropertiesFromConfiguration() {
+ // given
+ FetchDynamicConfig loadDynamicConfig = new FetchDynamicConfig();
+ FetchDynamicConfig.configFile = temporaryFile.toString();
+ String sampleConfiguration = LoadDynamicConfig.readFile("src/test/resources/controller-config_singleline_ip.json");
+
+ // when
+ loadDynamicConfig.writefile(sampleConfiguration);
+
+ // then
+ JsonObject actuallyWrittenJSONContent = TestingUtilities.readJSONFromFile(temporaryFile);
+ assertTrue(actuallyWrittenJSONContent.has("streams_publishes"));
+ }
+
+ @Test
+ public void shouldThrowNoErrorsWhileParsingConsulResponse() {
+ // given
+ FetchDynamicConfig.retString = "[{\"ID\":\"81bc2a17-8cfa-3f6f-30a9-a545a9b6ac2f\",\"Node\":\"zldcrdm5bdcc2dokr00\",\"Address\":\"135.25.108.161\",\"Datacenter\":\"zldcrdm5bdcc2\",\"TaggedAddresses\":{\"lan\":\"135.25.108.161\",\"wan\":\"135.25.108.161\"},\"NodeMeta\":{\"fqdn\":\"zldcrdm5bdcc2dokr00.2f3fb3.rdm5b.tci.att.com\"},\"ServiceID\":\"20299a144716:config_binding_service:10000\",\"ServiceName\":\"config_binding_service\",\"ServiceTags\":[],\"ServiceAddress\":\"135.25.108.161\",\"ServicePort\":10000,\"ServiceEnableTagOverride\":false,\"CreateIndex\":9153156,\"ModifyIndex\":9153156}]";
+
+ // then
+ FetchDynamicConfig.getCBS();
+ }
+
+
+ @Test
+ public void shouldReturnTrueOnConfigurationChange() {
+ // given
+ FetchDynamicConfig.configFile = "src/test/resources/controller-config_singleline_ip.json";
+ FetchDynamicConfig.retCBSString = "{\"header.authflag\": \"1\", \"collector.schema.file\": \"{\\\"v1\\\": \\\"./etc/CommonEventFormat_27.2.json\\\", \\\"v2\\\": \\\"./etc/CommonEventFormat_27.2.json\\\", \\\"v3\\\": \\\"./etc/CommonEventFormat_27.2.json\\\", \\\"v4\\\": \\\"./etc/CommonEventFormat_27.2.json\\\", \\\"v5\\\": \\\"./etc/CommonEventFormat_28.4.json\\\"}\", \"collector.keystore.passwordfile\": \"/opt/app/dcae-certificate/.password\", \"tomcat.maxthreads\": \"200\", \"collector.dmaap.streamid\": \"fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling\", \"streams_subscribes\": {}, \"collector.inputQueue.maxPending\": \"8096\", \"collector.keystore.alias\": \"dynamically generated\", \"streams_publishes\": {\"ves-mobileflow\": {\"type\": \"message_router\", \"dmaap_info\": {\"client_id\": \"1517590629043\", \"client_role\": \"com.att.secCollector.member\", \"location\": \"rdm5bdcc2\", \"topic_url\": \"https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-MOBILEFLOW-OUTPUT-v1\"}, \"aaf_username\": \"userid@namespace\", \"aaf_password\": \"authpwd\"}, \"ves-measurement\": {\"type\": \"message_router\", \"dmaap_info\": {\"client_id\": \"1517590433916\", \"client_role\": \"com.att.secCollector.member\", \"location\": \"rdm5bdcc2\", \"topic_url\": \"https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-ENC-MEASUREMENT-OUTPUT-v1\"}, \"aaf_username\": \"userid@namespace\", \"aaf_password\": \"authpwd\"}, \"ves-voicequality\": {\"type\": \"message_router\", \"dmaap_info\": {\"client_id\": \"1517590778397\", \"client_role\": \"com.att.secCollector.member\", \"location\": \"rdm5bdcc2\", \"topic_url\": \"https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-VES-VOICEQUALITY-OUTPUT-v1\"}, \"aaf_username\": \"userid@namespace\", \"aaf_password\": \"authpwd\"}, \"ves-thresholdCrossingAlert\": {\"type\": \"message_router\", \"dmaap_info\": {\"client_id\": \"1517590728150\", \"client_role\": \"com.att.secCollector.member\", \"location\": \"rdm5bdcc2\", \"topic_url\": \"https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-TCA-OUTPUT-v1\"}, \"aaf_username\": \"userid@namespace\", \"aaf_password\": \"authpwd\"}, \"ves-fault\": {\"type\": \"message_router\", \"dmaap_info\": {\"client_id\": \"1517590384670\", \"client_role\": \"com.att.secCollector.member\", \"location\": \"rdm5bdcc2\", \"topic_url\": \"https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-FAULT-OUTPUT-v1\"}, \"aaf_username\": \"userid@namespace\", \"aaf_password\": \"authpwd\"}, \"ves-heartbeat\": {\"type\": \"message_router\", \"dmaap_info\": {\"client_id\": \"1517590530041\", \"client_role\": \"com.att.secCollector.member\", \"location\": \"rdm5bdcc2\", \"topic_url\": \"https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-HEARTBEAT-OUTPUT-v1\"}, \"aaf_username\": \"userid@namespace\", \"aaf_password\": \"authpwd\"}, \"ves-sipsignaling\": {\"type\": \"message_router\", \"dmaap_info\": {\"client_id\": \"1517590828736\", \"client_role\": \"com.att.secCollector.member\", \"location\": \"rdm5bdcc2\", \"topic_url\": \"https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-VES-SIPSIGNALING-OUTPUT-v1\"}, \"aaf_username\": \"userid@namespace\", \"aaf_password\": \"authpwd\"}, \"ves-syslog\": {\"type\": \"message_router\", \"dmaap_info\": {\"client_id\": \"1517590482019\", \"client_role\": \"com.att.secCollector.member\", \"location\": \"rdm5bdcc2\", \"topic_url\": \"https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-SYSLOG-OUTPUT-v1\"}, \"aaf_username\": \"userid@namespace\", \"aaf_password\": \"authpwd\"}, \"ves-other\": {\"type\": \"message_router\", \"dmaap_info\": {\"client_id\": \"1517590581045\", \"client_role\": \"com.att.secCollector.member\", \"location\": \"rdm5bdcc2\", \"topic_url\": \"https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-OTHER-OUTPUT-v1\"}, \"aaf_username\": \"userid@namespace\", \"aaf_password\": \"authpwd\"}, \"ves-statechange\": {\"type\": \"message_router\", \"dmaap_info\": {\"client_id\": \"1517590677649\", \"client_role\": \"com.att.secCollector.member\", \"location\": \"rdm5bdcc2\", \"topic_url\": \"https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-STATECHANGE-OUTPUT-v1\"}, \"aaf_username\": \"userid@namespace\", \"aaf_password\": \"authpwd\"}}, \"collector.schema.checkflag\": \"1\", \"services_calls\": {}, \"event.transform.flag\": \"1\", \"collector.keystore.file.location\": \"/opt/app/dcae-certificate/keystore.jks\", \"header.authlist\": \"sample1,c2FtcGxlMQ==|userid1,base64encodepwd1|userid2,base64encodepwd2\", \"collector.service.secure.port\": \"8443\", \"collector.service.port\": \"-1\"}";
+
+ // when
+ boolean didConfigsChange = FetchDynamicConfig.verifyConfigChange();
+
+ // then
+ assertTrue(didConfigsChange);
+ }
+
+}
+
diff --git a/src/test/java/org/onap/dcae/vestest/TestJsonSchemaValidation.java b/src/test/java/org/onap/dcae/vestest/TestJsonSchemaValidation.java
new file mode 100644
index 00000000..0489811d
--- /dev/null
+++ b/src/test/java/org/onap/dcae/vestest/TestJsonSchemaValidation.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dcae.vestest;
+
+import static java.nio.file.Files.readAllBytes;
+import static junit.framework.Assert.assertEquals;
+
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import java.io.IOException;
+import java.nio.file.Paths;
+import org.junit.Test;
+import org.onap.dcae.commonFunction.CommonStartup;
+
+public class TestJsonSchemaValidation {
+
+ @Test
+ public void shouldValidEventPassSchema_27_2() throws IOException {
+ String result = CommonStartup.validateAgainstSchema(
+ readJSONFromFile("src/test/resources/VES_valid.txt").toString(),
+ readJSONFromFile("etc/CommonEventFormat_27.2.json").toString());
+ assertEquals(result, "true");
+ }
+
+
+ @Test
+ public void shouldInvalidEventDoesNotPassSchema_27_2() throws IOException {
+ String result = CommonStartup.validateAgainstSchema(
+ readJSONFromFile("src/test/resources/VES_invalid.txt").toString(),
+ readJSONFromFile("etc/CommonEventFormat_27.2.json").toString());
+ assertEquals(result, "false");
+ }
+
+
+ private static JsonObject readJSONFromFile(String path) throws IOException {
+ return (JsonObject) new JsonParser().parse(new String(readAllBytes(Paths.get(path))));
+ }
+}
+
diff --git a/src/test/java/org/onap/dcae/vestest/TestLoadDynamicConfig.java b/src/test/java/org/onap/dcae/vestest/TestLoadDynamicConfig.java
index 902add73..03a074d7 100644
--- a/src/test/java/org/onap/dcae/vestest/TestLoadDynamicConfig.java
+++ b/src/test/java/org/onap/dcae/vestest/TestLoadDynamicConfig.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* PROJECT
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed 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.
@@ -19,54 +19,58 @@
*/
package org.onap.dcae.vestest;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.onap.dcae.vestest.TestingUtilities.createTemporaryFile;
-import java.io.File;
-import java.io.FileReader;
-import java.net.URL;
-import java.util.Map;
-
-import org.json.simple.JSONObject;
-
-import org.junit.After;
-import org.junit.Assert;
+import com.github.fge.jackson.JsonLoader;
+import com.google.gson.JsonObject;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import org.onap.dcae.controller.LoadDynamicConfig;
-import com.google.gson.JsonParser;
-
public class TestLoadDynamicConfig {
- LoadDynamicConfig lc;
- String propop = "src/test/resources/testcollector.properties";
-
- @Before
- public void setUp() throws Exception {
-
-
+ private Path temporaryFile;
+
+ @Before
+ public void setUp() {
+ temporaryFile = createTemporaryFile();
+ }
+
+ @Test
+ public void shouldReadFileContent() throws IOException {
+ // given
+ String expectedJSON = "{ \"field\" : 1 }";
+ Files.write(temporaryFile, expectedJSON.getBytes());
- }
+ // when
+ String readFileContent = LoadDynamicConfig.readFile(temporaryFile.toString());
- @After
- public void tearDown() throws Exception {
- }
+ // then
+ assertEquals(JsonLoader.fromString(expectedJSON), JsonLoader.fromString(readFileContent));
+ }
- @Test
- public void testLoad() {
+ @Test
+ public void shouldWriteFileAndAttachDMaaPRelatedPropertiesFromConfiguration() {
+ // given
+ LoadDynamicConfig loadDynamicConfig = new LoadDynamicConfig();
+ loadDynamicConfig.propFile = "src/test/resources/test_collector_ip_op.properties";
+ loadDynamicConfig.configFile = "src/test/resources/controller-config_dmaap_ip.json";
+ loadDynamicConfig.dMaaPOutputFile = temporaryFile.toString();
+ String sampleConfiguration = LoadDynamicConfig.readFile(loadDynamicConfig.configFile);
- // File file = new File(".");
- // for(String fileNames : file.list()) System.out.println(fileNames);
-
- Boolean flag=false;
- lc = new LoadDynamicConfig();
- lc.propFile = "src/test/resources/testcollector.properties";
- lc.configFile = "src/test/resources/controller-config.json";
-
- String data = LoadDynamicConfig.readFile(propop);
- assertEquals(data.isEmpty(), flag);
- }
+ // when
+ loadDynamicConfig.writeconfig(new JSONObject(sampleConfiguration));
+ // then
+ JsonObject actuallyWrittenJSONContent = TestingUtilities.readJSONFromFile(temporaryFile);
+ assertTrue(actuallyWrittenJSONContent.has("ves-fault-secondary"));
+ }
}
diff --git a/src/test/java/org/onap/dcae/vestest/TestSchemaValidation.java b/src/test/java/org/onap/dcae/vestest/TestSchemaValidation.java
deleted file mode 100644
index a34b3336..00000000
--- a/src/test/java/org/onap/dcae/vestest/TestSchemaValidation.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-package org.onap.dcae.vestest;
-
-import static org.junit.Assert.*;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.charset.StandardCharsets;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.json.simple.JSONObject;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.dcae.commonFunction.CommonStartup;
-import org.onap.dcae.restapi.endpoints.EventReceipt;
-
-import com.att.nsa.drumlin.service.framework.DrumlinServlet;
-import com.att.nsa.drumlin.service.framework.context.DrumlinRequestContext;
-import com.google.gson.JsonParser;
-
-public class TestSchemaValidation {
-
- CommonStartup cl;
- String schema = null;
- String payload = null;
- String payloadinvalid = null;
-
- @Before
- public void setUp() throws Exception {
-
- schema = new JsonParser().parse(new FileReader("etc/CommonEventFormat_27.2.json")).toString();
- payload = new JsonParser().parse(new FileReader("src/test/resources/VES_valid.txt")).toString();
- payloadinvalid = new JsonParser().parse(new FileReader("src/test/resources/VES_invalid.txt")).toString();
-
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
- @Test
- public void testsuccessfulschemavalidation() {
-
- String valresult = CommonStartup.schemavalidate(payload, schema);
- System.out.println("testsuccessfulschemavalidation:" + valresult);
- Assert.assertEquals(valresult, "true");
- }
-
- @Test
- public void testunsuccessfulschemavalidation() {
- String valresult = null;
- valresult = CommonStartup.schemavalidate(payloadinvalid, schema);
- System.out.println("testunsuccessfulschemavalidation:" + valresult);
- Assert.assertFalse(valresult.equals("true"));
-
- }
-
-
- @Test
- public void testeventReceipt() {
-
- //com.att.nsa.drumlin.service.framework.context.DrumlinRequestContext.DrumlinRequestContext(DrumlinServlet webServlet,
- //HttpServletRequest req, HttpServletResponse resp, DrumlinConnection s, Map<String, Object> objects, DrumlinRequestRouter router)
- //HttpServletRequest req = new HttpServletRequest();
- //HttpServletResponse res = new HttpServletResponse();
- DrumlinServlet webServlet = new DrumlinServlet();
- //webServlet.addToBaseContext(key, o);
- //Map<String,Object> mp = new Map<String, Object>();
- DrumlinRequestContext ctx = new DrumlinRequestContext(webServlet, null, null, null, null, null);
- EventReceipt er= new EventReceipt();
- try {
- EventReceipt.receiveVESEvent(null);
- } catch ( NullPointerException e) {
- // TODO Auto-generated catch block
-
- }
-
-
- Assert.assertEquals("true", "true");
-
- }
-
- @Test
- public void testsafeclosefr() {
-
-
- FileReader fr;
- try {
- fr = new FileReader("etc/CommonEventFormat_27.2.json");
- EventReceipt.safeClose(fr);
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- Assert.assertEquals("true", "true");
-
- }
-
- @Test
- public void testsafecloseis() {
-
- InputStream is = new ByteArrayInputStream(StandardCharsets.UTF_16.encode("randomstring").array());
- EventReceipt.safeClose(is);
- Assert.assertEquals("true", "true");
-
- }
-}
-
diff --git a/src/test/java/org/onap/dcae/vestest/TestVESLogger.java b/src/test/java/org/onap/dcae/vestest/TestVESLogger.java
new file mode 100644
index 00000000..484f7dc8
--- /dev/null
+++ b/src/test/java/org/onap/dcae/vestest/TestVESLogger.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PROJECT
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.vestest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.onap.dcae.commonFunction.VESLogger.REQUEST_ID;
+
+import com.att.nsa.logging.LoggingContext;
+import com.att.nsa.logging.log4j.EcompFields;
+import java.util.UUID;
+import org.junit.Test;
+import org.onap.dcae.commonFunction.VESLogger;
+
+public class TestVESLogger {
+
+ @Test
+ public void shouldOnLoggingContextInitializationPutRandomUUIDAsRequestID() {
+ LoggingContext commonLoggingContext = VESLogger.getCommonLoggingContext();
+ String requestId = commonLoggingContext.get(REQUEST_ID, "default");
+
+ assertNotNull(requestId);
+ assertNotSame(requestId, "default");
+
+ }
+
+ @Test
+ public void shouldOnLoggingContextInitializationPutGivenUUIDAsRequestIDAndSupplyEndTimestamp() {
+ final UUID uuid = UUID.randomUUID();
+ LoggingContext loggingContextForThread = VESLogger.getLoggingContextForThread(uuid);
+ String requestId = loggingContextForThread.get(REQUEST_ID, "default");
+ String endTimestamp = loggingContextForThread.get(EcompFields.kEndTimestamp, "default");
+
+ assertNotNull(requestId);
+ assertNotNull(endTimestamp);
+ assertNotSame(endTimestamp, "default");
+ assertEquals(requestId, uuid.toString());
+ }
+
+ @Test
+ public void shouldOnLoggingContextInitializationPutGivenUUIDAsRequestIDAndSupplyEndTimestampAndCompleteStatusCode() {
+ final UUID uuid = UUID.randomUUID();
+ LoggingContext loggingContextForThread = VESLogger.getLoggingContextForThread(uuid.toString());
+ String requestId = loggingContextForThread.get(REQUEST_ID, "default");
+ String statusCode = loggingContextForThread.get("statusCode", "default");
+ String endTimestamp = loggingContextForThread.get(EcompFields.kEndTimestamp, "default");
+
+ assertNotNull(requestId);
+ assertNotNull(endTimestamp);
+ assertNotNull(statusCode);
+ assertNotSame(endTimestamp, "default");
+ assertEquals(requestId, uuid.toString());
+ assertEquals(statusCode, "COMPLETE");
+ }
+
+}
+
diff --git a/src/test/java/org/onap/dcae/vestest/TestingUtilities.java b/src/test/java/org/onap/dcae/vestest/TestingUtilities.java
new file mode 100644
index 00000000..eff31f6d
--- /dev/null
+++ b/src/test/java/org/onap/dcae/vestest/TestingUtilities.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.onap.dcaegen2.collectors.ves
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.dcae.vestest;
+
+import static java.nio.file.Files.readAllBytes;
+
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import io.vavr.collection.HashMap;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/**
+ * @author Pawel Szalapski (pawel.szalapski@nokia.com)
+ */
+public final class TestingUtilities {
+
+ private TestingUtilities() {
+ // utility class, no objects allowed
+ }
+
+ static JsonObject readJSONFromFile(Path path) {
+ return rethrow(() -> (JsonObject) new JsonParser().parse(new String(readAllBytes(path))));
+ }
+
+ static Path createTemporaryFile() {
+ return rethrow(() -> {
+ Path temporaryDirectory = Files.createTempDirectory("temporaryDirectory");
+ Path temporaryFile = TestingUtilities.createFile(temporaryDirectory + "/testFile");
+ TestingUtilities.scheduleToBeDeletedAfterTests(temporaryDirectory);
+ TestingUtilities.scheduleToBeDeletedAfterTests(temporaryFile);
+ return temporaryFile;
+ });
+ }
+
+ public static HashMap<String, String[]> convertDMaaPStreamsPropertyToMap(String streamIdsProperty) {
+ java.util.HashMap<String, String[]> domainToStreamIdsMapping = new java.util.HashMap<>();
+ String[] topics = streamIdsProperty.split("\\|");
+ for (String t : topics) {
+ String domain = t.split("=")[0];
+ String[] streamIds = t.split("=")[1].split(",");
+ domainToStreamIdsMapping.put(domain, streamIds);
+ }
+ return HashMap.ofAll(domainToStreamIdsMapping);
+ }
+
+ private static Path createFile(String path) {
+ return rethrow(() -> Files.createFile(Paths.get(path)));
+ }
+
+ private static void scheduleToBeDeletedAfterTests(Path path) {
+ path.toFile().deleteOnExit();
+ }
+
+ /**
+ * Exception in test case usually means there is something wrong, it should never be catched, but rather thrown to
+ * be handled by JUnit framework.
+ */
+ private static <T> T rethrow(CheckedSupplier<T> supplier) {
+ try {
+ return supplier.get();
+ } catch (Exception e) {
+ throw new RuntimeException();
+ }
+ }
+
+ @FunctionalInterface
+ interface CheckedSupplier<T> {
+
+ T get() throws Exception;
+ }
+
+
+}
diff --git a/src/test/java/org/onap/dcae/vestest/VesCollectorJunitTest.java b/src/test/java/org/onap/dcae/vestest/VesCollectorJunitTest.java
deleted file mode 100644
index 88ea1926..00000000
--- a/src/test/java/org/onap/dcae/vestest/VesCollectorJunitTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * PROJECT
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-/*
- *
- * Purpose: CommonCollectorJunitTest is the wrapper class to invoke all prescribed Junit test cases.
- *
- */
-
-package org.onap.dcae.vestest;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-import org.json.JSONObject;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class VesCollectorJunitTest {
-
- private static final Logger log = LoggerFactory.getLogger(VesCollectorJunitTest.class);
-
- public static String schemaFile = "etc/CommonEventFormat_27.2.json";
- public static String output;
-
-
- String message = "true";
- InputJsonValidation messageUtil = new InputJsonValidation();
-
- @Test
- public void validJsonValidation() {
-
- output = "true";
- testHelper(new Properties());
-
- assertEquals("true", output);
- }
-
-
- @Test
- public void nonValidJsonValidation() {
- output = "false";
- testHelper(new Properties());
- //assertEquals("false",messageUtil.nonValidJsonValidation());
- assertEquals("false", output);
- }
-
- private void testHelper(Properties prop) {
- try (InputStream input = new FileInputStream("etc/collector.properties")) {
- prop.load(input);
- //schemaFile=prop.getProperty("collector.schema.file");
-
- JSONObject schemaFileJson = new JSONObject(
- prop.getProperty("collector.schema.file"));
- log.info("JSON Schemafile" + schemaFileJson);
- //schemaFile = schemaFileJson.getString("v4");
-
- log.info("Schema file location: " + schemaFile);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- log.error(e.getLocalizedMessage(), e);
- }
- }
-
- //The test case requires common collector running in the environment prior to start execution of JUNIT test cases
- /*
- @Test
- public void testValidJSONObjectReception() {
-
- assertEquals("true",messageUtil.eventReception());
- assertEquals("true",output);
- }*/
-}
-
diff --git a/src/test/resources/controller-config.json b/src/test/resources/controller-config.json
deleted file mode 100644
index c71f434d..00000000
--- a/src/test/resources/controller-config.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "services_calls": {},
- "collector.schema.checkflag": 1,
- "collector.inputQueue.maxPending": 8096,
- "collector.keystore.alias": "dynamically generated",
- "collector.schema.file": "{\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.json\"}",
- "header.authlist": "userid1,base64encodepwd1|userid2,base64encodepwd2",
- "streams_subscribes": {},
- "tomcat.maxthreads": "200",
- "collector.service.secure.port": 8443,
- "collector.dmaap.streamid": "fault=ves_fault|syslog=ves_syslog|heartbeat=ves_heartbeat|measurementsForVfScaling=ves_measurement|mobileFlow=ves_mobileflow|other=ves_other|stateChange=ves_statechange|thresholdCrossingAlert=ves_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling",
- "event.transform.flag": 0,
- "collector.keystore.file.location": "/opt/app/dcae-certificate/keystore.jks",
- "collector.keystore.passwordfile": "/opt/app/dcae-certificate/.password",
- "header.authflag": 0,
- "collector.service.port": 8080
-}
diff --git a/src/test/resources/controller-config_dmaap_ip.json b/src/test/resources/controller-config_dmaap_ip.json
new file mode 100644
index 00000000..8979a614
--- /dev/null
+++ b/src/test/resources/controller-config_dmaap_ip.json
@@ -0,0 +1,239 @@
+{
+ "header.authflag": 1,
+ "collector.inputQueue.maxPending": 8096,
+ "collector.keystore.alias": "dynamically generated",
+ "collector.schema.checkflag": 1,
+ "collector.keystore.file.location": "/opt/app/dcae-certificate/keystore.jks",
+ "tomcat.maxthreads": "200",
+ "collector.keystore.passwordfile": "/opt/app/dcae-certificate/.password",
+ "collector.service.secure.port": 8443,
+ "collector.schema.file": "{\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.json\"}",
+ "collector.dmaap.streamid": "fault=ves-fault,ves-fault-secondary|syslog=ves-syslog,ves-syslog-secondary|heartbeat=ves-heartbeat,ves-heartbeat-secondary|measurementsForVfScaling=ves-measurement,ves-measurement-secondary|mobileFlow=ves-mobileflow,ves-mobileflow-secondary|other=ves-other,ves-other-secondary|stateChange=ves-statechange,ves-statechange-secondary|thresholdCrossingAlert=ves-thresholdCrossingAlert,ves-thresholdCrossingAlert-secondary|voiceQuality=ves-voicequality,ves-voicequality-secondary|sipSignaling=ves-sipsignaling,ves-sipsignaling-secondary",
+ "streams_subscribes": {},
+ "collector.service.port": -1,
+ "services_calls": {},
+ "streams_publishes": {
+ "ves-other": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-fault": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-syslog": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-other-secondary": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-syslog-secondary": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-thresholdCrossingAlert-secondary": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-voicequality": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-sipsignaling-secondary": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-heartbeat": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-mobileflow-secondary": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-heartbeat-secondary": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-measurement-secondary": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-measurement": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-sipsignaling": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-statechange-secondary": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-voicequality-secondary": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-fault-secondary": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-statechange": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-mobileflow": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ },
+ "ves-thresholdCrossingAlert": {
+ "aaf_username": null,
+ "type": "message_router",
+ "aaf_password": null,
+ "dmaap_info": {
+ "client_id": null,
+ "location": "mtl5",
+ "client_role": null,
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ }
+ },
+ "event.transform.flag": 1,
+ "header.authlist": "sample1,c2FtcGxlMQ==|userid1,base64encodepwd1|userid2,base64encodepwd2"
+}
diff --git a/src/test/resources/controller-config_singleline_ip.json b/src/test/resources/controller-config_singleline_ip.json
new file mode 100644
index 00000000..220e3f1b
--- /dev/null
+++ b/src/test/resources/controller-config_singleline_ip.json
@@ -0,0 +1 @@
+{"header.authflag": "1", "collector.schema.file": "{\"v1\": \"./etc/CommonEventFormat_27.2.json\", \"v2\": \"./etc/CommonEventFormat_27.2.json\", \"v3\": \"./etc/CommonEventFormat_27.2.json\", \"v4\": \"./etc/CommonEventFormat_27.2.json\", \"v5\": \"./etc/CommonEventFormat_28.4.json\"}", "collector.keystore.passwordfile": "/opt/app/dcae-certificate/.password", "tomcat.maxthreads": "200", "collector.dmaap.streamid": "fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling", "streams_subscribes": {}, "collector.inputQueue.maxPending": "8096", "collector.keystore.alias": "dynamically generated", "streams_publishes": {"ves-mobileflow": {"type": "message_router", "dmaap_info": {"client_id": "1517590629043", "client_role": "com.att.secCollector.member", "location": "rdm5bdcc2", "topic_url": "https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-MOBILEFLOW-OUTPUT-v1"}, "aaf_username": "userid@namespace", "aaf_password": "authpwd"}, "ves-measurement": {"type": "message_router", "dmaap_info": {"client_id": "1517590433916", "client_role": "com.att.secCollector.member", "location": "rdm5bdcc2", "topic_url": "https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-ENC-MEASUREMENT-OUTPUT-v1"}, "aaf_username": "userid@namespace", "aaf_password": "authpwd"}, "ves-voicequality": {"type": "message_router", "dmaap_info": {"client_id": "1517590778397", "client_role": "com.att.secCollector.member", "location": "rdm5bdcc2", "topic_url": "https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-VES-VOICEQUALITY-OUTPUT-v1"}, "aaf_username": "userid@namespace", "aaf_password": "authpwd"}, "ves-thresholdCrossingAlert": {"type": "message_router", "dmaap_info": {"client_id": "1517590728150", "client_role": "com.att.secCollector.member", "location": "rdm5bdcc2", "topic_url": "https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-TCA-OUTPUT-v1"}, "aaf_username": "userid@namespace", "aaf_password": "authpwd"}, "ves-fault": {"type": "message_router", "dmaap_info": {"client_id": "1517590384670", "client_role": "com.att.secCollector.member", "location": "rdm5bdcc2", "topic_url": "https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-FAULT-OUTPUT-v1"}, "aaf_username": "userid@namespace", "aaf_password": "authpwd"}, "ves-heartbeat": {"type": "message_router", "dmaap_info": {"client_id": "1517590530041", "client_role": "com.att.secCollector.member", "location": "rdm5bdcc2", "topic_url": "https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-HEARTBEAT-OUTPUT-v1"}, "aaf_username": "userid@namespace", "aaf_password": "authpwd"}, "ves-sipsignaling": {"type": "message_router", "dmaap_info": {"client_id": "1517590828736", "client_role": "com.att.secCollector.member", "location": "rdm5bdcc2", "topic_url": "https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-VES-SIPSIGNALING-OUTPUT-v1"}, "aaf_username": "userid@namespace", "aaf_password": "authpwd"}, "ves-syslog": {"type": "message_router", "dmaap_info": {"client_id": "1517590482019", "client_role": "com.att.secCollector.member", "location": "rdm5bdcc2", "topic_url": "https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-SYSLOG-OUTPUT-v1"}, "aaf_username": "userid@namespace", "aaf_password": "authpwd"}, "ves-other": {"type": "message_router", "dmaap_info": {"client_id": "1517590581045", "client_role": "com.att.secCollector.member", "location": "rdm5bdcc2", "topic_url": "https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-OTHER-OUTPUT-v1"}, "aaf_username": "userid@namespace", "aaf_password": "authpwd"}, "ves-statechange": {"type": "message_router", "dmaap_info": {"client_id": "1517590677649", "client_role": "com.att.secCollector.member", "location": "rdm5bdcc2", "topic_url": "https://DMAAPHOST:3905/events/com.att.dcae.dmaap.FTL.24256-SEC-STATECHANGE-OUTPUT-v1"}, "aaf_username": "userid@namespace", "aaf_password": "authpwd"}}, "collector.schema.checkflag": "1", "services_calls": {}, "event.transform.flag": "1", "collector.keystore.file.location": "/opt/app/dcae-certificate/keystore.jks", "header.authlist": "sample1,c2FtcGxlMQ==|userid1,base64encodepwd1|userid2,base64encodepwd2", "collector.service.secure.port": "8443", "collector.service.port": "-1"} \ No newline at end of file
diff --git a/src/test/resources/testDmaapConfig.json b/src/test/resources/testDmaapConfig_ip.json
index 247db789..247db789 100644
--- a/src/test/resources/testDmaapConfig.json
+++ b/src/test/resources/testDmaapConfig_ip.json
diff --git a/src/test/resources/testFullDmaapConfig_gen2.json b/src/test/resources/testFullDmaapConfig_gen2.json
new file mode 100644
index 00000000..68804663
--- /dev/null
+++ b/src/test/resources/testFullDmaapConfig_gen2.json
@@ -0,0 +1,24 @@
+{
+ "ves-fault-secondary": {
+ "aaf_username": "sampleUsername",
+ "dmaap_info": {
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV",
+ "location": "mtl5",
+ "client_id": null,
+ "client_role": null
+ },
+ "type": "message_router",
+ "aaf_password": "SamplePasswd"
+ },
+ "ves-thresholdCrossingAlert-secondary": {
+ "aaf_username": "sampleUsername2",
+ "dmaap_info": {
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV",
+ "location": "mtl5",
+ "client_id": null,
+ "client_role": null
+ },
+ "type": "message_router",
+ "aaf_password": "SamplePassWD2"
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/testParseDMaaPCredentialsGen2.json b/src/test/resources/testParseDMaaPCredentialsGen2.json
new file mode 100644
index 00000000..953cb6e8
--- /dev/null
+++ b/src/test/resources/testParseDMaaPCredentialsGen2.json
@@ -0,0 +1,21 @@
+{
+ "auth-credentials-null": {
+ "aaf_username": null,
+ "dmaap_info": {
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV",
+ },
+ "aaf_password": null
+ },
+ "auth-credentials-present": {
+ "aaf_username": "sampleUser",
+ "dmaap_info": {
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV",
+ },
+ "aaf_password": "samplePassword"
+ },
+ "auth-credentials-missing": {
+ "dmaap_info": {
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV",
+ }
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/testParseDMaaPCredentialsLegacy.json b/src/test/resources/testParseDMaaPCredentialsLegacy.json
new file mode 100644
index 00000000..ca59c7e7
--- /dev/null
+++ b/src/test/resources/testParseDMaaPCredentialsLegacy.json
@@ -0,0 +1,26 @@
+{
+ "channels": [
+ {
+ "name": "auth-credentials-null",
+ "cambria.url": "127.0.0.1:3904",
+ "cambria.hosts": "uebsb91kcdc.it.att.com,uebsb92kcdc.it.att.com,uebsb93kcdc.it.att.com",
+ "cambria.topic": "DCAE-SE-COLLECTOR-EVENTS-DEV",
+ "basicAuthPassword": null,
+ "basicAuthUsername": null,
+ },
+ {
+ "name": "auth-credentials-present",
+ "cambria.url": "127.0.0.1:3904",
+ "cambria.hosts": "uebsb91kcdc.it.att.com,uebsb92kcdc.it.att.com,uebsb93kcdc.it.att.com",
+ "cambria.topic": "DCAE-SE-COLLECTOR-EVENTS-DEV",
+ "basicAuthPassword": "samplePassword",
+ "basicAuthUsername": "sampleUser",
+ },
+ {
+ "name": "auth-credentials-missing",
+ "cambria.url": "127.0.0.1:3904",
+ "cambria.hosts": "uebsb91kcdc.it.att.com,uebsb92kcdc.it.att.com,uebsb93kcdc.it.att.com",
+ "cambria.topic": "DCAE-SE-COLLECTOR-EVENTS-DEV",
+ }
+ ]
+} \ No newline at end of file
diff --git a/src/test/resources/testParseDMaaPGen2.json b/src/test/resources/testParseDMaaPGen2.json
new file mode 100644
index 00000000..5b4fe6a6
--- /dev/null
+++ b/src/test/resources/testParseDMaaPGen2.json
@@ -0,0 +1,12 @@
+{
+ "event-segments-with-port": {
+ "dmaap_info": {
+ "topic_url": "http://UEBHOST:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV",
+ }
+ },
+ "other-segments-without-ports": {
+ "dmaap_info": {
+ "topic_url": "http://UEBHOST:3904/somethingHere/DCAE-SE-COLLECTOR-EVENTS-DEV",
+ }
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/testParseDMaaPLegacy.json b/src/test/resources/testParseDMaaPLegacy.json
new file mode 100644
index 00000000..9661e30c
--- /dev/null
+++ b/src/test/resources/testParseDMaaPLegacy.json
@@ -0,0 +1,21 @@
+{
+ "channels": [
+ {
+ "name": "url-precedes-hosts",
+ "cambria.url": "127.0.0.1:3904",
+ "cambria.hosts": "h1.att.com,h2.att.com",
+ "cambria.topic": "DCAE-SE-COLLECTOR-EVENTS-DEV",
+ },
+ {
+ "name": "url-key-missing",
+ "cambria.hosts": "h1.att.com,h2.att.com",
+ "cambria.topic": "DCAE-SE-COLLECTOR-EVENTS-DEV",
+ },
+ {
+ "name": "url-is-null",
+ "cambria.url": null,
+ "cambria.hosts": "h1.att.com,h2.att.com",
+ "cambria.topic": "DCAE-SE-COLLECTOR-EVENTS-DEV"
+ }
+ ]
+} \ No newline at end of file
diff --git a/src/test/resources/test_anynode_class.json b/src/test/resources/test_anynode_class.json
new file mode 100644
index 00000000..0d349451
--- /dev/null
+++ b/src/test/resources/test_anynode_class.json
@@ -0,0 +1,9 @@
+{
+ "channels": [{
+ "one": "number1", "two": "number2", "three": "number3"}],
+ "sampleStrList": ["1", "2", "3", "4", "5"],
+ "sampleNestedObject": {"a": 1, "b": 2},
+ "sampleInt": 1,
+ "sampleString": "str",
+ "sampleNull": null
+}
diff --git a/src/test/resources/test_collector_ip_op.properties b/src/test/resources/test_collector_ip_op.properties
new file mode 100644
index 00000000..f29a2ba6
--- /dev/null
+++ b/src/test/resources/test_collector_ip_op.properties
@@ -0,0 +1,16 @@
+collector.service.port=-1
+collector.service.secure.port=8443
+collector.keystore.file.location=/opt/app/dcae-certificate/keystore.jks
+collector.keystore.passwordfile=/opt/app/dcae-certificate/.password
+collector.keystore.alias=dynamically generated
+collector.schema.checkflag=1
+collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.json\"}
+collector.dmaap.streamid=fault=ves-fault,ves-fault-secondary|syslog=ves-syslog,ves-syslog-secondary|heartbeat=ves-heartbeat,ves-heartbeat-secondary|measurementsForVfScaling=ves-measurement,ves-measurement-secondary|mobileFlow=ves-mobileflow,ves-mobileflow-secondary|other=ves-other,ves-other-secondary|stateChange=ves-statechange,ves-statechange-secondary|thresholdCrossingAlert=ves-thresholdCrossingAlert,ves-thresholdCrossingAlert-secondary|voiceQuality=ves-voicequality,ves-voicequality-secondary|sipSignaling=ves-sipsignaling,ves-sipsignaling-secondary
+collector.dmaapfile=./etc/DmaapConfig.json
+header.authflag=1
+header.authlist=sample1,c2FtcGxlMQ==|userid1,base64encodepwd1|userid2,base64encodepwd2
+event.transform.flag=1
+collector.inputQueue.maxPending = 8096
+streams_subscribes = {}
+services_calls = {}
+tomcat.maxthreads = 200
diff --git a/src/test/resources/testcollector.properties b/src/test/resources/testcollector.properties
index 6b166b04..7de53d61 100644
--- a/src/test/resources/testcollector.properties
+++ b/src/test/resources/testcollector.properties
@@ -1,75 +1,14 @@
-###############################################################################
-##
-## Collector Server config
-##
-## - Default values are shown as commented settings.
-##
-###############################################################################
-##
-## HTTP(S) service
-##
-## Normally:
-##
-## - 8080 is http service
-## - https is disabled by default (-1)
-##
-## - At this time, the server always binds to 0.0.0.0
-##
-## The default port when header.authflag is disabled (0)
-collector.service.port=9999
-
-## The secure port is required if header.authflag is set to 1 (true)
-## Authentication is only supported via secure port
-## When enabled - require valid keystore defined
-collector.service.secure.port=8443
-
-## The keystore must be setup per installation when secure port is configured
-collector.keystore.file.location=../etc/keystore
-collector.keystore.passwordfile=./etc/passwordfile
-collector.keystore.alias=tomcat
-
-
-###############################################################################
-## Processing
-##
-## If there's a problem that prevents the collector from processing alarms,
-## it's normally better to apply back pressure to the caller than to try to
-## buffer beyond a reasonable size limit. With a limit, the server won't crash
-## due to being out of memory, and the caller will get a 5xx reply saying the
-## server is in trouble.
-collector.inputQueue.maxPending=8096
-
-## Schema Validation checkflag
-## default no validation checkflag (-1)
-## If enabled (1) - schemafile location must be specified
-collector.schema.checkflag=1
-collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.json\"}
-
-## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile
-collector.dmaap.streamid=fault=sec_fault|syslog=sec_syslog|heartbeat=sec_heartbeat|measurementsForVfScaling=sec_measurement|mobileFlow=sec_mobileflow|other=sec_other|stateChange=sec_statechange|thresholdCrossingAlert=sec_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling
-collector.dmaapfile=./etc/DmaapConfig.json
-
-## Custom ExceptionConfiguration
-exceptionConfig=./etc/ExceptionConfig.json
-
-## authflag control authentication by the collector
-## If enabled (1) - then authlist has to be defined
-## When authflag is enabled, only secure port will be supported
-## To disable enter 0
-header.authflag=1
-## Combination of userid,base64 encoded pwd list to be supported
-## userid and pwd comma separated; pipe delimitation between each pair
-header.authlist=secureid,IWRjYWVSb2FkbTEyMyEt|sample1,c2FtcGxlMQ==|vdnsagg,dmRuc2FnZw==
-
-## Event transformation Flag - when set expects configurable transformation
-## defined under ./etc/eventTransform.json
-## Enabled by default; to disable set to 0
-event.transform.flag=1
-
-###############################################################################
-##
-## Tomcat control
-##
-#tomcat.maxthreads=(tomcat default, which is usually 200)
-
-
+collector.service.port=9999
+collector.service.secure.port=8443
+collector.keystore.file.location=../etc/keystore
+collector.keystore.passwordfile=./etc/passwordfile
+collector.keystore.alias=tomcat
+collector.schema.checkflag=1
+collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.json\"}
+collector.dmaap.streamid=fault=sec_fault|syslog=sec_syslog|heartbeat=sec_heartbeat|measurementsForVfScaling=sec_measurement|mobileFlow=sec_mobileflow|other=sec_other|stateChange=sec_statechange|thresholdCrossingAlert=sec_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling
+collector.dmaapfile=./etc/DmaapConfig.json
+header.authflag=1
+header.authlist=secureid,IWRjYWVSb2FkbTEyMyEt|sample1,c2FtcGxlMQ==
+event.transform.flag=1
+
+
diff --git a/swagger_vescollector.yaml b/swagger_vescollector.yaml
index 0c8a5b53..7e27fad6 100644
--- a/swagger_vescollector.yaml
+++ b/swagger_vescollector.yaml
@@ -1,6 +1,23 @@
+# ================================================================================
+# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed 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.
+# ============LICENSE_END=========================================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
swagger: '2.0'
info:
- version: 1.1.0
+ version: 1.2.0
title: VES Collector
description: >
Virtual Event Streaming (VES) Collector is RESTful collector for processing
diff --git a/version.properties b/version.properties
index 300ac3f5..7d6815b1 100644
--- a/version.properties
+++ b/version.properties
@@ -1,6 +1,6 @@
major=1
-minor=1
-patch=4
+minor=3
+patch=0
base_version=${major}.${minor}.${patch}
release_version=${base_version}
snapshot_version=${base_version}-SNAPSHOT