Updating config variable names for HttpClient
[cps.git] / cps-application / src / main / resources / application.yml
1 #  ============LICENSE_START=======================================================
2 #  Copyright (C) 2021 Pantheon.tech
3 #  Modifications Copyright (C) 2021-2022 Bell Canada
4 #  Modifications Copyright (C) 2021-2023 Nordix Foundation
5 #  ================================================================================
6 #  Licensed under the Apache License, Version 2.0 (the "License");
7 #  you may not use this file except in compliance with the License.
8 #  You may obtain a copy of the License at
9 #
10 #        http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #  Unless required by applicable law or agreed to in writing, software
13 #  distributed under the License is distributed on an "AS IS" BASIS,
14 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #  See the License for the specific language governing permissions and
16 #  limitations under the License.
17 #
18 #  SPDX-License-Identifier: Apache-2.0
19 #  ============LICENSE_END=========================================================
20
21 server:
22     port: 8080
23
24 rest:
25     api:
26         cps-base-path: /cps/api
27         ncmp-base-path: /ncmp
28         ncmp-inventory-base-path: /ncmpInventory
29
30 spring:
31     main:
32         banner-mode: "off"
33     application:
34         name: "cps-application"
35     jpa:
36         show-sql: false
37         ddl-auto: create
38         open-in-view: false
39         properties:
40             hibernate.enable_lazy_load_no_trans: true
41             hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
42
43     datasource:
44         url: jdbc:postgresql://${DB_HOST}:${DB_PORT:5432}/cpsdb
45         username: ${DB_USERNAME}
46         password: ${DB_PASSWORD}
47         driverClassName: org.postgresql.Driver
48         hikari:
49             minimumIdle: 5
50             maximumPoolSize: 80
51             idleTimeout: 60000
52             connectionTimeout: 120000
53             leakDetectionThreshold: 30000
54             pool-name: CpsDatabasePool
55
56     cache:
57         type: caffeine
58         cache-names: yangSchema
59         caffeine:
60             spec: maximumSize=10000,expireAfterAccess=10m
61
62     liquibase:
63         change-log: classpath:changelog/changelog-master.yaml
64         labels: ${LIQUIBASE_LABELS}
65
66     servlet:
67         multipart:
68             enabled: true
69             max-file-size: 100MB
70             max-request-size: 100MB
71
72     kafka:
73         bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVER:localhost:9092}
74         security:
75             protocol: PLAINTEXT
76         producer:
77             value-serializer: io.cloudevents.kafka.CloudEventSerializer
78             client-id: cps-core
79         consumer:
80             group-id: ${NCMP_CONSUMER_GROUP_ID:ncmp-group}
81             key-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
82             value-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
83             properties:
84                 spring.deserializer.key.delegate.class: org.apache.kafka.common.serialization.StringDeserializer
85                 spring.deserializer.value.delegate.class: io.cloudevents.kafka.CloudEventDeserializer
86                 spring.json.use.type.headers: false
87
88     jackson:
89         default-property-inclusion: NON_NULL
90         serialization:
91             FAIL_ON_EMPTY_BEANS: false
92     sql:
93         init:
94             mode: ALWAYS
95 app:
96     ncmp:
97         async-m2m:
98             topic: ${NCMP_ASYNC_M2M_TOPIC:ncmp-async-m2m}
99         avc:
100             subscription-topic: ${NCMP_CM_AVC_SUBSCRIPTION:subscription}
101             subscription-forward-topic-prefix: ${NCMP_FORWARD_CM_AVC_SUBSCRIPTION:ncmp-dmi-cm-avc-subscription-}
102             subscription-response-topic: ${NCMP_RESPONSE_CM_AVC_SUBSCRIPTION:dmi-ncmp-cm-avc-subscription}
103             subscription-outcome-topic: ${NCMP_OUTCOME_CM_AVC_SUBSCRIPTION:subscription-response}
104             cm-events-topic: ${NCMP_CM_EVENTS_TOPIC:cm-events}
105     lcm:
106         events:
107             topic: ${LCM_EVENTS_TOPIC:ncmp-events}
108     dmi:
109         cm-events:
110             topic: ${DMI_CM_EVENTS_TOPIC:dmi-cm-events}
111         device-heartbeat:
112             topic: ${DMI_DEVICE_HEARTBEAT_TOPIC:dmi-device-heartbeat}
113
114
115 notification:
116     enabled: true
117     async:
118         executor:
119             core-pool-size: 2
120             max-pool-size: 10
121             queue-capacity: 500
122             wait-for-tasks-to-complete-on-shutdown: true
123             thread-name-prefix: Async-
124             time-out-value-in-ms: 2000
125
126 springdoc:
127     swagger-ui:
128         disable-swagger-default-url: true
129         urlsPrimaryName: cps-core
130         urls:
131             - name: cps-core
132               url: /api-docs/cps-core/openapi.yaml
133             - name: cps-ncmp
134               url: /api-docs/cps-ncmp/openapi.yaml
135             - name: cps-ncmp-inventory
136               url: /api-docs/cps-ncmp/openapi-inventory.yaml
137
138
139
140 security:
141     # comma-separated uri patterns which do not require authorization
142     permit-uri: /actuator/**,/swagger-ui.html,/swagger-ui/**,/swagger-resources/**,/api-docs/**
143     auth:
144         username: ${CPS_USERNAME}
145         password: ${CPS_PASSWORD}
146
147 # Actuator
148 management:
149     endpoints:
150         web:
151             exposure:
152                 include: info,health,loggers,prometheus
153     endpoint:
154         health:
155             show-details: always
156             # kubernetes probes: liveness and readiness
157             probes:
158                 enabled: true
159
160 logging:
161     format: json
162     level:
163         org:
164             springframework: INFO
165             onap:
166                 cps: INFO
167 ncmp:
168     dmi:
169         httpclient:
170             connectionTimeoutInSeconds: 180
171             maximumConnectionsPerRoute: 50
172             maximumConnectionsTotal: 100
173             idleConnectionEvictionThresholdInSeconds: 5
174         auth:
175             username: ${DMI_USERNAME}
176             password: ${DMI_PASSWORD}
177             enabled: ${DMI_AUTH_ENABLED:true}
178         api:
179             base-path: dmi
180
181     timers:
182         advised-modules-sync:
183             sleep-time-ms: 5000
184         locked-modules-sync:
185             sleep-time-ms: 300000
186         cm-handle-data-sync:
187             sleep-time-ms: 30000
188         subscription-forwarding:
189             dmi-response-timeout-ms: 30000
190         model-loader:
191             retry-time-ms: 1000
192         trust-level:
193             dmi-availability-watchdog-ms: 30000
194
195     modules-sync-watchdog:
196         async-executor:
197             parallelism-level: 10
198
199     model-loader:
200         subscription: true
201         maximum-attempt-count: 20
202
203 # Custom Hazelcast Config.
204 hazelcast:
205     cluster-name: ${CPS_NCMP_CACHES_CLUSTER_NAME:"cps-and-ncmp-common-cache-cluster"}
206     mode:
207         kubernetes:
208             enabled: ${HAZELCAST_MODE_KUBERNETES_ENABLED:false}
209             service-name: ${CPS_NCMP_SERVICE_NAME:"cps-and-ncmp-service"}