From 6ea2e1bb9f7ee330f04fe8e28fd94fbf398a06ec Mon Sep 17 00:00:00 2001 From: Chenfei Gao Date: Thu, 31 Jan 2019 16:09:09 -0500 Subject: Add changes to basic structure of api component Includes: 1) Changed logging from FlexLogger to slf4j and used the logback.xml aligned with v1.2 logging requirements. 2) Added https as a configurable parameter of api rest server. 3) Added aaf as a condfigurable parameter of api rest server. 4) Added AafFilter classes for healthcheck and statistics. 5) Added api statistics REST entry point. 6) Created related junit tests. 7) Packaged docker Issue-ID: POLICY-1270 Change-Id: I638f61361bb052545e8597531ba3d58019bf1f24 Signed-off-by: Chenfei Gao --- packages/policy-api-tarball/pom.xml | 65 ++++++++ .../src/main/package/tarball/assembly.xml | 62 ++++++++ .../src/main/resources/etc/defaultConfig.json | 11 ++ .../src/main/resources/etc/logback.xml | 166 +++++++++++++++++++++ .../src/main/resources/etc/s3pConfig.json | 11 ++ .../src/main/resources/etc/ssl/policy-keystore | Bin 0 -> 4311 bytes .../src/main/resources/etc/ssl/policy-truststore | Bin 0 -> 124180 bytes 7 files changed, 315 insertions(+) create mode 100644 packages/policy-api-tarball/pom.xml create mode 100644 packages/policy-api-tarball/src/main/package/tarball/assembly.xml create mode 100644 packages/policy-api-tarball/src/main/resources/etc/defaultConfig.json create mode 100644 packages/policy-api-tarball/src/main/resources/etc/logback.xml create mode 100644 packages/policy-api-tarball/src/main/resources/etc/s3pConfig.json create mode 100644 packages/policy-api-tarball/src/main/resources/etc/ssl/policy-keystore create mode 100644 packages/policy-api-tarball/src/main/resources/etc/ssl/policy-truststore (limited to 'packages/policy-api-tarball') diff --git a/packages/policy-api-tarball/pom.xml b/packages/policy-api-tarball/pom.xml new file mode 100644 index 00000000..cdb68c24 --- /dev/null +++ b/packages/policy-api-tarball/pom.xml @@ -0,0 +1,65 @@ + + + + 4.0.0 + + org.onap.policy.api + packages + 2.0.0-SNAPSHOT + + + policy-api-tarball + ${project.artifactId} + [${project.parent.artifactId}] + + + + org.onap.policy.api + main + ${project.version} + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + generate-complete-tar + package + + single + + + + src/main/package/tarball/assembly.xml + + ${project.artifactId}-${project.version} + + + + + + + diff --git a/packages/policy-api-tarball/src/main/package/tarball/assembly.xml b/packages/policy-api-tarball/src/main/package/tarball/assembly.xml new file mode 100644 index 00000000..e08be24d --- /dev/null +++ b/packages/policy-api-tarball/src/main/package/tarball/assembly.xml @@ -0,0 +1,62 @@ + + + + tarball + + tar.gz + + false + + + true + /lib + false + runtime + + *:jar + + + + + + ${project.basedir}/src/main/resources/etc + + + *.json + *.xml + + /etc + unix + + *.formatted + + + + ${project.basedir}/src/main/resources/etc/ssl + + + policy* + + /etc/ssl + keep + + + diff --git a/packages/policy-api-tarball/src/main/resources/etc/defaultConfig.json b/packages/policy-api-tarball/src/main/resources/etc/defaultConfig.json new file mode 100644 index 00000000..f7aaf393 --- /dev/null +++ b/packages/policy-api-tarball/src/main/resources/etc/defaultConfig.json @@ -0,0 +1,11 @@ +{ + "name": "ApiGroup", + "restServerParameters": { + "host": "0.0.0.0", + "port": 6969, + "userName": "healthcheck", + "password": "zb!XztG34", + "https": true, + "aaf": false + } +} diff --git a/packages/policy-api-tarball/src/main/resources/etc/logback.xml b/packages/policy-api-tarball/src/main/resources/etc/logback.xml new file mode 100644 index 00000000..234695ee --- /dev/null +++ b/packages/policy-api-tarball/src/main/resources/etc/logback.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + ${logDir}/${errorLog}.log + + ${logDir}/${errorLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + WARN + + + ${errorPattern} + + + + + + + + + ${logDir}/${debugLog}.log + + ${logDir}/${debugLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + ${debugPattern} + + + + + + + + + ${logDir}/${networkLog}.log + + ${logDir}/${networkLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + ${networkPattern} + + + + + + + + + ${logDir}/${metricLog}.log + + ${logDir}/${metricLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + ${metricPattern} + + + + + + + + + ${logDir}/${transactionLog}.log + + ${logDir}/${transactionLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + ${transactionPattern} + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/policy-api-tarball/src/main/resources/etc/s3pConfig.json b/packages/policy-api-tarball/src/main/resources/etc/s3pConfig.json new file mode 100644 index 00000000..6df43f77 --- /dev/null +++ b/packages/policy-api-tarball/src/main/resources/etc/s3pConfig.json @@ -0,0 +1,11 @@ +{ + "name": "ApiGroup", + "restServerParameters": { + "host": "0.0.0.0", + "port": 6969, + "userName": "healthcheck", + "password": "zb!XztG34", + "https": true, + "aaf": false + } +} \ No newline at end of file diff --git a/packages/policy-api-tarball/src/main/resources/etc/ssl/policy-keystore b/packages/policy-api-tarball/src/main/resources/etc/ssl/policy-keystore new file mode 100644 index 00000000..7d2b1ecc Binary files /dev/null and b/packages/policy-api-tarball/src/main/resources/etc/ssl/policy-keystore differ diff --git a/packages/policy-api-tarball/src/main/resources/etc/ssl/policy-truststore b/packages/policy-api-tarball/src/main/resources/etc/ssl/policy-truststore new file mode 100644 index 00000000..8834ac25 Binary files /dev/null and b/packages/policy-api-tarball/src/main/resources/etc/ssl/policy-truststore differ -- cgit 1.2.3-korg