aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/config.json42
-rw-r--r--src/main/resources/config.yml96
-rw-r--r--src/main/resources/logback.xml34
3 files changed, 172 insertions, 0 deletions
diff --git a/src/main/resources/config.json b/src/main/resources/config.json
new file mode 100644
index 0000000..436a181
--- /dev/null
+++ b/src/main/resources/config.json
@@ -0,0 +1,42 @@
+{
+ "database": {
+ "driverClass": "org.postgresql.Driver",
+ "user": "postgres",
+ "password": "test123",
+ "url": "jdbc:postgresql://127.0.0.1:5432/dcae_inv",
+ "properties": {
+ "charSet": "UTF-8"
+ },
+ "maxWaitForConnection": "1s",
+ "validationQuery": "/* MyService Health Check */ SELECT 1",
+ "minSize": 2,
+ "maxSize": 8,
+ "initialSize": 2,
+ "checkConnectionWhileIdle": false,
+ "evictionInterval": "10s",
+ "minIdleTime": "1 minute"
+ },
+ "dcaeControllerConnection": {
+ "host": "dcae-controller-hostname",
+ "port": 9998,
+ "basePath": "resources",
+ "user": null,
+ "password": null,
+ "required": false
+ },
+ "databusControllerConnection": {
+ "host": "databus-controller-hostname",
+ "port": 8443,
+ "mechId": null,
+ "password": null,
+ "required": false
+ },
+ "httpClient": {
+ "minThreads": 1,
+ "maxThreads": 128,
+ "gzipEnabled": false,
+ "gzipEnabledForRequests": false,
+ "timeout": "5000milliseconds",
+ "connectionTimeout": "5000milliseconds"
+ }
+}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
new file mode 100644
index 0000000..505eea5
--- /dev/null
+++ b/src/main/resources/config.yml
@@ -0,0 +1,96 @@
+# The database config was lifted from https://dropwizard.github.io/dropwizard/0.7.1/docs/manual/jdbi.html
+database:
+ # the name of your JDBC driver
+ driverClass: org.postgresql.Driver
+
+ # the username
+ user: postgres
+
+ # the password
+ password: test123
+
+ # the JDBC URL
+ # TODO: Probably want to programmatically set the database name.
+ url: jdbc:postgresql://127.0.0.1:5432/dcae_inv
+
+ # any properties specific to your JDBC driver:
+ properties:
+ charSet: UTF-8
+
+ # the maximum amount of time to wait on an empty pool before throwing an exception
+ maxWaitForConnection: 1s
+
+ # the SQL query to run when validating a connection's liveness
+ validationQuery: "/* MyService Health Check */ SELECT 1"
+
+ # the minimum number of connections to keep open
+ minSize: 2
+
+ # the maximum number of connections to keep open
+ maxSize: 8
+
+ initialSize: 2
+
+ # whether or not idle connections should be validated
+ checkConnectionWhileIdle: false
+
+ # the amount of time to sleep between runs of the idle connection validation, abandoned cleaner and idle pool resizing
+ evictionInterval: 10s
+
+ # the minimum amount of time an connection must sit idle in the pool before it is eligible for eviction
+ minIdleTime: 1 minute
+
+dcaeControllerConnection:
+ host: dcae-controller-hostname
+ port: 9998
+ # Apparently this is variable parameter amongst DCAE controller instances
+ basePath: resources
+ user:
+ password:
+
+databusControllerConnection:
+ host: databus-controller-hostname
+ port: 8443
+ mechId:
+ password:
+
+httpClient:
+ # The minimum number of threads to use for asynchronous calls.
+ minThreads: 1
+
+ # The maximum number of threads to use for asynchronous calls.
+ maxThreads: 128
+
+ # If true, the client will automatically decode response entities
+ # with gzip content encoding.
+ gzipEnabled: false
+
+ # If true, the client will encode request entities with gzip
+ # content encoding. (Requires gzipEnabled to be true).
+ gzipEnabledForRequests: false
+
+ # Requests to databus controller were timing out so I bumped it up 4x of default
+ timeout: 5000milliseconds
+ connectionTimeout: 5000milliseconds
+
+server:
+ # requestLog is for those messages you see right when the service handles HTTP requests
+ requestLog:
+ appenders:
+ - type: file
+ currentLogFilename: /opt/logs/DCAE/inventory/audit.log
+ archive: true
+ archivedLogFilenamePattern: /opt/logs/DCAE/inventory/audit-%d.log.gz
+ archivedFileCount: 10
+ - type: console
+
+# Rolling is c.q.l.core.rolling.TimeBasedRollingPolicy
+logging:
+ level: INFO
+ appenders:
+ - type: file
+ currentLogFilename: /opt/logs/DCAE/inventory/audit.log
+ archive: true
+ archivedLogFilenamePattern: /opt/logs/DCAE/inventory/audit-%d.log.gz
+ archivedFileCount: 10
+ - type: console
diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml
new file mode 100644
index 0000000..aa16762
--- /dev/null
+++ b/src/main/resources/logback.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ dcae-inventory
+ ================================================================================
+ 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=========================================================
+ -->
+
+<configuration>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
+ </layout>
+ </appender>
+
+ <logger name="com" level="INFO"/>
+
+ <root level="debug">
+ <appender-ref ref="STDOUT" />
+ </root>
+</configuration>