Improve oran_oom helm charts
[it/dep.git] / smo-install / oran_oom / dmaapmediatorservice / resources / dmaap-topic-init.sh
@@ -1,5 +1,6 @@
+#!/bin/sh
 ################################################################################
-#   Copyright (c) 2020 Nordix Foundation.                                      #
+#   Copyright (c) 2024 NYCU WINLab.                                            #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
 #   limitations under the License.                                             #
 ################################################################################
 
-spring:
-  profiles:
-    active: prod
-  main:
-    allow-bean-definition-overriding: true
-  aop:
-    auto: false
-management:
-  endpoints:
-    web:
-      exposure:
-        include: "loggers,logfile,health,info,metrics,threaddump,heapdump"
+topics='{{ .Values.dmaapTopicInit.topics | toRawJson }}'
 
-logging:
-  level:
-    ROOT: ERROR
-    org.springframework: ERROR
-    org.springframework.data: ERROR
-    org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
-    org.oransc.enrichment: INFO
-  file:
-    name: /var/log/enrichment-coordinator-service/application.log
-server:
-   port : 8434
-   http-port: 8083
-   ssl:
-      key-store-type: JKS
-      key-store-password: policy_agent
-      key-store: /opt/app/enrichment-coordinator-service/etc/cert/keystore.jks
-      key-password: policy_agent
-      key-alias: policy_agent
-app:
-  filepath: /opt/app/enrichment-coordinator-service/data/application_configuration.json
-  webclient:
-    trust-store-used: false
-    trust-store-password: policy_agent
-    trust-store: /opt/app/enrichment-coordinator-service/etc/cert/truststore.jks
-  vardata-directory: /var/enrichment-coordinator-service
\ No newline at end of file
+echo $topics | jq -c '.[]' | while read -r obj; do
+    curl -X POST -H "Content-Type: application/json" -d "$obj" {{ .Values.dmaapTopicInit.dmaapMrAddr }}/topics/create
+    response=$?
+    if [ $response -ne 0 ]; then
+        echo "Failed to create topic $obj"
+        exit 1
+    fi
+done