Merge "Fix: Update OpenSSF Scorecard to RelEng reusable"
[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) 2024 TechMahindra Ltd
5 #  Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
6 #  ================================================================================
7 #  Licensed under the Apache License, Version 2.0 (the "License");
8 #  you may not use this file except in compliance with the License.
9 #  You may obtain a copy of the License at
10 #
11 #        http://www.apache.org/licenses/LICENSE-2.0
12 #
13 #  Unless required by applicable law or agreed to in writing, software
14 #  distributed under the License is distributed on an "AS IS" BASIS,
15 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 #  See the License for the specific language governing permissions and
17 #  limitations under the License.
18 #
19 #  SPDX-License-Identifier: Apache-2.0
20 #  ============LICENSE_END=========================================================
21
22 server:
23     port: 8080
24
25 rest:
26     api:
27         cps-base-path: /cps/api
28         ncmp-base-path: /ncmp
29         ncmp-inventory-base-path: /ncmpInventory
30
31 spring:
32     main:
33         banner-mode: "off"
34     application:
35         name: "cps-application"
36     jpa:
37         show-sql: false
38         ddl-auto: create
39         open-in-view: false
40         properties:
41             hibernate.enable_lazy_load_no_trans: true
42             hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
43             # Please ensure these values match those used in integration-test/src/test/resources/application.yml
44             hibernate.id.new_generator_mappings: true
45             hibernate.jdbc.batch_size: 100
46
47     datasource:
48         url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/cpsdb
49         username: ${DB_USERNAME}
50         password: ${DB_PASSWORD}
51         driverClassName: org.postgresql.Driver
52         hikari:
53             minimumIdle: 5
54             maximumPoolSize: 80
55             idleTimeout: 60000
56             connectionTimeout: 30000
57             leakDetectionThreshold: 30000
58             pool-name: CpsDatabasePool
59
60     cache:
61         type: caffeine
62         cache-names: yangSchema
63         caffeine:
64             spec: maximumSize=10000,expireAfterAccess=10m
65
66     liquibase:
67         change-log: classpath:changelog/changelog-master.yaml
68         label-filter: ${LIQUIBASE_LABELS}
69
70     servlet:
71         multipart:
72             enabled: true
73             max-file-size: 100MB
74             max-request-size: 100MB
75
76     kafka:
77         bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVER:localhost:9092}
78         security:
79             protocol: PLAINTEXT
80         producer:
81             value-serializer: io.cloudevents.kafka.CloudEventSerializer
82             client-id: cps-core
83         consumer:
84             group-id: ${NCMP_CONSUMER_GROUP_ID:ncmp-group}
85             key-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
86             value-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
87             properties:
88                 spring.deserializer.key.delegate.class: org.apache.kafka.common.serialization.StringDeserializer
89                 spring.deserializer.value.delegate.class: io.cloudevents.kafka.CloudEventDeserializer
90                 spring.json.use.type.headers: false
91
92     jackson:
93         default-property-inclusion: NON_NULL
94         serialization:
95             FAIL_ON_EMPTY_BEANS: false
96     sql:
97         init:
98             mode: ALWAYS
99 app:
100     ncmp:
101         async-m2m:
102             topic: ${NCMP_ASYNC_M2M_TOPIC:ncmp-async-m2m}
103         avc:
104             cm-subscription-ncmp-in: ${CM_SUBSCRIPTION_NCMP_IN_TOPIC:subscription}
105             cm-subscription-dmi-in: ${CM_SUBSCRIPTION_DMI_IN_TOPIC:ncmp-dmi-cm-avc-subscription}
106             cm-subscription-dmi-out: ${CM_SUBSCRIPTION_DMI_OUT_TOPIC:dmi-ncmp-cm-avc-subscription}
107             cm-subscription-ncmp-out: ${CM_SUBSCRIPTION_NCMP_OUT_TOPIC:subscription-response}
108             cm-events-topic: ${NCMP_CM_EVENTS_TOPIC:cm-events}
109             inventory-events-topic: ncmp-inventory-events
110     lcm:
111         events:
112             topic: ${LCM_EVENTS_TOPIC:ncmp-events}
113     dmi:
114         cm-events:
115             topic: ${DMI_CM_EVENTS_TOPIC:dmi-cm-events}
116         device-heartbeat:
117             topic: ${DMI_DEVICE_HEARTBEAT_TOPIC:dmi-device-heartbeat}
118     cps:
119         data-updated:
120             change-event-notifications-enabled: ${CPS_CHANGE_EVENT_NOTIFICATIONS_ENABLED:false}
121             topic: ${CPS_CHANGE_EVENT_TOPIC:cps-data-updated-events}
122
123 notification:
124     enabled: true
125     async:
126         executor:
127             core-pool-size: 2
128             max-pool-size: 10
129             queue-capacity: 500
130             wait-for-tasks-to-complete-on-shutdown: true
131             thread-name-prefix: Async-
132             time-out-value-in-ms: 60000
133
134 springdoc:
135     swagger-ui:
136         disable-swagger-default-url: true
137         urlsPrimaryName: cps-core
138         urls:
139             - name: cps-core
140               url: /api-docs/cps-core/openapi.yaml
141             - name: cps-ncmp
142               url: /api-docs/cps-ncmp/openapi.yaml
143             - name: cps-ncmp-inventory
144               url: /api-docs/cps-ncmp/openapi-inventory.yaml
145
146 cps:
147     monitoring:
148         micrometer-jvm-extras: false
149     tracing:
150         sampler:
151             jaeger_remote:
152                 endpoint: ${ONAP_OTEL_SAMPLER_JAEGER_REMOTE_ENDPOINT:http://onap-otel-collector:14250}
153         exporter:
154             endpoint: ${ONAP_OTEL_EXPORTER_ENDPOINT:http://onap-otel-collector:4317}
155             protocol: ${ONAP_OTEL_EXPORTER_PROTOCOL:grpc}
156         enabled: ${ONAP_TRACING_ENABLED:false}
157         excluded-observation-names: ${ONAP_EXCLUDED_OBSERVATION_NAMES:tasks.scheduled.execution}
158
159 # Actuator
160 management:
161     tracing:
162         propagation:
163             produce: ${ONAP_PROPAGATOR_PRODUCE:[W3C]}
164         sampling:
165             probability: 1.0
166     endpoints:
167         web:
168             exposure:
169                 include: info,health,loggers,prometheus,metrics,heapdump,threaddump
170     endpoint:
171         health:
172             show-details: always
173             # kubernetes probes: liveness and readiness
174             probes:
175                 enabled: true
176
177     info:
178         git:
179             enabled: true
180             mode: full
181
182 logging:
183     format: json
184     level:
185         org:
186             springframework: INFO
187             onap:
188                 cps: INFO
189 ncmp:
190     policy-executor:
191         enabled: ${POLICY_SERVICE_ENABLED:false}
192         defaultDecision: ${POLICY_SERVICE_DEFAULT_DECISION:"allow"}
193         server:
194             address: ${POLICY_SERVICE_URL:http://policy-executor-stub}
195             port: ${POLICY_SERVICE_PORT:8093}
196         httpclient:
197             all-services:
198                 maximumInMemorySizeInMegabytes: 16
199                 maximumConnectionsTotal: 100
200                 pendingAcquireMaxCount: 50
201                 connectionTimeoutInSeconds: 30
202                 readTimeoutInSeconds: 30
203                 writeTimeoutInSeconds: 30
204                 responseTimeoutInSeconds: 60
205     dmi:
206         httpclient:
207             data-services:
208                 maximumInMemorySizeInMegabytes: 16
209                 maximumConnectionsTotal: 100
210                 pendingAcquireMaxCount: 50
211                 connectionTimeoutInSeconds: 30
212                 readTimeoutInSeconds: 30
213                 writeTimeoutInSeconds: 30
214                 responseTimeoutInSeconds: 60
215             model-services:
216                 maximumInMemorySizeInMegabytes: 16
217                 maximumConnectionsTotal: 100
218                 pendingAcquireMaxCount: 50
219                 connectionTimeoutInSeconds: 30
220                 readTimeoutInSeconds: 30
221                 writeTimeoutInSeconds: 30
222                 responseTimeoutInSeconds: 60
223         auth:
224             username: ${DMI_USERNAME:cpsuser}
225             password: ${DMI_PASSWORD:cpsr0cks!}
226             enabled: ${DMI_AUTH_ENABLED:true}
227         api:
228             base-path: dmi
229
230     timers:
231         advised-modules-sync:
232             initial-delay-ms: 40000
233             sleep-time-ms: 5000
234         cm-handle-data-sync:
235             initial-delay-ms: 40000
236             sleep-time-ms: 30000
237         subscription-forwarding:
238             dmi-response-timeout-ms: 30000
239         model-loader:
240             retry-time-ms: 1000
241         trust-level:
242             dmi-availability-watchdog-ms: 30000
243
244     model-loader:
245         maximum-attempt-count: 20
246
247 # Custom Hazelcast Config.
248 hazelcast:
249     cluster-name: ${CPS_NCMP_CACHES_CLUSTER_NAME:"cps-and-ncmp-common-cache-cluster"}
250     instance-config-name: ${CPS_NCMP_INSTANCE_CONFIG_NAME:"cps-and-ncmp-hazelcast-instance-config"}
251     mode:
252         kubernetes:
253             enabled: ${HAZELCAST_MODE_KUBERNETES_ENABLED:false}
254             service-name: ${CPS_NCMP_SERVICE_NAME:"cps-and-ncmp-service"}
255
256 otel:
257     exporter:
258         otlp:
259             traces:
260                 protocol: ${ONAP_OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:grpc}