diff options
author | k.kedron <k.kedron@partner.samsung.com> | 2021-03-17 09:09:29 +0100 |
---|---|---|
committer | k.kedron <k.kedron@partner.samsung.com> | 2021-03-23 13:55:07 +0100 |
commit | 431dd5721e7c37170c254836f4566e48a0cc1837 (patch) | |
tree | 35b6d50fdf81d2bcab54762cefc80032bb872d43 /src/main/resources | |
parent | 24459b83d85ac601c59c819384259d34289f87ea (diff) |
Initial code check-in for A1 Policy Enforcement Simulator
Issue-ID: INT-1887
Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com>
Change-Id: I643dadac5386bf21eaa108435c83b69706b0bc1c
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/application-dev.properties | 17 | ||||
-rw-r--r-- | src/main/resources/application.properties | 41 | ||||
-rw-r--r-- | src/main/resources/failurePmVes.json | 41 | ||||
-rw-r--r-- | src/main/resources/logback-spring.xml | 115 | ||||
-rw-r--r-- | src/main/resources/pmVes.json | 41 |
5 files changed, 255 insertions, 0 deletions
diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties new file mode 100644 index 0000000..d8e142d --- /dev/null +++ b/src/main/resources/application-dev.properties @@ -0,0 +1,17 @@ +# +# Copyright (C) 2021 Samsung Electronics +# 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 +# + +vnf.config.file=src/test/resources/vnf.config + +topology.cell.config.file=src/test/resources/cells.json +topology.ue.config.file=src/test/resources/ue.json
\ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..b1f3a97 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,41 @@ +# +# Copyright (C) 2021 Samsung Electronics +# 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 +# + +server.port=9998 +vnf.config.file=/var/a1pesim/vnf.config +ves.collector.protocol=https +ves.collector.endpoint=/eventListener/v7 +ves.pm.maxPoolSize=10 +ves.defaultInterval=10 +ves.defaultFailureDuration=120 + +ves.failing.throughput=1 +ves.failing.latency=500 +# in sec +ves.failing.checkout.delay=15 + +topology.cell.range=5 +topology.cell.config.file=/var/a1pesim/cells.json +topology.ue.config.file=/var/a1pesim/ue.json + +spring.cache.cache-names=vnfConfig,pmVes,failurePmVes +spring.cache.caffeine.spec=maximumSize=10,expireAfterAccess=900s + +spring.mvc.view.prefix: / +spring.mvc.view.suffix: .jsp + +logging.config=classpath:logback-spring.xml + +refresher.fixed.rate.ms=60000 + +restapi.version=v1
\ No newline at end of file diff --git a/src/main/resources/failurePmVes.json b/src/main/resources/failurePmVes.json new file mode 100644 index 0000000..1fdcdd3 --- /dev/null +++ b/src/main/resources/failurePmVes.json @@ -0,0 +1,41 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "domain": "measurement", + "eventName": "Measurement_vIsbcMmc", + "eventId": "measurement0000259", + "sequence": 3, + "priority": "Normal", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "ibcx0001vm002ssc001", + "nfVendorName": "Samsung", + "nfNamingCode": "ibcx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "measurementFields": { + "additionalMeasurements": [ + { + "name": "latency", + "hashMap": { + "value": "[[200->500]]" + } + }, + { + "name": "throughput", + "hashMap": { + "value": "[[10->1]]" + } + } + ], + "measurementInterval": 5, + "measurementFieldsVersion": "4.0" + } + } +} diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..f03b9bd --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Copyright (C) 2021 Samsung Electronics + ~ 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 + --> + +<configuration> + + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <layout class="ch.qos.logback.classic.PatternLayout"> + <Pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n</Pattern> + </layout> + </appender> + + <springProfile name="!dev"> + + <property name="LOG_DIR" value="${user.home}/log/${proc.name}"/> + + <appender name="A1-PE-SIMULATOR-METRICS" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <filter class="ch.qos.logback.classic.filter.LevelFilter"> + <level>INFO</level> + <onMatch>ACCEPT</onMatch> + <onMismatch>DENY</onMismatch> + </filter> + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${LOG_DIR}/application/metrics-%d{yyyy-MM-dd}.%i.log.gz + </fileNamePattern> + <maxFileSize>30MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>1GB</totalSizeCap> + </rollingPolicy> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00}|NULL|%-5level:%class{36}:%M:%L: %m%n + </pattern> + </layout> + </appender> + + <appender name="A1-PE-SIMULATOR-DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <filter class="ch.qos.logback.classic.filter.LevelFilter"> + <level>DEBUG</level> + <onMatch>ACCEPT</onMatch> + <onMismatch>DENY</onMismatch> + </filter> + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${LOG_DIR}/application/debug-%d{yyyy-MM-dd}.%i.log.gz + </fileNamePattern> + <maxFileSize>30MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>1GB</totalSizeCap> + </rollingPolicy> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00}|NULL|%-5level:%class{36}:%M:%L: %m%n + </pattern> + </layout> + </appender> + + <appender name="A1-PE-SIMULATOR-ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <filter class="ch.qos.logback.classic.filter.LevelFilter"> + <level>ERROR</level> + <onMatch>ACCEPT</onMatch> + <onMismatch>DENY</onMismatch> + </filter> + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${LOG_DIR}/application/error-%d{yyyy-MM-dd}.%i.log.gz + </fileNamePattern> + <maxFileSize>30MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>1GB</totalSizeCap> + </rollingPolicy> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00}|NULL|%-5level:%class{36}:%M:%L: %m%n + </pattern> + </layout> + </appender> + + <appender name="debugAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${LOG_DIR}/debug-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern> + <maxFileSize>30MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>1GB</totalSizeCap> + </rollingPolicy> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00}|NULL|%-5level:%class{36}:%M:%L: %m%n + </pattern> + </layout> + </appender> + + <logger name="org.onap.a1pesimulator" level="debug" additivity="false"> + <appender-ref ref="A1-PE-SIMULATOR-DEBUG"/> + <appender-ref ref="A1-PE-SIMULATOR-METRICS"/> + <appender-ref ref="A1-PE-SIMULATOR-ERROR"/> + </logger> + + <root level="INFO"> + <appender-ref ref="debugAppender"/> + </root> + + </springProfile> + + <springProfile name="dev"> + <root level="INFO"> + <appender-ref ref="STDOUT"/> + </root> + </springProfile> + +</configuration> diff --git a/src/main/resources/pmVes.json b/src/main/resources/pmVes.json new file mode 100644 index 0000000..9c4f717 --- /dev/null +++ b/src/main/resources/pmVes.json @@ -0,0 +1,41 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "domain": "measurement", + "eventName": "Measurement_vIsbcMmc", + "eventId": "measurement0000259", + "sequence": 3, + "priority": "Normal", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "ibcx0001vm002ssc001", + "nfVendorName": "Samsung", + "nfNamingCode": "ibcx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "measurementFields": { + "additionalMeasurements": [ + { + "name": "latency", + "hashMap": { + "value": "[[10-150]]" + } + }, + { + "name": "throughput", + "hashMap": { + "value": "[[10-100]]" + } + } + ], + "measurementInterval": 5, + "measurementFieldsVersion": "4.0" + } + } +} |