diff options
471 files changed, 3644 insertions, 10909 deletions
diff --git a/compose/README.md b/compose/README.md index dcc21c05..692bc06e 100644 --- a/compose/README.md +++ b/compose/README.md @@ -93,17 +93,9 @@ with compose. ## Database support -From Oslo version onwards, this docker compose setup uses Postgres database as default; MariaDB is -still available, but support might be limited. +From Paris version onwards, this docker compose setup uses Postgres database; MariaDB support has +been removed. -To start docker compose with MariaDB, add a flag to use it: - -```sh -# that will start apex-pdp and its dependencies (pap, api, mariadb, simulator) -./start-compose.sh apex-pdp --mariadb -# that will start apex-pdp and its dependencies (pap, api, postgres, simulator) -./start-compose.sh apex-pdp -``` ### Docker compose files @@ -116,7 +108,5 @@ the services: - Metrics services (prometheus, grafana, jaeger) - compose.postgres.yml - Postgres database and policy-db-migrator working towards it -- compose.mariadb.yml - - MariaDB database and policy-db-migrator working towards it - compose.yml - All the policy components. diff --git a/compose/compose.acm.scale.yml b/compose/compose.acm.scale.yml index ee6679b2..b9484ee5 100644 --- a/compose/compose.acm.scale.yml +++ b/compose/compose.acm.scale.yml @@ -1,6 +1,6 @@ # # ===========LICENSE_START==================================================== -# Copyright (C) 2024 Nordix Foundation. +# Copyright (C) 2024-2025 Nordix Foundation. # ============================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ # 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. +# SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END===================================================== # @@ -142,7 +143,7 @@ services: volumes: - ./config/clamp/HttpParticipantParameters.yaml:/opt/app/policy/clamp/etc/HttpParticipantParameters.yaml - ./config/clamp/http-participant.sh:/opt/app/policy/clamp/bin/http-participant.sh:rw - - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro + - ./config/clamp/logback-ppnt.xml:/opt/app/policy/clamp/etc/logback.xml:ro - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro entrypoint: /opt/app/policy/bin/wait_for_port.sh command: [ @@ -168,7 +169,7 @@ services: volumes: - ./config/clamp/KubernetesParticipantParameters.yaml:/opt/app/policy/clamp/etc/KubernetesParticipantParameters.yaml - ./config/clamp/kubernetes-participant.sh:/opt/app/policy/clamp/bin/kubernetes-participant.sh:rw - - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro + - ./config/clamp/logback-ppnt.xml:/opt/app/policy/clamp/etc/logback.xml:ro - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro entrypoint: /opt/app/policy/bin/wait_for_port.sh command: [ @@ -194,7 +195,7 @@ services: volumes: - ./config/clamp/PolicyParticipantParameters.yaml:/opt/app/policy/clamp/etc/PolicyParticipantParameters.yaml:ro - ./config/clamp/policy-participant.sh:/opt/app/policy/clamp/bin/policy-participant.sh:rw - - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro + - ./config/clamp/logback-ppnt.xml:/opt/app/policy/clamp/etc/logback.xml:ro - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro entrypoint: /opt/app/policy/bin/wait_for_port.sh command: [ diff --git a/compose/compose.common.yml b/compose/compose.common.yml index 47212adb..c78a7814 100644 --- a/compose/compose.common.yml +++ b/compose/compose.common.yml @@ -1,6 +1,6 @@ # # ===========LICENSE_START==================================================== -# Copyright (C) 2024 Nordix Foundation. +# Copyright (C) 2024-2025 Nordix Foundation. # ============================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ # 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. +# SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END===================================================== # @@ -60,7 +61,7 @@ services: volumes: - ./config/clamp/SimulatorParticipantParameters.yaml:/opt/app/policy/clamp/etc/SimulatorParticipantParameters.yaml:ro - ./config/clamp/sim-participant.sh:/opt/app/policy/clamp/bin/sim-participant.sh:rw - - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro + - ./config/clamp/logback-ppnt.xml:/opt/app/policy/clamp/etc/logback.xml:ro - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro entrypoint: /opt/app/policy/bin/wait_for_port.sh command: [ @@ -93,7 +94,7 @@ services: # messaging services: zookeeper: - image: confluentinc/cp-zookeeper:latest + image: nexus3.onap.org:10001/confluentinc/cp-zookeeper:latest container_name: zookeeper hostname: zookeeper ports: @@ -102,7 +103,7 @@ services: ZOOKEEPER_CLIENT_PORT: 2181 kafka: - image: confluentinc/cp-kafka:latest + image: nexus3.onap.org:10001/confluentinc/cp-kafka:latest container_name: kafka hostname: kafka depends_on: @@ -120,7 +121,7 @@ services: KAFKA_ADVERTISED_HOST_NAME: kafka jaeger: - image: jaegertracing/all-in-one:1.58 + image: nexus3.onap.org:10001/jaegertracing/all-in-one:1.58 container_name: jaeger ports: - "4318:4318" diff --git a/compose/compose.mariadb.yml b/compose/compose.mariadb.yml deleted file mode 100644 index 2dbae99f..00000000 --- a/compose/compose.mariadb.yml +++ /dev/null @@ -1,54 +0,0 @@ -# -# ===========LICENSE_START==================================================== -# Copyright (C) 2024 Nordix Foundation. -# ============================================================================ -# 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===================================================== -# - -# Services running against mariadb - -services: - - mariadb: - image: nexus3.onap.org:10001/mariadb:${POLICY_MARIADB_VER} - container_name: mariadb - hostname: mariadb - command: [ '--lower-case-table-names=1', '--wait_timeout=28800', '--default-authentication-plugin=mysql_native_password' ] - env_file: config/db/db.conf - volumes: - - ./config/db:/docker-entrypoint-initdb.d:ro - ports: - - "3306:3306" - - policy-db-migrator: - image: ${CONTAINER_LOCATION}onap/policy-db-migrator:${POLICY_DOCKER_VERSION} - container_name: policy-db-migrator - hostname: policy-db-migrator - depends_on: - - mariadb - expose: - - 6824 - env_file: config/db/db.conf - environment: - SQL_DB: policyadmin clampacm pooling operationshistory - SQL_HOST: mariadb - volumes: - - ./config/db-migrator/init.sh:/opt/app/policy/bin/db_migrator_policy_init.sh:ro - - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro - entrypoint: /opt/app/policy/bin/wait_for_port.sh - command: [ - '-c', - '/opt/app/policy/bin/db_migrator_policy_init.sh', - 'mariadb', '3306' - ] diff --git a/compose/compose.yaml b/compose/compose.yaml index 2210de8f..8ed55b92 100644 --- a/compose/compose.yaml +++ b/compose/compose.yaml @@ -2,8 +2,8 @@ # ===========LICENSE_START==================================================== # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. # Modifications Copyright (C) 2021 Bell Canada. All rights reserved. -# Modification Copyright 2021-2024 Nordix Foundation. -# Modifications Copyright 2024 Deutsche Telekom +# Modifications Copyright 2021-2025 Nordix Foundation. +# Modifications Copyright 2024-2025 Deutsche Telekom # ============================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ # 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. +# SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END===================================================== # @@ -131,7 +132,6 @@ services: 'kafka', '9092' ] - opa-pdp: image: ${CONTAINER_LOCATION}onap/policy-opa-pdp:${POLICY_OPA_PDP_VERSION} container_name: policy-opa-pdp @@ -143,12 +143,6 @@ services: - ./config/opa-pdp/config.json:/app/config/config.json:ro - ./config/opa-pdp/policy-opa-pdp.sh:/app/policy-opa-pdp.sh:ro - ./wait_for_port.sh:/app/wait_for_port.sh - - type: bind - source: ./config/opa-pdp/policies - target: /opt/policies - - type: bind - source: ./config/opa-pdp/data - target: /opt/data env_file: "./config/opa-pdp/opa-pdp.env" entrypoint: sh wait_for_port.sh command: [ @@ -268,7 +262,7 @@ services: volumes: - ./config/clamp/HttpParticipantParameters.yaml:/opt/app/policy/clamp/etc/HttpParticipantParameters.yaml - ./config/clamp/http-participant.sh:/opt/app/policy/clamp/bin/http-participant.sh:rw - - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro + - ./config/clamp/logback-ppnt.xml:/opt/app/policy/clamp/etc/logback.xml:ro - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro entrypoint: /opt/app/policy/bin/wait_for_port.sh command: [ @@ -294,7 +288,7 @@ services: volumes: - ./config/clamp/KubernetesParticipantParameters.yaml:/opt/app/policy/clamp/etc/KubernetesParticipantParameters.yaml - ./config/clamp/kubernetes-participant.sh:/opt/app/policy/clamp/bin/kubernetes-participant.sh:rw - - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro + - ./config/clamp/logback-ppnt.xml:/opt/app/policy/clamp/etc/logback.xml:ro - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro entrypoint: /opt/app/policy/bin/wait_for_port.sh command: [ @@ -321,7 +315,7 @@ services: volumes: - ./config/clamp/PolicyParticipantParameters.yaml:/opt/app/policy/clamp/etc/PolicyParticipantParameters.yaml:ro - ./config/clamp/policy-participant.sh:/opt/app/policy/clamp/bin/policy-participant.sh:rw - - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro + - ./config/clamp/logback-ppnt.xml:/opt/app/policy/clamp/etc/logback.xml:ro - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro entrypoint: /opt/app/policy/bin/wait_for_port.sh command: [ @@ -347,7 +341,7 @@ services: volumes: - ./config/clamp/A1pmsParticipantParameters.yaml:/opt/app/policy/clamp/etc/A1pmsParticipantParameters.yaml:ro - ./config/clamp/a1pms-participant.sh:/opt/app/policy/clamp/bin/a1pms-participant.sh:rw - - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro + - ./config/clamp/logback-ppnt.xml:/opt/app/policy/clamp/etc/logback.xml:ro - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro entrypoint: /opt/app/policy/bin/wait_for_port.sh command: [ @@ -372,7 +366,7 @@ services: volumes: - ./config/clamp/KserveParticipantParameters.yaml:/opt/app/policy/clamp/etc/KserveParticipantParameters.yaml:ro - ./config/clamp/kserve-participant.sh:/opt/app/policy/clamp/bin/kserve-participant.sh:rw - - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro + - ./config/clamp/logback-ppnt.xml:/opt/app/policy/clamp/etc/logback.xml:ro - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro entrypoint: /opt/app/policy/bin/wait_for_port.sh command: [ diff --git a/compose/config/api/apiParameters.yaml b/compose/config/api/apiParameters.yaml index f6fafa06..4b0b20f7 100644 --- a/compose/config/api/apiParameters.yaml +++ b/compose/config/api/apiParameters.yaml @@ -71,6 +71,7 @@ policy-preload: - policytypes/onap.policies.controlloop.operational.common.Drools.yaml - policytypes/onap.policies.native.opa.yaml policies: + - policies/opa.policy.slice.capacity.check.tosca.yaml - policies/sdnc.policy.naming.input.tosca.yaml management: @@ -82,24 +83,3 @@ management: path-mapping: -metrics: plain-metrics -prometheus: metrics - ---- - -spring: - config: - activate: - on-profile: mariadb - datasource: - url: jdbc:mariadb://mariadb:3306/policyadmin - driverClassName: org.mariadb.jdbc.Driver - username: policy_user - password: policy_user - -database: - name: PolicyProviderParameterGroup - implementation: org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl - driver: org.mariadb.jdbc.Driver - url: jdbc:mariadb://mariadb:3306/policyadmin - user: policy_user - password: policy_user - persistenceUnit: PolicyDb diff --git a/compose/config/clamp/AcRuntimeParameters.yaml b/compose/config/clamp/AcRuntimeParameters.yaml index 1a58aa34..b1297650 100644 --- a/compose/config/clamp/AcRuntimeParameters.yaml +++ b/compose/config/clamp/AcRuntimeParameters.yaml @@ -77,6 +77,7 @@ runtime: acmParameters: toscaElementName: org.onap.policy.clamp.acm.AutomationCompositionElement toscaCompositionName: org.onap.policy.clamp.acm.AutomationComposition + enableEncryption: true management: tracing: @@ -137,13 +138,3 @@ runtime: acmParameters: toscaElementName: org.onap.policy.clamp.acm.AutomationCompositionElement toscaCompositionName: org.onap.policy.clamp.acm.AutomationComposition - ---- -# mariadb config -spring: - config: - activate: - on-profile: mariadb - datasource: - url: jdbc:mariadb://${mariadb.host:mariadb}:${mariadb.port:3306}/clampacm - driverClassName: org.mariadb.jdbc.Driver diff --git a/compose/config/clamp/logback-ppnt.xml b/compose/config/clamp/logback-ppnt.xml new file mode 100644 index 00000000..6188c2fa --- /dev/null +++ b/compose/config/clamp/logback-ppnt.xml @@ -0,0 +1,205 @@ +<!-- + ============LICENSE_START======================================================= + Copyright (C) 2025 Nordix Foundation. + ================================================================================ + 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. + SPDX-License-Identifier: Apache-2.0 + ============LICENSE_END========================================================= + --> + +<configuration scan="true" scanPeriod="30 seconds" debug="false"> + + <property name="logDir" value="${POLICY_LOGS}" /> + + <property name="errorLog" value="error" /> + <property name="debugLog" value="debug" /> + <property name="networkLog" value="network" /> + + <property name="metricLog" value="metric" /> + <property name="transactionLog" value="audit" /> + + <property name="debugPattern" + value="[%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%level|%logger{0}|%thread] %msg%n" /> + <property name="errorPattern" value="${debugPattern}" /> + <property name="networkPattern" + value="[%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%t]%m%n" /> + + <property + name="mpPreamble" + value="%X{RequestID}|%X{InvocationID}|%X{ServiceName}|%X{PartnerName}" /> + + <property + name="mpTime" + value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{ElapsedTime}" /> + + <property + name="mpLine1" + value="%X{ServiceInstanceID}|%X{VirtualServerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}" /> + + <property + name="mpLine2" + value="%X{InstanceUUID}|%X{Severity}|%X{TargetEntity}|%X{TargetServiceName}|%X{Server}|%X{ServerIPAddress}" /> + + <property + name="mpLine3" + value="%X{ServerFQDN}|%X{ClientIPAddress}|%X{ProcessKey}|%X{RemoteHost}|%X{AlertSeverity}" /> + + <property + name="mpLine4" + value="%X{TargetVirtualEntity}|%level|%thread| %msg%n" /> + + + <property name="metricPattern" + value="{$mpPreamble}|{$mpTime}|{$mpLine1}|{$mpLine2}|{$mpLine3}|$mpLine4" /> + + <property name="transactionPattern" value="${metricPattern}" /> + + <appender name="ErrorOut" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDir}/${errorLog}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${logDir}/${errorLog}.%d{yyyy-MM-dd}.%i.log.zip + </fileNamePattern> + <maxFileSize>50MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>10GB</totalSizeCap> + </rollingPolicy> + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> + <level>WARN</level> + </filter> + <encoder> + <pattern>${errorPattern}</pattern> + </encoder> + </appender> + + <appender name="AsyncErrorOut" + class="ch.qos.logback.classic.AsyncAppender"> + <appender-ref ref="ErrorOut" /> + </appender> + + <appender name="DebugOut" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDir}/${debugLog}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${logDir}/${debugLog}.%d{yyyy-MM-dd}.%i.log.zip + </fileNamePattern> + <maxFileSize>50MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>10GB</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${debugPattern}</pattern> + </encoder> + </appender> + + <appender name="AsyncDebugOut" + class="ch.qos.logback.classic.AsyncAppender"> + <appender-ref ref="DebugOut" /> + </appender> + + <appender name="NetworkOut" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDir}/${networkLog}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${logDir}/${networkLog}.%d{yyyy-MM-dd}.%i.log.zip + </fileNamePattern> + <maxFileSize>50MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>10GB</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${networkPattern}</pattern> + </encoder> + </appender> + + <appender name="AsyncNetworkOut" + class="ch.qos.logback.classic.AsyncAppender"> + <appender-ref ref="NetworkOut" /> + </appender> + + <appender name="MetricOut" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDir}/${metricLog}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${logDir}/${metricLog}.%d{yyyy-MM-dd}.%i.log.zip + </fileNamePattern> + <maxFileSize>50MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>10GB</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${metricPattern}</pattern> + </encoder> + </appender> + + <appender name="AsyncMetricOut" + class="ch.qos.logback.classic.AsyncAppender"> + <appender-ref ref="MetricOut" /> + </appender> + + <appender name="TransactionOut" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDir}/${transactionLog}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${logDir}/${transactionLog}.%d{yyyy-MM-dd}.%i.log.zip + </fileNamePattern> + <maxFileSize>50MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>10GB</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${transactionPattern}</pattern> + </encoder> + </appender> + + <appender name="AsyncTransactionOut" + class="ch.qos.logback.classic.AsyncAppender"> + <appender-ref ref="TransactionOut" /> + </appender> + + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <Pattern>[%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%level|%logger{0}|%thread] %msg%n</Pattern> + </encoder> + </appender> + + <appender name="AsyncStdOut" class="ch.qos.logback.classic.AsyncAppender"> + <appender-ref ref="STDOUT" /> + </appender> + + <logger name="network" level="INFO" additivity="false"> + <appender-ref ref="AsyncNetworkOut" /> + <appender-ref ref="AsyncStdOut" /> + </logger> + + <logger name="org.eclipse.jetty.server.RequestLog" level="info" additivity="false"> + <appender-ref ref="AsyncNetworkOut" /> + <appender-ref ref="AsyncStdOut" /> + </logger> + + <logger name="org.eclipse.jetty" level="ERROR" /> + + <root level="INFO"> + <appender-ref ref="AsyncDebugOut" /> + <appender-ref ref="AsyncErrorOut" /> + <appender-ref ref="AsyncMetricOut" /> + <appender-ref ref="AsyncTransactionOut" /> + <appender-ref ref="AsyncStdOut" /> + </root> + +</configuration> diff --git a/compose/config/clamp/logback.xml b/compose/config/clamp/logback.xml index c316e179..d5833334 100644 --- a/compose/config/clamp/logback.xml +++ b/compose/config/clamp/logback.xml @@ -2,7 +2,7 @@ ============LICENSE_START======================================================= policy-clamp ================================================================================ - Copyright (C) 2021 Nordix Foundation. + Copyright (C) 2021,2025 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ 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. + SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= --> @@ -24,7 +25,7 @@ <property name="errorLog" value="error" /> <property name="debugLog" value="debug" /> - <property name="networkLog" value="network" /> + <property name="networkLog" value="acm-network" /> <property name="metricLog" value="metric" /> <property name="transactionLog" value="audit" /> @@ -183,7 +184,12 @@ <appender-ref ref="STDOUT" /> </appender> - <logger name="network" level="INFO" additivity="false"> + <logger name="network" level="OFF" additivity="false"> + <appender-ref ref="AsyncNetworkOut" /> + <appender-ref ref="AsyncStdOut" /> + </logger> + + <logger name="acm-network" level="INFO" additivity="false"> <appender-ref ref="AsyncNetworkOut" /> <appender-ref ref="AsyncStdOut" /> </logger> diff --git a/compose/config/db/db.conf b/compose/config/db/db.conf deleted file mode 100644 index 29638c86..00000000 --- a/compose/config/db/db.conf +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2019,2021 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. -MYSQL_ROOT_PASSWORD=secret -MYSQL_USER=policy_user -MYSQL_PASSWORD=policy_user -MYSQL_CMD=mysql diff --git a/compose/config/db/db.sh b/compose/config/db/db.sh deleted file mode 100755 index a916abc0..00000000 --- a/compose/config/db/db.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -xv -# Copyright 2019,2021 AT&T Intellectual Property. All rights reserved -# Modifications Copyright (c) 2022, 2024 Nordix Foundation. -# -# 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. - -for db in migration pooling policyadmin operationshistory clampacm policyclamp -do - mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};" - mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;" -done - -mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;" diff --git a/compose/config/drools-applications/env/base-mariadb.conf b/compose/config/drools-applications/env/base-mariadb.conf deleted file mode 100644 index 20b290a2..00000000 --- a/compose/config/drools-applications/env/base-mariadb.conf +++ /dev/null @@ -1,151 +0,0 @@ -# ============LICENSE_START================================================== -# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. -# Modifications Copyright (C) 2021 Bell Canada. All rights reserved. -# Modification Copyright 2024 Nordix Foundation. -# =========================================================================== -# 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==================================================== - -# JVM options - -JVM_OPTIONS=-server -Xms512m -Xmx512m - -# SYSTEM software configuration - -DEBUG=y -POLICY_HOME=/opt/app/policy -POLICY_LOGS=/var/log/onap/policy/pdpd -KEYSTORE_PASSWD=Pol1cy_0nap -TRUSTSTORE_PASSWD=Pol1cy_0nap - -# Telemetry credentials - -TELEMETRY_PORT=9696 -TELEMETRY_HOST=0.0.0.0 -TELEMETRY_USER=demo@people.osaaf.org -TELEMETRY_PASSWORD=demo123456! - -# nexus repository - -SNAPSHOT_REPOSITORY_ID= -SNAPSHOT_REPOSITORY_URL= -RELEASE_REPOSITORY_ID= -RELEASE_REPOSITORY_URL= -REPOSITORY_USERNAME= -REPOSITORY_PASSWORD= -REPOSITORY_OFFLINE=true - -# Relational (SQL) DB access - -SQL_HOST=mariadb -SQL_USER=policy_user -SQL_PASSWORD=policy_user -SQL_PORT=3306 -JDBC_URL=jdbc:mariadb://mariadb:3306/ -JDBC_OPTS= -JDBC_DRIVER=org.mariadb.jdbc.Driver -MYSQL_CMD= - -# HTTP Servers - -HTTP_SERVER_HTTPS=false -PROMETHEUS=true - -# kafka server - -KAFKA_SERVERS=kafka:9092 -KAFKA_HTTPS=false - -# LIVENESS Checks - -LIVENESS_CONTROLLERS=* - -# PDP-D Kafka configuration channel - -PDPD_CONFIGURATION_TOPIC=pdpd-configuration -PDPD_CONFIGURATION_SERVERS=kafka:9092 -PDPD_CONFIGURATION_API_KEY= -PDPD_CONFIGURATION_API_SECRET= -PDPD_CONFIGURATION_CONSUMER_GROUP= -PDPD_CONFIGURATION_CONSUMER_INSTANCE= -PDPD_CONFIGURATION_PARTITION_KEY= - -# PAP-PDP configuration channel - -POLICY_PDP_PAP_TOPIC=policy-pdp-pap -POLICY_PDP_PAP_API_KEY= -POLICY_PDP_PAP_API_SECRET= -POLICY_PDP_PAP_POLICYTYPES=onap.policies.controlloop.operational.common.Drools - -# PAP - -PAP_HOST=policy-pap -PAP_USERNAME=policyadmin -PAP_PASSWORD=zb!XztG34 - -# PDP-X - -GUARD_DISABLED=false -PDP_HOST=policy-xacml-pdp -PDP_PORT=6969 -PDP_CONTEXT_URI=policy/pdpx/v1/ -PDP_USERNAME=policyadmin -PDP_PASSWORD=zb!XztG34 -PDP_HTTPS=false - -# DCAE Kafka - -DCAE_TOPIC=dcae_topic -DCAE_SERVERS=kafka:9092 -DCAE_CONSUMER_GROUP=dcae.policy.shared - -# AAI - -AAI_HOST=aai-sim -AAI_PORT=6666 -AAI_CONTEXT_URI= -AAI_USERNAME=policy@policy.onap.org -AAI_PASSWORD=demo123456! -AAI_HTTPS=false - -# MSO - -SO_HOST=so-sim -SO_PORT=6669 -SO_CONTEXT_URI= -SO_URL=http://so-sim:6669/ -SO_USERNAME=InfraPortalClient -SO_PASSWORD='password1$' - -# VFC - -VFC_HOST=vfc-sim -VFC_PORT=6670 -VFC_CONTEXT_URI= -VFC_USERNAME= -VFC_PASSWORD= - -# SDNC - -SDNC_HOST=sdnc-sim -SDNC_PORT=6668 -SDNC_CONTEXT_URI= -SDNC_USERNAME= -SDNC_PASSWORD= - -# CDS - -CDS_GRPC_HOST=grpc-sim -CDS_GRPC_PORT=6680 -CDS_GRPC_USERNAME="ccsdkapps" -CDS_GRPC_PASSWORD="ccsdkapps" diff --git a/compose/config/drools-pdp/env/base-mariadb.conf b/compose/config/drools-pdp/env/base-mariadb.conf deleted file mode 100644 index 95aac748..00000000 --- a/compose/config/drools-pdp/env/base-mariadb.conf +++ /dev/null @@ -1,138 +0,0 @@ -# ============LICENSE_START======================================================= -# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. -# Modifications Copyright (C) 2021 Bell Canada. All rights reserved. -# Modification Copyright 2024 Nordix Foundation. -# ================================================================================ -# 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========================================================= - -# JVM options - -JVM_OPTIONS=-server -Xms512m -Xmx512m - -# SYSTEM software configuration - -DEBUG=y -POLICY_HOME=/opt/app/policy -POLICY_LOGS=/var/log/onap/policy/pdpd -KEYSTORE_PASSWD=Pol1cy_0nap -TRUSTSTORE_PASSWD=Pol1cy_0nap - -# Telemetry credentials - -TELEMETRY_PORT=9696 -TELEMETRY_HOST=0.0.0.0 -TELEMETRY_USER=demo@people.osaaf.org -TELEMETRY_PASSWORD=demo123456! - -# nexus repository - -SNAPSHOT_REPOSITORY_ID=policy-nexus-snapshots -SNAPSHOT_REPOSITORY_URL=http://nexus:8081/nexus/content/repositories/snapshots/ -RELEASE_REPOSITORY_ID=policy-nexus-releases -RELEASE_REPOSITORY_URL=http://nexus:8081/nexus/content/repositories/releases/ -REPOSITORY_USERNAME=admin -REPOSITORY_PASSWORD=admin123 -REPOSITORY_OFFLINE=false - -# Relational (SQL) DB access - -SQL_HOST=mariadb -SQL_USER=policy_user -SQL_PASSWORD=policy_user -SQL_PORT=3306 -JDBC_URL=jdbc:mariadb://mariadb:3306/ -JDBC_OPTS= -MYSQL_CMD= - -# HTTP Servers - -HTTP_SERVER_HTTPS=false -PROMETHEUS=true - -# PDP-D Kafka configuration channel - -PDPD_CONFIGURATION_TOPIC=pdpd-configuration -PDPD_CONFIGURATION_API_KEY= -PDPD_CONFIGURATION_API_SECRET= -PDPD_CONFIGURATION_CONSUMER_GROUP= -PDPD_CONFIGURATION_CONSUMER_INSTANCE= -PDPD_CONFIGURATION_PARTITION_KEY= - -# PAP-PDP configuration channel - -POLICY_PDP_PAP_TOPIC=policy-pdp-pap -POLICY_PDP_PAP_API_KEY= -POLICY_PDP_PAP_API_SECRET= - -# PAP - -PAP_HOST= -PAP_USERNAME= -PAP_PASSWORD= - -# PDP-X - -PDP_HOST= -PDP_PORT= -PDP_CONTEXT_URI=policy/pdpx/v1/ -PDP_USERNAME= -PDP_PASSWORD= -PDP_CLIENT_USERNAME= -PDP_CLIENT_PASSWORD= -PDP_ENVIRONMENT= -GUARD_DISABLED=false - -# DCAE Kafka - -DCAE_TOPIC=dcae_topic -DCAE_SERVERS= -DCAE_CONSUMER_GROUP=dcae.policy.shared - -# kafka server - -KAFKA_SERVERS=kafka:9092 -KAFKA_HTTPS=false - -# AAI - -AAI_HOST=aai.api.simpledemo.onap.org -AAI_PORT=8443 -AAI_CONTEXT_URI= -AAI_USERNAME=policy@policy.onap.org -AAI_PASSWORD=demo123456! - -# MSO - -SO_HOST=vm1.mso.simpledemo.onap.org -SO_PORT=8080 -SO_CONTEXT_URI=onap/so/infra/ -SO_URL=http://vm1.mso.simpledemo.onap.org:8080/onap/so/infra -SO_USERNAME=InfraPortalClient -SO_PASSWORD='password1$' - -# VFC - -VFC_HOST= -VFC_PORT= -VFC_CONTEXT_URI=api/nslcm/v1/ -VFC_USERNAME= -VFC_PASSWORD= - -# SDNC - -SDNC_HOST= -SDNC_PORT= -SDNC_CONTEXT_URI=restconf/operations/ -SDNC_USERNAME= -SDNC_PASSWORD= diff --git a/compose/config/opa-pdp/config.json b/compose/config/opa-pdp/config.json index 3f2aa437..0eb38c9d 100644 --- a/compose/config/opa-pdp/config.json +++ b/compose/config/opa-pdp/config.json @@ -2,22 +2,6 @@ "logging": { "level": "debug" }, - "services": [ - { - "name": "opa-bundle-server", - "url": "http://localhost:8282/opa/bundles" - } - ], - "bundles": { - "opabundle": { - "service": "opa-bundle-server", - "resource": "bundle.tar.gz", - "polling": { - "min_delay_seconds": 60, - "max_delay_seconds": 120 - } - } - }, "decision_logs": { "console": true } diff --git a/compose/config/opa-pdp/data/abac/data.json b/compose/config/opa-pdp/data/abac/data.json deleted file mode 100644 index 77b5668e..00000000 --- a/compose/config/opa-pdp/data/abac/data.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "sensor_data": [ - { - "id": "0001", - "location": "Sri Lanka", - "temperature": "28 C", - "precipitation": "1000 mm", - "windspeed": "5.5 m/s", - "humidity": "40%", - "particle_density": "1.3 g/l", - "timestamp": "2024-02-26" - }, - { - "id": "0002", - "location": "Colombo", - "temperature": "30 C", - "precipitation": "1200 mm", - "windspeed": "6.0 m/s", - "humidity": "45%", - "particle_density": "1.5 g/l", - "timestamp": "2024-02-26" - }, - { - "id": "0003", - "location": "Kandy", - "temperature": "25 C", - "precipitation": "800 mm", - "windspeed": "4.5 m/s", - "humidity": "60%", - "particle_density": "1.1 g/l", - "timestamp": "2024-02-26" - }, - { - "id": "0004", - "location": "Galle", - "temperature": "35 C", - "precipitation": "500 mm", - "windspeed": "7.2 m/s", - "humidity": "30%", - "particle_density": "1.8 g/l", - "timestamp": "2024-02-27" - }, - { - "id": "0005", - "location": "Jaffna", - "temperature": "-5 C", - "precipitation": "300 mm", - "windspeed": "3.8 m/s", - "humidity": "20%", - "particle_density": "0.9 g/l", - "timestamp": "2024-02-27" - }, - { - "id": "0006", - "location": "Trincomalee", - "temperature": "20 C", - "precipitation": "1000 mm", - "windspeed": "5.0 m/s", - "humidity": "55%", - "particle_density": "1.2 g/l", - "timestamp": "2024-02-28" - }, - { - "id": "0007", - "location": "Nuwara Eliya", - "temperature": "25 C", - "precipitation": "600 mm", - "windspeed": "4.0 m/s", - "humidity": "50%", - "particle_density": "1.3 g/l", - "timestamp": "2024-02-28" - }, - { - "id": "0008", - "location": "Anuradhapura", - "temperature": "28 C", - "precipitation": "700 mm", - "windspeed": "5.8 m/s", - "humidity": "40%", - "particle_density": "1.4 g/l", - "timestamp": "2024-02-29" - }, - { - "id": "0009", - "location": "Matara", - "temperature": "32 C", - "precipitation": "900 mm", - "windspeed": "6.5 m/s", - "humidity": "65%", - "particle_density": "1.6 g/l", - "timestamp": "2024-02-29" - } - ] -} diff --git a/compose/config/opa-pdp/data/account/data.json b/compose/config/opa-pdp/data/account/data.json deleted file mode 100644 index df263d36..00000000 --- a/compose/config/opa-pdp/data/account/data.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "account_attributes":{ - "11111":{ - "owner":"alice", - "amount":10000 - }, - "22222":{ - "owner":"bob", - "amount":10000 - }, - "33333":{ - "owner":"cam", - "amount":10000 - } - } -} diff --git a/compose/config/opa-pdp/data/action/data.json b/compose/config/opa-pdp/data/action/data.json deleted file mode 100644 index 99145b74..00000000 --- a/compose/config/opa-pdp/data/action/data.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "user_roles": { - "alice": [ - "admin" - ], - "bob": [ - "editor" - ], - "charlie": [ - "viewer" - ] - }, - "role_permissions": { - "admin": { - "actions": [ - "read", - "write", - "delete" - ], - "resources": [ - "server", - "database" - ] - }, - "editor": { - "actions": [ - "read", - "write" - ], - "resources": [ - "server" - ] - }, - "viewer": { - "actions": [ - "read" - ], - "resources": [ - "server" - ] - } - } -} diff --git a/compose/config/opa-pdp/data/blacklist/data.json b/compose/config/opa-pdp/data/blacklist/data.json new file mode 100644 index 00000000..9fd6233f --- /dev/null +++ b/compose/config/opa-pdp/data/blacklist/data.json @@ -0,0 +1,6 @@ +{ + "blacklist" : [ + "the-vfmodule-where-root-is-true", + "another-vfmodule-where-root-is-true" +] +} diff --git a/compose/config/opa-pdp/data/cell/consistency/data.json b/compose/config/opa-pdp/data/cell/consistency/data.json new file mode 100644 index 00000000..1f823a10 --- /dev/null +++ b/compose/config/opa-pdp/data/cell/consistency/data.json @@ -0,0 +1,5 @@ +{ + "allowedCellId" : 445611193265040129, + "minPCI": 1, + "maxPCI": 3000 +} diff --git a/compose/config/opa-pdp/data/monitor/data.json b/compose/config/opa-pdp/data/monitor/data.json new file mode 100644 index 00000000..f28f73cd --- /dev/null +++ b/compose/config/opa-pdp/data/monitor/data.json @@ -0,0 +1,13 @@ +{ "domain": "measurementsForVfScaling", + "metricsPerEventName": [{ + "eventName": "Measurement_vGMUX", + "controlLoopSchemaType": "VNF", + "policyScope": "DCAE", + "policyName": "DCAE.Config_tca-hi-lo", + "policyVersion": "v0.0.1", + "thresholds" : [{"version": "1.0.2", + "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", + "thresholdValue": 0 + }] +}] +} diff --git a/compose/config/opa-pdp/data/organization/data.json b/compose/config/opa-pdp/data/organization/data.json deleted file mode 100644 index 35fe4a14..00000000 --- a/compose/config/opa-pdp/data/organization/data.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "acls": [ - { - "user": "alice", - "actions": [ - "edit", - "read" - ], - "component": "component_A", - "project": "project_A", - "organization": "org_A" - }, - { - "user": "bob", - "actions": ["read"], - "organization": "org_A" - }, - { - "user": "bob", - "action": ["edit"], - "component": "component_A", - "project": "project_B", - "organization": "org_A" - }, - { - "user": "charlie", - "action": ["read"], - "project": "project_B", - "organization": "org_A" - } - ] -} diff --git a/compose/config/opa-pdp/groups.json b/compose/config/opa-pdp/groups.json index ef4ee5f4..30a81dce 100644 --- a/compose/config/opa-pdp/groups.json +++ b/compose/config/opa-pdp/groups.json @@ -2,9 +2,8 @@ "groups": [ { "name": "opaGroup", - "version": "1.0.0", - "description": "The default group that registers all supported policy types and pdps.", "pdpGroupState": "ACTIVE", + "properties": {}, "pdpSubgroups": [ { "pdpType": "opa", @@ -16,7 +15,12 @@ "version": "1.0.0" } ], - "policies": [] + "policies": [ + { + "name": "slice.capacity.check", + "version": "1.0.0" + } + ] } ] } diff --git a/compose/config/opa-pdp/policies/abac/policy.rego b/compose/config/opa-pdp/policies/abac/policy.rego deleted file mode 100644 index 9dc6ea9b..00000000 --- a/compose/config/opa-pdp/policies/abac/policy.rego +++ /dev/null @@ -1,20 +0,0 @@ -package abac - -import rego.v1 - -default allow := false - -allow if { - viewable_sensor_data - action_is_read -} - -action_is_read if "read" in input.actions - -viewable_sensor_data contains view_data if { - some sensor_data in data.abac.sensor_data - sensor_data.timestamp >= input.time_period.from - sensor_data.timestamp < input.time_period.to - - view_data := {datatype: sensor_data[datatype] | datatype in input.datatypes} -} diff --git a/compose/config/opa-pdp/policies/example/policy.rego b/compose/config/opa-pdp/policies/access_method/policy.rego index cc192851..618aacca 100644 --- a/compose/config/opa-pdp/policies/example/policy.rego +++ b/compose/config/opa-pdp/policies/access_method/policy.rego @@ -1,4 +1,4 @@ -package example +package access_method import rego.v1 diff --git a/compose/config/opa-pdp/policies/account/policy.rego b/compose/config/opa-pdp/policies/account/policy.rego deleted file mode 100644 index f99e8eb0..00000000 --- a/compose/config/opa-pdp/policies/account/policy.rego +++ /dev/null @@ -1,17 +0,0 @@ -package account - -import rego.v1 - -default allow := false - -allow if { - creditor_is_valid - debtor_is_valid - period_is_valid - amount_is_valid -} -creditor_is_valid if data.account.account_attributes[input.creditor_account].owner == input.creditor -debtor_is_valid if data.account.account_attributes[input.debtor_account].owner == input.debtor - -period_is_valid if input.period <= 30 -amount_is_valid if data.account.account_attributes[input.debtor_account].amount >= input.amount diff --git a/compose/config/opa-pdp/policies/action/policy.rego b/compose/config/opa-pdp/policies/action/policy.rego deleted file mode 100644 index 300fe501..00000000 --- a/compose/config/opa-pdp/policies/action/policy.rego +++ /dev/null @@ -1,21 +0,0 @@ -package action - -import rego.v1 - -# By default, deny requests. -default allow := false - - -# Allow the action if admin role is granted permission to perform the action. -allow if { - some i - data.action.user_roles[input.user][i] == role - some j - data.action.role_permissions[role].actions[j] == input.action - some k - data.action.role_permissions[role].resources[k] == input.type -} -# * Rego comparison to other systems: https://www.openpolicyagent.org/docs/latest/comparison-to-other-systems/ -# * Rego Iteration: https://www.openpolicyagent.org/docs/latest/#iteration - - diff --git a/compose/config/opa-pdp/policies/blacklist/policy.rego b/compose/config/opa-pdp/policies/blacklist/policy.rego new file mode 100644 index 00000000..b2855933 --- /dev/null +++ b/compose/config/opa-pdp/policies/blacklist/policy.rego @@ -0,0 +1,18 @@ +package blacklist +import future.keywords.in +import rego.v1 + +# Define a rule to check if the operation should be allowed +module_allow[module] := false if { + some module in input.vfmodule + not validate(module) +} + +module_allow[module] := true if{ + some module in input.vfmodule + validate(module) +} + +validate(module) if { + module in data.node.blacklist.blacklist +} diff --git a/compose/config/opa-pdp/policies/cell/consistency/policy.rego b/compose/config/opa-pdp/policies/cell/consistency/policy.rego new file mode 100644 index 00000000..6137df70 --- /dev/null +++ b/compose/config/opa-pdp/policies/cell/consistency/policy.rego @@ -0,0 +1,17 @@ +package cell.consistency +import rego.v1 +default allow = false +# Rule to check cell consistency +check_cell_consistency if { + input.cell != data.node.cell.consistency.allowedCellId +} +# Rule to allow if PCI is within range 1-3000 +allow_if_pci_in_range if { + input.PCI >= data.node.cellconsistency.minPCI + input.PCI <= data.node.cellconsistency.maxPCI +} +# Main rule to determine the final decision +allow if{ + check_cell_consistency + allow_if_pci_in_range +} diff --git a/compose/config/opa-pdp/policies/cell/consistency/topology/policy.rego b/compose/config/opa-pdp/policies/cell/consistency/topology/policy.rego new file mode 100644 index 00000000..dccfac6b --- /dev/null +++ b/compose/config/opa-pdp/policies/cell/consistency/topology/policy.rego @@ -0,0 +1,6 @@ +package cell.consistency.topology +import rego.v1 +# Rule to check cell consistency +check_cell_consistency if { + input.cell != data.node.cell.consistency.allowedCellId +} diff --git a/compose/config/opa-pdp/policies/data/abac/data.json b/compose/config/opa-pdp/policies/data/abac/data.json deleted file mode 100644 index 77b5668e..00000000 --- a/compose/config/opa-pdp/policies/data/abac/data.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "sensor_data": [ - { - "id": "0001", - "location": "Sri Lanka", - "temperature": "28 C", - "precipitation": "1000 mm", - "windspeed": "5.5 m/s", - "humidity": "40%", - "particle_density": "1.3 g/l", - "timestamp": "2024-02-26" - }, - { - "id": "0002", - "location": "Colombo", - "temperature": "30 C", - "precipitation": "1200 mm", - "windspeed": "6.0 m/s", - "humidity": "45%", - "particle_density": "1.5 g/l", - "timestamp": "2024-02-26" - }, - { - "id": "0003", - "location": "Kandy", - "temperature": "25 C", - "precipitation": "800 mm", - "windspeed": "4.5 m/s", - "humidity": "60%", - "particle_density": "1.1 g/l", - "timestamp": "2024-02-26" - }, - { - "id": "0004", - "location": "Galle", - "temperature": "35 C", - "precipitation": "500 mm", - "windspeed": "7.2 m/s", - "humidity": "30%", - "particle_density": "1.8 g/l", - "timestamp": "2024-02-27" - }, - { - "id": "0005", - "location": "Jaffna", - "temperature": "-5 C", - "precipitation": "300 mm", - "windspeed": "3.8 m/s", - "humidity": "20%", - "particle_density": "0.9 g/l", - "timestamp": "2024-02-27" - }, - { - "id": "0006", - "location": "Trincomalee", - "temperature": "20 C", - "precipitation": "1000 mm", - "windspeed": "5.0 m/s", - "humidity": "55%", - "particle_density": "1.2 g/l", - "timestamp": "2024-02-28" - }, - { - "id": "0007", - "location": "Nuwara Eliya", - "temperature": "25 C", - "precipitation": "600 mm", - "windspeed": "4.0 m/s", - "humidity": "50%", - "particle_density": "1.3 g/l", - "timestamp": "2024-02-28" - }, - { - "id": "0008", - "location": "Anuradhapura", - "temperature": "28 C", - "precipitation": "700 mm", - "windspeed": "5.8 m/s", - "humidity": "40%", - "particle_density": "1.4 g/l", - "timestamp": "2024-02-29" - }, - { - "id": "0009", - "location": "Matara", - "temperature": "32 C", - "precipitation": "900 mm", - "windspeed": "6.5 m/s", - "humidity": "65%", - "particle_density": "1.6 g/l", - "timestamp": "2024-02-29" - } - ] -} diff --git a/compose/config/opa-pdp/policies/data/account/data.json b/compose/config/opa-pdp/policies/data/account/data.json deleted file mode 100644 index df263d36..00000000 --- a/compose/config/opa-pdp/policies/data/account/data.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "account_attributes":{ - "11111":{ - "owner":"alice", - "amount":10000 - }, - "22222":{ - "owner":"bob", - "amount":10000 - }, - "33333":{ - "owner":"cam", - "amount":10000 - } - } -} diff --git a/compose/config/opa-pdp/policies/data/action/data.json b/compose/config/opa-pdp/policies/data/action/data.json deleted file mode 100644 index 99145b74..00000000 --- a/compose/config/opa-pdp/policies/data/action/data.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "user_roles": { - "alice": [ - "admin" - ], - "bob": [ - "editor" - ], - "charlie": [ - "viewer" - ] - }, - "role_permissions": { - "admin": { - "actions": [ - "read", - "write", - "delete" - ], - "resources": [ - "server", - "database" - ] - }, - "editor": { - "actions": [ - "read", - "write" - ], - "resources": [ - "server" - ] - }, - "viewer": { - "actions": [ - "read" - ], - "resources": [ - "server" - ] - } - } -} diff --git a/compose/config/opa-pdp/policies/data/organization/data.json b/compose/config/opa-pdp/policies/data/organization/data.json deleted file mode 100644 index 35fe4a14..00000000 --- a/compose/config/opa-pdp/policies/data/organization/data.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "acls": [ - { - "user": "alice", - "actions": [ - "edit", - "read" - ], - "component": "component_A", - "project": "project_A", - "organization": "org_A" - }, - { - "user": "bob", - "actions": ["read"], - "organization": "org_A" - }, - { - "user": "bob", - "action": ["edit"], - "component": "component_A", - "project": "project_B", - "organization": "org_A" - }, - { - "user": "charlie", - "action": ["read"], - "project": "project_B", - "organization": "org_A" - } - ] -} diff --git a/compose/config/opa-pdp/policies/data/role/data.json b/compose/config/opa-pdp/policies/data/role/data.json deleted file mode 100644 index 88ac41b8..00000000 --- a/compose/config/opa-pdp/policies/data/role/data.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "user_roles": { - "alice": [ - "admin" - ], - "bob": [ - "employee", - "billing" - ], - "eve": [ - "customer" - ] - }, - "role_grants": { - "customer": [ - { - "action": "read", - "type": "dog" - }, - { - "action": "read", - "type": "cat" - }, - { - "action": "adopt", - "type": "dog" - }, - { - "action": "adopt", - "type": "cat" - } - ], - "employee": [ - { - "action": "read", - "type": "dog" - }, - { - "action": "read", - "type": "cat" - }, - { - "action": "update", - "type": "dog" - }, - { - "action": "update", - "type": "cat" - } - ], - "billing": [ - { - "action": "read", - "type": "finance" - }, - { - "action": "update", - "type": "finance" - } - ] - } -} - diff --git a/compose/config/opa-pdp/policies/monitor/policy.rego b/compose/config/opa-pdp/policies/monitor/policy.rego new file mode 100644 index 00000000..b3d9aaa4 --- /dev/null +++ b/compose/config/opa-pdp/policies/monitor/policy.rego @@ -0,0 +1,39 @@ +package monitor + +# Policy allows if a matching threshold is met +result contains output if { + input.domain = data.node.monitor.domain + some events in data.node.monitor.metricsPerEventName + events.eventName == input.eventName + events.controlLoopSchemaType == input.controlLoopSchemaType + events.policyScope == input.policyScope + events.policyName == input.policyName + events.policyVersion == input.policyVersion + some value in events.thresholds + input.controlname == value.closedLoopControlName + input.version == value.version + input.thresholdValue == value.thresholdValue + output := { + "severity" : "MAJOR", + "closedLoopEventStatus" : "ABATED" + } +} + +# Policy allows if a matching threshold is met +result contains output if { + input.domain = data.node.monitor.domain + some events in data.node.monitor.metricsPerEventName + events.eventName == input.eventName + events.controlLoopSchemaType == input.controlLoopSchemaType + events.policyScope == input.policyScope + events.policyName == input.policyName + events.policyVersion == input.policyVersion + some value in events.thresholds + input.controlname == value.closedLoopControlName + input.version == value.version + input.thresholdValue > value.thresholdValue + output := { + "severity" : "CRITICAL", + "closedLoopEventStatus" : "ONSET" + } +} diff --git a/compose/config/opa-pdp/policies/organization/policy.rego b/compose/config/opa-pdp/policies/organization/policy.rego deleted file mode 100644 index 31e7fb66..00000000 --- a/compose/config/opa-pdp/policies/organization/policy.rego +++ /dev/null @@ -1,38 +0,0 @@ -package organization - -import rego.v1 - -default allow := false - -# organization level access -allow if { - some acl in data.organization.acls - acl.user == input.user - acl.organization == input.organization - acl.project == input.project - acl.component == input.component - - some action in acl.actions - action == input.action -} - -# project level access -allow if { - some acl in data.organization.acls - acl.user == input.user - acl.organization == input.organization - acl.project == input.project - - some action in acl.actions - action == input.action -} - -# component level access -allow if { - some acl in data.organization.acls - acl.user == input.user - acl.organization == input.organization - - some action in acl.actions - action == input.action -} diff --git a/compose/config/pap/papParameters.yaml b/compose/config/pap/papParameters.yaml index 57b540bb..868fc9a8 100644 --- a/compose/config/pap/papParameters.yaml +++ b/compose/config/pap/papParameters.yaml @@ -39,7 +39,6 @@ pap: stateChangeParameters: maxRetryCount: 1 maxWaitMs: 30000 - savePdpStatisticsInDb: true topicParameterGroup: topicSources: - topic: ${pap.topic.pdp-pap.name} @@ -85,24 +84,3 @@ management: path-mapping: -metrics: plain-metrics -prometheus: metrics - ---- - -spring: - config: - activate: - on-profile: mariadb - datasource: - url: jdbc:mariadb://mariadb:3306/policyadmin - driverClassName: org.mariadb.jdbc.Driver - username: policy_user - password: policy_user - -database: - name: PolicyProviderParameterGroup - implementation: org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl - driver: org.mariadb.jdbc.Driver - url: jdbc:mariadb://mariadb:3306/policyadmin - user: policy_user - password: policy_user - persistenceUnit: PolicyDb diff --git a/compose/config/xacml-pdp/xacml-mariadb.properties b/compose/config/xacml-pdp/xacml-mariadb.properties deleted file mode 100644 index ede93c70..00000000 --- a/compose/config/xacml-pdp/xacml-mariadb.properties +++ /dev/null @@ -1,54 +0,0 @@ -# -# Properties that the embedded PDP engine uses to configure and load -# -# Standard API Factories -# -xacml.dataTypeFactory=com.att.research.xacml.std.StdDataTypeFactory -xacml.pdpEngineFactory=com.att.research.xacmlatt.pdp.ATTPDPEngineFactory -xacml.pepEngineFactory=com.att.research.xacml.std.pep.StdEngineFactory -xacml.pipFinderFactory=com.att.research.xacml.std.pip.StdPIPFinderFactory -xacml.traceEngineFactory=com.att.research.xacml.std.trace.LoggingTraceEngineFactory -# -# AT&T PDP Implementation Factories -# -xacml.att.evaluationContextFactory=com.att.research.xacmlatt.pdp.std.StdEvaluationContextFactory -xacml.att.combiningAlgorithmFactory=com.att.research.xacmlatt.pdp.std.StdCombiningAlgorithmFactory -xacml.att.functionDefinitionFactory=com.att.research.xacmlatt.pdp.std.StdFunctionDefinitionFactory -# -# ONAP PDP Implementation Factories -# -xacml.att.policyFinderFactory=org.onap.policy.pdp.xacml.application.common.OnapPolicyFinderFactory - -# -# Use a root combining algorithm -# -xacml.att.policyFinderFactory.combineRootPolicies=urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:deny-overrides - -# -# PIP Engine Definitions -# -count-recent-operations.classname=org.onap.policy.pdp.xacml.application.common.operationshistory.CountRecentOperationsPip -count-recent-operations.issuer=urn:org:onap:xacml:guard:count-recent-operations -count-recent-operations.name=CountRecentOperations -count-recent-operations.description=Returns operation counts based on time window -count-recent-operations.persistenceunit=OperationsHistoryPU - -get-operation-outcome.classname=org.onap.policy.pdp.xacml.application.common.operationshistory.GetOperationOutcomePip -get-operation-outcome.issuer=urn:org:onap:xacml:guard:get-operation-outcome -get-operation-outcome.name=GetOperationOutcome -get-operation-outcome.description=Returns operation outcome -get-operation-outcome.persistenceunit=OperationsHistoryPU - -# -# Make pips available to finder -# -xacml.pip.engines=count-recent-operations,get-operation-outcome - -# -# JPA Properties -# -eclipselink.target-database=MySQL -jakarta.persistence.jdbc.driver=org.mariadb.jdbc.Driver -jakarta.persistence.jdbc.url=jdbc:mariadb://mariadb:3306/operationshistory -jakarta.persistence.jdbc.user=policy_user -jakarta.persistence.jdbc.password=policy_user diff --git a/compose/config/xacml-pdp/xacml-postgres.properties b/compose/config/xacml-pdp/xacml-postgres.properties index a3446c4c..4dc66bfd 100644 --- a/compose/config/xacml-pdp/xacml-postgres.properties +++ b/compose/config/xacml-pdp/xacml-postgres.properties @@ -47,8 +47,8 @@ xacml.pip.engines=count-recent-operations,get-operation-outcome # # JPA Properties # -eclipselink.target-database=PostgreSQL jakarta.persistence.jdbc.driver=org.postgresql.Driver jakarta.persistence.jdbc.url=jdbc:postgresql://postgres:5432/operationshistory jakarta.persistence.jdbc.user=policy_user jakarta.persistence.jdbc.password=policy_user + diff --git a/compose/get-k8s-versions.sh b/compose/get-k8s-versions.sh index 49954604..1adc8adb 100755 --- a/compose/get-k8s-versions.sh +++ b/compose/get-k8s-versions.sh @@ -2,6 +2,7 @@ # ============LICENSE_START==================================================== # Copyright (C) 2023-2024 Nordix Foundation. All rights reserved. +# Modifications Copyright 2024-2025 Deutsche Telekom # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +28,7 @@ fi VALUES_YML=${WORKSPACE}/helm/policy/values.yaml -policy_components=(policy-api policy-pap policy-apex-pdp policy-models-simulator policy-pdpd-cl policy-xacml-pdp policy-distribution policy-db-migrator) +policy_components=(policy-api policy-pap policy-apex-pdp policy-models-simulator policy-pdpd-cl policy-xacml-pdp policy-distribution policy-db-migrator policy-opa-pdp) clamp_components=(policy-clamp-runtime-acm policy-clamp-ac-kserve-ppnt policy-clamp-ac-k8s-ppnt policy-clamp-ac-pf-ppnt policy-clamp-ac-http-ppnt policy-clamp-ac-sim-ppnt policy-clamp-ac-a1pms-ppnt) diff --git a/compose/get-versions.sh b/compose/get-versions.sh index 9d9b42b7..cb8b83a9 100755 --- a/compose/get-versions.sh +++ b/compose/get-versions.sh @@ -26,9 +26,6 @@ if [ -z "${WORKSPACE}" ]; then fi #default values -export POLICY_MARIADB_VER=10.10.2 -echo POLICY_MARIADB_VER=${POLICY_MARIADB_VER} - export POLICY_POSTGRES_VER=16.4 echo POLICY_POSTGRES_VER=${POLICY_POSTGRES_VER} @@ -145,7 +142,8 @@ else getDockerVersion xacml-pdp export POLICY_XACML_PDP_VERSION="$docker_image_version" - export POLICY_OPA_PDP_VERSION="1.0.0-SNAPSHOT" + getDockerVersion opa-pdp + export POLICY_OPA_PDP_VERSION="$docker_image_version" getDockerVersion distribution export POLICY_DISTRIBUTION_VERSION="$docker_image_version" diff --git a/compose/metrics/dashboards/dashboard-opa-pdp.json b/compose/metrics/dashboards/dashboard-opa-pdp.json new file mode 100644 index 00000000..771c994c --- /dev/null +++ b/compose/metrics/dashboards/dashboard-opa-pdp.json @@ -0,0 +1,753 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "Grafana Dashboard for Policy OPA-PDP", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 6, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 19, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "refId": "A" + } + ], + "title": "Quick Info", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "description": "Uptime per pod for Policy OPA-PDP application calculated in days", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "decimals": 1, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 0, + "y": 1 + }, + "id": 4, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "vertical", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": { + "titleSize": 16 + }, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "editorMode": "code", + "exemplar": true, + "expr": "(time() - process_start_time_seconds{job=\"opa-pdp-metrics\"})", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "process_uptime: {{pod}}", + "refId": "A" + } + ], + "title": "Process Uptime", + "transparent": true, + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "description": "Policy OPA-PDP CPU Usage Monitoring", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "decimals": 2, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "percent" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "process-1h: dev-policy-api-69f54f45cc-wq6xq" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "process_1h: dev-policy-api-69f54f45cc-wq6xq" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 6, + "y": 1 + }, + "id": 26, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": false, + "sizing": "auto", + "text": {} + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "exemplar": true, + "expr": "irate(process_cpu_seconds_total{job=\"opa-pdp-metrics\"}[$__range]) * 100", + "interval": "", + "legendFormat": "{{pod}}", + "refId": "A" + } + ], + "title": "CPU Usage", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "description": "Policy OPA-PDP Memory Usage Monitoring", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "{area=\"heap\", container=\"policy-api\", endpoint=\"policy-api\", id=\"Tenured Gen\", instance=\"10.42.7.19:6969\", job=\"policy-api\", namespace=\"onap\", pod=\"dev-policy-api-69f54f45cc-sb56v\", service=\"policy-api\"}" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "text", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Tenured Gen - dev-policy-api-69f54f45cc-wq6xq" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 12, + "y": 1 + }, + "id": 27, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": false, + "sizing": "auto" + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "exemplar": true, + "expr": "100 * process_resident_memory_bytes{job=\"opa-pdp-metrics\"} / (1024 * 1024 * 1024)", + "hide": false, + "interval": "", + "legendFormat": "RSS : {{ pod }}", + "refId": "A" + } + ], + "title": "Memory Usage", + "type": "gauge" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 17, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "refId": "A" + } + ], + "title": "System", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "description": "Policy OPA-PDP CPU Usage Monitoring", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "process-1h: dev-policy-api-69f54f45cc-wq6xq" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "process_1h: dev-policy-api-69f54f45cc-wq6xq" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 8, + "x": 0, + "y": 8 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "max", + "mean", + "last" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "editorMode": "code", + "exemplar": true, + "expr": "irate(process_cpu_seconds_total{job=\"opa-pdp-metrics\"}[$__range])*100", + "interval": "", + "legendFormat": "opa: {{pod}}", + "range": true, + "refId": "A" + } + ], + "title": "CPU Usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "description": "Policy OPA-PDP Memory Usage Monitoring", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "{area=\"heap\", container=\"policy-api\", endpoint=\"policy-api\", id=\"Tenured Gen\", instance=\"10.42.7.19:6969\", job=\"policy-api\", namespace=\"onap\", pod=\"dev-policy-api-69f54f45cc-sb56v\", service=\"policy-api\"}" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "text", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Tenured Gen - dev-policy-api-69f54f45cc-wq6xq" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 7, + "x": 8, + "y": 8 + }, + "id": 13, + "options": { + "legend": { + "calcs": [ + "max", + "mean", + "last" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last", + "sortDesc": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "editorMode": "code", + "exemplar": true, + "expr": "100 * process_resident_memory_bytes{job=\"opa-pdp-metrics\"} / (1024 * 1024 * 1024)", + "hide": false, + "interval": "", + "legendFormat": "Alloc : {{ pod }}", + "range": true, + "refId": "A" + } + ], + "title": "Memory Usage", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 26 + }, + "id": 21, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "refId": "A" + } + ], + "title": "Requests", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "description": "Policy Decisions Total for OPA-PDP per instance", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 27 + }, + "id": 30, + "options": { + "displayMode": "gradient", + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "dkSf71fnz" + }, + "exemplar": true, + "expr": "opa_decision_response_time_seconds_count{instance=\"policy-opa-pdp:8282\", job=\"opa-pdp-metrics\"}", + "hide": false, + "interval": "", + "legendFormat": "Decision Count", + "refId": "B" + } + ], + "title": "Policy Decisions", + "type": "bargauge" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Policy OPA-PDP", + "uid": "go-U1x9FQmA", + "version": 3, + "weekStart": "" +} diff --git a/compose/metrics/prometheus.yml b/compose/metrics/prometheus.yml index 5ff5f949..5cf4051c 100644 --- a/compose/metrics/prometheus.yml +++ b/compose/metrics/prometheus.yml @@ -1,6 +1,7 @@ # # ===========LICENSE_START==================================================== # Copyright (C) 2022-2024 Nordix Foundation. +# Modifications Copyright 2025 Deutsche Telekom # ============================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -79,6 +80,14 @@ scrape_configs: username: "policyadmin" password: "zb!XztG34" +- job_name: "opa-pdp-metrics" + static_configs: + - targets: + - "policy-opa-pdp:8282" + basic_auth: + username: "policyadmin" + password: "zb!XztG34" + - job_name: "xacml-pdp-metrics" static_configs: - targets: diff --git a/csit/resources/Dockerfile b/csit/resources/Dockerfile index b0f41b6a..8f0190b2 100644 --- a/csit/resources/Dockerfile +++ b/csit/resources/Dockerfile @@ -1,12 +1,13 @@ -FROM nexus3.onap.org:10001/library/python:3.10-slim-bullseye +FROM nexus3.onap.org:10001/library/python:3.13-slim-bullseye ARG CSIT_SCRIPT=${CSIT_SCRIPT} ARG ROBOT_FILE=${ROBOT_FILE} ENV ROBOT_WORKSPACE=/opt/robotworkspace ROBOT_FILE=$ROBOT_FILE TEST_ENV=$TEST_ENV -RUN python3 -m pip -qq install --upgrade pip && \ - python3 -m pip -qq install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.6.0.*' --pre && \ - python3 -m pip -qq install --upgrade confluent-kafka && \ - python3 -m pip freeze -RUN mkdir -p ${ROBOT_WORKSPACE} +RUN apt-get update && apt-get install -y gcc; \ + python3 -m pip -qq install --upgrade pip; \ + python3 -m pip -qq install --upgrade confluent-kafka; \ + python3 -m pip -qq install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.6.0.*' --pre; \ + python3 -m pip freeze; \ + mkdir -p ${ROBOT_WORKSPACE} COPY scripts/run-test.sh tests/ ${ROBOT_WORKSPACE}/ WORKDIR ${ROBOT_WORKSPACE} CMD ["sh", "-c", "./run-test.sh" ] diff --git a/csit/resources/scripts/build-csit-docker-image.sh b/csit/resources/scripts/build-csit-docker-image.sh index 8b5aa7d6..ad5dd7e4 100755 --- a/csit/resources/scripts/build-csit-docker-image.sh +++ b/csit/resources/scripts/build-csit-docker-image.sh @@ -13,6 +13,8 @@ # 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. +# +# SPDX-License-Identifier: Apache-2.0 function clone_models() { # download models examples @@ -37,16 +39,21 @@ fi GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' "${WORKSPACE}"/.gitreview) export ROBOT_DOCKER_IMAGE="policy-csit-robot" -cd ${WORKSPACE}/csit/resources || exit +cd "${WORKSPACE}"/csit/resources || exit + +IMAGE_ID=$(docker images -q "onap/${ROBOT_DOCKER_IMAGE}") -docker image rm -f ${ROBOT_DOCKER_IMAGE} +if [ -n "$IMAGE_ID" ]; then + echo "Image onap/${ROBOT_DOCKER_IMAGE} exists. Removing..." + docker rmi "onap/${ROBOT_DOCKER_IMAGE}" +fi # get models clone_models -echo "Build robot framework docker image" +echo "Building robot framework docker image" docker build . --file Dockerfile --tag "onap/${ROBOT_DOCKER_IMAGE}" --quiet -docker save -o policy-csit-robot.tar ${ROBOT_DOCKER_IMAGE}:latest +docker save -o policy-csit-robot.tar "onap/${ROBOT_DOCKER_IMAGE}":latest -rm -rf ${WORKSPACE}/csit/resources/policy-csit-robot.tar -rm -rf ${WORKSPACE}/csit/resources/tests/models/ +rm -rf "${WORKSPACE}"/csit/resources/policy-csit-robot.tar +rm -rf "${WORKSPACE}"/csit/resources/tests/models/ diff --git a/csit/resources/scripts/cluster_setup.sh b/csit/resources/scripts/cluster_setup.sh new file mode 100755 index 00000000..6d72bac3 --- /dev/null +++ b/csit/resources/scripts/cluster_setup.sh @@ -0,0 +1,250 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2025 Nordix Foundation. 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +WORKSPACE=$(git rev-parse --show-toplevel) +export WORKSPACE + +export GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' "${WORKSPACE}"/.gitreview) + +# Source the shared config script +source "$(dirname "$0")/config_setup.sh" + +KAFKA_DIR=${WORKSPACE}/helm/cp-kafka +SET_VALUES="" + +ZK_CONTAINER="zookeeper-deployment" +KAFKA_CONTAINER="kafka-deployment" + +function spin_microk8s_cluster() { + echo "Verify if Microk8s cluster is running.." + microk8s version + exitcode="${?}" + + if [ "$exitcode" -ne 0 ]; then + echo "Microk8s cluster not available, Spinning up the cluster.." + sudo snap install microk8s --classic --channel=1.30/stable + + if [ "${?}" -ne 0 ]; then + echo "Failed to install kubernetes cluster. Aborting.." + return 1 + fi + echo "Microk8s cluster installed successfully" + sudo usermod -a -G microk8s $USER + echo "Enabling DNS and Storage plugins" + sudo microk8s.enable dns hostpath-storage + echo "Creating configuration file for Microk8s" + sudo mkdir -p $HOME/.kube + sudo chown -R $USER:$USER $HOME/.kube + sudo microk8s kubectl config view --raw >$HOME/.kube/config + sudo chmod 600 $HOME/.kube/config + echo "K8s installation completed" + echo "----------------------------------------" + else + echo "K8s cluster is already running" + echo "----------------------------------------" + fi + + echo "Verify if kubectl is running.." + kubectl version + exitcode="${?}" + + if [ "$exitcode" -ne 0 ]; then + echo "Kubectl not available, Installing.." + sudo snap install kubectl --classic --channel=1.30/stable + + if [ "${?}" -ne 0 ]; then + echo "Failed to install Kubectl. Aborting.." + return 1 + fi + echo "Kubectl installation completed" + echo "----------------------------------------" + else + echo "Kubectl is already running" + echo "----------------------------------------" + return 0 + fi + + echo "Verify if helm is running.." + helm version + exitcode="${?}" + + if [ "$exitcode" -ne 0 ]; then + echo "Helm not available, Installing.." + sudo snap install helm --classic --channel=3.7 + + if [ "${?}" -ne 0 ]; then + echo "Failed to install Helm client. Aborting.." + return 1 + fi + echo "Helm installation completed" + echo "----------------------------------------" + else + echo "Helm is already running" + echo "----------------------------------------" + return 0 + fi +} + +function install_kafka() { + echo "Installing Confluent kafka" + kubectl apply -f $KAFKA_DIR/zookeeper.yaml + kubectl apply -f $KAFKA_DIR/kafka.yaml + echo "----------------------------------------" +} + +function uninstall_policy() { + echo "Removing the policy helm deployment" + helm uninstall csit-policy + helm uninstall prometheus + helm uninstall csit-robot + kubectl delete deploy $ZK_CONTAINER $KAFKA_CONTAINER + rm -rf ${WORKSPACE}/helm/policy/Chart.lock + if [ "$PROJECT" == "clamp" ] || [ "$PROJECT" == "policy-clamp" ]; then + helm uninstall policy-chartmuseum + helm repo remove chartmuseum-git policy-chartmuseum + fi + sudo rm -rf /dockerdata-nfs/mariadb-galera/ + kubectl delete pvc --all + echo "Policy deployment deleted" + echo "Clean up docker" + docker image prune -f +} + +function teardown_cluster() { + echo "Removing k8s cluster and k8s configuration file" + sudo snap remove microk8s;rm -rf $HOME/.kube/config + sudo snap remove helm; + sudo snap remove kubectl; + echo "MicroK8s Cluster removed" +} + +function install_chartmuseum () { + echo "---------------------------------------------" + echo "Installing Chartmuseum helm repository..." + helm repo add chartmuseum-git https://chartmuseum.github.io/charts + helm repo update + helm install policy-chartmuseum chartmuseum-git/chartmuseum --set env.open.DISABLE_API=false --set service.type=NodePort --set service.nodePort=30208 + helm plugin install https://github.com/chartmuseum/helm-push + echo "---------------------------------------------" +} + +function get_pod_name() { + pods=$(kubectl get pods --no-headers -o custom-columns=':metadata.name' | grep $1) + read -rd '' -a pod_array <<< "$pods" + echo "${pod_array[@]}" +} + +function wait_for_pods_running() { + local namespace="$1" + shift + local timeout_seconds="$1" + shift + + IFS=',' read -ra pod_names <<< "$@" + shift + + local pending_pods=("${pod_names[@]}") + local start_time + start_time=$(date +%s) + + while [ ${#pending_pods[@]} -gt 0 ]; do + local current_time + current_time=$(date +%s) + local elapsed_time + elapsed_time=$((current_time - start_time)) + + if [ "$elapsed_time" -ge "$timeout_seconds" ]; then + echo "Timed out waiting for the pods to reach 'Running' state." + echo "Printing the current status of the deployment before exiting.." + kubectl get po; + kubectl describe pods; + echo "------------------------------------------------------------" + for pod in "${pending_pods[@]}"; do + echo "Logs of the pod $pod" + kubectl logs $pod + echo "---------------------------------------------------------" + done + exit 1 + fi + + local newly_running_pods=() + + for pod_name_prefix in "${pending_pods[@]}"; do + local pod_names=$(get_pod_name "$pod_name_prefix") + IFS=' ' read -r -a pod_array <<< "$pod_names" + if [ "${#pod_array[@]}" -eq 0 ]; then + echo "*** Error: No pods found for the deployment $pod_name_prefix . Exiting ***" + return -1 + fi + for pod in "${pod_array[@]}"; do + local pod_status + local pod_ready + pod_status=$(kubectl get pod "$pod" -n "$namespace" --no-headers -o custom-columns=STATUS:.status.phase 2>/dev/null) + pod_ready=$(kubectl get pod "$pod" -o jsonpath='{.status.containerStatuses[*].ready}') + + if [ "$pod_status" == "Running" ] && { [ "$pod_ready" == "true" ] || [ "$pod_ready" == "true true" ]; }; then + echo "Pod '$pod' in namespace '$namespace' is now in 'Running' state and 'Readiness' is true" + else + newly_running_pods+=("$pod") + echo "Waiting for pod '$pod' in namespace '$namespace' to reach 'Running' and 'Ready' state..." + fi + done + done + + pending_pods=("${newly_running_pods[@]}") + + sleep 5 + done + + echo "All specified pods are in the 'Running and Ready' state. Exiting the function." +} + +OPERATION="$1" +PROJECT="$2" +LOCALIMAGE="${3:-false}" + +if [ $OPERATION == "install" ]; then + spin_microk8s_cluster + if [ "${?}" -eq 0 ]; then + export KAFKA_CONTAINERS=($KAFKA_CONTAINER,$ZK_CONTAINER) + install_kafka + wait_for_pods_running default 300 $KAFKA_CONTAINERS + set_project_config "$PROJECT" + echo "Installing policy helm charts in the default namespace" + source ${WORKSPACE}/compose/get-k8s-versions.sh + if [ $LOCALIMAGE == "true" ]; then + echo "loading local image" + source ${WORKSPACE}/compose/get-versions.sh + ${WORKSPACE}/compose/loaddockerimage.sh + fi + cd ${WORKSPACE}/helm || exit + helm dependency build policy + helm install csit-policy policy ${SET_VALUES} + helm install prometheus prometheus + wait_for_pods_running default 900 ${READINESS_CONTAINERS[@]} + echo "Policy chart installation completed" + echo "-------------------------------------------" + fi +elif [ $OPERATION == "uninstall" ]; then + uninstall_policy +elif [ $OPERATION == "clean" ]; then + teardown_cluster +else + echo "Invalid arguments provided. Usage: $0 [options..] {install {project_name} | uninstall | clean} {uselocalimage = true/false}" +fi diff --git a/csit/resources/scripts/config_setup.sh b/csit/resources/scripts/config_setup.sh new file mode 100755 index 00000000..bd039958 --- /dev/null +++ b/csit/resources/scripts/config_setup.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2025 Nordix Foundation. All rights reserved. +# Modifications Copyright 2025 Deutsche Telekom +# ================================================================================ +# 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +export POLICY_CLAMP_ROBOT="policy-clamp-test.robot clamp-slas.robot" +export POLICY_API_ROBOT="api-test.robot api-slas.robot" +export POLICY_PAP_ROBOT="pap-test.robot pap-slas.robot" +export POLICY_APEX_PDP_ROBOT="apex-pdp-test.robot apex-slas.robot" +export POLICY_XACML_PDP_ROBOT="xacml-pdp-test.robot xacml-pdp-slas.robot" +export POLICY_OPA_PDP_ROBOT="opa-pdp-test.robot opa-pdp-slas.robot" +export POLICY_DROOLS_PDP_ROBOT="drools-pdp-test.robot" +export POLICY_DISTRIBUTION_ROBOT="distribution-test.robot" + +export POLICY_API_CONTAINER="policy-api" +export POLICY_PAP_CONTAINER="policy-pap" +export POLICY_CLAMP_CONTAINER="policy-clamp-runtime-acm" +export POLICY_APEX_CONTAINER="policy-apex-pdp" +export POLICY_DROOLS_CONTAINER="policy-drools-pdp" +export POLICY_XACML_CONTAINER="policy-xacml-pdp" +export POLICY_OPA_CONTAINER="policy-opa-pdp" +export POLICY_DISTRIBUTION_CONTAINER="policy-distribution" +export POLICY_K8S_PPNT_CONTAINER="policy-clamp-ac-k8s-ppnt" +export POLICY_HTTP_PPNT_CONTAINER="policy-clamp-ac-http-ppnt" +export POLICY_SIM_PPNT_CONTAINER="policy-clamp-ac-sim-ppnt" +export POLICY_PF_PPNT_CONTAINER="policy-clamp-ac-pf-ppnt" +export JAEGER_CONTAINER="jaeger" + +function install_chartmuseum () { + echo "---------------------------------------------" + echo "Installing Chartmuseum helm repository..." + helm repo add chartmuseum-git https://chartmuseum.github.io/charts + helm repo update + helm install policy-chartmuseum chartmuseum-git/chartmuseum --set env.open.DISABLE_API=false --set service.type=NodePort --set service.nodePort=30208 + helm plugin install https://github.com/chartmuseum/helm-push + echo "---------------------------------------------" +} + +function set_project_config() { + echo "Setting project configuration for: $PROJECT" + case $PROJECT in + clamp | policy-clamp) + export ROBOT_FILE=$POLICY_CLAMP_ROBOT + export READINESS_CONTAINERS=($POLICY_CLAMP_CONTAINER,$POLICY_APEX_CONTAINER,$POLICY_PF_PPNT_CONTAINER,$POLICY_K8S_PPNT_CONTAINER, + $POLICY_HTTP_PPNT_CONTAINER,$POLICY_SIM_PPNT_CONTAINER,$JAEGER_CONTAINER) + export SET_VALUES="--set $POLICY_CLAMP_CONTAINER.enabled=true --set $POLICY_APEX_CONTAINER.enabled=true + --set $POLICY_PF_PPNT_CONTAINER.enabled=true --set $POLICY_K8S_PPNT_CONTAINER.enabled=true + --set $POLICY_HTTP_PPNT_CONTAINER.enabled=true --set $POLICY_SIM_PPNT_CONTAINER.enabled=true + --set $JAEGER_CONTAINER.enabled=true" + install_chartmuseum + ;; + api | policy-api) + export ROBOT_FILE=$POLICY_API_ROBOT + export READINESS_CONTAINERS=($POLICY_API_CONTAINER) + ;; + pap | policy-pap) + export ROBOT_FILE=$POLICY_PAP_ROBOT + export READINESS_CONTAINERS=($POLICY_APEX_CONTAINER,$POLICY_PAP_CONTAINER,$POLICY_API_CONTAINER,$POLICY_XACML_CONTAINER) + export SET_VALUES="--set $POLICY_APEX_CONTAINER.enabled=true --set $POLICY_XACML_CONTAINER.enabled=true" + ;; + apex-pdp | policy-apex-pdp) + export ROBOT_FILE=$POLICY_APEX_PDP_ROBOT + export READINESS_CONTAINERS=($POLICY_APEX_CONTAINER,$POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER) + export SET_VALUES="--set $POLICY_APEX_CONTAINER.enabled=true" + ;; + xacml-pdp | policy-xacml-pdp) + export ROBOT_FILE=($POLICY_XACML_PDP_ROBOT) + export READINESS_CONTAINERS=($POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER,$POLICY_XACML_CONTAINER) + export SET_VALUES="--set $POLICY_XACML_CONTAINER.enabled=true" + ;; + opa-pdp | policy-opa-pdp) + export ROBOT_FILE=($POLICY_OPA_PDP_ROBOT) + export READINESS_CONTAINERS=($POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER,$POLICY_OPA_CONTAINER) + export SET_VALUES="--set $POLICY_OPA_CONTAINER.enabled=true" + ;; + drools-pdp | policy-drools-pdp) + export ROBOT_FILE=($POLICY_DROOLS_PDP_ROBOT) + export READINESS_CONTAINERS=($POLICY_DROOLS_CONTAINER) + export SET_VALUES="--set $POLICY_DROOLS_CONTAINER.enabled=true" + ;; + distribution | policy-distribution) + export ROBOT_FILE=($POLICY_DISTRIBUTION_ROBOT) + export READINESS_CONTAINERS=($POLICY_APEX_CONTAINER,$POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER,$POLICY_DISTRIBUTION_CONTAINER) + export SET_VALUES="--set $POLICY_APEX_CONTAINER.enabled=true --set $POLICY_DISTRIBUTION_CONTAINER.enabled=true" + ;; + *) + echo "Unknown project supplied. Enabling all policy charts for the deployment" + export READINESS_CONTAINERS=($POLICY_APEX_CONTAINER,$POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER, + $POLICY_DISTRIBUTION_CONTAINER,$POLICY_DROOLS_CONTAINER,$POLICY_XACML_CONTAINER,$POLICY_OPA_CONTAINER, + $POLICY_CLAMP_CONTAINER,$POLICY_PF_PPNT_CONTAINER,$POLICY_K8S_PPNT_CONTAINER, + $POLICY_HTTP_PPNT_CONTAINER,$POLICY_SIM_PPNT_CONTAINER) + export SET_VALUES="--set $POLICY_APEX_CONTAINER.enabled=true --set $POLICY_XACML_CONTAINER.enabled=true + --set $POLICY_OPA_CONTAINER.enabled=true --set $POLICY_DISTRIBUTION_CONTAINER.enabled=true --set $POLICY_DROOLS_CONTAINER.enabled=true + --set $POLICY_CLAMP_CONTAINER.enabled=true --set $POLICY_PF_PPNT_CONTAINER.enabled=true + --set $POLICY_K8S_PPNT_CONTAINER.enabled=true --set $POLICY_HTTP_PPNT_CONTAINER.enabled=true + --set $POLICY_SIM_PPNT_CONTAINER.enabled=true" + ;; + esac +} diff --git a/csit/resources/scripts/get-cluster-info.sh b/csit/resources/scripts/get-cluster-info.sh index 75fe7193..1252f3e4 100755 --- a/csit/resources/scripts/get-cluster-info.sh +++ b/csit/resources/scripts/get-cluster-info.sh @@ -133,7 +133,38 @@ function expose_services() { patch_ports } +# Port forward Kafka to handle traffic to/from JMeter +function setup_kafka_connection() { + # Get the Kafka pod name + KAFKA_POD=$(kubectl get pods -l app=kafka -o jsonpath="{.items[0].metadata.name}") + + # Set up port forwarding + kubectl port-forward pod/$KAFKA_POD 29092:29092 & + PF_PID=$! + + # Wait for port forwarding to be established + sleep 5 + + KAFKA_POD_IP=$(kubectl get pod $KAFKA_POD -o jsonpath='{.status.podIP}') + + # Update hosts file + echo "127.0.0.1 $KAFKA_POD" | sudo tee -a /etc/hosts + + export KAFKA_HOST="127.0.0.1" + export KAFKA_PORT="29092" +} + +function teardown_kafka_connection() { + kill $PF_PID + sudo sed -i "/$KAFKA_POD/d" /etc/hosts +} + ####MAIN### -get_pod_names -get_svc_names -expose_services +if [ "$1" = "teardown" ]; then + teardown_kafka_connection +else + get_pod_names + get_svc_names + expose_services + setup_kafka_connection +fi
\ No newline at end of file diff --git a/csit/resources/scripts/robot_setup.sh b/csit/resources/scripts/robot_setup.sh new file mode 100755 index 00000000..f5ef2f3d --- /dev/null +++ b/csit/resources/scripts/robot_setup.sh @@ -0,0 +1,162 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2025 Nordix Foundation. 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +WORKSPACE=$(git rev-parse --show-toplevel) +export WORKSPACE + +export ROBOT_FILE="" + +PROJECT="$1" +CSIT_SCRIPT="scripts/run-test.sh" +ROBOT_DOCKER_IMAGE="policy-csit-robot" +ROBOT_LOG_DIR=${WORKSPACE}/csit/archives + +# Source the shared config script +source "$(dirname "$0")/config_setup.sh" + +DISTRIBUTION_CSAR=${WORKSPACE}/csit/resources/tests/data/csar +DIST_TEMP_FOLDER=/tmp/distribution + +function clone_models() { + local retry_count=3 + local success=false + cd tests + for ((i = 1; i <= retry_count; i++)); do + git clone "https://gerrit.onap.org/r/policy/models" && success=true && break + echo "Retrying git clone ($i/$retry_count)..." + sleep 5 + done + + cd ../ + if [ "$success" = false ]; then + echo "Error: failed to clone policy-models repository after $retry_count attempts" + exit 1 + fi + + sed -e 's!Measurement_vGMUX!ADifferentValue!' \ + tests/models/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.json \ + >tests/models/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.v1_2.json + + sed -e 's!"version": "1.0.0"!"version": "2.0.0"!' \ + -e 's!"policy-version": 1!"policy-version": 2!' \ + tests/models/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.json \ + >tests/models/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.v2.json + +} + +function copy_csar_file() { + zip -F ${DISTRIBUTION_CSAR}/sample_csar_with_apex_policy.csar \ + --out ${DISTRIBUTION_CSAR}/csar_temp.csar -q + sudo rm -rf "${DIST_TEMP_FOLDER}" + sudo mkdir "${DIST_TEMP_FOLDER}" + sudo cp ${DISTRIBUTION_CSAR}/csar_temp.csar ${DISTRIBUTION_CSAR}/temp.csar + sudo mv ${DISTRIBUTION_CSAR}/temp.csar ${DIST_TEMP_FOLDER}/sample_csar_with_apex_policy.csar +} + +function build_robot_image() { + echo "Build docker image for robot framework" + cd ${WORKSPACE}/csit/resources || exit + clone_models + if [ "${PROJECT}" == "distribution" ] || [ "${PROJECT}" == "policy-distribution" ]; then + copy_csar_file + fi + echo "Build robot framework docker image" + sudo apt install gnupg2 pass -y + export DOCKERPW=docker + echo "$DOCKERPW" | docker login -u docker --password-stdin nexus3.onap.org:10001 + docker build . --file Dockerfile \ + --build-arg CSIT_SCRIPT="$CSIT_SCRIPT" \ + --build-arg ROBOT_FILE="$ROBOT_FILE" \ + --tag "${ROBOT_DOCKER_IMAGE}" --no-cache + echo "---------------------------------------------" +} + +function push_acelement_chart() { + echo "Pushing acelement chart to the chartmuseum repo..." + helm repo add policy-chartmuseum http://localhost:30208 + cd tests || exit + local retry_count=3 + local success=false + for ((i = 1; i <= retry_count; i++)); do + git clone "https://gerrit.onap.org/r/policy/clamp" && success=true && break + echo "Retrying git clone ($i/$retry_count)..." + sleep 5 + done + + ACELEMENT_CHART=${WORKSPACE}/csit/resources/tests/clamp/examples/src/main/resources/clamp/acm/acelement-helm/acelement + helm cm-push $ACELEMENT_CHART policy-chartmuseum + helm repo update + rm -rf ${WORKSPACE}/csit/resources/tests/clamp/ + echo "-------------------------------------------" +} + +function print_robot_log() { + count_pods=0 + while [[ ${count_pods} -eq 0 ]]; do + echo "Waiting for pods to come up..." + sleep 5 + count_pods=$(kubectl get pods --output name | wc -l) + done + robotpod=$(kubectl get po | grep policy-csit) + podName=$(echo "$robotpod" | awk '{print $1}') + echo "The robot tests will begin once the policy components {${READINESS_CONTAINERS[*]}} are up and running..." + kubectl wait --for=jsonpath='{.status.phase}'=Running --timeout=18m pod/"$podName" + echo "Policy deployment status:" + kubectl get po + kubectl get all -A + echo "Robot Test logs:" + kubectl logs -f "$podName" +} + +function start_csit() { + build_robot_image + if [ "${?}" -eq 0 ]; then + echo "Importing robot image into microk8s registry" + docker save -o policy-csit-robot.tar ${ROBOT_DOCKER_IMAGE}:latest + sudo microk8s ctr image import policy-csit-robot.tar + rm -rf ${WORKSPACE}/csit/resources/policy-csit-robot.tar + rm -rf ${WORKSPACE}/csit/resources/tests/models/ + echo "---------------------------------------------" + if [ "$PROJECT" == "clamp" ] || [ "$PROJECT" == "policy-clamp" ]; then + POD_READY_STATUS="0/1" + while [[ ${POD_READY_STATUS} != "1/1" ]]; do + echo "Waiting for chartmuseum pod to come up..." + sleep 5 + POD_READY_STATUS=$(kubectl get pods | grep -e "policy-chartmuseum" | awk '{print $2}') + done + push_acelement_chart + fi + echo "Installing Robot framework pod for running CSIT" + cd ${WORKSPACE}/helm || exit + mkdir -p ${ROBOT_LOG_DIR} + helm install csit-robot robot --set robot="$ROBOT_FILE" --set "readiness={$(echo ${READINESS_CONTAINERS} | sed 's/[{}]//g' | sed 's/,$//')}" --set robotLogDir=$ROBOT_LOG_DIR + print_robot_log + fi +} + +if [ "$PROJECT" ]; then + set_project_config "$PROJECT" + export ROBOT_LOG_DIR=${WORKSPACE}/csit/archives/${PROJECT} + echo "CSIT will be invoked from $ROBOT_FILE" + echo "Readiness containers: ${READINESS_CONTAINERS[*]}" + echo "-------------------------------------------" + start_csit +else + echo "No project supplied for running CSIT" +fi diff --git a/csit/resources/tests/apex-pdp-test.robot b/csit/resources/tests/apex-pdp-test.robot index cf4c713d..0de2b908 100644 --- a/csit/resources/tests/apex-pdp-test.robot +++ b/csit/resources/tests/apex-pdp-test.robot @@ -58,20 +58,20 @@ Metrics [Documentation] Verify policy-apex-pdp is exporting prometheus metrics ${auth}= PolicyAdminAuth ${resp}= PerformGetRequest ${APEX_IP} /metrics 200 null ${auth} - Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="TOTAL",} 3.0 - Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="SUCCESS",} 3.0 - Should Contain ${resp.text} pdpa_policy_executions_total{status="SUCCESS",} 3.0 - Should Contain ${resp.text} pdpa_policy_executions_total{status="TOTAL",} 3.0 - Should Match ${resp.text} *pdpa_engine_event_executions{engine_instance_id="NSOApexEngine-*:0.0.1",}* - Should Match ${resp.text} *pdpa_engine_event_executions{engine_instance_id="MyApexEngine-*:0.0.1",}* - Should Match ${resp.text} *pdpa_engine_state{engine_instance_id=*,} 2.0* + Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="TOTAL"} 3.0 + Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="SUCCESS"} 3.0 + Should Contain ${resp.text} pdpa_policy_executions_total{status="SUCCESS"} 3.0 + Should Contain ${resp.text} pdpa_policy_executions_total{status="TOTAL"} 3.0 + Should Match ${resp.text} *pdpa_engine_event_executions{engine_instance_id="NSOApexEngine-*:0.0.1"}* + Should Match ${resp.text} *pdpa_engine_event_executions{engine_instance_id="MyApexEngine-*:0.0.1"}* + Should Match ${resp.text} *pdpa_engine_state{engine_instance_id=*} 2.0* Should Contain ${resp.text} pdpa_engine_event_executions Should Contain ${resp.text} pdpa_engine_average_execution_time_seconds Should Contain ${resp.text} pdpa_engine_last_execution_time_bucket Should Contain ${resp.text} pdpa_engine_last_execution_time_count Should Contain ${resp.text} pdpa_engine_last_execution_time_sum - Should Match ${resp.text} *pdpa_engine_last_start_timestamp_epoch{engine_instance_id="NSOApexEngine-*:0.0.1",}*E12* - Should Match ${resp.text} *pdpa_engine_last_start_timestamp_epoch{engine_instance_id="MyApexEngine-*:0.0.1",}*E12* + Should Match ${resp.text} *pdpa_engine_last_start_timestamp_epoch{engine_instance_id="NSOApexEngine-*:0.0.1"}*E12* + Should Match ${resp.text} *pdpa_engine_last_start_timestamp_epoch{engine_instance_id="MyApexEngine-*:0.0.1"}*E12* Should Contain ${resp.text} jvm_threads_current *** Keywords *** diff --git a/csit/resources/tests/api-test.robot b/csit/resources/tests/api-test.robot index e1b8fd47..a6130db4 100644 --- a/csit/resources/tests/api-test.robot +++ b/csit/resources/tests/api-test.robot @@ -60,7 +60,7 @@ RetrievePoliciesOfType RetrieveAllPolicies [Documentation] Retrieve all policies - FetchPolicies /policy/api/v1/policies 3 + FetchPolicies /policy/api/v1/policies 4 RetrieveSpecificPolicy [Documentation] Retrieve a policy named 'onap.restart.tca' and version '1.0.0' using generic api diff --git a/csit/resources/tests/common-library.robot b/csit/resources/tests/common-library.robot index e0b1c0f1..89a9c726 100644 --- a/csit/resources/tests/common-library.robot +++ b/csit/resources/tests/common-library.robot @@ -11,6 +11,15 @@ PolicyAdminAuth ${policyadmin}= Create list policyadmin zb!XztG34 RETURN ${policyadmin} +PerformPatchRequest + [Arguments] ${domain} ${url} ${expectedstatus} ${patchjson} ${params} ${auth} + Log Creating session http://${domain} + ${session}= Create Session policy http://${domain} auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= PATCH On Session policy ${url} data=${patchjson} params=${params} headers=${headers} expected_status=${expectedstatus} + Log Received response from policy ${resp.text} + RETURN ${resp} + PerformPostRequest [Arguments] ${domain} ${url} ${expectedstatus} ${postjson} ${params} ${auth} Log Creating session http://${domain} @@ -20,6 +29,15 @@ PerformPostRequest Log Received response from policy ${resp.text} RETURN ${resp} +PerformPostRequestWithYaml + [Arguments] ${domain} ${url} ${expectedstatus} ${postyaml} ${params} ${auth} + Log Creating session http://${domain} + ${session}= Create Session policy http://${domain} auth=${auth} + ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml + ${resp}= POST On Session policy ${url} data=${postyaml} params=${params} headers=${headers} expected_status=${expectedstatus} + Log Received response from policy ${resp.text} + RETURN ${resp} + PerformPutRequest [Arguments] ${domain} ${url} ${expectedstatus} ${params} ${auth} Log Creating session http://${domain} @@ -52,6 +70,20 @@ CreatePolicy ${policyadmin}= PolicyAdminAuth ${resp}= PerformPostRequest ${POLICY_API_IP} ${url} ${expectedstatus} ${postjson} null ${policyadmin} +CreatePolicyWithYaml + [Arguments] ${url} ${expectedstatus} ${postyaml} + [Documentation] Create the specific policy + ${policyadmin}= PolicyAdminAuth + ${resp}= PerformPostRequestWithYaml ${POLICY_API_IP} ${url} ${expectedstatus} ${postyaml} null ${policyadmin} + +CreateFailurePolicyWithYaml + [Arguments] ${url} ${expectedstatus} ${postyaml} ${keyword} + [Documentation] Trying to create policy with Invalid Data + ${policyadmin}= PolicyAdminAuth + ${resp}= PerformPostRequestWithYaml ${POLICY_API_IP} ${url} ${expectedstatus} ${postyaml} null ${policyadmin} + Should Contain ${resp.text} ${keyword} + + CreatePolicySuccessfully [Arguments] ${url} ${postjson} ${policyname} ${policyversion} [Documentation] Create the specific policy @@ -164,4 +196,4 @@ ValidatePolicyExecution ${resp}= QueryPrometheus ${url} ${rawNumber}= Evaluate ${resp['data']['result'][0]['value'][1]} ${actualTime}= Set Variable ${rawNumber * ${1000}} - Should Be True ${actualTime} <= ${executionTime}
\ No newline at end of file + Should Be True ${actualTime} <= ${executionTime} diff --git a/csit/resources/tests/data/AcK8s.json b/csit/resources/tests/data/AcK8s.json index 8585faf5..c8f1a838 100644 --- a/csit/resources/tests/data/AcK8s.json +++ b/csit/resources/tests/data/AcK8s.json @@ -1201,7 +1201,8 @@ "body": "{ \"receiverId\": { \"name\": \"onap.policy.clamp.ac.startertobridge\", \"version\": \"1.0.0\" }, \"timerMs\": 20000, \"elementType\": \"STARTER\", \"topicParameterGroup\": { \"server\": \"kafka:9092\", \"listenerTopic\": \"policy_update_msg\", \"publisherTopic\": \"ac_element_msg\", \"fetchTimeout\": 15000, \"topicCommInfrastructure\": \"kafka\" } }", "expectedResponse": 201 } - ] + ], + "password": "dummyPasswordStringForEncryption" } ] } @@ -1236,7 +1237,8 @@ "body": "{ \"receiverId\": { \"name\": \"onap.policy.clamp.ac.bridgetosink\", \"version\": \"1.0.0\" }, \"timerMs\": 20000, \"elementType\": \"BRIDGE\", \"topicParameterGroup\": { \"server\": \"kafka:9092\", \"listenerTopic\": \"policy_update_msg\", \"publisherTopic\": \"ac_element_msg\", \"fetchTimeout\": 15000, \"topicCommInfrastructure\": \"kafka\" } }", "expectedResponse": 201 } - ] + ], + "password": "dummyPasswordStringForEncryption" } ] } @@ -1271,7 +1273,8 @@ "body": "{ \"receiverId\": { \"name\": \"onap.policy.clamp.ac.sink\", \"version\": \"1.0.0\" }, \"timerMs\": 20000, \"elementType\": \"SINK\", \"topicParameterGroup\": { \"server\": \"kafka:9092\", \"listenerTopic\": \"policy_update_msg\", \"publisherTopic\": \"ac_element_msg\", \"fetchTimeout\": 15000, \"topicCommInfrastructure\": \"kafka\" } }", "expectedResponse": 201 } - ] + ], + "password": "dummyPasswordStringForEncryption" } ] } diff --git a/csit/resources/tests/data/ac-definition-migration-from.yaml b/csit/resources/tests/data/ac-definition-migration-from.yaml index f11b174c..2ed23d25 100644 --- a/csit/resources/tests/data/ac-definition-migration-from.yaml +++ b/csit/resources/tests/data/ac-definition-migration-from.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2024 Nordix Foundation. +# Copyright (C) 2024-2025 OpenInfra Foundation Europe. 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. @@ -58,8 +58,8 @@ node_types: in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously stage: - type: list - description: A list indicating the stages in which this automation composition element will be started, the + type: map + description: A map of list indicating for each operation the stages in which this automation composition element will be started, the first stage is zero. Automation Composition Elements are started in their stage order. Automation Composition Elements with the same stage are started simultaneously. @@ -90,6 +90,8 @@ node_types: type: string required: true description: The base URL to be prepended to each path, identifies the host for the REST endpoints. + metadata: + sensitive: true httpHeaders: type: map required: false @@ -123,7 +125,9 @@ topology_template: properties: provider: ONAP startPhase: 0 - stage: [1,2] + stage: + prepare: [1,2] + migrate: [1,2] onap.policy.clamp.ac.element.Sim_BridgeAutomationCompositionElement: version: 1.2.3 @@ -133,7 +137,9 @@ topology_template: properties: provider: ONAP startPhase: 0 - stage: [0,1] + stage: + prepare: [0,1] + migrate: [0,1] onap.policy.clamp.ac.element.Sim_SinkAutomationCompositionElement: version: 1.2.3 @@ -143,7 +149,9 @@ topology_template: properties: provider: ONAP startPhase: 0 - stage: [0,2] + stage: + prepare: [0,2] + migrate: [0,2] onap.policy.clamp.ac.element.AutomationCompositionDefinition: version: 1.2.3 diff --git a/csit/resources/tests/data/ac-definition-migration-to.yaml b/csit/resources/tests/data/ac-definition-migration-to.yaml index 179fe11c..905227d0 100644 --- a/csit/resources/tests/data/ac-definition-migration-to.yaml +++ b/csit/resources/tests/data/ac-definition-migration-to.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2024 Nordix Foundation. +# Copyright (C) 2024-2025 OpenInfra Foundation Europe. 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. @@ -58,8 +58,8 @@ node_types: in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously stage: - type: list - description: A list indicating the stages in which this automation composition element will be started, the + type: map + description: A map of list indicating for each operation the stages in which this automation composition element will be started, the first stage is zero. Automation Composition Elements are started in their stage order. Automation Composition Elements with the same stage are started simultaneously. @@ -90,6 +90,8 @@ node_types: type: string required: true description: The base URL to be prepended to each path, identifies the host for the REST endpoints. + metadata: + sensitive: true httpHeaders: type: map required: false @@ -123,7 +125,9 @@ topology_template: properties: provider: ONAP startPhase: 0 - stage: [1,2] + stage: + prepare: [1,2] + migrate: [1,2] onap.policy.clamp.ac.element.Sim_BridgeAutomationCompositionElement: version: 1.2.4 @@ -133,7 +137,9 @@ topology_template: properties: provider: ONAP startPhase: 0 - stage: [0,1] + stage: + prepare: [0,1] + migrate: [0,1] onap.policy.clamp.ac.element.Sim_NewAutomationCompositionElement: version: 1.2.4 @@ -143,7 +149,9 @@ topology_template: properties: provider: ONAP startPhase: 0 - stage: [0,2] + stage: + prepare: [0,2] + migrate: [0,2] onap.policy.clamp.ac.element.AutomationCompositionDefinition: version: 1.2.4 diff --git a/csit/resources/tests/data/acelement-usecase.yaml b/csit/resources/tests/data/acelement-usecase.yaml index b727a68f..84fd944c 100644 --- a/csit/resources/tests/data/acelement-usecase.yaml +++ b/csit/resources/tests/data/acelement-usecase.yaml @@ -73,6 +73,10 @@ data_types: type: org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest type_version: 1.0.0 description: A sequence of REST commands to send to the REST endpoint + password: + type: string + metadata: + sensitive: true node_types: org.onap.policy.clamp.acm.Participant: @@ -195,6 +199,8 @@ node_types: type: string required: true description: The base URL to be prepended to each path, identifies the host for the REST endpoints. + metadata: + sensitive: true httpHeaders: type: map required: false diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.data-empty.json b/csit/resources/tests/data/onap.policy.opa.pdp.data-empty.json new file mode 100644 index 00000000..cd74b413 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.data-empty.json @@ -0,0 +1,21 @@ +{ + "data": { + "node": { + "slice": { + "capacity": { + "check": { + "threshold": 70 + } + } + } + }, + "system": { + "version": { + "build_commit": "", + "build_hostname": "", + "build_timestamp": "", + "version": "1.1.0" + } + } + } +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.decision.badRequest.json b/csit/resources/tests/data/onap.policy.opa.pdp.decision.badRequest.json deleted file mode 100644 index b92aa88e..00000000 --- a/csit/resources/tests/data/onap.policy.opa.pdp.decision.badRequest.json +++ /dev/null @@ -1,2 +0,0 @@ -{"onapName":"CDS","onapComponent":"CDS","onapInstance":"CDS","currentDate": "2024-11-22", "currentTime": "2024-11-22T11:34:56Z", "timeZone": "UTC", "timeOffset": "+05:30", "currentDateTime": "2024-11-22T12:08:00Z" "policyName":"role/allow","input":{"user":"carol","action":"write","object":"id123","type":"dog"}} - diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.decision.request.json b/csit/resources/tests/data/onap.policy.opa.pdp.decision.request.json deleted file mode 100644 index 66132ea7..00000000 --- a/csit/resources/tests/data/onap.policy.opa.pdp.decision.request.json +++ /dev/null @@ -1 +0,0 @@ -{"onapName":"CDS","onapComponent":"CDS","onapInstance":"CDS","currentDate": "2024-11-22", "currentTime": "2024-11-22T11:34:56Z", "timeZone": "UTC", "timeOffset": "+05:30", "currentDateTime": "2024-11-22T12:08:00Z", "policyName":"role/allow","input":{"user":"alice","action":"write","object":"id123","type":"dog"}} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.decision.requestIndeterminate.json b/csit/resources/tests/data/onap.policy.opa.pdp.decision.requestIndeterminate.json deleted file mode 100644 index 352ddb55..00000000 --- a/csit/resources/tests/data/onap.policy.opa.pdp.decision.requestIndeterminate.json +++ /dev/null @@ -1,2 +0,0 @@ -{"onapName":"CDS","onapComponent":"CDS","onapInstance":"CDS","currentDate": "2024-11-22", "currentTime": "2024-11-22T11:34:56Z", "timeZone": "UTC", "timeOffset": "+05:30", "currentDateTime": "2024-11-22T12:08:00Z", "policyName":"role1/allow","input":{"user":"alice","action":"write","object":"id123","type":"dog"}} - diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.decision.requestfailure.json b/csit/resources/tests/data/onap.policy.opa.pdp.decision.requestfailure.json deleted file mode 100644 index e9aea14a..00000000 --- a/csit/resources/tests/data/onap.policy.opa.pdp.decision.requestfailure.json +++ /dev/null @@ -1 +0,0 @@ -{"onapName":"CDS","onapComponent":"CDS","onapInstance":"CDS","currentDate": "2024-11-22", "currentTime": "2024-11-22T11:34:56Z", "timeZone": "UTC", "timeOffset": "+05:30", "currentDateTime": "2024-11-22T12:08:00Z", "policyName":"role/allow","input":{"user":"carol","action":"write","object":"id123","type":"dog"}} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.decision.zone-incorrect-policyfilter.json b/csit/resources/tests/data/onap.policy.opa.pdp.decision.zone-incorrect-policyfilter.json new file mode 100644 index 00000000..ab124b67 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.decision.zone-incorrect-policyfilter.json @@ -0,0 +1,29 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+05:30", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "policyName": "zoneB", + "policyFilter": [ + "has_ze_access" + ], + "input": { + "actions": [ + "view" + ], + "log_id": "log1", + "datatypes": [ + "access", + "user" + ], + "time_period": { + "from": "2024-11-01T09:00:00Z", + "to": "2024-11-01T10:00:00Z" + }, + "zone_id": "zoneA" + } +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.decision.zone-incorrect-policyname.json b/csit/resources/tests/data/onap.policy.opa.pdp.decision.zone-incorrect-policyname.json new file mode 100644 index 00000000..199b10d8 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.decision.zone-incorrect-policyname.json @@ -0,0 +1,29 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+05:30", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "policyName": "zoeB", + "policyFilter": [ + "has_zone_access" + ], + "input": { + "actions": [ + "view" + ], + "log_id": "log1", + "datatypes": [ + "access", + "user" + ], + "time_period": { + "from": "2024-11-01T09:00:00Z", + "to": "2024-11-01T10:00:00Z" + }, + "zone_id": "zoneA" + } +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.decision.zone-policy-output.json b/csit/resources/tests/data/onap.policy.opa.pdp.decision.zone-policy-output.json new file mode 100644 index 00000000..1e7228dd --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.decision.zone-policy-output.json @@ -0,0 +1,12 @@ +{ + "output": { + "has_zone_access": [ + { + "access": "granted", + "user": "user1" + } + ] + }, + "policyName": "zoneB", + "statusMessage": "OPA Allowed" +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-add-output.json b/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-add-output.json new file mode 100644 index 00000000..eac292e5 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-add-output.json @@ -0,0 +1,19 @@ +{ + "data": { + "round": "trail", + "vehicles": [ + { + "owner": "user1", + "status": "available", + "type": "car", + "vehicle_id": "v1" + }, + { + "owner": "user2", + "status": "in use", + "type": "bike", + "vehicle_id": "v2" + } + ] + } +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-add.json b/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-add.json new file mode 100644 index 00000000..04478eec --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-add.json @@ -0,0 +1 @@ +{"onapName": "CDS","onapComponent": "CDS","onapInstance": "CDS","currentDateTime": "2025-01-17T08:26:41.857Z","currentDate": "2025-01-17","currentTime": "08:26:41.857Z","timeZone": "UTC","timeOffset": "+08:45","policyName": "vehicle","data": [{"op": "add","path": "/round","value": "trail"}]} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-remove.json b/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-remove.json new file mode 100644 index 00000000..a4cac2f3 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-remove.json @@ -0,0 +1,17 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+08:45", + "policyName": "vehicle", + "data": [ + { + "op": "remove", + "path": "/round" + } + ] +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-replace-output.json b/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-replace-output.json new file mode 100644 index 00000000..8c00e047 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-replace-output.json @@ -0,0 +1,19 @@ +{ + "data": { + "round": 578, + "vehicles": [ + { + "owner": "user1", + "status": "available", + "type": "car", + "vehicle_id": "v1" + }, + { + "owner": "user2", + "status": "in use", + "type": "bike", + "vehicle_id": "v2" + } + ] + } +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-replace.json b/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-replace.json new file mode 100644 index 00000000..c45138c0 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.dyn-data-replace.json @@ -0,0 +1,18 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+08:45", + "policyName": "vehicle", + "data": [ + { + "op": "replace", + "path": "/round", + "value": 578 + } + ] +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-create.yaml b/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-create.yaml new file mode 100644 index 00000000..759fc162 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-create.yaml @@ -0,0 +1,16 @@ +tosca_definitions_version: tosca_simple_yaml_1_1_0 +topology_template: + policies: + - abac: + type: onap.policies.native.opa + type_version: 1.0.0 + properties: + data: + node.abac: ewogICAgInNlbnNvcl9kYXRhIjogWwogICAgICAgIHsKICAgICAgICAgICAgImlkIjogIjAwMDEiLAogICAgICAgICAgICAibG9jYXRpb24iOiAiU3JpIExhbmthIiwKICAgICAgICAgICAgInRlbXBlcmF0dXJlIjogIjI4IEMiLAogICAgICAgICAgICAicHJlY2lwaXRhdGlvbiI6ICIxMDAwIG1tIiwKICAgICAgICAgICAgIndpbmRzcGVlZCI6ICI1LjUgbS9zIiwKICAgICAgICAgICAgImh1bWlkaXR5IjogIjQwJSIsCiAgICAgICAgICAgICJwYXJ0aWNsZV9kZW5zaXR5IjogIjEuMyBnL2wiLAogICAgICAgICAgICAidGltZXN0YW1wIjogIjIwMjQtMDItMjYiCiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJpZCI6ICIwMDAyIiwKICAgICAgICAgICAgImxvY2F0aW9uIjogIkNvbG9tYm8iLAogICAgICAgICAgICAidGVtcGVyYXR1cmUiOiAiMzAgQyIsCiAgICAgICAgICAgICJwcmVjaXBpdGF0aW9uIjogIjEyMDAgbW0iLAogICAgICAgICAgICAid2luZHNwZWVkIjogIjYuMCBtL3MiLAogICAgICAgICAgICAiaHVtaWRpdHkiOiAiNDUlIiwKICAgICAgICAgICAgInBhcnRpY2xlX2RlbnNpdHkiOiAiMS41IGcvbCIsCiAgICAgICAgICAgICJ0aW1lc3RhbXAiOiAiMjAyNC0wMi0yNiIKICAgICAgICB9LAogICAgICAgIHsKICAgICAgICAgICAgImlkIjogIjAwMDMiLAogICAgICAgICAgICAibG9jYXRpb24iOiAiS2FuZHkiLAogICAgICAgICAgICAidGVtcGVyYXR1cmUiOiAiMjUgQyIsCiAgICAgICAgICAgICJwcmVjaXBpdGF0aW9uIjogIjgwMCBtbSIsCiAgICAgICAgICAgICJ3aW5kc3BlZWQiOiAiNC41IG0vcyIsCiAgICAgICAgICAgICJodW1pZGl0eSI6ICI2MCUiLAogICAgICAgICAgICAicGFydGljbGVfZGVuc2l0eSI6ICIxLjEgZy9sIiwKICAgICAgICAgICAgInRpbWVzdGFtcCI6ICIyMDI0LTAyLTI2IgogICAgICAgIH0sCiAgICAgICAgewogICAgICAgICAgICAiaWQiOiAiMDAwNCIsCiAgICAgICAgICAgICJsb2NhdGlvbiI6ICJHYWxsZSIsCiAgICAgICAgICAgICJ0ZW1wZXJhdHVyZSI6ICIzNSBDIiwKICAgICAgICAgICAgInByZWNpcGl0YXRpb24iOiAiNTAwIG1tIiwKICAgICAgICAgICAgIndpbmRzcGVlZCI6ICI3LjIgbS9zIiwKICAgICAgICAgICAgImh1bWlkaXR5IjogIjMwJSIsCiAgICAgICAgICAgICJwYXJ0aWNsZV9kZW5zaXR5IjogIjEuOCBnL2wiLAogICAgICAgICAgICAidGltZXN0YW1wIjogIjIwMjQtMDItMjciCiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJpZCI6ICIwMDA1IiwKICAgICAgICAgICAgImxvY2F0aW9uIjogIkphZmZuYSIsCiAgICAgICAgICAgICJ0ZW1wZXJhdHVyZSI6ICItNSBDIiwKICAgICAgICAgICAgInByZWNpcGl0YXRpb24iOiAiMzAwIG1tIiwKICAgICAgICAgICAgIndpbmRzcGVlZCI6ICIzLjggbS9zIiwKICAgICAgICAgICAgImh1bWlkaXR5IjogIjIwJSIsCiAgICAgICAgICAgICJwYXJ0aWNsZV9kZW5zaXR5IjogIjAuOSBnL2wiLAogICAgICAgICAgICAidGltZXN0YW1wIjogIjIwMjQtMDItMjciCiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJpZCI6ICIwMDA2IiwKICAgICAgICAgICAgImxvY2F0aW9uIjogIlRyaW5jb21hbGVlIiwKICAgICAgICAgICAgInRlbXBlcmF0dXJlIjogIjIwIEMiLAogICAgICAgICAgICAicHJlY2lwaXRhdGlvbiI6ICIxMDAwIG1tIiwKICAgICAgICAgICAgIndpbmRzcGVlZCI6ICI1LjAgbS9zIiwKICAgICAgICAgICAgImh1bWlkaXR5IjogIjU1JSIsCiAgICAgICAgICAgICJwYXJ0aWNsZV9kZW5zaXR5IjogIjEuMiBnL2wiLAogICAgICAgICAgICAidGltZXN0YW1wIjogIjIwMjQtMDItMjgiCiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJpZCI6ICIwMDA3IiwKICAgICAgICAgICAgImxvY2F0aW9uIjogIk51d2FyYSBFbGl5YSIsCiAgICAgICAgICAgICJ0ZW1wZXJhdHVyZSI6ICIyNSBDIiwKICAgICAgICAgICAgInByZWNpcGl0YXRpb24iOiAiNjAwIG1tIiwKICAgICAgICAgICAgIndpbmRzcGVlZCI6ICI0LjAgbS9zIiwKICAgICAgICAgICAgImh1bWlkaXR5IjogIjUwJSIsCiAgICAgICAgICAgICJwYXJ0aWNsZV9kZW5zaXR5IjogIjEuMyBnL2wiLAogICAgICAgICAgICAidGltZXN0YW1wIjogIjIwMjQtMDItMjgiCiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJpZCI6ICIwMDA4IiwKICAgICAgICAgICAgImxvY2F0aW9uIjogIkFudXJhZGhhcHVyYSIsCiAgICAgICAgICAgICJ0ZW1wZXJhdHVyZSI6ICIyOCBDIiwKICAgICAgICAgICAgInByZWNpcGl0YXRpb24iOiAiNzAwIG1tIiwKICAgICAgICAgICAgIndpbmRzcGVlZCI6ICI1LjggbS9zIiwKICAgICAgICAgICAgImh1bWlkaXR5IjogIjQwJSIsCiAgICAgICAgICAgICJwYXJ0aWNsZV9kZW5zaXR5IjogIjEuNCBnL2wiLAogICAgICAgICAgICAidGltZXN0YW1wIjogIjIwMjQtMDItMjkiCiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJpZCI6ICIwMDA5IiwKICAgICAgICAgICAgImxvY2F0aW9uIjogIk1hdGFyYSIsCiAgICAgICAgICAgICJ0ZW1wZXJhdHVyZSI6ICIzMiBDIiwKICAgICAgICAgICAgInByZWNpcGl0YXRpb24iOiAiOTAwIG1tIiwKICAgICAgICAgICAgIndpbmRzcGVlZCI6ICI2LjUgbS9zIiwKICAgICAgICAgICAgImh1bWlkaXR5IjogIjY1JSIsCiAgICAgICAgICAgICJwYXJ0aWNsZV9kZW5zaXR5IjogIjEuNiBnL2wiLAogICAgICAgICAgICAidGltZXN0YW1wIjogIjIwMjQtMDItMjkiCiAgICAgICAgfQogICAgXQp9 + policy: + abac: cGFja2FnZSBhYmFjCgppbXBvcnQgcmVnby52MQoKZGVmYXVsdCBhbGxvdyA6PSBmYWxzZQoKYWxsb3cgaWYgewogdmlld2FibGVfc2Vuc29yX2RhdGEKIGFjdGlvbl9pc19yZWFkCn0KCmFjdGlvbl9pc19yZWFkIGlmICJyZWFkIiBpbiBpbnB1dC5hY3Rpb25zCgp2aWV3YWJsZV9zZW5zb3JfZGF0YSBjb250YWlucyB2aWV3X2RhdGEgaWYgewogc29tZSBzZW5zb3JfZGF0YSBpbiBkYXRhLm5vZGUuYWJhYy5zZW5zb3JfZGF0YQogc2Vuc29yX2RhdGEudGltZXN0YW1wID49IGlucHV0LnRpbWVfcGVyaW9kLmZyb20KIHNlbnNvcl9kYXRhLnRpbWVzdGFtcCA8IGlucHV0LnRpbWVfcGVyaW9kLnRvCgogdmlld19kYXRhIDo9IHtkYXRhdHlwZTogc2Vuc29yX2RhdGFbZGF0YXR5cGVdIHwgZGF0YXR5cGUgaW4gaW5wdXQuZGF0YXR5cGVzfQp9 + name: abac + version: 1.0.7 + metadata: + policy-id: abac + policy-version: 1.0.7 diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-deploy.json b/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-deploy.json new file mode 100644 index 00000000..15c88261 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-deploy.json @@ -0,0 +1,9 @@ +{ + "policies": [ + { + "policy-id": "abac", + "policy-version": "1.0.7" + } + ] +} + diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-duplicate-create.yaml b/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-duplicate-create.yaml new file mode 100644 index 00000000..776b654b --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-duplicate-create.yaml @@ -0,0 +1,16 @@ +tosca_definitions_version: tosca_simple_yaml_1_1_0 +topology_template: + policies: + - abac: + type: onap.policies.native.opa + type_version: 1.0.0 + properties: + data: + node.abac: cGFja2FnZSBvcmdfYWNjZXNzX2NvbnRyb2wucG9saWN5CmltcG9ydCByZWdvLnYxCmltcG9ydCBkYXRhLm9yZ19hY2Nlc3NfY29udHJvbC5yb2xlcwppbXBvcnQgZGF0YS5vcmdfYWNjZXNzX2NvbnRyb2wudXNlcnMKaW1wb3J0IGRhdGEub3JnX2FjY2Vzc19jb250cm9sLmdyb3VwcwppbXBvcnQgZGF0YS5vcmdfYWNjZXNzX2NvbnRyb2wuZG9jdW1lbnRzCmRlZmF1bHQgYWxsb3cgPSBmYWxzZQojIEFsbG93IGFjY2VzcyBpZiB0aGUgdXNlciBoYXMgdGhlIHJlcXVpcmVkIHBlcm1pc3Npb24KYWxsb3cgaWZ7CiAgICBpbnB1dC51c2VyID0gdXNlcgogICAgaW5wdXQuYWN0aW9uID0gYWN0aW9uCiAgICB1c2VyX2hhc19wZXJtaXNzaW9uKHVzZXIsIGFjdGlvbikKfQojIENoZWNrIGlmIHRoZSB1c2VyIGhhcyBwZXJtaXNzaW9uIGJhc2VkIG9uIHRoZWlyIHJvbGUKdXNlcl9oYXNfcGVybWlzc2lvbih1c2VyLCBhY3Rpb24pIGlmewogICAgcm9sZSA6PSB1c2Vyc1t1c2VyXS5yb2xlIAogICAgYWN0aW9uIGluIHJvbGVzW3JvbGVdCn0KIyBBbGxvdyBhY2Nlc3MgZm9yIGEgZ3JvdXAgaWYgYW55IHVzZXIgaW4gdGhlIGdyb3VwIGhhcyB0aGUgcmVxdWlyZWQgcGVybWlzc2lvbgphbGxvd19ncm91cCBpZnsKICAgIGlucHV0Lmdyb3VwID0gZ3JvdXAKICAgIGlucHV0LmFjdGlvbiA9IGFjdGlvbgogICAgdXNlcl9pbl9ncm91cCA6PSBncm91cHNbZ3JvdXBdCiAgICB1c2VyX2hhc19wZXJtaXNzaW9uKHVzZXJfaW5fZ3JvdXAsIGFjdGlvbikgCn0KIyBBbGxvdyBhY2Nlc3MgdG8gZG9jdW1lbnRzIGJhc2VkIG9uIHRoZSB1c2VyJ3MgZG9jdW1lbnQgb3duZXJzaGlwCmFsbG93X2RvY3VtZW50X2FjY2VzcyBpZnsKICAgIGlucHV0LnVzZXIgPSB1c2VyCiAgICBpbnB1dC5kb2N1bWVudF9pZCA9IGRvY3VtZW50X2lkCiAgICBkb2N1bWVudF9vd25lciA6PSBkb2N1bWVudHNbZG9jdW1lbnRfaWRdLm93bmVyCiAgICB1c2VyID09IGRvY3VtZW50X293bmVyCn0= + policy: + abac: cGFja2FnZSBhYmFjCgppbXBvcnQgcmVnby52MQoKZGVmYXVsdCBhbGxvdyA6PSBmYWxzZQoKYWxsb3cgaWYgewogdmlld2FibGVfc2Vuc29yX2RhdGEKIGFjdGlvbl9pc19yZWFkCn0KCmFjdGlvbl9pc19yZWFkIGlmICJyZWFkIiBpbiBpbnB1dC5hY3Rpb25zCgp2aWV3YWJsZV9zZW5zb3JfZGF0YSBjb250YWlucyB2aWV3X2RhdGEgaWYgewogc29tZSBzZW5zb3JfZGF0YSBpbiBkYXRhLmFiYWMuc2Vuc29yX2RhdGEKIHNlbnNvcl9kYXRhLnRpbWVzdGFtcCA+PSBpbnB1dC50aW1lX3BlcmlvZC5mcm9tCiBzZW5zb3JfZGF0YS50aW1lc3RhbXAgPCBpbnB1dC50aW1lX3BlcmlvZC50bwoKIHZpZXdfZGF0YSA6PSB7ZGF0YXR5cGU6IHNlbnNvcl9kYXRhW2RhdGF0eXBlXSB8IGRhdGF0eXBlIGluIGlucHV0LmRhdGF0eXBlc30KfQ== + name: abac + version: 1.0.7 + metadata: + policy-id: abac + policy-version: 1.0.7 diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-output.json b/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-output.json new file mode 100644 index 00000000..87c968bb --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-abac-output.json @@ -0,0 +1,96 @@ +{ + "data": { + "sensor_data": [ + { + "humidity": "40%", + "id": "0001", + "location": "Sri Lanka", + "particle_density": "1.3 g/l", + "precipitation": "1000 mm", + "temperature": "28 C", + "timestamp": "2024-02-26", + "windspeed": "5.5 m/s" + }, + { + "humidity": "45%", + "id": "0002", + "location": "Colombo", + "particle_density": "1.5 g/l", + "precipitation": "1200 mm", + "temperature": "30 C", + "timestamp": "2024-02-26", + "windspeed": "6.0 m/s" + }, + { + "humidity": "60%", + "id": "0003", + "location": "Kandy", + "particle_density": "1.1 g/l", + "precipitation": "800 mm", + "temperature": "25 C", + "timestamp": "2024-02-26", + "windspeed": "4.5 m/s" + }, + { + "humidity": "30%", + "id": "0004", + "location": "Galle", + "particle_density": "1.8 g/l", + "precipitation": "500 mm", + "temperature": "35 C", + "timestamp": "2024-02-27", + "windspeed": "7.2 m/s" + }, + { + "humidity": "20%", + "id": "0005", + "location": "Jaffna", + "particle_density": "0.9 g/l", + "precipitation": "300 mm", + "temperature": "-5 C", + "timestamp": "2024-02-27", + "windspeed": "3.8 m/s" + }, + { + "humidity": "55%", + "id": "0006", + "location": "Trincomalee", + "particle_density": "1.2 g/l", + "precipitation": "1000 mm", + "temperature": "20 C", + "timestamp": "2024-02-28", + "windspeed": "5.0 m/s" + }, + { + "humidity": "50%", + "id": "0007", + "location": "Nuwara Eliya", + "particle_density": "1.3 g/l", + "precipitation": "600 mm", + "temperature": "25 C", + "timestamp": "2024-02-28", + "windspeed": "4.0 m/s" + }, + { + "humidity": "40%", + "id": "0008", + "location": "Anuradhapura", + "particle_density": "1.4 g/l", + "precipitation": "700 mm", + "temperature": "28 C", + "timestamp": "2024-02-29", + "windspeed": "5.8 m/s" + }, + { + "humidity": "65%", + "id": "0009", + "location": "Matara", + "particle_density": "1.6 g/l", + "precipitation": "900 mm", + "temperature": "32 C", + "timestamp": "2024-02-29", + "windspeed": "6.5 m/s" + } + ] + } +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-resource-not-found.json b/csit/resources/tests/data/onap.policy.opa.pdp.policy-resource-not-found.json new file mode 100644 index 00000000..3fd7170e --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-resource-not-found.json @@ -0,0 +1,5 @@ +{ + "errorMessage": "Error in getting data - storage_not_found_error: /node/vehicle: document does not exist", + "policyName": "", + "responseCode": "resource_not_found" +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-vehicle-create.yaml b/csit/resources/tests/data/onap.policy.opa.pdp.policy-vehicle-create.yaml new file mode 100644 index 00000000..93af4a93 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-vehicle-create.yaml @@ -0,0 +1,17 @@ +tosca_definitions_version: tosca_simple_yaml_1_1_0 +topology_template: + policies: + - vehicle: + type: onap.policies.native.opa + type_version: 1.0.0 + properties: + data: + node.vehicle: ewogICJ2ZWhpY2xlcyI6IFsKICAgIHsgInZlaGljbGVfaWQiOiAidjEiLCAib3duZXIiOiAidXNlcjEiLCAidHlwZSI6ICJjYXIiLCAic3RhdHVzIjogImF2YWlsYWJsZSIgfSwKICAgIHsgInZlaGljbGVfaWQiOiAidjIiLCAib3duZXIiOiAidXNlcjIiLCAidHlwZSI6ICJiaWtlIiwgInN0YXR1cyI6ICJpbiB1c2UiIH0KICBdCn0K + policy: + vehicle: cGFja2FnZSB2ZWhpY2xlCgppbXBvcnQgIHJlZ28udjEKCmRlZmF1bHQgYWxsb3cgOj0gZmFsc2UKCmFsbG93IGlmIHsKICAgIHVzZXJfaGFzX3ZlaGljbGVfYWNjZXNzCiAgICBhY3Rpb25faXNfZ3JhbnRlZAp9CgphY3Rpb25faXNfZ3JhbnRlZCBpZiB7CiAgICAidXNlIiBpbiBpbnB1dC5hY3Rpb25zCn0KCnVzZXJfaGFzX3ZlaGljbGVfYWNjZXNzIGNvbnRhaW5zIHZlaGljbGVfZGF0YSBpZiB7CiAgICBzb21lIHZlaGljbGUgaW4gZGF0YS5ub2RlLnZlaGljbGUudmVoaWNsZXMKICAgIHZlaGljbGUudmVoaWNsZV9pZCA9PSBpbnB1dC52ZWhpY2xlX2lkCiAgICB2ZWhpY2xlLm93bmVyID09IGlucHV0LnVzZXIKICAgIHZlaGljbGVfZGF0YSA6PSB7aW5mbzogdmVoaWNsZVtpbmZvXSB8IGluZm8gaW4gaW5wdXQuYXR0cmlidXRlc30KfQo= + name: vehicle + version: 1.0.6 + metadata: + policy-id: vehicle + policy-version: 1.0.6 + diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-vehicle-deploy.json b/csit/resources/tests/data/onap.policy.opa.pdp.policy-vehicle-deploy.json new file mode 100644 index 00000000..ed275a25 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-vehicle-deploy.json @@ -0,0 +1,9 @@ +{ + "policies": [ + { + "policy-id": "vehicle", + "policy-version": "1.0.6" + } + ] +} + diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-vehicle-output.json b/csit/resources/tests/data/onap.policy.opa.pdp.policy-vehicle-output.json new file mode 100644 index 00000000..09148079 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-vehicle-output.json @@ -0,0 +1,18 @@ +{ + "data": { + "vehicles": [ + { + "owner": "user1", + "status": "available", + "type": "car", + "vehicle_id": "v1" + }, + { + "owner": "user2", + "status": "in use", + "type": "bike", + "vehicle_id": "v2" + } + ] + } +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-zone-create.yaml b/csit/resources/tests/data/onap.policy.opa.pdp.policy-zone-create.yaml new file mode 100644 index 00000000..47179c29 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-zone-create.yaml @@ -0,0 +1,17 @@ +tosca_definitions_version: tosca_simple_yaml_1_1_0 +topology_template: + policies: + - zoneB: + type: onap.policies.native.opa + type_version: 1.0.0 + properties: + data: + node.zoneB: ewogICJ6b25lIjogewogICAgInpvbmVfYWNjZXNzX2xvZ3MiOiBbCiAgICAgIHsgImxvZ19pZCI6ICJsb2cxIiwgInRpbWVzdGFtcCI6ICIyMDI0LTExLTAxVDA5OjAwOjAwWiIsICJ6b25lX2lkIjogInpvbmVBIiwgImFjY2VzcyI6ICJncmFudGVkIiwgInVzZXIiOiAidXNlcjEiIH0sCiAgICAgIHsgImxvZ19pZCI6ICJsb2cyIiwgInRpbWVzdGFtcCI6ICIyMDI0LTExLTAxVDEwOjMwOjAwWiIsICJ6b25lX2lkIjogInpvbmVBIiwgImFjY2VzcyI6ICJkZW5pZWQiLCAidXNlciI6ICJ1c2VyMiIgfSwKICAgICAgeyAibG9nX2lkIjogImxvZzMiLCAidGltZXN0YW1wIjogIjIwMjQtMTEtMDFUMTE6MDA6MDBaIiwgInpvbmVfaWQiOiAiem9uZUIiLCAiYWNjZXNzIjogImdyYW50ZWQiLCAidXNlciI6ICJ1c2VyMyIgfQogICAgXQogIH0KfQ== + policy: + zoneB: cGFja2FnZSB6b25lQgogCmltcG9ydCByZWdvLnYxCiAKZGVmYXVsdCBhbGxvdyA6PSBmYWxzZQogCmFsbG93IGlmIHsKICAgIGhhc196b25lX2FjY2VzcwogICAgYWN0aW9uX2lzX2xvZ192aWV3Cn0KIAphY3Rpb25faXNfbG9nX3ZpZXcgaWYgewogICAgInZpZXciIGluIGlucHV0LmFjdGlvbnMKfQogCmhhc196b25lX2FjY2VzcyBjb250YWlucyBhY2Nlc3NfZGF0YSBpZiB7CiAgICBzb21lIHpvbmVfZGF0YSBpbiBkYXRhLm5vZGUuem9uZUIuem9uZS56b25lX2FjY2Vzc19sb2dzCiAgICB6b25lX2RhdGEudGltZXN0YW1wID49IGlucHV0LnRpbWVfcGVyaW9kLmZyb20KICAgIHpvbmVfZGF0YS50aW1lc3RhbXAgPCBpbnB1dC50aW1lX3BlcmlvZC50bwogICAgem9uZV9kYXRhLnpvbmVfaWQgPT0gaW5wdXQuem9uZV9pZAogICAgYWNjZXNzX2RhdGEgOj0ge2RhdGF0eXBlOiB6b25lX2RhdGFbZGF0YXR5cGVdIHwgZGF0YXR5cGUgaW4gaW5wdXQuZGF0YXR5cGVzfQp9 + name: zoneB + version: 1.0.6 + metadata: + policy-id: zoneB + policy-version: 1.0.6 + diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-zone-deploy.json b/csit/resources/tests/data/onap.policy.opa.pdp.policy-zone-deploy.json new file mode 100644 index 00000000..ad5b3bd9 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-zone-deploy.json @@ -0,0 +1,8 @@ +{ + "policies": [ + { + "policy-id": "zoneB", + "policy-version": "1.0.6" + } + ] +} diff --git a/csit/resources/tests/data/onap.policy.opa.pdp.policy-zone-output.json b/csit/resources/tests/data/onap.policy.opa.pdp.policy-zone-output.json new file mode 100644 index 00000000..d1d8e687 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.opa.pdp.policy-zone-output.json @@ -0,0 +1,27 @@ +{ + "data":{ + "zone_access_logs":[ + { + "access":"granted", + "log_id":"log1", + "timestamp":"2024-11-01T09:00:00Z", + "user":"user1", + "zone_id":"zoneA" + }, + { + "access":"denied", + "log_id":"log2", + "timestamp":"2024-11-01T10:30:00Z", + "user":"user2", + "zone_id":"zoneA" + }, + { + "access":"granted", + "log_id":"log3", + "timestamp":"2024-11-01T11:00:00Z", + "user":"user3", + "zone_id":"zoneB" + } + ] + } +} diff --git a/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-incorrect-policyfilter.json b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-incorrect-policyfilter.json new file mode 100644 index 00000000..80b49f88 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-incorrect-policyfilter.json @@ -0,0 +1,29 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+05:30", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "policyName": "abac", + "policyFilter": [ + "viewable_sesor_data" + ], + "input": { + "actions": [ + "read" + ], + "datatypes": [ + "location", + "temperature", + "precipitation", + "windspeed" + ], + "time_period": { + "from": "2024-02-27", + "to": "2024-02-29" + } + } +} diff --git a/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-incorrect-policyname.json b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-incorrect-policyname.json new file mode 100644 index 00000000..095f3d62 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-incorrect-policyname.json @@ -0,0 +1,29 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+05:30", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "policyName": "abc", + "policyFilter": [ + "viewable_sensor_data" + ], + "input": { + "actions": [ + "read" + ], + "datatypes": [ + "location", + "temperature", + "precipitation", + "windspeed" + ], + "time_period": { + "from": "2024-02-27", + "to": "2024-02-29" + } + } +} diff --git a/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-output.json b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-output.json new file mode 100644 index 00000000..f3bd987d --- /dev/null +++ b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-output.json @@ -0,0 +1,32 @@ +{ + "output": { + "viewable_sensor_data": [ + { + "location": "Galle", + "precipitation": "500 mm", + "temperature": "35 C", + "windspeed": "7.2 m/s" + }, + { + "location": "Jaffna", + "precipitation": "300 mm", + "temperature": "-5 C", + "windspeed": "3.8 m/s" + }, + { + "location": "Nuwara Eliya", + "precipitation": "600 mm", + "temperature": "25 C", + "windspeed": "4.0 m/s" + }, + { + "location": "Trincomalee", + "precipitation": "1000 mm", + "temperature": "20 C", + "windspeed": "5.0 m/s" + } + ] + }, + "policyName": "abac", + "statusMessage": "OPA Allowed" +} diff --git a/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-pemit-policy.json b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-pemit-policy.json new file mode 100644 index 00000000..9471eec5 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.abac-pemit-policy.json @@ -0,0 +1,29 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+05:30", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "policyName": "abac", + "policyFilter": [ + "viewable_sensor_data" + ], + "input": { + "actions": [ + "read" + ], + "datatypes": [ + "location", + "temperature", + "precipitation", + "windspeed" + ], + "time_period": { + "from": "2024-02-27", + "to": "2024-02-29" + } + } +} diff --git a/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle-incorect-policyfilter.json b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle-incorect-policyfilter.json new file mode 100644 index 00000000..a3efb3c3 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle-incorect-policyfilter.json @@ -0,0 +1,25 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+05:30", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "policyName": "vehicle", + "policyFilter": [ + "user_has_vecle_access" + ], + "input": { + "actions": [ + "use" + ], + "user": "user1", + "vehicle_id": "v1", + "attributes": [ + "type", + "status" + ] + } +} diff --git a/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle-incorect-policyname.json b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle-incorect-policyname.json new file mode 100644 index 00000000..aaa8f416 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle-incorect-policyname.json @@ -0,0 +1,25 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+05:30", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "policyName": "vehile", + "policyFilter": [ + "user_has_vehicle_access" + ], + "input": { + "actions": [ + "use" + ], + "user": "user1", + "vehicle_id": "v1", + "attributes": [ + "type", + "status" + ] + } +} diff --git a/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle_input.json b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle_input.json new file mode 100644 index 00000000..999a76e1 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle_input.json @@ -0,0 +1,25 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+05:30", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "policyName": "vehicle", + "policyFilter": [ + "user_has_vehicle_access" + ], + "input": { + "actions": [ + "use" + ], + "user": "user1", + "vehicle_id": "v1", + "attributes": [ + "type", + "status" + ] + } +} diff --git a/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle_output.json b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle_output.json new file mode 100644 index 00000000..c6271b21 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.vehicle_output.json @@ -0,0 +1,12 @@ +{ + "output": { + "user_has_vehicle_access": [ + { + "status": "available", + "type": "car" + } + ] + }, + "policyName": "vehicle", + "statusMessage": "OPA Allowed" +} diff --git a/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.zone-policy-input.json b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.zone-policy-input.json new file mode 100644 index 00000000..13618ed4 --- /dev/null +++ b/csit/resources/tests/data/onap.policy.policy.opa.pdp.decision.zone-policy-input.json @@ -0,0 +1,29 @@ +{ + "onapName": "CDS", + "onapComponent": "CDS", + "onapInstance": "CDS", + "currentDate": "2025-01-17", + "currentTime": "08:26:41.857Z", + "timeZone": "UTC", + "timeOffset": "+05:30", + "currentDateTime": "2025-01-17T08:26:41.857Z", + "policyName": "zoneB", + "policyFilter": [ + "has_zone_access" + ], + "input": { + "actions": [ + "view" + ], + "log_id": "log1", + "datatypes": [ + "access", + "user" + ], + "time_period": { + "from": "2024-11-01T09:00:00Z", + "to": "2024-11-01T10:00:00Z" + }, + "zone_id": "zoneA" + } +} diff --git a/csit/resources/tests/opa-pdp-common.robot b/csit/resources/tests/opa-pdp-common.robot new file mode 100644 index 00000000..c4eba43a --- /dev/null +++ b/csit/resources/tests/opa-pdp-common.robot @@ -0,0 +1,11 @@ +*** Settings *** + +*** Keywords *** + +Is Variable Dictionary + [Arguments] ${variable} + ${is_dict}= Set Variable False + ${status} ${result}= Run Keyword And Ignore Error Should Contain ${variable} data + Run Keyword If '${status}' + ... Set Variable ${is_dict}= True # It means it's a dictionary. + RETURN ${is_dict} diff --git a/csit/resources/tests/opa-pdp-slas.robot b/csit/resources/tests/opa-pdp-slas.robot new file mode 100644 index 00000000..da28b415 --- /dev/null +++ b/csit/resources/tests/opa-pdp-slas.robot @@ -0,0 +1,60 @@ +*** Settings *** +Library OperatingSystem +Resource common-library.robot + +*** Test Cases *** +WaitForPrometheusServer + [Documentation] Sleep time to wait for Prometheus server to gather all metrics + Sleep 1 minute + +ValidateOPAPolicyDecisionsTotalCounter + [Documentation] Validate opa policy decision counters using prometheus metrics + ValidateOPAPrometheusMetric opa_decision_response_time_seconds_count{instance="policy-opa-pdp:8282", job="opa-pdp-metrics"} 9 + +ValidateOPAPolicyDataTotalCounter + [Documentation] Validate opa policy data counters using prometheus metrics + ValidateOPAPrometheusMetric opa_data_response_time_seconds_count{instance="policy-opa-pdp:8282", job="opa-pdp-metrics"} 12 + +ValidateOPADecisionAverageResponseTime + [Documentation] Ensure average response time is less than 10ms + ValidateOPADecisionAverageResponseTimeMetric 1.5 + +ValidateOPADataAverageResponseTime + [Documentation] Ensure average response time is less than 10ms + ValidateOPADataAverageResponseTimeMetric 1.5 + + +*** Keywords *** +ValidateOPAPrometheusMetric + [Arguments] ${url} ${expectedLimit} + [Documentation] Check the policy decision/data execution count + ${resp}= QueryPrometheus ${url} + ${actualValue}= Evaluate ${resp['data']['result'][0]['value'][1]} + Should Be True ${actual_value} == ${expectedLimit} + +ValidateOPADecisionAverageResponseTimeMetric + [Arguments] ${threshold} + [Documentation] Validate that the average response time is below the threshold + + ${sum_resp}= QueryPrometheus opa_decision_response_time_seconds_sum{instance="policy-opa-pdp:8282", job="opa-pdp-metrics"} + ${count_resp}= QueryPrometheus opa_decision_response_time_seconds_count{instance="policy-opa-pdp:8282", job="opa-pdp-metrics"} + + ${sum_value}= Evaluate ${sum_resp['data']['result'][0]['value'][1]} + ${count_value}= Evaluate ${count_resp['data']['result'][0]['value'][1]} + + ${avg_response_time}= Evaluate float(${sum_value}) / float(${count_value}) + Should Be True ${avg_response_time} < ${threshold} msg=Average response time exceeded ${threshold} + + +ValidateOPADataAverageResponseTimeMetric + [Arguments] ${threshold} + [Documentation] Validate that the average response time is below the threshold + + ${sum_resp}= QueryPrometheus opa_data_response_time_seconds_sum{instance="policy-opa-pdp:8282", job="opa-pdp-metrics"} + ${count_resp}= QueryPrometheus opa_data_response_time_seconds_count{instance="policy-opa-pdp:8282", job="opa-pdp-metrics"} + + ${sum_value}= Evaluate ${sum_resp['data']['result'][0]['value'][1]} + ${count_value}= Evaluate ${count_resp['data']['result'][0]['value'][1]} + + ${avg_response_time}= Evaluate float(${sum_value}) / float(${count_value}) + Should Be True ${avg_response_time} < ${threshold} msg=Average response time exceeded ${threshold} diff --git a/csit/resources/tests/opa-pdp-test.robot b/csit/resources/tests/opa-pdp-test.robot index a6d4c6d2..98e413c4 100644 --- a/csit/resources/tests/opa-pdp-test.robot +++ b/csit/resources/tests/opa-pdp-test.robot @@ -5,32 +5,65 @@ Library OperatingSystem Library Process Library json Resource common-library.robot - +Resource opa-pdp-common.robot *** Variables *** ${OPA_PDP_HOST} /policy/pdpo/v1/healthcheck ${url} /policy/pdpo/v1/decision +${DATA_URL} /policy/pdpo/v1/data/ *** Test Cases *** Healthcheck [Documentation] Verify OPA PDP health check PdpxGetReq ${OPA_PDP_HOST} <Response [200]> -RetrieveSuccessfulRequest - [Documentation] Get Decision Request Successful for Opa Pdp - DecisionRequest onap.policy.opa.pdp.decision.request.json PERMIT 200 +ValidateDataBeforePolicyDeployment + ValidateGetDynamicData ${DATA_URL} 200 onap.policy.opa.pdp.data-empty.json data + +ValidatesZonePolicy + CreateOpaPolicy onap.policy.opa.pdp.policy-zone-create.yaml zoneB 1.0.3 201 + DeployOpaPolicy onap.policy.opa.pdp.policy-zone-deploy.json zoneB + ${URL_CONTEXT}= Set Variable node/zoneB/zone + ${DYNAMIC_URL}= Set Variable ${DATA_URL}${URL_CONTEXT} + ValidateGetDynamicData ${DYNAMIC_URL} 200 onap.policy.opa.pdp.policy-zone-output.json data + ValidatePolicyResponse onap.policy.policy.opa.pdp.decision.zone-policy-input.json 200 onap.policy.opa.pdp.decision.zone-policy-output.json + ValidateIncorrectPolicyNameResponse onap.policy.opa.pdp.decision.zone-incorrect-policyname.json 400 + ValidateIncorrectPolicyFilterResponse onap.policy.opa.pdp.decision.zone-incorrect-policyfilter.json 200 + UndeployOpaPolicy /policy/pap/v1/pdps/policies/zoneB 202 + UndeployOpaPolicy /policy/pap/v1/pdps/policies/zoneB 400 -RetrieveDenyRequest - [Documentation] Get Decision Request DENY for Opa Pdp - DecisionRequest onap.policy.opa.pdp.decision.requestfailure.json DENY 200 +ValidatesVehiclePolicy + CreateOpaPolicy onap.policy.opa.pdp.policy-vehicle-create.yaml vehicle 1.0.3 201 + DeployOpaPolicy onap.policy.opa.pdp.policy-vehicle-deploy.json vehicle + ${URL_CONTEXT}= Set Variable node/vehicle + ${DYNAMIC_URL}= Set Variable ${DATA_URL}${URL_CONTEXT} + ValidateGetDynamicData ${DYNAMIC_URL} 200 onap.policy.opa.pdp.policy-vehicle-output.json data + ValidatePatchDynamicData ${DYNAMIC_URL} onap.policy.opa.pdp.dyn-data-add.json 204 + ValidateGetDynamicData ${DYNAMIC_URL} 200 onap.policy.opa.pdp.dyn-data-add-output.json data + ValidatePatchDynamicData ${DYNAMIC_URL} onap.policy.opa.pdp.dyn-data-replace.json 204 + ValidateGetDynamicData ${DYNAMIC_URL} 200 onap.policy.opa.pdp.dyn-data-replace-output.json data + ValidatePatchDynamicData ${DYNAMIC_URL} onap.policy.opa.pdp.dyn-data-remove.json 204 + ValidateGetDynamicData ${DYNAMIC_URL} 200 onap.policy.opa.pdp.policy-vehicle-output.json data + ValidatePolicyResponse onap.policy.policy.opa.pdp.decision.vehicle_input.json 200 onap.policy.policy.opa.pdp.decision.vehicle_output.json + ValidateIncorrectPolicyNameResponse onap.policy.policy.opa.pdp.decision.vehicle-incorect-policyname.json 400 + ValidateIncorrectPolicyFilterResponse onap.policy.policy.opa.pdp.decision.vehicle-incorect-policyfilter.json 200 + UndeployOpaPolicy /policy/pap/v1/pdps/policies/vehicle 202 + UndeployOpaPolicy /policy/pap/v1/pdps/policies/vehicle 400 + ValidateGetDynamicData ${DYNAMIC_URL} 404 onap.policy.opa.pdp.policy-resource-not-found.json responseCode + ValidatePatchDynamicData ${DYNAMIC_URL} onap.policy.opa.pdp.dyn-data-remove.json 400 -*** comments *** -| RetrieveFailureRequest -| |[Documentation] | Get Decision Request INDETERMINATE for Opa Pdp *** -| | |DecisionRequest onap.policy.opa.pdp.decision.requestIndeterminate.json INDETERMINATE 200 *** +ValidatesAbacPolicy + CreateOpaPolicy onap.policy.opa.pdp.policy-abac-create.yaml abac 1.0.2 201 + DeployOpaPolicy onap.policy.opa.pdp.policy-abac-deploy.json abac + ${URL_CONTEXT}= Set Variable node/abac + ${DYNAMIC_URL}= Set Variable ${DATA_URL}${URL_CONTEXT} + ValidateGetDynamicData ${DYNAMIC_URL} 200 onap.policy.opa.pdp.policy-abac-output.json data + ValidatePolicyResponse onap.policy.policy.opa.pdp.decision.abac-pemit-policy.json 200 onap.policy.policy.opa.pdp.decision.abac-output.json + ValidateIncorrectPolicyNameResponse onap.policy.policy.opa.pdp.decision.abac-incorrect-policyname.json 400 + ValidateIncorrectPolicyFilterResponse onap.policy.policy.opa.pdp.decision.abac-incorrect-policyfilter.json 200 + CreatePolicyDeployFailure onap.policy.opa.pdp.policy-abac-duplicate-create.yaml 406 NOT_ACCEPTABLE + UndeployOpaPolicy /policy/pap/v1/pdps/policies/abac 202 + UndeployOpaPolicy /policy/pap/v1/pdps/policies/abac 400 -RetrieveFailureBadRequest - [Documentation] Get Decision Request Failure Bad Request for Opa Pdp - DecisionRequest onap.policy.opa.pdp.decision.badRequest.json BAD_REQUEST 400 *** Keywords *** PdpxGetReq [Documentation] Verify the response of Health Check is Successful @@ -39,15 +72,101 @@ PdpxGetReq ${resp}= PerformGetRequest ${POLICY_OPA_IP} ${url} 200 null ${hcauth} Should Be Equal As Strings ${resp} ${status} -DecisionRequest - [Arguments] ${jsonfile} ${keyword} ${status} +CreateOpaPolicy + [Documentation] Create a opa policy + [Arguments] ${jsonfile} ${policy_name} ${policy_version} ${expected_status} ${postjson}= Get file ${CURDIR}/data/${jsonfile} - ${resp}= DecisionPostReq ${postjson} ${status} abbrev=true - Should Contain ${resp.text} ${keyword} + CreatePolicyWithYaml /policy/api/v1/policytypes/onap.policies.native.opa/versions/1.0.0/policies ${expected_status} ${postjson} + +CreatePolicyDeployFailure + [Documentation] Create a Failure opa policy + [Arguments] ${jsonfile} ${expected_status} ${keyword} + ${postjson}= Get file ${CURDIR}/data/onap.policy.opa.pdp.policy-abac-duplicate-create.yaml + CreateFailurePolicyWithYaml /policy/api/v1/policytypes/onap.policies.native.opa/versions/1.0.0/policies ${expected_status} ${postjson} ${keyword} + +DeployOpaPolicy + [Documentation] Runs Policy PAP to deploy a policy + [Arguments] ${jsonfile} ${policy_name} + ${postjson}= Get file ${CURDIR}/data/${jsonfile} + ${policyadmin}= PolicyAdminAuth + PerformPostRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/policies 202 ${postjson} null ${policyadmin} + Sleep 20sec + ${result}= CheckKafkaTopic policy-notification ${policy_name} + Should Contain ${result} deployed-policies + +UndeployOpaPolicy + [Documentation] Runs Policy PAP to undeploy a policy + [Arguments] ${url} ${expected_status} + ${policyadmin}= PolicyAdminAuth + PerformDeleteRequest ${POLICY_PAP_IP} ${url} ${expected_status} ${policyadmin} + +ValidatePolicyResponse + [Documentation] Validating the output for the policy + [Arguments] ${jsonfile} ${status} ${jsonfile1} + ${expectedStatus}= Set Variable ${status} + ${postjson}= Get file ${CURDIR}/data/${jsonfile} + ${expected_data}= Get file ${CURDIR}/data/${jsonfile1} + ${hcauth}= PolicyAdminAuth + ${resp}= PerformPostRequest ${POLICY_OPA_IP} ${url} ${expectedStatus} ${postjson} abbrev=true ${hcauth} + ${response_data}= Get From Dictionary ${resp.json()} output + ${expected_value}= Evaluate json.loads('''${expected_data}''') json + ${expected_output}= Get From Dictionary ${expected_value} output + Dictionaries Should Be Equal ${response_data} ${expected_output} + +ValidateGetDynamicData + [Documentation] Validating the output for the policy + [Arguments] ${dyn_url} ${status} ${jsonfile1} ${json_key_name} + ${expectedStatus}= Set Variable ${status} + ${expected_data}= Get file ${CURDIR}/data/${jsonfile1} + ${hcauth}= PolicyAdminAuth + ${resp}= PerformGetRequest ${POLICY_OPA_IP} ${dyn_url} ${expectedStatus} abbrev=true ${hcauth} + ${response_data}= Get From Dictionary ${resp.json()} ${json_key_name} + ${expected_value}= Evaluate json.loads('''${expected_data}''') json + ${expected_output}= Get From Dictionary ${expected_value} ${json_key_name} + ${is_dict}= Is Variable Dictionary ${response_data} + Run Keyword If ${is_dict} + ... Should Be Equal ${response_data} ${expected_output} + Run Keyword If not ${is_dict} + ... Should Be Equal As Strings ${response_data} ${expected_output} -DecisionPostReq - [Arguments] ${postjson} ${status} ${abbr} +ValidatePatchDynamicData + [Documentation] Validating the output for the policy + [Arguments] ${dyn_url} ${jsonfile} ${status} ${expectedStatus}= Set Variable ${status} + ${patchjson}= Get file ${CURDIR}/data/${jsonfile} + ${hcauth}= PolicyAdminAuth + ${resp}= PerformPatchRequest ${POLICY_OPA_IP} ${dyn_url} ${expectedStatus} ${patchjson} abbrev=true ${hcauth} + Should Be Equal As Integers ${resp.status_code} ${expectedStatus} + +ValidatePolicyResponseWithoutFilter + [Documentation] Validating the output for the policy + [Arguments] ${jsonfile} ${status} ${jsonfile1} + ${expectedStatus}= Set Variable ${status} + ${postjson}= Get file ${CURDIR}/data/${jsonfile} + ${expected_data}= Get file ${CURDIR}/data/${jsonfile1} + ${hcauth}= PolicyAdminAuth + ${resp}= PerformPostRequest ${POLICY_OPA_IP} ${url} ${expectedStatus} ${postjson} abbrev=true ${hcauth} + ${response_data}= Get From Dictionary ${resp.json()} responseCode + ${expected_value}= Evaluate json.loads('''${expected_data}''') json + ${expected_output}= Get From Dictionary ${expected_value} responseCode + Should Be Equal As Strings ${response_data} ${expected_output} + +ValidateIncorrectPolicyNameResponse + [Documentation] Validating the incorrect name output for the policy + [Arguments] ${jsonfile} ${status} + ${expectedStatus}= Set Variable ${status} + ${postjson}= Get file ${CURDIR}/data/${jsonfile} + ${hcauth}= PolicyAdminAuth + ${resp}= PerformPostRequest ${POLICY_OPA_IP} ${url} ${expectedStatus} ${postjson} abbrev=true ${hcauth} + ${response_data}= Get From Dictionary ${resp.json()} responseCode + Should Be Equal As Strings ${response_data} bad_request + +ValidateIncorrectPolicyFilterResponse + [Documentation] Validating the incorrect filter output for the policy + [Arguments] ${jsonfile} ${status} + ${expectedStatus}= Set Variable ${status} + ${postjson}= Get file ${CURDIR}/data/${jsonfile} ${hcauth}= PolicyAdminAuth - ${resp}= PerformPostRequest ${POLICY_OPA_IP} ${url} ${expectedStatus} ${postjson} ${abbr} ${hcauth} - RETURN ${resp} + ${resp}= PerformPostRequest ${POLICY_OPA_IP} ${url} ${expectedStatus} ${postjson} abbrev=true ${hcauth} + ${response_data}= Get From Dictionary ${resp.json()} output + Should Be Equal As Strings ${response_data} None diff --git a/csit/resources/tests/policy-clamp-test.robot b/csit/resources/tests/policy-clamp-test.robot index b2e30fc8..082b8ef6 100644 --- a/csit/resources/tests/policy-clamp-test.robot +++ b/csit/resources/tests/policy-clamp-test.robot @@ -121,6 +121,25 @@ InstantiateAutomationCompositionMigrationFrom set Suite variable ${instanceMigrationId} ${respyaml["instanceId"]} Should Be Equal As Strings ${resp.status_code} 201 +FailPrepareAutomationCompositionMigrationFrom + [Documentation] Fail Prepare automation composition migration. + SetParticipantSimFail + ${auth}= ClampAuth + ${postjson}= Get file ${CURDIR}/data/PrepareAC.json + ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances/${instanceMigrationId} ${postjson} ${auth} + Should Be Equal As Strings ${resp.status_code} 202 + Wait Until Keyword Succeeds 2 min 5 sec VerifyStateChangeResult ${compositionFromId} ${instanceMigrationId} FAILED + +PrepareAutomationCompositionMigrationFrom + [Documentation] Prepare automation composition migration. + SetParticipantSimSuccess + ${auth}= ClampAuth + ${postjson}= Get file ${CURDIR}/data/PrepareAC.json + ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances/${instanceMigrationId} ${postjson} ${auth} + Should Be Equal As Strings ${resp.status_code} 202 + Wait Until Keyword Succeeds 10 min 5 sec VerifySubStatus ${compositionFromId} ${instanceMigrationId} + VerifyPrepareElementsRuntime ${compositionFromId} ${instanceMigrationId} + FailDeployAutomationCompositionMigration [Documentation] Fail Deploy automation composition. SetParticipantSimFail @@ -138,14 +157,6 @@ TimeoutDeployAutomationCompositionMigration ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances/${instanceMigrationId} ${postjson} ${auth} Should Be Equal As Strings ${resp.status_code} 202 -PrepareAutomationComposition - [Documentation] Prepare automation composition. - ${auth}= ClampAuth - ${postjson}= Get file ${CURDIR}/data/PrepareAC.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances/${instanceId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 - Wait Until Keyword Succeeds 10 min 5 sec VerifySubStatus ${compositionId} ${instanceId} - DeployAutomationComposition [Documentation] Deploy automation composition. ${auth}= ClampAuth @@ -211,14 +222,6 @@ QueryPolicyTypes Should Be Equal As Strings ${resp.status_code} 200 List Should Contain Value ${resp.json()['policy_types']} onap.policies.native.Apex -ReviewAutomationComposition - [Documentation] Review automation composition. - ${auth}= ClampAuth - ${postjson}= Get file ${CURDIR}/data/ReviewAC.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances/${instanceId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 - Wait Until Keyword Succeeds 10 min 5 sec VerifySubStatus ${compositionId} ${instanceId} - CheckTimeoutAutomationComposition [Documentation] Timeout Deploy automation composition. Wait Until Keyword Succeeds 5 min 5 sec VerifyStateChangeResult ${compositionFromId} ${instanceMigrationId} TIMEOUT @@ -237,11 +240,35 @@ SendOutPropertiesToRuntime ${auth}= ParticipantAuth ${postjson}= Get file ${CURDIR}/data/OutProperties.json ${updatedpostjson}= Replace String ${postjson} INSTACEIDPLACEHOLDER ${instanceMigrationId} + ${updatedpostjson}= Replace String ${updatedpostjson} TEXTPLACEHOLDER DumpTest + ${resp}= MakeJsonPutRequest participant ${POLICY_PARTICIPANT_SIM_IP} /onap/policy/simparticipant/v2/datas ${updatedpostjson} ${auth} + Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= MakeJsonPutRequest participant ${POLICY_PARTICIPANT_SIM_IP} /onap/policy/simparticipant/v2/datas ${updatedpostjson} ${auth} + Should Be Equal As Strings ${resp.status_code} 200 + ${updatedpostjson}= Replace String ${postjson} INSTACEIDPLACEHOLDER ${instanceMigrationId} ${updatedpostjson}= Replace String ${updatedpostjson} TEXTPLACEHOLDER MyTextToSend ${resp}= MakeJsonPutRequest participant ${POLICY_PARTICIPANT_SIM_IP} /onap/policy/simparticipant/v2/datas ${updatedpostjson} ${auth} Should Be Equal As Strings ${resp.status_code} 200 Wait Until Keyword Succeeds 2 min 5 sec VerifyPropertiesUpdated ${compositionFromId} ${instanceMigrationId} MyTextToSend +FailReviewAutomationCompositionMigrationFrom + [Documentation] Fail Review automation composition migration. + SetParticipantSimFail + ${auth}= ClampAuth + ${postjson}= Get file ${CURDIR}/data/ReviewAC.json + ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances/${instanceMigrationId} ${postjson} ${auth} + Should Be Equal As Strings ${resp.status_code} 202 + Wait Until Keyword Succeeds 2 min 5 sec VerifyStateChangeResult ${compositionFromId} ${instanceMigrationId} FAILED + +ReviewAutomationCompositionMigrationFrom + [Documentation] Review automation composition migration. + SetParticipantSimSuccess + ${auth}= ClampAuth + ${postjson}= Get file ${CURDIR}/data/ReviewAC.json + ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances/${instanceMigrationId} ${postjson} ${auth} + Should Be Equal As Strings ${resp.status_code} 202 + Wait Until Keyword Succeeds 10 min 5 sec VerifySubStatus ${compositionFromId} ${instanceMigrationId} + AutomationCompositionUpdate [Documentation] Update of an automation composition. ${auth}= ClampAuth @@ -504,6 +531,19 @@ VerifyMigratedElementsRuntime ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c37']['outProperties']['stage']} Should Be Equal As Strings ${respstring} [0, 2] +VerifyPrepareElementsRuntime + [Arguments] ${theCompositionId} ${theInstanceId} + [Documentation] Verify the Instance elements after Prepare + ${auth}= ClampAuth + ${resp}= MakeGetRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${theCompositionId}/instances/${theInstanceId} ${auth} + Should Be Equal As Strings ${resp.status_code} 200 + ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c34']['outProperties']['prepareStage']} + Should Be Equal As Strings ${respstring} [1, 2] + ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c35']['outProperties']['prepareStage']} + Should Be Equal As Strings ${respstring} [0, 1] + ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c36']['outProperties']['prepareStage']} + Should Be Equal As Strings ${respstring} [0, 2] + VerifyMigratedElementsSim [Arguments] ${theInstanceId} [Documentation] Query on Participant Simulator diff --git a/csit/resources/tests/xacml-pdp-slas.robot b/csit/resources/tests/xacml-pdp-slas.robot index e3d2d910..98a44a80 100644 --- a/csit/resources/tests/xacml-pdp-slas.robot +++ b/csit/resources/tests/xacml-pdp-slas.robot @@ -7,13 +7,6 @@ WaitForPrometheusServer [Documentation] Sleep time to wait for Prometheus server to gather all metrics Sleep 1 minute -ValidatePolicyDecisionsGauge - [Documentation] Validate policy execution gauge using prometheus metrics - ValidatePrometheusMetric pdpx_policy_decisions_created{application="optimization",status="permit", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1.8E9 - ValidatePrometheusMetric pdpx_policy_decisions_created{application="guard",status="not_applicable", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1.8E9 - ValidatePrometheusMetric pdpx_policy_decisions_created{application="monitoring",status="permit", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1.8E9 - ValidatePrometheusMetric pdpx_policy_decisions_created{application="naming",status="permit", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1.8E9 - ValidatePolicyDecisionsTotalCounter [Documentation] Validate policy decision counters using prometheus metrics ValidatePrometheusMetric pdpx_policy_decisions_total{application="optimization",status="permit", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1 diff --git a/csit/run-k8s-csit.sh b/csit/run-k8s-csit.sh index 7d93fa8d..2d5dfed3 100755 --- a/csit/run-k8s-csit.sh +++ b/csit/run-k8s-csit.sh @@ -24,453 +24,82 @@ # Runs CSITs in kubernetes. WORKSPACE=$(git rev-parse --show-toplevel) -export WORKSPACE -export GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' "${WORKSPACE}"/.gitreview) - -CSIT_SCRIPT="scripts/run-test.sh" -ROBOT_DOCKER_IMAGE="policy-csit-robot" -POLICY_CLAMP_ROBOT="policy-clamp-test.robot clamp-slas.robot" -POLICY_API_ROBOT="api-test.robot api-slas.robot" -POLICY_PAP_ROBOT="pap-test.robot pap-slas.robot" -POLICY_APEX_PDP_ROBOT="apex-pdp-test.robot apex-slas.robot" -POLICY_XACML_PDP_ROBOT="xacml-pdp-test.robot xacml-pdp-slas.robot" -POLICY_OPA_PDP_ROBOT="opa-pdp-test.robot" -POLICY_DROOLS_PDP_ROBOT="drools-pdp-test.robot" -POLICY_DISTRIBUTION_ROBOT="distribution-test.robot" - -POLICY_API_CONTAINER="policy-api" -POLICY_PAP_CONTAINER="policy-pap" -POLICY_CLAMP_CONTAINER="policy-clamp-runtime-acm" -POLICY_APEX_CONTAINER="policy-apex-pdp" -POLICY_DROOLS_CONTAINER="policy-drools-pdp" -POLICY_XACML_CONTAINER="policy-xacml-pdp" -POLICY_OPA_CONTAINER="policy-opa-pdp" -POLICY_DISTRIBUTION_CONTAINER="policy-distribution" -POLICY_K8S_PPNT_CONTAINER="policy-clamp-ac-k8s-ppnt" -POLICY_HTTP_PPNT_CONTAINER="policy-clamp-ac-http-ppnt" -POLICY_SIM_PPNT_CONTAINER="policy-clamp-ac-sim-ppnt" -POLICY_PF_PPNT_CONTAINER="policy-clamp-ac-pf-ppnt" -JAEGER_CONTAINER="jaeger" -KAFKA_CONTAINER="kafka-deployment" -ZK_CONTAINER="zookeeper-deployment" -KAFKA_DIR=${WORKSPACE}/helm/cp-kafka -SET_VALUES="" - -DISTRIBUTION_CSAR=${WORKSPACE}/csit/resources/tests/data/csar -DIST_TEMP_FOLDER=/tmp/distribution - -export PROJECT="" -export ROBOT_FILE="" -export ROBOT_LOG_DIR=${WORKSPACE}/csit/archives -export READINESS_CONTAINERS=() - - -function spin_microk8s_cluster() { - echo "Verify if Microk8s cluster is running.." - microk8s version - exitcode="${?}" - - if [ "$exitcode" -ne 0 ]; then - echo "Microk8s cluster not available, Spinning up the cluster.." - sudo snap install microk8s --classic --channel=1.30/stable - - if [ "${?}" -ne 0 ]; then - echo "Failed to install kubernetes cluster. Aborting.." - return 1 - fi - echo "Microk8s cluster installed successfully" - sudo usermod -a -G microk8s $USER - echo "Enabling DNS and Storage plugins" - sudo microk8s.enable dns hostpath-storage - echo "Creating configuration file for Microk8s" - sudo mkdir -p $HOME/.kube - sudo chown -R $USER:$USER $HOME/.kube - sudo microk8s kubectl config view --raw >$HOME/.kube/config - sudo chmod 600 $HOME/.kube/config - echo "K8s installation completed" - echo "----------------------------------------" - else - echo "K8s cluster is already running" - echo "----------------------------------------" - fi - - echo "Verify if kubectl is running.." - kubectl version - exitcode="${?}" - - if [ "$exitcode" -ne 0 ]; then - echo "Kubectl not available, Installing.." - sudo snap install kubectl --classic --channel=1.30/stable - - if [ "${?}" -ne 0 ]; then - echo "Failed to install Kubectl. Aborting.." - return 1 - fi - echo "Kubectl installation completed" - echo "----------------------------------------" - else - echo "Kubectl is already running" - echo "----------------------------------------" - return 0 - fi - - echo "Verify if helm is running.." - helm version - exitcode="${?}" - - if [ "$exitcode" -ne 0 ]; then - echo "Helm not available, Installing.." - sudo snap install helm --classic --channel=3.7 - - if [ "${?}" -ne 0 ]; then - echo "Failed to install Helm client. Aborting.." - return 1 - fi - echo "Helm installation completed" - echo "----------------------------------------" - else - echo "Helm is already running" - echo "----------------------------------------" - return 0 - fi +function print_usage() { + echo "Usage: $0 [OPTIONS] OPERATION PROJECT" + echo "" + echo "OPTIONS:" + echo " -c, --cluster-only Install cluster only, without running robot tests" + echo " -l, --local-image Use local Docker image" + echo " -h, --help Display this help message" + echo "" + echo "OPERATION:" + echo " install Install the cluster and optionally run robot tests" + echo " uninstall Uninstall the policy deployment" + echo " clean Teardown the cluster" + echo "" + echo "PROJECT:" + echo " Specify the project name (e.g., clamp, api, pap, etc.)" } -function install_kafka() { - echo "Installing Confluent kafka" - kubectl apply -f $KAFKA_DIR/zookeeper.yaml - kubectl apply -f $KAFKA_DIR/kafka.yaml - echo "----------------------------------------" -} - -function uninstall_policy() { - echo "Removing the policy helm deployment" - helm uninstall csit-policy - helm uninstall prometheus - helm uninstall csit-robot - kubectl delete deploy $ZK_CONTAINER $KAFKA_CONTAINER - rm -rf ${WORKSPACE}/helm/policy/Chart.lock - if [ "$PROJECT" == "clamp" ] || [ "$PROJECT" == "policy-clamp" ]; then - helm uninstall policy-chartmuseum - helm repo remove chartmuseum-git policy-chartmuseum - fi - sudo rm -rf /dockerdata-nfs/mariadb-galera/ - kubectl delete pvc --all - echo "Policy deployment deleted" - echo "Clean up docker" - docker image prune -f -} - -function teardown_cluster() { - echo "Removing k8s cluster and k8s configuration file" - sudo snap remove microk8s;rm -rf $HOME/.kube/config - sudo snap remove helm; - sudo snap remove kubectl; - echo "MicroK8s Cluster removed" -} - -function clone_models() { - - # download models examples - git clone -b "${GERRIT_BRANCH}" --single-branch https://github.com/onap/policy-models.git "${WORKSPACE}"/csit/resources/tests/models - - # create a couple of variations of the policy definitions - sed -e 's!Measurement_vGMUX!ADifferentValue!' \ - tests/models/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.json \ - >tests/models/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.v1_2.json - - sed -e 's!"version": "1.0.0"!"version": "2.0.0"!' \ - -e 's!"policy-version": 1!"policy-version": 2!' \ - tests/models/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.json \ - >tests/models/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.v2.json -} - -function copy_csar_file() { - zip -F ${DISTRIBUTION_CSAR}/sample_csar_with_apex_policy.csar \ - --out ${DISTRIBUTION_CSAR}/csar_temp.csar -q - # Remake temp directory - sudo rm -rf "${DIST_TEMP_FOLDER}" - sudo mkdir "${DIST_TEMP_FOLDER}" - sudo cp ${DISTRIBUTION_CSAR}/csar_temp.csar ${DISTRIBUTION_CSAR}/temp.csar - sudo mv ${DISTRIBUTION_CSAR}/temp.csar ${DIST_TEMP_FOLDER}/sample_csar_with_apex_policy.csar -} +CLUSTER_ONLY=false +LOCAL_IMAGE=false + +# Parse command-line options +while [[ $# -gt 0 ]]; do + case $1 in + -c|--cluster-only) + CLUSTER_ONLY=true + shift + ;; + -l|--local-image) + LOCAL_IMAGE=true + shift + ;; + -h|--help) + print_usage + exit 0 + ;; + *) + break + ;; + esac +done -function build_robot_image() { - echo "Build docker image for robot framework" - cd ${WORKSPACE}/csit/resources || exit - clone_models - if [ "${PROJECT}" == "distribution" ] || [ "${PROJECT}" == "policy-distribution" ]; then - copy_csar_file - fi - echo "Build robot framework docker image" - docker login -u docker -p docker nexus3.onap.org:10001 - docker build . --file Dockerfile \ - --build-arg CSIT_SCRIPT="$CSIT_SCRIPT" \ - --build-arg ROBOT_FILE="$ROBOT_FILE" \ - --tag "${ROBOT_DOCKER_IMAGE}" --no-cache - echo "---------------------------------------------" -} +# Check for required arguments +if [ $# -lt 2 ]; then + echo "Error: Insufficient arguments" + print_usage + exit 1 +fi -function push_acelement_chart() { - echo "Pushing acelement chart to the chartmuseum repo..." - helm repo add policy-chartmuseum http://localhost:30208 +OPERATION=$1 +PROJECT=$2 - # download clamp repo - git clone -b "${GERRIT_BRANCH}" --single-branch https://github.com/onap/policy-clamp.git "${WORKSPACE}"/csit/resources/tests/clamp - ACELEMENT_CHART=${WORKSPACE}/csit/resources/tests/clamp/examples/src/main/resources/clamp/acm/acelement-helm/acelement - helm cm-push $ACELEMENT_CHART policy-chartmuseum - helm repo update - rm -rf ${WORKSPACE}/csit/resources/tests/clamp/ - echo "-------------------------------------------" -} - -function print_robot_log() { - count_pods=0 - while [[ ${count_pods} -eq 0 ]]; do - echo "Waiting for pods to come up..." - sleep 5 - count_pods=$(kubectl get pods --output name | wc -l) - done - robotpod=$(kubectl get po | grep policy-csit) - podName=$(echo "$robotpod" | awk '{print $1}') - echo "The robot tests will begin once the policy components {${READINESS_CONTAINERS[*]}} are up and running..." - kubectl wait --for=jsonpath='{.status.phase}'=Running --timeout=18m pod/"$podName" - echo "Policy deployment status:" - kubectl get po - kubectl get all -A - echo "Robot Test logs:" - kubectl logs -f "$podName" -} +# Set local image flag +if [ "$LOCAL_IMAGE" = true ]; then + LOCAL_IMAGE_ARG="true" +else + LOCAL_IMAGE_ARG="false" +fi -function start_csit() { - build_robot_image - if [ "${?}" -eq 0 ]; then - echo "Importing robot image into microk8s registry" - docker save -o policy-csit-robot.tar ${ROBOT_DOCKER_IMAGE}:latest - sudo microk8s ctr image import policy-csit-robot.tar - rm -rf ${WORKSPACE}/csit/resources/policy-csit-robot.tar - rm -rf ${WORKSPACE}/csit/resources/tests/models/ - echo "---------------------------------------------" - if [ "$PROJECT" == "clamp" ] || [ "$PROJECT" == "policy-clamp" ]; then - POD_READY_STATUS="0/1" - while [[ ${POD_READY_STATUS} != "1/1" ]]; do - echo "Waiting for chartmuseum pod to come up..." - sleep 5 - POD_READY_STATUS=$(kubectl get pods | grep -e "policy-chartmuseum" | awk '{print $2}') - done - push_acelement_chart +# Execute the appropriate script based on the operation +case $OPERATION in + install) + ${WORKSPACE}/csit/resources/scripts/cluster_setup.sh install $PROJECT $LOCAL_IMAGE_ARG + if [ "$CLUSTER_ONLY" = false ]; then + ${WORKSPACE}/csit/resources/scripts/robot_setup.sh $PROJECT fi - echo "Installing Robot framework pod for running CSIT" - cd ${WORKSPACE}/helm - mkdir -p ${ROBOT_LOG_DIR} - helm install csit-robot robot --set robot="$ROBOT_FILE" --set "readiness={${READINESS_CONTAINERS[*]}}" --set robotLogDir=$ROBOT_LOG_DIR - print_robot_log - fi -} - -function install_chartmuseum () { - echo "---------------------------------------------" - echo "Installing Chartmuseum helm repository..." - helm repo add chartmuseum-git https://chartmuseum.github.io/charts - helm repo update - helm install policy-chartmuseum chartmuseum-git/chartmuseum --set env.open.DISABLE_API=false --set service.type=NodePort --set service.nodePort=30208 - helm plugin install https://github.com/chartmuseum/helm-push - echo "---------------------------------------------" -} - -function set_project_config() { - echo "Setting project configuration for: $PROJECT" - case $PROJECT in - - clamp | policy-clamp) - export ROBOT_FILE=$POLICY_CLAMP_ROBOT - export READINESS_CONTAINERS=($POLICY_CLAMP_CONTAINER,$POLICY_APEX_CONTAINER,$POLICY_PF_PPNT_CONTAINER,$POLICY_K8S_PPNT_CONTAINER, - $POLICY_HTTP_PPNT_CONTAINER,$POLICY_SIM_PPNT_CONTAINER,$JAEGER_CONTAINER) - export SET_VALUES="--set $POLICY_CLAMP_CONTAINER.enabled=true --set $POLICY_APEX_CONTAINER.enabled=true - --set $POLICY_PF_PPNT_CONTAINER.enabled=true --set $POLICY_K8S_PPNT_CONTAINER.enabled=true - --set $POLICY_HTTP_PPNT_CONTAINER.enabled=true --set $POLICY_SIM_PPNT_CONTAINER.enabled=true - --set $JAEGER_CONTAINER.enabled=true" - install_chartmuseum ;; - - api | policy-api) - export ROBOT_FILE=$POLICY_API_ROBOT - export READINESS_CONTAINERS=($POLICY_API_CONTAINER) + uninstall) + ${WORKSPACE}/csit/resources/scripts/cluster_setup.sh uninstall ;; - - pap | policy-pap) - export ROBOT_FILE=$POLICY_PAP_ROBOT - export READINESS_CONTAINERS=($POLICY_APEX_CONTAINER,$POLICY_PAP_CONTAINER,$POLICY_API_CONTAINER,$POLICY_XACML_CONTAINER) - export SET_VALUES="--set $POLICY_APEX_CONTAINER.enabled=true --set $POLICY_XACML_CONTAINER.enabled=true" - ;; - - apex-pdp | policy-apex-pdp) - export ROBOT_FILE=$POLICY_APEX_PDP_ROBOT - export READINESS_CONTAINERS=($POLICY_APEX_CONTAINER,$POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER) - export SET_VALUES="--set $POLICY_APEX_CONTAINER.enabled=true" - ;; - - xacml-pdp | policy-xacml-pdp) - export ROBOT_FILE=($POLICY_XACML_PDP_ROBOT) - export READINESS_CONTAINERS=($POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER,$POLICY_XACML_CONTAINER) - export SET_VALUES="--set $POLICY_XACML_CONTAINER.enabled=true" - ;; - - opa-pdp | policy-opa-pdp) - export ROBOT_FILE=($POLICY_OPA_PDP_ROBOT) - export READINESS_CONTAINERS=($POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER,$POLICY_OPA_CONTAINER) - export SET_VALUES="--set $POLICY_OPA_CONTAINER.enabled=true" - ;; - - drools-pdp | policy-drools-pdp) - export ROBOT_FILE=($POLICY_DROOLS_PDP_ROBOT) - export READINESS_CONTAINERS=($POLICY_DROOLS_CONTAINER) - export SET_VALUES="--set $POLICY_DROOLS_CONTAINER.enabled=true" - ;; - - distribution | policy-distribution) - export ROBOT_FILE=($POLICY_DISTRIBUTION_ROBOT) - export READINESS_CONTAINERS=($POLICY_APEX_CONTAINER,$POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER,$POLICY_DISTRIBUTION_CONTAINER) - export SET_VALUES="--set $POLICY_APEX_CONTAINER.enabled=true --set $POLICY_DISTRIBUTION_CONTAINER.enabled=true" + clean) + ${WORKSPACE}/csit/resources/scripts/cluster_setup.sh clean ;; - *) - echo "Unknown project supplied. Enabling all policy charts for the deployment" - export READINESS_CONTAINERS=($POLICY_APEX_CONTAINER,$POLICY_API_CONTAINER,$POLICY_PAP_CONTAINER, - $POLICY_DISTRIBUTION_CONTAINER,$POLICY_DROOLS_CONTAINER,$POLICY_XACML_CONTAINER,$POLICY_OPA_CONTAINER, - $POLICY_CLAMP_CONTAINER,$POLICY_PF_PPNT_CONTAINER,$POLICY_K8S_PPNT_CONTAINER, - $POLICY_HTTP_PPNT_CONTAINER,$POLICY_SIM_PPNT_CONTAINER) - export SET_VALUES="--set $POLICY_APEX_CONTAINER.enabled=true --set $POLICY_XACML_CONTAINER.enabled=true - --set $POLICY_OPA_CONTAINER.enabled=true --set $POLICY_DISTRIBUTION_CONTAINER.enabled=true --set $POLICY_DROOLS_CONTAINER.enabled=true - --set $POLICY_CLAMP_CONTAINER.enabled=true --set $POLICY_PF_PPNT_CONTAINER.enabled=true - --set $POLICY_K8S_PPNT_CONTAINER.enabled=true --set $POLICY_HTTP_PPNT_CONTAINER.enabled=true - --set $POLICY_SIM_PPNT_CONTAINER.enabled=true" + echo "Error: Invalid operation" + print_usage + exit 1 ;; - esac - -} - -function get_pod_name() { - pods=$(kubectl get pods --no-headers -o custom-columns=':metadata.name' | grep $1) - read -rd '' -a pod_array <<< "$pods" - echo "${pod_array[@]}" -} - -function wait_for_pods_running() { - local namespace="$1" - shift - local timeout_seconds="$1" - shift - - IFS=',' read -ra pod_names <<< "$@" - shift - - local pending_pods=("${pod_names[@]}") - local start_time - start_time=$(date +%s) - - while [ ${#pending_pods[@]} -gt 0 ]; do - local current_time - current_time=$(date +%s) - local elapsed_time - elapsed_time=$((current_time - start_time)) - - if [ "$elapsed_time" -ge "$timeout_seconds" ]; then - echo "Timed out waiting for the pods to reach 'Running' state." - echo "Printing the current status of the deployment before exiting.." - kubectl get po; - kubectl describe pods; - echo "------------------------------------------------------------" - for pod in "${pending_pods[@]}"; do - echo "Logs of the pod $pod" - kubectl logs $pod - echo "---------------------------------------------------------" - done - exit 1 - fi - - local newly_running_pods=() - - for pod_name_prefix in "${pending_pods[@]}"; do - local pod_names=$(get_pod_name "$pod_name_prefix") - IFS=' ' read -r -a pod_array <<< "$pod_names" - if [ "${#pod_array[@]}" -eq 0 ]; then - echo "*** Error: No pods found for the deployment $pod_name_prefix . Exiting ***" - return -1 - fi - for pod in "${pod_array[@]}"; do - local pod_status - local pod_ready - pod_status=$(kubectl get pod "$pod" -n "$namespace" --no-headers -o custom-columns=STATUS:.status.phase 2>/dev/null) - pod_ready=$(kubectl get pod "$pod" -o jsonpath='{.status.containerStatuses[*].ready}') - - if [ "$pod_status" == "Running" ] && { [ "$pod_ready" == "true" ] || [ "$pod_ready" == "true true" ]; }; then - echo "Pod '$pod' in namespace '$namespace' is now in 'Running' state and 'Readiness' is true" - else - newly_running_pods+=("$pod") - echo "Waiting for pod '$pod' in namespace '$namespace' to reach 'Running' and 'Ready' state..." - fi - - done - done - - pending_pods=("${newly_running_pods[@]}") - - sleep 5 - done - - echo "All specified pods are in the 'Running and Ready' state. Exiting the function." -} - -OPERATION="$1" -PROJECT="$2" -if [ -z "$3" ] -then - LOCALIMAGE="false" -else - LOCALIMAGE="$3" -fi - - -if [ $OPERATION == "install" ]; then - spin_microk8s_cluster - if [ "${?}" -eq 0 ]; then - export KAFKA_CONTAINERS=($KAFKA_CONTAINER,$ZK_CONTAINER) - install_kafka - wait_for_pods_running default 300 $KAFKA_CONTAINERS - set_project_config - echo "Installing policy helm charts in the default namespace" - source ${WORKSPACE}/compose/get-k8s-versions.sh - if [ $LOCALIMAGE == "true" ]; then - echo "loading local image" - source ${WORKSPACE}/compose/get-versions.sh - ${WORKSPACE}/compose/loaddockerimage.sh - fi - cd ${WORKSPACE}/helm || exit - helm dependency build policy - helm install csit-policy policy ${SET_VALUES} - helm install prometheus prometheus - wait_for_pods_running default 900 ${READINESS_CONTAINERS[@]} - echo "Policy chart installation completed" - echo "-------------------------------------------" - fi - - if [ "$PROJECT" ]; then - export ROBOT_LOG_DIR=${WORKSPACE}/csit/archives/${PROJECT} - echo "CSIT will be invoked from $ROBOT_FILE" - echo "Readiness containers: ${READINESS_CONTAINERS[*]}" - echo "-------------------------------------------" - start_csit - else - echo "No project supplied for running CSIT" - fi - -elif [ $OPERATION == "uninstall" ]; then - uninstall_policy - -elif [ $OPERATION == "clean" ]; then - teardown_cluster - -else - echo "Invalid arguments provided. Usage: $0 [options..] {install {project_name} | uninstall | clean} {uselocalimage = true/false}" -fi +esac diff --git a/csit/run-project-csit.sh b/csit/run-project-csit.sh index 9b2c7695..da01ea12 100755 --- a/csit/run-project-csit.sh +++ b/csit/run-project-csit.sh @@ -4,7 +4,7 @@ # Modification Copyright 2019 © Samsung Electronics Co., Ltd. # Modification Copyright 2021 © AT&T Intellectual Property. # Modification Copyright 2021-2025 Nordix Foundation. -# Modifications Copyright 2024 Deutsche Telekom +# Modifications Copyright 2024-2025 Deutsche Telekom # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,25 +18,26 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 SKIP_BUILDING_ROBOT_IMG=false DO_NOT_TEARDOWN=false # even with forced finish, clean up docker containers function on_exit(){ - rm -rf ${CSAR_DIR}/csar_temp.csar + rm -rf "${CSAR_DIR}"/csar_temp.csar if [ "${DO_NOT_TEARDOWN}" = false ]; then # teardown of compose containers for acm-replicas doesn't work with normal stop-compose script if [ "${ACM_REPLICA_TEARDOWN}" = true ]; then - source ${DOCKER_COMPOSE_DIR}/start-acm-replica.sh --stop --replicas=2 + source "${DOCKER_COMPOSE_DIR}"/start-acm-replica.sh --stop --replicas=2 elif [ "${APEX_REPLICA_TEARDOWN}" = true ]; then - source ${DOCKER_COMPOSE_DIR}/start-multiple-pdp.sh --stop --replicas=2 + source "${DOCKER_COMPOSE_DIR}"/start-multiple-pdp.sh --stop --replicas=2 else - source ${DOCKER_COMPOSE_DIR}/stop-compose.sh ${PROJECT} + source "${DOCKER_COMPOSE_DIR}"/stop-compose.sh "${PROJECT}" fi - mv ${DOCKER_COMPOSE_DIR}/*.log ${ROBOT_LOG_DIR} + mv "${DOCKER_COMPOSE_DIR}"/*.log "${ROBOT_LOG_DIR}" fi exit $RC @@ -71,7 +72,7 @@ function apex_healthcheck() { while [ $healthy = false ] do - msg=`curl -s -k --user 'policyadmin:zb!XztG34' http://localhost:${APEX_PORT}/policy/apex-pdp/v1/healthcheck` + msg=$(curl -s -k --user 'policyadmin:zb!XztG34' http://localhost:"${APEX_PORT}"/policy/apex-pdp/v1/healthcheck) echo "${msg}" | grep -q true if [ "${?}" -eq 0 ] then @@ -87,7 +88,7 @@ function apex_healthcheck() { } function check_rest_endpoint() { - bash ${SCRIPTS}/wait_for_rest.sh localhost "${1}" + bash "${SCRIPTS}"/wait_for_rest.sh localhost "${1}" rc=$? if [ $rc -ne 0 ]; then on_exit @@ -96,7 +97,7 @@ function check_rest_endpoint() { function setup_clamp() { export ROBOT_FILES="policy-clamp-test.robot clamp-slas.robot" - source ${DOCKER_COMPOSE_DIR}/start-compose.sh policy-clamp-runtime-acm --grafana + source "${DOCKER_COMPOSE_DIR}"/start-compose.sh policy-clamp-runtime-acm --grafana echo "Waiting 2 minutes acm-runtime and participants to start..." sleep 120 check_rest_endpoint "${ACM_PORT}" @@ -107,124 +108,127 @@ function setup_clamp_replica() { export ROBOT_FILES="policy-clamp-test.robot" export TEST_ENV="docker" export PROJECT=clamp - source ${DOCKER_COMPOSE_DIR}/start-acm-replica.sh --start --replicas=2 + source "${DOCKER_COMPOSE_DIR}"/start-acm-replica.sh --start --replicas=2 echo "Waiting 2 minutes for the replicas to be started..." sleep 120 # checking on apex-pdp status because acm-r replicas only start after apex-pdp is running - check_rest_endpoint ${PAP_PORT} - check_rest_endpoint ${APEX_PORT} + check_rest_endpoint "${PAP_PORT}" + check_rest_endpoint "${APEX_PORT}" apex_healthcheck - check_rest_endpoint ${ACM_PORT} + check_rest_endpoint "${ACM_PORT}" } function setup_api() { export ROBOT_FILES="api-test.robot api-slas.robot" - source ${DOCKER_COMPOSE_DIR}/start-compose.sh api --grafana + source "${DOCKER_COMPOSE_DIR}"/start-compose.sh api --grafana echo "Waiting 1 minute for policy-api to start..." sleep 60 - check_rest_endpoint ${API_PORT} + check_rest_endpoint "${API_PORT}" } function setup_pap() { export ROBOT_FILES="pap-test.robot pap-slas.robot" - source ${DOCKER_COMPOSE_DIR}/start-compose.sh apex-pdp --grafana + export PROJECT="pap" + source "${DOCKER_COMPOSE_DIR}"/start-compose.sh apex-pdp --grafana echo "Waiting 1 minute for policy-pap to start..." sleep 60 - check_rest_endpoint ${PAP_PORT} - check_rest_endpoint ${APEX_PORT} + check_rest_endpoint "${PAP_PORT}" + check_rest_endpoint "${APEX_PORT}" apex_healthcheck } function setup_apex() { export ROBOT_FILES="apex-pdp-test.robot apex-slas.robot" - source ${DOCKER_COMPOSE_DIR}/start-compose.sh apex-pdp --grafana + source "${DOCKER_COMPOSE_DIR}"/start-compose.sh apex-pdp --grafana echo "Waiting 1 minute for apex-pdp to start..." sleep 60 - check_rest_endpoint ${PAP_PORT} - check_rest_endpoint ${APEX_PORT} + check_rest_endpoint "${PAP_PORT}" + check_rest_endpoint "${APEX_PORT}" apex_healthcheck } function setup_apex_medium() { export ROBOT_FILES="apex-slas-3.robot" export APEX_REPLICA_TEARDOWN=true - source ${DOCKER_COMPOSE_DIR}/start-multiple-pdp.sh --start --replicas=3 + source "${DOCKER_COMPOSE_DIR}"/start-multiple-pdp.sh --start --replicas=3 echo "Waiting 1 minute for apex-pdp to start..." sleep 60 - check_rest_endpoint ${PAP_PORT} - check_rest_endpoint ${APEX_PORT} + check_rest_endpoint "${PAP_PORT}" + check_rest_endpoint "${APEX_PORT}" apex_healthcheck } function setup_apex_large() { export ROBOT_FILES="apex-slas-10.robot" export APEX_REPLICA_TEARDOWN=true - source ${DOCKER_COMPOSE_DIR}/start-multiple-pdp.sh --start --replicas=10 + source "${DOCKER_COMPOSE_DIR}"/start-multiple-pdp.sh --start --replicas=10 echo "Waiting 1 minute for apex-pdp to start..." sleep 60 - check_rest_endpoint ${PAP_PORT} - check_rest_endpoint ${APEX_PORT} + check_rest_endpoint "${PAP_PORT}" + check_rest_endpoint "${APEX_PORT}" apex_healthcheck } function setup_drools_apps() { export ROBOT_FILES="drools-applications-test.robot drools-applications-slas.robot" - source ${DOCKER_COMPOSE_DIR}/start-compose.sh drools-applications --grafana + source "${DOCKER_COMPOSE_DIR}"/start-compose.sh drools-applications --grafana echo "Waiting 1 minute for drools-pdp and drools-applications to start..." - sleep 60 - check_rest_endpoint ${PAP_PORT} - check_rest_endpoint ${DROOLS_APPS_PORT} - check_rest_endpoint ${DROOLS_APPS_TELEMETRY_PORT} + sleep 80 + check_rest_endpoint "${PAP_PORT}" + check_rest_endpoint "${XACML_PORT}" + check_rest_endpoint "${DROOLS_APPS_PORT}" + check_rest_endpoint "${DROOLS_APPS_TELEMETRY_PORT}" } function setup_xacml_pdp() { export ROBOT_FILES="xacml-pdp-test.robot xacml-pdp-slas.robot" - source ${DOCKER_COMPOSE_DIR}/start-compose.sh xacml-pdp --grafana + source "${DOCKER_COMPOSE_DIR}"/start-compose.sh xacml-pdp --grafana echo "Waiting 1 minute for xacml-pdp to start..." sleep 60 check_rest_endpoint "${XACML_PORT}" } function setup_opa_pdp() { - export ROBOT_FILES="opa-pdp-test.robot" + export ROBOT_FILES="opa-pdp-test.robot opa-pdp-slas.robot" export PROJECT="opa-pdp" - source ${DOCKER_COMPOSE_DIR}/start-compose.sh opa-pdp + source "${DOCKER_COMPOSE_DIR}"/start-compose.sh opa-pdp --grafana echo "Waiting 3 minutes for OPA-PDP to start..." sleep 180 + check_rest_endpoint "${PAP_PORT}" check_rest_endpoint "${OPA_PDP_PORT}" } function setup_drools_pdp() { export ROBOT_FILES="drools-pdp-test.robot" - source ${DOCKER_COMPOSE_DIR}/start-compose.sh drools-pdp --grafana + source "${DOCKER_COMPOSE_DIR}"/start-compose.sh drools-pdp --grafana echo "Waiting 1 minute for drools-pdp to start..." sleep 60 - check_rest_endpoint ${DROOLS_TELEMETRY_PORT} + check_rest_endpoint "${DROOLS_TELEMETRY_PORT}" } function setup_distribution() { - zip -F ${CSAR_DIR}/sample_csar_with_apex_policy.csar --out ${CSAR_DIR}/csar_temp.csar -q + zip -F "${CSAR_DIR}"/sample_csar_with_apex_policy.csar --out "${CSAR_DIR}"/csar_temp.csar -q # Remake temp directory sudo rm -rf /tmp/distribution sudo mkdir /tmp/distribution export ROBOT_FILES="distribution-test.robot" - source ${DOCKER_COMPOSE_DIR}/start-compose.sh distribution --grafana + source "${DOCKER_COMPOSE_DIR}"/start-compose.sh distribution --grafana echo "Waiting 1 minute for distribution to start..." sleep 60 check_rest_endpoint "${DIST_PORT}" - check_rest_endpoint ${APEX_PORT} + check_rest_endpoint "${APEX_PORT}" apex_healthcheck } function build_robot_image() { - bash ${SCRIPTS}/build-csit-docker-image.sh - cd ${WORKSPACE} + bash "${SCRIPTS}"/build-csit-docker-image.sh + cd "${WORKSPACE}" || exit } function run_robot() { - docker compose -f ${DOCKER_COMPOSE_DIR}/compose.yaml up csit-tests + docker compose -f "${DOCKER_COMPOSE_DIR}"/compose.yaml up csit-tests export RC=$? } @@ -310,6 +314,10 @@ do export DO_NOT_TEARDOWN=true shift ;; + --stop) + export TEARDOWN=true + shift + ;; *) export PROJECT="${1}" shift @@ -332,11 +340,15 @@ export ROBOT_FILES="" export ACM_REPLICA_TEARDOWN=false export APEX_REPLICA_TEARDOWN=false -cd "${WORKSPACE}" +cd "${WORKSPACE}" || exit # recreate the log folder with test results -sudo rm -rf ${ROBOT_LOG_DIR} -mkdir -p ${ROBOT_LOG_DIR} +sudo rm -rf "${ROBOT_LOG_DIR}" +mkdir -p "${ROBOT_LOG_DIR}" + +if [ "${TEARDOWN}" == "true" ]; then + on_exit +fi # log into nexus docker docker login -u docker -p docker nexus3.onap.org:10001 @@ -345,7 +357,7 @@ docker login -u docker -p docker nexus3.onap.org:10001 compose_version=$(docker compose version) if [[ $compose_version == *"Docker Compose version"* ]]; then - echo $compose_version + echo "$compose_version" else echo "Docker Compose Plugin not installed. Installing now..." sudo mkdir -p /usr/local/lib/docker/cli-plugins diff --git a/csit/run-s3p-tests.sh b/csit/run-s3p-tests.sh new file mode 100755 index 00000000..4dce3b7e --- /dev/null +++ b/csit/run-s3p-tests.sh @@ -0,0 +1,165 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2023-2025 Nordix Foundation. 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +# This script will be used to automatically trigger the S3P +# tests for policy components. + +script_start_time=$(date +%s) +log_file="${TESTDIR:-$(pwd)}/s3p_test_log_$(date +%Y%m%d_%H%M%S).log" +files_processed=0 +errors_encountered=0 +warnings_issued=0 + +# Function to log messages +log_message() { + local level="$1" + local message="$2" + echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$level] $message" | tee -a "$log_file" +} + +# Start Kubernetes +function start_kubernetes() { + log_message "INFO" "Starting Kubernetes cluster for $PROJECT" + bash resources/scripts/cluster_setup.sh install $PROJECT + if [ $? -eq 0 ]; then + log_message "INFO" "Kubernetes cluster started successfully" + else + log_message "ERROR" "Failed to start Kubernetes cluster" + ((errors_encountered++)) + fi + bash resources/scripts/get-cluster-info.sh +} + +function install_jmeter() { + log_message "INFO" "Installing JMeter" + cd ${TESTDIR}/automate-s3p-test || { log_message "ERROR" "Failed to change directory"; ((errors_encountered++)); return 1; } + + sudo apt-get update + sudo apt install curl -y + sudo apt install -y default-jdk + + curl -O https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.6.2.tgz + tar -xvf apache-jmeter-5.6.2.tgz + mv apache-jmeter-5.6.2 apache-jmeter + + echo 'export JVM_ARGS="-Xms2g -Xmx4g"' > apache-jmeter/bin/setenv.sh + echo 'export HEAP="-Xms1G -Xmx2G -XX:MaxMetaspaceSize=512m"' >> apache-jmeter/bin/setenv.sh + + rm -rf apache-jmeter/docs apache-jmeter/printable_docs + + cd apache-jmeter/lib || { log_message "ERROR" "Failed to change directory"; ((errors_encountered++)); return 1; } + curl -O https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2.1/cmdrunner-2.2.1.jar + curl -O https://repo1.maven.org/maven2/org/apache/kafka/kafka-clients/3.9.0/kafka-clients-3.9.0.jar + curl -O https://repo1.maven.org/maven2/org/apache/kafka/kafka_2.13/3.9.0/kafka_2.13-3.9.0.jar + + sudo cp -r ../../apache-jmeter /opt/ + + export JMETER_HOME="/opt/apache-jmeter" + export PATH="$JMETER_HOME/bin:$PATH" + + log_message "INFO" "JMeter installation completed" + ((files_processed+=7)) +} + +function on_exit() { + local exit_status=$? + local end_time=$(date +%s) + local runtime=$((end_time - script_start_time)) + + log_message "INFO" "=============== Exit Report ===============" + log_message "INFO" "Script execution completed at $(date)" + log_message "INFO" "Exit status: $exit_status" + log_message "INFO" "Total runtime: $runtime seconds" + log_message "INFO" "Operations summary:" + log_message "INFO" " - Files processed: $files_processed" + log_message "INFO" " - Errors encountered: $errors_encountered" + log_message "INFO" " - Warnings issued: $warnings_issued" + log_message "INFO" "Resource usage:" + ps -p $$ -o %cpu,%mem,etime >> "$log_file" + log_message "INFO" "Full log available at: $log_file" + log_message "INFO" "============================================" +} + +function show_usage() { + echo "Usage: $0 [option] {test <jmx_file> | clean}" + echo "Options:" + echo " test <jmx_file> Start the environment and run the specified JMX test plan" + echo " clean Uninstall the environment and remove temporary folders" +} + +function teardown() { + log_message "INFO" "Starting teardown process" + + log_message "INFO" "Tearing down Kubernetes cluster" + bash resources/scripts/cluster_setup.sh uninstall + + log_message "INFO" "Deleting created services" + microk8s kubectl get svc | awk '/svc/{system("microk8s kubectl delete svc " $1)}' + + log_message "INFO" "Teardown process completed" +} + +function main() { + PROJECT="$3" + case "$1" in + clean) + log_message "INFO" "Uninstalling environment and removing temp folders" + teardown + ;; + test) + if [ -z "$2" ]; then + log_message "ERROR" "JMX file not specified for test option" + show_usage + ((errors_encountered++)) + exit 1 + fi + log_message "INFO" "Starting K8s Environment" + start_kubernetes + + log_message "INFO" "Installing JMeter" + install_jmeter + + log_message "INFO" "Executing tests" + cd "${TESTDIR}/automate-s3p-test" || { log_message "ERROR" "Failed to change directory"; ((errors_encountered++)); exit 1; } + nohup jmeter -n -t "$2" -l s3pTestResults.jtl + if [ $? -eq 0 ]; then + log_message "INFO" "JMeter test completed successfully" + ((files_processed++)) + else + log_message "ERROR" "JMeter test failed" + ((errors_encountered++)) + fi + ;; + *) + log_message "WARNING" "Invalid option provided" + show_usage + ((warnings_issued++)) + exit 1 + ;; + esac +} + +# Set TESTDIR if not already set +TESTDIR=${TESTDIR:-$(pwd)} + +# Set up trap for exit +trap on_exit EXIT + +# Call the main function with all script arguments +main "$@" diff --git a/csit/start-s3p-tests.sh b/csit/start-s3p-tests.sh deleted file mode 100755 index 41974601..00000000 --- a/csit/start-s3p-tests.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. 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. -# -# SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END========================================================= - -# This script will be used to automatically trigger the S3P -# tests for policy components. - -# Start Kubernetes -function start_kubernetes() { - bash run-k8s-csit.sh install - bash resources/scripts/get-cluster-info.sh -} - -function install_jmeter() { - - #NOTE: $TESTDIR is set by the component triggering this script - cd ${TESTDIR}/automate-s3p-test - - sudo apt-get update - - # Install curl - sudo apt install curl -y - - # Install JDK - sudo apt install -y default-jdk - - # Install JMeter - curl -O https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.6.2.tgz - tar -xvf apache-jmeter-5.6.2.tgz - mv apache-jmeter-5.6.2 apache-jmeter - - # Define your desired heap size values - echo 'export JVM_ARGS="-Xms2g -Xmx4g"' > apache-jmeter/bin/setenv.sh - echo 'export HEAP="-Xms1G -Xmx2G -XX:MaxMetaspaceSize=512m"' >> apache-jmeter/bin/setenv.sh - - - # Remove unnecessary files - rm -rf apache-jmeter/docs apache-jmeter/printable_docs - - # Install CMD Runner - cd apache-jmeter/lib - curl -O https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2.1/cmdrunner-2.2.1.jar - - # Move JMeter to /opt - sudo cp -r ../../apache-jmeter /opt/ - - # Add JMeter Path Variable - export JMETER_HOME="/opt/apache-jmeter" - export PATH="$JMETER_HOME/bin:$PATH" -} - -function on_exit() { - # TODO: Generate report - echo "Generating report..." -} - -function teardown() { - echo "Removing temp directories.." - - rm -r ${TESTDIR}/automate-s3p-test - - echo "Removed directories" - - echo "Tearing down kubernetes cluster..." - bash run-k8s-csit.sh uninstall - - # DELETE created services - microk8s kubectl get svc | awk '/svc/{system("microk8s kubectl delete svc " $1)}' -} - -#===MAIN===# - -if [ $1 == "run" ] -then - - echo "===========================" - echo "Starting K8s Environment" - echo "===========================" - start_kubernetes - - echo "===========================" - echo "Installing JMeter" - echo "===========================" - install_jmeter - - # Run the JMX test plan - echo "===========================" - echo "Executing tests" - echo "===========================" - cd ${TESTDIR}/automate-s3p-test || exit - nohup jmeter -n -t $2 -l s3pTestResults.jtl - - # TODO: Generate report on on_exit() - -elif [ $1 == "uninstall" ] -then - echo "Uninstalling environment and removing temp folders..." - teardown -else - echo "Invalid arguments provided. Usage: $0 [option..] {run | uninstall}" -fi diff --git a/helm/policy/Chart.yaml b/helm/policy/Chart.yaml index 8caccf55..d3d268ac 100755..100644 --- a/helm/policy/Chart.yaml +++ b/helm/policy/Chart.yaml @@ -1,4 +1,4 @@ -# Copyright © 2022-2024 Nordix Foundation +# Copyright © 2022-2025 Nordix Foundation # # Modifications Copyright © 2024 Deutsche Telekom # @@ -8,6 +8,7 @@ # # http://www.apache.org/licenses/LICENSE-2.0 # +# SPDX-License-Identifier: Apache-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. @@ -20,10 +21,10 @@ name: policy version: 11.0.1 dependencies: - - name: mariadb-galera + - name: postgres version: ~11.x-0 - repository: 'file://components/mariadb-galera' - condition: mariadb-galera.enabled + repository: 'file://components/postgres' + condition: postgres.enabled - name: policy-clamp-ac-k8s-ppnt version: ~11.x-0 repository: 'file://components/policy-clamp-ac-k8s-ppnt' diff --git a/helm/policy/components/mariadb-galera/.helmignore b/helm/policy/components/mariadb-galera/.helmignore deleted file mode 100644 index f0c13194..00000000 --- a/helm/policy/components/mariadb-galera/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/helm/policy/components/mariadb-galera/templates/configmap.yaml b/helm/policy/components/mariadb-galera/templates/configmap.yaml deleted file mode 100644 index e0b33086..00000000 --- a/helm/policy/components/mariadb-galera/templates/configmap.yaml +++ /dev/null @@ -1,30 +0,0 @@ -{{/* -# Copyright © 2022 Nordix Foundation -# -# 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. -*/}} - -{{ if .Values.mariadbConfiguration }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Chart.Name }}-configuration - namespace: default - labels: - app.kubernetes.io/name: {{ .Chart.Name }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: Helm -data: - my.cnf: | -{{ .Values.mariadbConfiguration | indent 4 }} -{{- end }} diff --git a/helm/policy/components/mariadb-galera/templates/pdb.yaml b/helm/policy/components/mariadb-galera/templates/pdb.yaml deleted file mode 100644 index e4f7e5c3..00000000 --- a/helm/policy/components/mariadb-galera/templates/pdb.yaml +++ /dev/null @@ -1,37 +0,0 @@ -{{/* -# Copyright © 2022 Nordix Foundation -# -# 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. -*/}} - -{{- if .Values.podDisruptionBudget.create }} -apiVersion: policy/v1 -kind: PodDisruptionBudget -metadata: - name: {{ .Chart.Name }} - namespace: default - labels: - app.kubernetes.io/name: {{ .Chart.Name }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: Helm -spec: -{{- if .Values.podDisruptionBudget.minAvailable }} - minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} -{{- end }} -{{- if .Values.podDisruptionBudget.maxUnavailable }} - maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} -{{- end }} - selector: - matchLabels: - app.kubernetes.io/name: {{ .Chart.Name }} -{{- end }} diff --git a/helm/policy/components/mariadb-galera/templates/pv.yaml b/helm/policy/components/mariadb-galera/templates/pv.yaml deleted file mode 100644 index 3790c78a..00000000 --- a/helm/policy/components/mariadb-galera/templates/pv.yaml +++ /dev/null @@ -1,81 +0,0 @@ -{{/* -# Copyright © 2022 Nordix Foundation -# -# 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. -*/}} - -kind: PersistentVolume -apiVersion: v1 -metadata: - name: {{ .Chart.Name }}--0 - namespace: default - labels: - app.kubernetes.io/name: {{ .Chart.Name }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: Helm - -spec: - capacity: - storage: {{ .Values.persistence.size }} - accessModes: - - {{ .Values.persistence.accessMode }} - persistentVolumeReclaimPolicy: - storageClassName: "mariadb-galera-data" - hostPath: - path: /dockerdata-nfs/mariadb-galera/data-0 - ---- - -kind: PersistentVolume -apiVersion: v1 -metadata: - name: {{ .Chart.Name }}--1 - namespace: default - labels: - app.kubernetes.io/name: {{ .Chart.Name }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: Helm - -spec: - capacity: - storage: {{ .Values.persistence.size }} - accessModes: - - {{ .Values.persistence.accessMode }} - persistentVolumeReclaimPolicy: - storageClassName: "mariadb-galera-data" - hostPath: - path: /dockerdata-nfs/mariadb-galera/data-1 - ---- - -kind: PersistentVolume -apiVersion: v1 -metadata: - name: {{ .Chart.Name }}--2 - namespace: default - labels: - app.kubernetes.io/name: {{ .Chart.Name }} - - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: Helm - -spec: - capacity: - storage: {{ .Values.persistence.size }} - accessModes: - - {{ .Values.persistence.accessMode }} - persistentVolumeReclaimPolicy: - storageClassName: "mariadb-galera-data" - hostPath: - path: /dockerdata-nfs/mariadb-galera/data-2 - diff --git a/helm/policy/components/mariadb-galera/templates/role-binding.yaml b/helm/policy/components/mariadb-galera/templates/role-binding.yaml deleted file mode 100644 index c06b1950..00000000 --- a/helm/policy/components/mariadb-galera/templates/role-binding.yaml +++ /dev/null @@ -1,29 +0,0 @@ -{{/* -# Copyright © 2022 Nordix Foundation -# -# 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. -*/}} - -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ .Chart.Name }}-read - namespace: default -subjects: -- kind: ServiceAccount - name: {{ .Chart.Name }}-read -roleRef: - kind: Role - name: read - apiGroup: rbac.authorization.k8s.io - diff --git a/helm/policy/components/mariadb-galera/templates/secrets.yaml b/helm/policy/components/mariadb-galera/templates/secrets.yaml deleted file mode 100644 index 7a134928..00000000 --- a/helm/policy/components/mariadb-galera/templates/secrets.yaml +++ /dev/null @@ -1,59 +0,0 @@ -{{/* -# Copyright © 2022 Nordix Foundation -# -# 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. -*/}} - -apiVersion: v1 -kind: Secret -metadata: - name: mariadb-galera-db-backup-credentials - namespace: default - labels: - app: {{ .Chart.Name }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - heritage: Helm -type: Opaque -stringData: - login: {{ .Values.galera.mariabackup.user }} - password: {{ .Values.galera.mariabackup.password }} - ---- -apiVersion: v1 -kind: Secret -metadata: - name: mariadb-galera-db-root-password - namespace: default - labels: - app: {{ .Chart.Name }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - heritage: Helm -type: Opaque -stringData: - password: {{ .Values.rootUser.password }} - ---- -apiVersion: v1 -kind: Secret -metadata: - name: mariadb-galera-db-user-credentials - namespace: default - labels: - app: {{ .Chart.Name }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - heritage: Helm -type: Opaque -stringData: - login: {{ .Values.db.user }} - password: {{ .Values.db.password }} - diff --git a/helm/policy/components/mariadb-galera/templates/service-account.yaml b/helm/policy/components/mariadb-galera/templates/service-account.yaml deleted file mode 100644 index 417938a6..00000000 --- a/helm/policy/components/mariadb-galera/templates/service-account.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{{/* -# Copyright © 2022 Nordix Foundation -# -# 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. -*/}} - -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ .Chart.Name }}-read diff --git a/helm/policy/components/mariadb-galera/templates/service.yaml b/helm/policy/components/mariadb-galera/templates/service.yaml deleted file mode 100644 index 0494f7d8..00000000 --- a/helm/policy/components/mariadb-galera/templates/service.yaml +++ /dev/null @@ -1,68 +0,0 @@ -{{/* -# Copyright © 2022 Nordix Foundation -# -# 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. -*/}} - -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - namespace: default - labels: - app.kubernetes.io/name: {{ .Chart.Name }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: Helm -spec: - ports: - - port: 3306 - targetPort: tcp-mysql - protocol: TCP - name: tcp-mysql - ipFamilyPolicy: PreferDualStack - type: ClusterIP - selector: - app.kubernetes.io/name: {{ .Chart.Name }} - sessionAffinity: None - ---- - -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }}-headless - namespace: default - labels: - app.kubernetes.io/name: {{ .Chart.Name }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: Helm -spec: - clusterIP: None - ports: - - port: 4567 - targetPort: tcp-galera - protocol: TCP - name: tcp-galera - - port: 4568 - targetPort: tcp-ist - protocol: TCP - name: tcp-ist - - port: 4444 - targetPort: tcp-sst - protocol: TCP - name: tcp-sst - ipFamilyPolicy: PreferDualStack - type: ClusterIP - selector: - app.kubernetes.io/name: {{ .Chart.Name }} - sessionAffinity: None diff --git a/helm/policy/components/mariadb-galera/templates/statefulset.yaml b/helm/policy/components/mariadb-galera/templates/statefulset.yaml deleted file mode 100644 index a606088e..00000000 --- a/helm/policy/components/mariadb-galera/templates/statefulset.yaml +++ /dev/null @@ -1,292 +0,0 @@ -{{/* -# Copyright © 2022 Nordix Foundation -# -# 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. -*/}} - -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ .Chart.Name }} - namespace: default - labels: - app.kubernetes.io/name: {{ .Chart.Name }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: Helm - -spec: - podManagementPolicy: {{ .Values.podManagementPolicy }} - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app.kubernetes.io/name: {{ .Chart.Name }} - - serviceName: {{ .Chart.Name }}-headless - updateStrategy: - type: {{ .Values.updateStrategy.type }} - {{- if (eq "Recreate" .Values.updateStrategy.type) }} - rollingUpdate: null - {{- end }} - template: - metadata: - annotations: - traffic.sidecar.istio.io/excludeInboundPorts: 4444,4567,4568 - traffic.sidecar.istio.io/excludeOutboundPorts: 4444,4567,4568 - traffic.sidecar.istio.io/includeInboundPorts: '*' - labels: - app.kubernetes.io/name: {{ .Chart.Name }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: Helm - name: {{ .Chart.Name }} - - spec: - securityContext: - runAsUser: 10001 - runAsGroup: 10001 - fsGroup: 10001 - initContainers: - # we shouldn't need this but for unknown reason, it's fsGroup is not - # applied - - name: fix-permission - command: - - /bin/sh - args: - - -c - - | - chown -R {{ .Values.securityContext.user_id }}:{{ .Values.securityContext.group_id }} /data - chown -R {{ .Values.securityContext.user_id }}:{{ .Values.securityContext.group_id }} /bootstrap/ - chown -R {{ .Values.securityContext.user_id }}:{{ .Values.securityContext.group_id }} /tmp/ - {{- if .Values.mariadbConfiguration }} - cp /config/my.cnf /actual/my.cnf - chown -R {{ .Values.securityContext.user_id }}:{{ .Values.securityContext.group_id }} /actual - {{- end }} - image: docker.io/library/busybox:1.34.1 - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - securityContext: - runAsUser: 0 - volumeMounts: - - name: previous-boot - mountPath: /bootstrap - - name: mariadb-tmp-folder - mountPath: /tmp - - name: {{ .Chart.Name }} - mountPath: /data - {{- if .Values.mariadbConfiguration }} - - name: mariadb-galera-starting-config - mountPath: /config/my.cnf - subPath: my.cnf - - name: mariadb-galera-actual-config - mountPath: /actual - {{- end }} - containers: - - name: {{ .Chart.Name }} - image: {{ .Values.global.dockerRepository }}/{{ .Values.global.image.mariadb }} - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}} - command: - - bash - - -ec - - | - {{- if (not (empty (.Values.galera.bootstrap.bootstrapFromNode | quote)))}} - {{- $fullname := "mariadb-galera" }} - {{- $bootstrapFromNode := int .Values.galera.bootstrap.bootstrapFromNode }} - # Bootstrap from the indicated node - NODE_ID="${MY_POD_NAME#"{{ $fullname }}-"}" - if [[ "$NODE_ID" -eq "{{ $bootstrapFromNode }}" ]]; then - export MARIADB_GALERA_CLUSTER_BOOTSTRAP=yes - export MARIADB_GALERA_FORCE_SAFETOBOOTSTRAP={{ ternary "yes" "no" .Values.galera.bootstrap.forceSafeToBootstrap }} - fi - {{- end }} - exec /opt/bitnami/scripts/mariadb-galera/entrypoint.sh /opt/bitnami/scripts/mariadb-galera/run.sh - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: BITNAMI_DEBUG - value: {{ ternary "true" "false" .Values.debug | quote }} - - name: MARIADB_INIT_SLEEP_TIME - value: {{ .Values.init_sleep_time | quote }} - - name: MARIADB_GALERA_CLUSTER_NAME - value: {{ .Values.galera.name | quote }} - - name: MARIADB_GALERA_CLUSTER_ADDRESS - value: "gcomm://{{ .Chart.Name }}-headless.default.svc.{{ .Values.global.clusterDomain }}" - # Bitnami init script don't behave well in dual stack env. - # set it here as long as https://github.com/bitnami/charts/issues/4077 is not solved. - - name: MARIADB_GALERA_NODE_ADDRESS - valueFrom: - fieldRef: - fieldPath: status.podIP - - name: MARIADB_ROOT_USER - value: {{ .Values.rootUser.user | quote }} - - name: MARIADB_ROOT_PASSWORD - valueFrom: - secretKeyRef: - name: mariadb-galera-db-root-password - key: password - - name: MARIADB_USER - valueFrom: - secretKeyRef: - name: mariadb-galera-db-user-credentials - key: login - - name: MARIADB_PASSWORD - valueFrom: - secretKeyRef: - name: mariadb-galera-db-user-credentials - key: password - - name: MARIADB_DATABASE - value: {{ .Values.db.name | quote }} - - name: MARIADB_GALERA_MARIABACKUP_USER - valueFrom: - secretKeyRef: - name: mariadb-galera-db-backup-credentials - key: login - - name: MARIADB_GALERA_MARIABACKUP_PASSWORD - valueFrom: - secretKeyRef: - name: mariadb-galera-db-backup-credentials - key: password - {{- if .Values.extraFlags }} - - name: MARIADB_EXTRA_FLAGS - value: {{ .Values.extraFlags | quote }} - {{- end }} - ports: - - containerPort: 3306 - name: tcp-mysql - - containerPort: 4567 - name: tcp-galera - - containerPort: 4568 - name: tcp-ist - - containerPort: 4444 - name: tcp-sst - {{- if .Values.livenessProbe.enabled }} - livenessProbe: - exec: - command: - - sh - - -ec - - | - exec mysqladmin status -u$MARIADB_ROOT_USER -p$MARIADB_ROOT_PASSWORD - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - failureThreshold: {{ .Values.livenessProbe.failureThreshold }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: - exec: - command: - - sh - - -ec - - | - exec mysqladmin status -u$MARIADB_ROOT_USER -p$MARIADB_ROOT_PASSWORD - initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.readinessProbe.successThreshold }} - failureThreshold: {{ .Values.readinessProbe.failureThreshold }} - {{- end }} - {{- if .Values.startupProbe.enabled }} - startupProbe: - exec: - command: - - sh - - -ec - - | - exec mysqladmin status -u$MARIADB_ROOT_USER -p$MARIADB_ROOT_PASSWORD - initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.startupProbe.periodSeconds }} - timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }} - successThreshold: {{ .Values.startupProbe.successThreshold }} - failureThreshold: {{ .Values.startupProbe.failureThreshold }} - {{- end }} - resources: -{{ toYaml .Values.resources.small | indent 12 }} - volumeMounts: - - name: previous-boot - mountPath: /opt/bitnami/mariadb/.bootstrap - - name: {{ .Chart.Name }} - mountPath: /bitnami/mariadb - - name: mariadb-tmp-folder - mountPath: /opt/bitnami/mariadb/tmp - {{- if .Values.mariadbConfiguration }} - - name: mariadb-galera-actual-config - mountPath: /opt/bitnami/mariadb/conf - {{- end }} - imagePullSecrets: - - name: default-docker-registry-key - {{- if .Values.schedulerName }} - schedulerName: {{ .Values.schedulerName | quote }} - {{- end }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName }} - {{- end }} - serviceAccountName: mariadb-galera-read - affinity: - podAffinity: {} - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/name: {{ .Chart.Name }} - namespaces: - - default - topologyKey: kubernetes.io/hostname - weight: 1 - nodeAffinity: {} - {{- if .Values.nodeSelector }} - nodeSelector: -{{ toYaml .Values.nodeSelector | indent 10 }} - {{- end }} - {{- if .Values.tolerations }} - tolerations: -{{ toYaml .Values.tolerations | indent 10 }} - {{- end }} - volumes: - - name: previous-boot - emptyDir: {} - - name: mariadb-tmp-folder - emptyDir: {} - {{- if .Values.mariadbConfiguration }} - - name: mariadb-galera-actual-config - emptyDir: {} - - name: mariadb-galera-starting-config - configMap: - name: {{ .Chart.Name }}-configuration - {{- end }} -{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }} - - name: {{ .Chart.Name }} - persistentVolumeClaim: - claimName: {{ .Values.persistence.existingClaim }} -{{- else if not .Values.persistence.enabled }} - - name: {{ .Chart.Name }} - emptyDir: {} -{{- else if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - volumeClaimTemplates: - - metadata: - name: {{ .Chart.Name }} - namespace: default - labels: - app.kubernetes.io/name: {{ .Chart.Name }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: Helm - - spec: - accessModes: - - {{ .Values.persistence.accessMode }} - storageClassName: mariadb-galera-data - resources: - requests: - storage: {{ .Values.persistence.size }} -{{- end }} diff --git a/helm/policy/components/mariadb-galera/values.yaml b/helm/policy/components/mariadb-galera/values.yaml deleted file mode 100644 index f0a21386..00000000 --- a/helm/policy/components/mariadb-galera/values.yaml +++ /dev/null @@ -1,606 +0,0 @@ -# Copyright © 2022 Nordix Foundation -# -# 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. - -################################################################# -# Global configuration defaults. -################################################################# -global: - nodePortPrefix: 302 - persistence: - mountPath: /dockerdata-nfs - backup: - mountPath: /dockerdata-nfs/backup - clusterDomain: cluster.local - metrics: {} - dockerHubRepository: &dockerHubRepository docker.io - -passwordStrengthOverride: basic - -## Specify a imagePullPolicy -## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' -## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images -## -pullPolicy: Always - -## Set to true if you would like to see extra information on logs -## It turns BASH debugging in minideb-extras-base -## -debug: true - -## Sometimes, especially when a lot of pods are created at the same time, -## actions performed on the databases are tried to be done before actual start. -init_sleep_time: 5 - -## String to partially override common.names.fullname template (will maintain the release name) -## -nameOverride: mariadb-galera - -## Use an alternate scheduler, e.g. "stork". -## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ -## -# schedulerName: - -## StatefulSet controller supports relax its ordering guarantees while preserving its uniqueness and identity guarantees. There are two valid pod management policies: OrderedReady and Parallel -## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy -## -podManagementPolicy: OrderedReady - - -## Pods Service Account -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ -## -serviceAccount: - nameOverride: mariadb-galera - roles: - - read - -## Pod Security Context -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ -## -securityContext: - enabled: true - user_id: 10001 - group_id: 10001 - -## Database credentials for root (admin) user -## -rootUser: - ## MariaDB admin user - user: root - ## MariaDB admin password - ## Password is ignored if externalSecret is specified. - ## If not set, password will be "randomly" generated - ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#setting-the-root-password-on-first-run - ## - password: dOM39tQX - # externalSecret: - -## Custom db configuration -## -db: - ## MariaDB username and password - ## Password is ignored if externalSecret is specified. - ## If not set, password will be "randomly" generated - ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-user-on-first-run - ## - user: policy-user - password: policy-user - # externalSecret: - ## Database to create - ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-on-first-run - ## - # name: my_database - -## Galera configuration -## -galera: - ## Galera cluster name - ## - name: galera - - ## Bootstraping options - ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#bootstraping - bootstrap: - ## Node to bootstrap from, you will need to change this parameter incase you want to bootstrap from other node - ## - bootstrapFromNode: 0 - ## Force safe_to_bootstrap in grastate.date file. - ## This will set safe_to_bootstrap=1 in the node indicated by bootstrapFromNode. - forceSafeToBootstrap: true - - ## Credentials to perform backups - ## - mariabackup: - ## MariaBackup username and password - ## Password is ignored if externalSecret is specified. - ## If not set, password will be "randomly" generated - ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#setting-up-a-multi-master-cluster - ## - user: mariabackup - password: pt49gEq7 - # externalSecret: - -## The backup job will mount the mariadb data pvc in order to run mariabackup. -## For this reason the db data pvc needs to have accessMode: ReadWriteMany. -backup: - enabled: false - cron: "00 00 * * *" - retentionPeriod: 3 - persistence: - ## If true, use a Persistent Volume Claim, If false, use emptyDir - ## - enabled: true - # Enable persistence using an existing PVC - # existingClaim: - ## selector can be used to match an existing PersistentVolume - ## selector: - ## matchLabels: - ## app: my-app - selector: {} - ## Persistent Volume Storage Class - ## If defined, storageClassName: <storageClass> - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - ## Persistent Volume Claim annotations - ## - annotations: - ## Persistent Volume Access Mode - ## - accessMode: ReadWriteOnce - ## Persistent Volume size - ## - size: 2Gi - -## TLS configuration -## -tls: - ## Enable TLS - ## - enabled: false - ## Name of the secret that contains the certificates - ## - # certificatesSecret: - ## Certificate filename - ## - # certFilename: - ## Certificate Key filename - ## - # certKeyFilename: - ## CA Certificate filename - ## - # certCAFilename: - -## Configure MariaDB with a custom my.cnf file -## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file -## Alternatively, you can put your my.cnf under the files/ directory -## -mariadbConfiguration: |- - [client] - port=3306 - socket=/opt/bitnami/mariadb/tmp/mysql.sock - plugin_dir=/opt/bitnami/mariadb/plugin - - [mysqld] - lower_case_table_names = 1 - default_storage_engine=InnoDB - basedir=/opt/bitnami/mariadb - datadir=/bitnami/mariadb/data - plugin_dir=/opt/bitnami/mariadb/plugin - tmpdir=/opt/bitnami/mariadb/tmp - socket=/opt/bitnami/mariadb/tmp/mysql.sock - pid_file=/opt/bitnami/mariadb/tmp/mysqld.pid - bind_address=0.0.0.0 - - ## Character set - collation_server=utf8_unicode_ci - init_connect='SET NAMES utf8' - character_set_server=utf8 - - ## MyISAM - key_buffer_size=32M - myisam_recover_options=FORCE,BACKUP - - ## Safety - skip_host_cache - skip_name_resolve - max_allowed_packet=16M - max_connect_errors=1000000 - sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY - sysdate_is_now=1 - - ## Binary Logging - log_bin=mysql-bin - expire_logs_days=14 - # Disabling for performance per http://severalnines.com/blog/9-tips-going-production-galera-cluster-mysql - sync_binlog=0 - # Required for Galera - binlog_format=row - - ## Caches and Limits - tmp_table_size=32M - max_heap_table_size=32M - # Re-enabling as now works with Maria 10.1.2 - query_cache_type=1 - query_cache_limit=4M - query_cache_size=256M - max_connections=500 - thread_cache_size=50 - open_files_limit=65535 - table_definition_cache=4096 - table_open_cache=4096 - - ## InnoDB - innodb=FORCE - innodb_strict_mode=1 - # Mandatory per https://github.com/codership/documentation/issues/25 - innodb_autoinc_lock_mode=2 - # Per https://www.percona.com/blog/2006/08/04/innodb-double-write/ - innodb_doublewrite=1 - innodb_flush_method=O_DIRECT - innodb_log_files_in_group=2 - innodb_log_file_size=128M - innodb_flush_log_at_trx_commit=1 - innodb_file_per_table=1 - # 80% Memory is default reco. - # Need to re-evaluate when DB size grows - innodb_buffer_pool_size=2G - innodb_file_format=Barracuda - - ## Logging - log_error=/opt/bitnami/mariadb/logs/mysqld.log - slow_query_log_file=/opt/bitnami/mariadb/logs/mysqld.log - log_queries_not_using_indexes=1 - slow_query_log=1 - - ## SSL - ## Use extraVolumes and extraVolumeMounts to mount /certs filesystem - # ssl_ca=/certs/ca.pem - # ssl_cert=/certs/server-cert.pem - # ssl_key=/certs/server-key.pem - - [galera] - wsrep_on=ON - wsrep_provider=/opt/bitnami/mariadb/lib/libgalera_smm.so - wsrep_sst_method=mariabackup - wsrep_slave_threads=4 - wsrep_cluster_address=gcomm:// - wsrep_cluster_name=galera - wsrep_sst_auth="root:" - # Enabled for performance per https://mariadb.com/kb/en/innodb-system-variables/#innodb_flush_log_at_trx_commit - innodb_flush_log_at_trx_commit=2 - # MYISAM REPLICATION SUPPORT # - wsrep_replicate_myisam=ON - binlog_format=row - default_storage_engine=InnoDB - innodb_autoinc_lock_mode=2 - transaction-isolation=READ-COMMITTED - wsrep_causal_reads=1 - wsrep_sync_wait=7 - - [mariadb] - plugin_load_add=auth_pam - - ## Data-at-Rest Encryption - ## Use extraVolumes and extraVolumeMounts to mount /encryption filesystem - # plugin_load_add=file_key_management - # file_key_management_filename=/encryption/keyfile.enc - # file_key_management_filekey=FILE:/encryption/keyfile.key - # file_key_management_encryption_algorithm=AES_CTR - # encrypt_binlog=ON - # encrypt_tmp_files=ON - - ## InnoDB/XtraDB Encryption - # innodb_encrypt_tables=ON - # innodb_encrypt_temporary_tables=ON - # innodb_encrypt_log=ON - # innodb_encryption_threads=4 - # innodb_encryption_rotate_key_age=1 - - ## Aria Encryption - # aria_encrypt_tables=ON - # encrypt_tmp_disk_tables=ON - -## MariaDB additional command line flags -## Can be used to specify command line flags, for example: -## -## extraFlags: "--max-connect-errors=1000 --max_connections=155" - -## Desired number of cluster nodes -## -replicaCount: 1 - -## updateStrategy for MariaDB Master StatefulSet -## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies -## -updateStrategy: - type: RollingUpdate - -## Additional pod annotations for MariaDB Galera pods -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -## -> here required to enable mariadb-galera in istio -## -podAnnotations: - # sidecar.istio.io/inject: "false" - traffic.sidecar.istio.io/excludeInboundPorts: "4444,4567,4568" - traffic.sidecar.istio.io/includeInboundPorts: '*' - traffic.sidecar.istio.io/excludeOutboundPorts: "4444,4567,4568" - -## Pod affinity preset -## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAffinityPreset: "" - -## Pod anti-affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAntiAffinityPreset: soft - -## Node affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity -## Allowed values: soft, hard -## -nodeAffinityPreset: - ## Node affinity type - ## Allowed values: soft, hard - type: "" - ## Node label key to match - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## Node label values to match - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] - -## Affinity for pod assignment. Evaluated as a template. -## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set -## -affinity: {} - -## Node labels for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/user-guide/node-selection/ -## -nodeSelector: {} - -## Tolerations for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -## -tolerations: [] - -## Enable persistence using Persistent Volume Claims -## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ -## -persistence: - ## If true, use a Persistent Volume Claim, If false, use emptyDir - ## - enabled: true - # Enable persistence using an existing PVC - # existingClaim: - mountPath: /dockerdata-nfs - mountSubPath: "mariadb-galera/data" - ## selector can be used to match an existing PersistentVolume - ## selector: - ## matchLabels: - ## app: my-app - selector: {} - ## Persistent Volume Storage Class - ## If defined, storageClassName: <storageClass> - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - ## Persistent Volume Claim annotations - ## - annotations: - ## Persistent Volume Access Mode - ## Use ReadWriteMany if backup is enabled, see backup section. - ## - accessMode: ReadWriteOnce - ## Persistent Volume size - ## - size: 3Gi - -## Additional pod labels -## -# podLabels: -# extraLabel: extraValue - -## Priority Class Name -# -# priorityClassName: 'priorityClass' - -## MariaDB Galera containers' resource requests and limits -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## -flavor: small -resources: - small: - limits: - cpu: 1 - memory: 4Gi - requests: - cpu: 500m - memory: 2Gi - unlimited: {} - -## MariaDB Galera containers' liveness and readiness probes -## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes -## -livenessProbe: - enabled: true - initialDelaySeconds: 1 - periodSeconds: 10 - timeoutSeconds: 180 - successThreshold: 1 - failureThreshold: 3 -readinessProbe: - enabled: true - initialDelaySeconds: 1 - periodSeconds: 10 - timeoutSeconds: 180 - successThreshold: 1 - failureThreshold: 3 -startupProbe: - ## Initializing the database could take some time - ## - enabled: true - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 180 - successThreshold: 1 - # will wait up for initialDelaySeconds + failureThreshold*periodSeconds before - # stating startup wasn't good (910s per default) - failureThreshold: 90 - -## Pod disruption budget configuration -## -podDisruptionBudget: - ## Specifies whether a Pod disruption budget should be created - ## - create: true - minAvailable: 1 - # maxUnavailable: 1 - -## Prometheus exporter configuration -## -metrics: - ## Bitnami MySQL Prometheus exporter image - ## ref: https://hub.docker.com/r/bitnami/mysqld-exporter/tags/ - ## - image: docker.io/bitnami/mysqld-exporter:0.12.1-debian-10-r264 - pullPolicy: Always - ## MySQL exporter additional command line flags - ## Can be used to specify command line flags - ## E.g.: - ## extraFlags: - ## - --collect.binlog_size - ## - extraFlags: [] - ## MySQL Prometheus exporter containers' resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - limits: - cpu: 0.5 - memory: 256Mi - requests: - cpu: 0.5 - memory: 256Mi - ## MariaDB Galera metrics container's liveness and readiness probes - ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes - ## - livenessProbe: - enabled: true - initialDelaySeconds: 30 - periodSeconds: 10 - timeoutSeconds: 5 - successThreshold: 1 - failureThreshold: 3 - readinessProbe: - enabled: true - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 5 - successThreshold: 1 - failureThreshold: 3 - ## MySQL Prometheus exporter service parameters - ## - service: - type: ClusterIP - port: 9104 - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "9104" - - ## Prometheus Operator ServiceMonitor configuration - ## - serviceMonitor: - enabled: false - ## Namespace in which Prometheus is running - ## - # namespace: monitoring - - ## Interval at which metrics should be scraped. - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint - ## - # interval: 10s - - ## Timeout after which the scrape is ended - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint - ## - # scrapeTimeout: 10s - - ## ServiceMonitor selector labels - ## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration - ## - # selector: - # prometheus: kube-prometheus - - ## RelabelConfigs to apply to samples before scraping - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig - ## Value is evalued as a template - ## - relabelings: [] - - ## MetricRelabelConfigs to apply to samples before ingestion - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig - ## Value is evalued as a template - ## - metricRelabelings: [] - # - sourceLabels: - # - "__name__" - # targetLabel: "__name__" - # action: replace - # regex: '(.*)' - # replacement: 'example_prefix_$1' - - ## Prometheus Operator PrometheusRule configuration - ## - prometheusRules: - enabled: false - - ## Additional labels to add to the PrometheusRule so it is picked up by the operator. - ## If using the [Helm Chart](https://github.com/helm/charts/tree/master/stable/prometheus-operator) this is the name of the Helm release and 'app: prometheus-operator' - selector: - app: prometheus-operator - release: prometheus - - ## Rules as a map. - rules: [] - # - alert: MariaDB-Down - # annotations: - # message: 'MariaDB instance {{ $labels.instance }} is down' - # summary: MariaDB instance is down - # expr: absent(up{job="mariadb-galera"} == 1) - # labels: - # severity: warning - # service: mariadb-galera - # for: 5m diff --git a/helm/policy/components/policy-apex-pdp/resources/config/OnapPfConfigSampleGroup.json b/helm/policy/components/policy-apex-pdp/resources/config/OnapPfConfigSampleGroup.json index 70943d68..c151852c 100644 --- a/helm/policy/components/policy-apex-pdp/resources/config/OnapPfConfigSampleGroup.json +++ b/helm/policy/components/policy-apex-pdp/resources/config/OnapPfConfigSampleGroup.json @@ -9,7 +9,7 @@ "prometheus": true }, "pdpStatusParameters": { - "pdpGroup": "defaultGroup", + "pdpGroup": "sampleGroup", "timeIntervalMs": 20000, "pdpType": "apex", "description": "Pdp Heartbeat", diff --git a/helm/policy/components/policy-api/resources/config/apiParameters.yaml b/helm/policy/components/policy-api/resources/config/apiParameters.yaml index 3d593260..ef3369f1 100644 --- a/helm/policy/components/policy-api/resources/config/apiParameters.yaml +++ b/helm/policy/components/policy-api/resources/config/apiParameters.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. All rights reserved. +# Copyright (C) 2023,2025 Nordix Foundation. 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. @@ -29,8 +29,8 @@ spring: password: "${RESTSERVER_PASSWORD}" mvc.converters.preferred-json-mapper: gson datasource: - url: jdbc:mariadb://{{ .Values.db.service.name }}/policyadmin - driverClassName: org.mariadb.jdbc.Driver + url: jdbc:postgresql://{{ .Values.db.service.name }}/policyadmin + driverClassName: org.postgresql.Driver username: "${SQL_USER}" password: "${SQL_PASSWORD}" hikari: @@ -52,8 +52,8 @@ policy-api: database: name: PolicyProviderParameterGroup implementation: org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl - driver: org.mariadb.jdbc.Driver - url: jdbc:mariadb://{{ .Values.db.service.name }}/policyadmin + driver: org.postgresql.Driver + url: jdbc:postgresql://{{ .Values.db.service.name }}/policyadmin user: "${SQL_USER}" password: "${SQL_PASSWORD}" persistenceUnit: PolicyDb @@ -92,6 +92,7 @@ policy-preload: - policytypes/onap.policies.controlloop.operational.Common.yaml - policytypes/onap.policies.controlloop.operational.common.Apex.yaml - policytypes/onap.policies.controlloop.operational.common.Drools.yaml + - policytypes/onap.policies.native.opa.yaml policies: - policies/sdnc.policy.naming.input.tosca.yaml diff --git a/helm/policy/components/policy-api/templates/deployment.yaml b/helm/policy/components/policy-api/templates/deployment.yaml index e6c9223d..9b77ebf2 100755..100644 --- a/helm/policy/components/policy-api/templates/deployment.yaml +++ b/helm/policy/components/policy-api/templates/deployment.yaml @@ -1,6 +1,6 @@ {{/* # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. +# Copyright (C) 2023,2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ spec: - /app/ready.py args: - --job-name - - policy-galera-config + - policy-pg-config env: - name: NAMESPACE valueFrom: @@ -146,4 +146,4 @@ spec: emptyDir: medium: Memory imagePullSecrets: - - name: "default-docker-registry-key"
\ No newline at end of file + - name: "default-docker-registry-key" diff --git a/helm/policy/components/policy-api/values.yaml b/helm/policy/components/policy-api/values.yaml index b5ce0824..8ceb475a 100644 --- a/helm/policy/components/policy-api/values.yaml +++ b/helm/policy/components/policy-api/values.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. All rights reserved. +# Copyright (C) 2023,2025 Nordix Foundation. 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. @@ -38,8 +38,8 @@ db: user: policy-user password: policy-user service: - name: mariadb-galera - internalPort: 3306 + name: postgres-service + internalPort: 5432 restServer: user: policyadmin diff --git a/helm/policy/components/policy-clamp-ac-a1pms-ppnt/resources/config/A1pmsParticipantParameters.yaml b/helm/policy/components/policy-clamp-ac-a1pms-ppnt/resources/config/A1pmsParticipantParameters.yaml index 14de491c..bbceccf5 100755 --- a/helm/policy/components/policy-clamp-ac-a1pms-ppnt/resources/config/A1pmsParticipantParameters.yaml +++ b/helm/policy/components/policy-clamp-ac-a1pms-ppnt/resources/config/A1pmsParticipantParameters.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023-2024 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2025 Nordix Foundation. 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. @@ -96,10 +96,10 @@ server: tracing: enabled: {{ .Values.jaeger.enabled }} exporter: - endpoint: {{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-a1pms-ppnt.exporter-port" . }} + endpoint: "{{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-a1pms-ppnt.exporter-port" . }}" protocol: {{ .Values.jaeger.collector.protocol }} sampler: jaeger-remote: - endpoint: {{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }} + endpoint: "{{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}" diff --git a/helm/policy/components/policy-clamp-ac-http-ppnt/resources/config/HttpParticipantParameters.yaml b/helm/policy/components/policy-clamp-ac-http-ppnt/resources/config/HttpParticipantParameters.yaml index 160144a3..db10b4a4 100644 --- a/helm/policy/components/policy-clamp-ac-http-ppnt/resources/config/HttpParticipantParameters.yaml +++ b/helm/policy/components/policy-clamp-ac-http-ppnt/resources/config/HttpParticipantParameters.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023-2024 Nordix Foundation. +# Copyright (C) 2023-2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -92,8 +92,8 @@ server: tracing: enabled: {{ .Values.jaeger.enabled }} exporter: - endpoint: {{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-http-ppnt.exporter-port" . }} + endpoint: "{{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-http-ppnt.exporter-port" . }}" protocol: {{ .Values.jaeger.collector.protocol }} sampler: jaeger-remote: - endpoint: {{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}
\ No newline at end of file + endpoint: "{{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}"
\ No newline at end of file diff --git a/helm/policy/components/policy-clamp-ac-k8s-ppnt/resources/config/KubernetesParticipantParameters.yaml b/helm/policy/components/policy-clamp-ac-k8s-ppnt/resources/config/KubernetesParticipantParameters.yaml index 4eedc0da..d90333cb 100644 --- a/helm/policy/components/policy-clamp-ac-k8s-ppnt/resources/config/KubernetesParticipantParameters.yaml +++ b/helm/policy/components/policy-clamp-ac-k8s-ppnt/resources/config/KubernetesParticipantParameters.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2022,2024 Nordix Foundation. +# Copyright (C) 2022,2024-2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -119,8 +119,8 @@ chart: tracing: enabled: {{ .Values.jaeger.enabled }} exporter: - endpoint: {{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-k8s-ppnt.exporter-port" . }} + endpoint: "{{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-k8s-ppnt.exporter-port" . }}" protocol: {{ .Values.jaeger.collector.protocol }} sampler: jaeger-remote: - endpoint: {{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}
\ No newline at end of file + endpoint: "{{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}"
\ No newline at end of file diff --git a/helm/policy/components/policy-clamp-ac-kserve-ppnt/resources/config/KserveParticipantParameters.yaml b/helm/policy/components/policy-clamp-ac-kserve-ppnt/resources/config/KserveParticipantParameters.yaml index 3b71737f..60eb6296 100755 --- a/helm/policy/components/policy-clamp-ac-kserve-ppnt/resources/config/KserveParticipantParameters.yaml +++ b/helm/policy/components/policy-clamp-ac-kserve-ppnt/resources/config/KserveParticipantParameters.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023-2024 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2025 Nordix Foundation. 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. @@ -102,8 +102,8 @@ server: tracing: enabled: {{ .Values.jaeger.enabled }} exporter: - endpoint: {{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-kserve-ppnt.exporter-port" . }} + endpoint: "{{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-kserve-ppnt.exporter-port" . }}" protocol: {{ .Values.jaeger.collector.protocol }} sampler: jaeger-remote: - endpoint: {{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }} + endpoint: "{{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}" diff --git a/helm/policy/components/policy-clamp-ac-pf-ppnt/resources/config/PolicyParticipantParameters.yaml b/helm/policy/components/policy-clamp-ac-pf-ppnt/resources/config/PolicyParticipantParameters.yaml index 5753fe83..51b9a0d7 100644 --- a/helm/policy/components/policy-clamp-ac-pf-ppnt/resources/config/PolicyParticipantParameters.yaml +++ b/helm/policy/components/policy-clamp-ac-pf-ppnt/resources/config/PolicyParticipantParameters.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023-2024 Nordix Foundation. +# Copyright (C) 2023-2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -113,8 +113,8 @@ server: tracing: enabled: {{ .Values.jaeger.enabled }} exporter: - endpoint: {{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-pf-ppnt.exporter-port" . }} + endpoint: "{{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-pf-ppnt.exporter-port" . }}" protocol: {{ .Values.jaeger.collector.protocol }} sampler: jaeger-remote: - endpoint: {{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}
\ No newline at end of file + endpoint: "{{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}"
\ No newline at end of file diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/SimulatorParticipantParameters.yaml b/helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/SimulatorParticipantParameters.yaml index f8932ecb..43cd7672 100644 --- a/helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/SimulatorParticipantParameters.yaml +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/SimulatorParticipantParameters.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2024 Nordix Foundation. +# Copyright (C) 2024-2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -92,8 +92,8 @@ server: tracing: enabled: {{ .Values.jaeger.enabled }} exporter: - endpoint: {{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-sim-ppnt.exporter-port" . }} + endpoint: "{{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-ac-sim-ppnt.exporter-port" . }}" protocol: {{ .Values.jaeger.collector.protocol }} sampler: jaeger-remote: - endpoint: {{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}
\ No newline at end of file + endpoint: "{{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}"
\ No newline at end of file diff --git a/helm/policy/components/policy-clamp-runtime-acm/resources/config/acRuntimeParameters.yaml b/helm/policy/components/policy-clamp-runtime-acm/resources/config/acRuntimeParameters.yaml index 7b8ceea7..f29c27e8 100755..100644 --- a/helm/policy/components/policy-clamp-runtime-acm/resources/config/acRuntimeParameters.yaml +++ b/helm/policy/components/policy-clamp-runtime-acm/resources/config/acRuntimeParameters.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2022,2024 Nordix Foundation. +# Copyright (C) 2022,2024-2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,8 +27,8 @@ spring: converters: preferred-json-mapper: gson datasource: - url: jdbc:mariadb://{{ .Values.db.service.name }}:{{ .Values.db.service.internalPort }}/clampacm - driverClassName: org.mariadb.jdbc.Driver + url: jdbc:postgresql://{{ .Values.db.service.name }}:{{ .Values.db.service.internalPort }}/clampacm + driverClassName: org.postgresql.Driver username: ${SQL_USER} password: ${SQL_PASSWORD} hikari: @@ -99,6 +99,7 @@ runtime: acmParameters: toscaElementName: {{ .Values.customNaming.toscaElementName }} toscaCompositionName: {{ .Values.customNaming.toscaCompositionName }} + enableEncryption: true @@ -117,8 +118,8 @@ management: tracing: enabled: {{ .Values.jaeger.enabled }} exporter: - endpoint: {{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-runtime-acm.exporter-port" . }} + endpoint: "{{ .Values.jaeger.collector.host }}:{{ include "policy-clamp-runtime-acm.exporter-port" . }}" protocol: {{ .Values.jaeger.collector.protocol }} sampler: jaeger-remote: - endpoint: {{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}
\ No newline at end of file + endpoint: "{{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.portJaegerGrpc }}" diff --git a/helm/policy/components/policy-clamp-runtime-acm/templates/deployment.yaml b/helm/policy/components/policy-clamp-runtime-acm/templates/deployment.yaml index 9175c433..a67fdcde 100644 --- a/helm/policy/components/policy-clamp-runtime-acm/templates/deployment.yaml +++ b/helm/policy/components/policy-clamp-runtime-acm/templates/deployment.yaml @@ -1,6 +1,6 @@ {{/* # ============LICENSE_START======================================================= -# Copyright (C) 2022-2024 Nordix Foundation. +# Copyright (C) 2022-2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ spec: - /app/ready.py args: - --job-name - - policy-galera-init + - policy-pg-init env: - name: NAMESPACE valueFrom: diff --git a/helm/policy/components/policy-clamp-runtime-acm/values.yaml b/helm/policy/components/policy-clamp-runtime-acm/values.yaml index 82487e69..ceb369c4 100644 --- a/helm/policy/components/policy-clamp-runtime-acm/values.yaml +++ b/helm/policy/components/policy-clamp-runtime-acm/values.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2022,2024 Nordix Foundation. +# Copyright (C) 2022,2024-2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -35,8 +35,8 @@ db: user: policy-user password: policy-user service: - name: mariadb-galera - internalPort: 3306 + name: postgres-service + internalPort: 5432 # default number of instances replicaCount: 1 @@ -110,4 +110,4 @@ jaeger: portOtlpHttp: 4318 portJaegerGrpc: 14250 -applicationName: acm-r
\ No newline at end of file +applicationName: acm-r diff --git a/helm/policy/components/policy-drools-pdp/resources/configmaps/base.conf b/helm/policy/components/policy-drools-pdp/resources/configmaps/base.conf index 1b976c60..6b1164d7 100755..100644 --- a/helm/policy/components/policy-drools-pdp/resources/configmaps/base.conf +++ b/helm/policy/components/policy-drools-pdp/resources/configmaps/base.conf @@ -1,5 +1,5 @@ {{/* -# Copyright © 2023-2024 Nordix Foundation. +# Copyright © 2023-2025 Nordix Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -7,6 +7,7 @@ # # http://www.apache.org/licenses/LICENSE-2.0 # +# SPDX-License-Identifier: Apache-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. @@ -39,8 +40,8 @@ REPOSITORY_OFFLINE={{.Values.nexus.offline}} # Relational (SQL) DB access SQL_HOST={{ .Values.db.name }} -SQL_PORT=3306 -JDBC_URL=jdbc:mariadb://{{ .Values.db.name }}:3306/ +SQL_PORT=5432 +JDBC_URL=jdbc:postgresql://{{ .Values.db.name }}:5432/ JDBC_OPTS= MYSQL_CMD= diff --git a/helm/policy/components/policy-drools-pdp/templates/statefulset.yaml b/helm/policy/components/policy-drools-pdp/templates/statefulset.yaml index 7ada63ad..5877f2bd 100644 --- a/helm/policy/components/policy-drools-pdp/templates/statefulset.yaml +++ b/helm/policy/components/policy-drools-pdp/templates/statefulset.yaml @@ -1,6 +1,6 @@ {{/* # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. +# Copyright (C) 2023,2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ spec: - /app/ready.py args: - --job-name - - policy-galera-config + - policy-pg-config env: - name: NAMESPACE valueFrom: diff --git a/helm/policy/components/policy-drools-pdp/values.yaml b/helm/policy/components/policy-drools-pdp/values.yaml index db61a719..61b76871 100644 --- a/helm/policy/components/policy-drools-pdp/values.yaml +++ b/helm/policy/components/policy-drools-pdp/values.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. All rights reserved. +# Copyright (C) 2023,2025 Nordix Foundation. 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. @@ -102,7 +102,7 @@ nexus: offline: true db: - name: mariadb-galera + name: postgres-service user: policy-user password: policy-user diff --git a/helm/policy/components/policy-opa-pdp/Chart.yaml b/helm/policy/components/policy-opa-pdp/Chart.yaml index b3c34fc6..3235b018 100755 --- a/helm/policy/components/policy-opa-pdp/Chart.yaml +++ b/helm/policy/components/policy-opa-pdp/Chart.yaml @@ -1,23 +1,23 @@ -# ============LICENSE_START=======================================================
-# Copyright (C) 2024 Deutsche Telekom 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-apiVersion: v2
-description: ONAP Policy OPA PDP
-name: policy-opa-pdp
-version: 11.0.0
-
+# ============LICENSE_START======================================================= +# Copyright (C) 2024-2025 Deutsche Telekom 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +apiVersion: v2 +description: ONAP Policy OPA PDP +name: policy-opa-pdp +version: 11.0.1 + diff --git a/helm/policy/components/policy-opa-pdp/resources/config/config.json b/helm/policy/components/policy-opa-pdp/resources/config/config.json index f0adf0d2..8a3b9735 100755 --- a/helm/policy/components/policy-opa-pdp/resources/config/config.json +++ b/helm/policy/components/policy-opa-pdp/resources/config/config.json @@ -1,6 +1,6 @@ {{/* # ============LICENSE_START======================================================= -# Copyright (C) 2024 Deutsche Telekom Intellectual Property. All rights reserved. +# Copyright (C) 2024-2025 Deutsche Telekom 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. @@ -21,22 +21,6 @@ "logging": { "level": "debug" }, - "services": [ - { - "name": "opa-bundle-server", - "url": "http://policy-opa-pdp:8282/opa/bundles" - } - ], - "bundles": { - "opabundle": { - "service": "opa-bundle-server", - "resource": "bundle.tar.gz", - "polling": { - "min_delay_seconds": 60, - "max_delay_seconds": 120 - } - } - }, "decision_logs": { "console": true } diff --git a/helm/policy/components/policy-opa-pdp/resources/policies/policy-data.tar.gz b/helm/policy/components/policy-opa-pdp/resources/policies/policy-data.tar.gz Binary files differdeleted file mode 100755 index 572e9639..00000000 --- a/helm/policy/components/policy-opa-pdp/resources/policies/policy-data.tar.gz +++ /dev/null diff --git a/helm/policy/components/policy-opa-pdp/templates/configmap.yaml b/helm/policy/components/policy-opa-pdp/templates/configmap.yaml index 36ad7cf4..96e2a6c7 100755 --- a/helm/policy/components/policy-opa-pdp/templates/configmap.yaml +++ b/helm/policy/components/policy-opa-pdp/templates/configmap.yaml @@ -1,6 +1,6 @@ {{/*
# ============LICENSE_START=======================================================
-# Copyright (C) 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+# Copyright (C) 2024-2025 Deutsche Telekom 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.
@@ -21,23 +21,6 @@ apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ .Chart.Name }}-configmap-policies-data
- namespace: default
- labels:
- app: {{ .Chart.Name }}
- chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: release
- heritage: Helm
- {{- with .Files.Glob "resources/policies/*" }}
-binaryData:
- {{- range $path, $bytes := . }}
- {{ base $path }}: {{ $.Files.Get $path | b64enc | quote }}
- {{- end }}
- {{- end }}
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
name: {{ .Chart.Name }}-configmap-config
namespace: default
labels:
diff --git a/helm/policy/components/policy-opa-pdp/templates/deployment.yaml b/helm/policy/components/policy-opa-pdp/templates/deployment.yaml index 2c5d8a6b..ece9dc3a 100755 --- a/helm/policy/components/policy-opa-pdp/templates/deployment.yaml +++ b/helm/policy/components/policy-opa-pdp/templates/deployment.yaml @@ -1,6 +1,6 @@ {{/*
# ============LICENSE_START=======================================================
-# Copyright (C) 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+# Copyright (C) 2024-2025 Deutsche Telekom 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.
@@ -40,33 +40,9 @@ spec: release: release
spec:
initContainers:
- - command:
- - /bin/sh
- args:
- - -c
- - |
- echo "*** set right permissions to the different folders"
- chown -R {{ .Values.permissions.uid }}:{{ .Values.permissions.gid }} /var/log;
- chmod -R 755 /var/log
- chown -R {{ .Values.permissions.uid }}:{{ .Values.permissions.gid }} /opt/;
- chmod -R 755 /opt/*
- tar -xvf /tmp/policies/policy-data.tar.gz -C /opt/
- image: busybox:latest
- imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
- securityContext:
- runAsUser: 1000
- runAsGroup: 1000
- allowPrivilegeEscalation: false
- readOnlyRootFilesystem: true
- name: {{ .Chart.Name }}-readiness
- volumeMounts:
- - name: logs
- mountPath: /var/log
- - name: tmp-policies-data
- mountPath: /tmp/policies
- - name : opa-policies-data
- mountPath: /opt/
-
+ - name: {{ .Chart.Name }}-readiness
+ image: busybox
+ command: ["sh", "-c", "echo Init container started; sleep 10; echo Init container completed"]
containers:
- name: {{ .Chart.Name }}
image: {{ .Values.global.repository }}/{{ .Values.global.image.opa }}
@@ -97,13 +73,13 @@ spec: timeoutSeconds: {{ .Values.readiness.timeout }}
env:
- name: UseSASLForKAFKA
- value: "{{ .Values.kafka.useSASL }}"
+ value: "{{ .Values.kafka.useSASL }}"
- name: BOOSTSTRAP_SERVER
value: "{{ .Values.kafka.brokers }}"
- name: KAFKA_USERNAME
value: "{{ .Values.kafka.username }}"
- name: KAFKA_PASSWORD
- value: "{{ .Values.kafka.password }}"
+ value: "{{ .Values.kafka.password }}"
- name: LOG_LEVEL
value: "{{ .Values.log.loglevel }}"
- name: GROUPID
@@ -111,14 +87,12 @@ spec: - name: TOPIC
value: "{{ .Values.kafka.topic }}"
volumeMounts:
- - name: opa-policies-data
- mountPath: /opt
- name: opa-config
mountPath: /app/config
- name: opa-bundles
mountPath: /app/bundles
- name: logs
- mountPath: /var/log
+ mountPath: /var/logs
resources:
{{ toYaml .Values.resources.small | indent 12 }}
{{- if .Values.nodeSelector }}
@@ -131,13 +105,6 @@ spec: {{- end }}
serviceAccountName: {{ .Chart.Name }}-read
volumes:
- - name: tmp-policies-data
- configMap:
- name: {{ .Chart.Name }}-configmap-policies-data
- defaultMode: 0755
- - name: opa-policies-data
- persistentVolumeClaim:
- claimName: {{ .Chart.Name }}-policies-data
- name: opa-config
configMap:
name: {{ .Chart.Name }}-configmap-config
diff --git a/helm/policy/components/policy-opa-pdp/templates/pvc.yaml b/helm/policy/components/policy-opa-pdp/templates/pvc.yaml deleted file mode 100755 index 6f0f7e1f..00000000 --- a/helm/policy/components/policy-opa-pdp/templates/pvc.yaml +++ /dev/null @@ -1,41 +0,0 @@ -{{/* -# ============LICENSE_START======================================================= -# Copyright (C) 2024 Deutsche Telekom 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. -# -# SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END========================================================= -*/}} - - -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .Chart.Name }}-policies-data - namespace: default - labels: - app: {{ .Chart.Name }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: 13.0.1 - heritage: {{ .Release.Service }} -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 5G - storageClassName: microk8s-hostpath - volumeMode: Filesystem - - diff --git a/helm/policy/components/policy-opa-pdp/values.yaml b/helm/policy/components/policy-opa-pdp/values.yaml index 615b6523..6c823aa0 100755 --- a/helm/policy/components/policy-opa-pdp/values.yaml +++ b/helm/policy/components/policy-opa-pdp/values.yaml @@ -1,117 +1,117 @@ -# ============LICENSE_START=======================================================
-# Copyright (C) 2024-2025 Deutsche Telekom 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-#################################################################
-# Global configuration defaults.
-#################################################################
-global:
- persistence: {}
- image:
- opapdp: nexus3.onap.org:10001/onap/policy-opa-pdp:1.0.0-SNAPSHOT
-log:
- loglevel: "debug"
-
-permissions:
- uid: 100
- gid: 102
-
-#################################################################
-# Secrets metaconfig
-#################################################################
-secrets:
- - uid: restserver-creds
- type: basicAuth
- externalSecret: '{{ tpl (default "" .Values.restServer.credsExternalSecret) . }}'
- login: '{{ .Values.restServer.user }}'
- password: '{{ .Values.restServer.password }}'
-#################################################################
-# Application configuration defaults.
-#################################################################
-# application image
-pullPolicy: Always
-
-# flag to enable debugging - application support required
-debugEnabled: false
-
-# application configuration
-
-restServer:
- user: policyadmin
- password: zb!XztG34
-
-# default number of instances
-replicaCount: 1
-
-nodeSelector: {}
-
-affinity: {}
-
-# probe configuration parameters
-liveness:
- initialDelaySeconds: 20
- periodSeconds: 10
- # necessary to disable liveness probe when setting breakpoints
- # in debugger so K8s doesn't restart unresponsive container
- enabled: true
-
-readiness:
- initialDelaySeconds: 10
- periodSeconds: 120
- api: /ready
- successThreshold: 1
- failureThreshold: 3
- timeout: 60
-
-service:
- type: ClusterIP
- name: policy-opa-pdp
- portName: http
- externalPort: 8282
- internalPort: 8282
-
-ingress:
- enabled: false
-
-flavor: small
-resources:
- small:
- limits:
- cpu: 1
- memory: 4Gi
- requests:
- cpu: 100m
- memory: 1Gi
- unlimited: {}
-
-dirSizes:
- bundleDir:
- sizeLimit: 1000Mi
-
-#Pods Service Account
-serviceAccount:
- nameOverride: policy-opa-pdp
- roles:
- - read
-kafka:
- groupid: "policy-opa-pdp"
- topic: "policy-pdp-pap"
- useSASL: "false"
- username: ""
- password: ""
- brokers: "kafka.default.svc.cluster.local:9092"
-
+# ============LICENSE_START======================================================= +# Copyright (C) 2024-2025 Deutsche Telekom 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +################################################################# +# Global configuration defaults. +################################################################# +global: + persistence: {} + image: + opapdp: nexus3.onap.org:10001/onap/policy-opa-pdp:1.0.4 +log: + loglevel: "debug" + +permissions: + uid: 100 + gid: 102 + +################################################################# +# Secrets metaconfig +################################################################# +secrets: + - uid: restserver-creds + type: basicAuth + externalSecret: '{{ tpl (default "" .Values.restServer.credsExternalSecret) . }}' + login: '{{ .Values.restServer.user }}' + password: '{{ .Values.restServer.password }}' +################################################################# +# Application configuration defaults. +################################################################# +# application image +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration + +restServer: + user: policyadmin + password: zb!XztG34 + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + +readiness: + initialDelaySeconds: 10 + periodSeconds: 120 + api: /ready + successThreshold: 1 + failureThreshold: 3 + timeout: 60 + +service: + type: ClusterIP + name: policy-opa-pdp + portName: http + externalPort: 8282 + internalPort: 8282 + +ingress: + enabled: false + +flavor: small +resources: + small: + limits: + cpu: 1 + memory: 4Gi + requests: + cpu: 100m + memory: 1Gi + unlimited: {} + +dirSizes: + bundleDir: + sizeLimit: 1000Mi + +#Pods Service Account +serviceAccount: + nameOverride: policy-opa-pdp + roles: + - read +kafka: + groupid: "policy-opa-pdp" + topic: "policy-pdp-pap" + useSASL: "false" + username: "" + password: "" + brokers: "kafka.default.svc.cluster.local:9092" + diff --git a/helm/policy/components/policy-pap/resources/config/papParameters.yaml b/helm/policy/components/policy-pap/resources/config/papParameters.yaml index 85315a17..d888bf7a 100644 --- a/helm/policy/components/policy-pap/resources/config/papParameters.yaml +++ b/helm/policy/components/policy-pap/resources/config/papParameters.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023-2024 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2025 Nordix Foundation. 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. @@ -25,8 +25,8 @@ spring: converters: preferred-json-mapper: gson datasource: - url: jdbc:mariadb://{{ .Values.db.service.name }}:{{ .Values.db.service.internalPort}}/policyadmin - driverClassName: org.mariadb.jdbc.Driver + url: jdbc:postgresql://{{ .Values.db.service.name }}:{{ .Values.db.service.internalPort}}/policyadmin + driverClassName: org.postgresql.Driver username: "${SQL_USER}" password: "${SQL_PASSWORD}" hikari: diff --git a/helm/policy/components/policy-pap/templates/deployment.yaml b/helm/policy/components/policy-pap/templates/deployment.yaml index ad7c632b..91f44ce0 100755..100644 --- a/helm/policy/components/policy-pap/templates/deployment.yaml +++ b/helm/policy/components/policy-pap/templates/deployment.yaml @@ -1,6 +1,6 @@ {{/* # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. +# Copyright (C) 2023,2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ spec: - /app/ready.py args: - --job-name - - policy-galera-config + - policy-pg-config env: - name: NAMESPACE valueFrom: diff --git a/helm/policy/components/policy-pap/values.yaml b/helm/policy/components/policy-pap/values.yaml index ffab46aa..8b1f6069 100755..100644 --- a/helm/policy/components/policy-pap/values.yaml +++ b/helm/policy/components/policy-pap/values.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. +# Copyright (C) 2023,2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,8 +39,8 @@ db: user: policy-user password: policy-user service: - name: mariadb-galera - internalPort: 3306 + name: postgres-service + internalPort: 5432 restServer: user: policyadmin diff --git a/helm/policy/components/policy-xacml-pdp/resources/config/xacml.properties b/helm/policy/components/policy-xacml-pdp/resources/config/xacml.properties index d2e9c62e..f03a4811 100755..100644 --- a/helm/policy/components/policy-xacml-pdp/resources/config/xacml.properties +++ b/helm/policy/components/policy-xacml-pdp/resources/config/xacml.properties @@ -49,8 +49,7 @@ xacml.pip.engines=count-recent-operations,get-operation-outcome # # JPA Properties # -eclipselink.target-database=MySQL -javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver -javax.persistence.jdbc.url=jdbc:mariadb://{{ .Values.db.service.name }}:{{ .Values.db.service.internalPort }}/operationshistory -javax.persistence.jdbc.user=${SQL_USER} -javax.persistence.jdbc.password=${SQL_PASSWORD} +jakarta.persistence.jdbc.driver=org.postgresql.Driver +jakarta.persistence.jdbc.url=jdbc:postgresql://{{ .Values.db.service.name }}:{{ .Values.db.service.internalPort }}/operationshistory +jakarta.persistence.jdbc.user=${SQL_USER} +jakarta.persistence.jdbc.password=${SQL_PASSWORD} diff --git a/helm/policy/components/policy-xacml-pdp/templates/deployment.yaml b/helm/policy/components/policy-xacml-pdp/templates/deployment.yaml index eb478740..799b1fbf 100755..100644 --- a/helm/policy/components/policy-xacml-pdp/templates/deployment.yaml +++ b/helm/policy/components/policy-xacml-pdp/templates/deployment.yaml @@ -1,6 +1,6 @@ {{/* # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. +# Copyright (C) 2023,2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ spec: - /app/ready.py args: - --job-name - - policy-galera-config + - policy-pg-config env: - name: NAMESPACE valueFrom: diff --git a/helm/policy/components/policy-xacml-pdp/values.yaml b/helm/policy/components/policy-xacml-pdp/values.yaml index 753a9d64..3cd90c0d 100644 --- a/helm/policy/components/policy-xacml-pdp/values.yaml +++ b/helm/policy/components/policy-xacml-pdp/values.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023-2024 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2025 Nordix Foundation. 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. @@ -62,8 +62,8 @@ db: user: policy-user password: policy-user service: - name: mariadb-galera - internalPort: 3306 + name: postgres-service + internalPort: 5432 restServer: user: policyadmin diff --git a/helm/policy/components/mariadb-galera/Chart.yaml b/helm/policy/components/postgres/Chart.yaml index 63b04a03..364fca64 100644 --- a/helm/policy/components/mariadb-galera/Chart.yaml +++ b/helm/policy/components/postgres/Chart.yaml @@ -1,4 +1,4 @@ -# Copyright © 2022 Nordix Foundation +# Copyright © 2025 Nordix Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -6,6 +6,7 @@ # # http://www.apache.org/licenses/LICENSE-2.0 # +# SPDX-License-Identifier: Apache-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. @@ -13,13 +14,6 @@ # limitations under the License. apiVersion: v2 -description: Chart for MariaDB Galera cluster -name: mariadb-galera +description: Chart for Postgres database +name: postgres version: 11.0.0 -keywords: - - mariadb - - mysql - - database - - sql - - galera - - cluster diff --git a/helm/policy/components/postgres/templates/configmap.yaml b/helm/policy/components/postgres/templates/configmap.yaml new file mode 100644 index 00000000..9e252cc0 --- /dev/null +++ b/helm/policy/components/postgres/templates/configmap.yaml @@ -0,0 +1,28 @@ +{{/* + # Copyright © 2025 Nordix Foundation + # + # 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 + # + # SPDX-License-Identifier: Apache-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. + */}} + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Chart.Name }}-secret + labels: + app: {{ .Chart.Name }} +data: + POSTGRES_DB: {{ .Values.config.pgDatabase }} + POSTGRES_USER: {{ .Values.config.pgUserName }} + POSTGRES_PASSWORD: {{ .Values.config.pgUserPassword }} + diff --git a/helm/policy/components/postgres/templates/deployment.yaml b/helm/policy/components/postgres/templates/deployment.yaml new file mode 100644 index 00000000..1488b961 --- /dev/null +++ b/helm/policy/components/postgres/templates/deployment.yaml @@ -0,0 +1,48 @@ +{{/* + # Copyright © 2025 Nordix Foundation + # + # 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 + # + # SPDX-License-Identifier: Apache-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. + */}} + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Chart.Name }} +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Chart.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: {{ .Values.global.repository }}/{{ .Values.global.image.postgres }} + imagePullPolicy: {{ .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + envFrom: + - configMapRef: + name: {{ .Chart.Name }}-secret + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: postgresdata + volumes: + - name: postgresdata + persistentVolumeClaim: + claimName: postgres-volume-claim + diff --git a/helm/policy/components/postgres/templates/pv.yaml b/helm/policy/components/postgres/templates/pv.yaml new file mode 100644 index 00000000..23d8e752 --- /dev/null +++ b/helm/policy/components/postgres/templates/pv.yaml @@ -0,0 +1,33 @@ +{{/* + # Copyright © 2025 Nordix Foundation + # + # 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 + # + # SPDX-License-Identifier: Apache-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. + */}} + +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Chart.Name }}-volume + labels: + type: local + app: {{ .Chart.Name }} +spec: + storageClassName: manual + capacity: + storage: {{ .Values.persistence.size }} + accessModes: + - {{ .Values.persistence.accessMode }} + hostPath: + path: {{ .Values.persistence.mountPath }} + diff --git a/helm/policy/components/postgres/templates/pvc.yaml b/helm/policy/components/postgres/templates/pvc.yaml new file mode 100644 index 00000000..8b0a2435 --- /dev/null +++ b/helm/policy/components/postgres/templates/pvc.yaml @@ -0,0 +1,31 @@ +{{/* + # Copyright © 2025 Nordix Foundation + # + # 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 + # + # SPDX-License-Identifier: Apache-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. + */}} + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Chart.Name }}-volume-claim + labels: + app: {{ .Chart.Name }} +spec: + storageClassName: manual + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size }} + diff --git a/helm/policy/components/postgres/templates/service.yaml b/helm/policy/components/postgres/templates/service.yaml new file mode 100644 index 00000000..e417df5d --- /dev/null +++ b/helm/policy/components/postgres/templates/service.yaml @@ -0,0 +1,30 @@ +{{/* + # Copyright © 2025 Nordix Foundation + # + # 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 + # + # SPDX-License-Identifier: Apache-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. + */}} + +apiVersion: v1 +kind: Service +metadata: + name: {{ .Chart.Name }}-service + labels: + app: {{ .Chart.Name }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.internalPort }} + selector: + app: {{ .Chart.Name }} + diff --git a/helm/policy/components/postgres/values.yaml b/helm/policy/components/postgres/values.yaml new file mode 100644 index 00000000..f3079d34 --- /dev/null +++ b/helm/policy/components/postgres/values.yaml @@ -0,0 +1,57 @@ +# Copyright © 2025 Nordix Foundation +# +# 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 +# +# SPDX-License-Identifier: Apache-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. + +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + persistence: {} + + +################################################################# +# Application configuration defaults. +################################################################# + +# bitnami image doesn't support well single quote in password +passwordStrengthOverride: basic + +pullPolicy: Always + +# application configuration +config: + pgUserName: policy-user + pgUserPassword: policy-user + pgDatabase: userdb + pgDataPath: data + +nodeSelector: {} + +affinity: {} + +## Persist data to a persitent volume +persistence: + volumeReclaimPolicy: Retain + accessMode: ReadWriteMany + size: 1Gi + mountPath: /dockerdata-nfs/postgres/data + mountInitPath: postgres + +service: + type: NodePort + name: pgsvc + externalPort: 5432 + internalPort: 5432 + diff --git a/helm/policy/resources/config/db-pg.sh b/helm/policy/resources/config/db-pg.sh new file mode 100644 index 00000000..32195d3f --- /dev/null +++ b/helm/policy/resources/config/db-pg.sh @@ -0,0 +1,34 @@ +#!/bin/bash -xv +# Copyright (C) 2025 Nordix Foundation. 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 +# +# SPDX-License-Identifier: Apache-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. + + +export PGPASSWORD=${PG_PASSWORD} # Set the password + +psql -h ${PG_HOST} -p ${PG_PORT} -U "${PG_USER}" -d postgres --command "CREATE USER \"${PG_USER}\" WITH PASSWORD '${PG_PASSWORD}';" + +# Loop through the databases to create and set permissions +for db in migration pooling policyadmin policyclamp operationshistory clampacm +do + # Create the database + psql -h ${PG_HOST} -p ${PG_PORT} -U "${PG_USER}" -d postgres --command "CREATE DATABASE ${db};" + + # Alter database owner + psql -h ${PG_HOST} -p ${PG_PORT} -U "${PG_USER}" -d postgres --command "ALTER DATABASE ${db} OWNER TO \"${PG_USER}\";" + + # Grant all privileges on the database + psql -h ${PG_HOST} -p ${PG_PORT} -U "${PG_USER}" -d postgres --command "GRANT ALL PRIVILEGES ON DATABASE ${db} TO \"${PG_USER}\";" +done + diff --git a/helm/policy/resources/config/db.sh b/helm/policy/resources/config/db.sh deleted file mode 100755 index 8c68c6ba..00000000 --- a/helm/policy/resources/config/db.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -{{/* -# -# ============LICENSE_START==================================================== -# Copyright (C) 2022 Nordix Foundation. -# ============================================================================= -# 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. -# -# SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END====================================================== -*/}} -mysql() { /usr/bin/mysql -h ${MYSQL_HOST} -P ${MYSQL_USER} "$@"; }; - -for db in migration pooling policyadmin policyclamp operationshistory clampacm -do - mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};" - mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;" -done - -mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;" diff --git a/helm/policy/resources/config/db_migrator_policy_init.sh b/helm/policy/resources/config/db_migrator_policy_init.sh deleted file mode 100644 index cd6181d4..00000000 --- a/helm/policy/resources/config/db_migrator_policy_init.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -{{/* -# ============LICENSE_START==================================================== -# Copyright (C) 2022 Nordix Foundation. -# ============================================================================= -# 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. -*/}} -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -rc=$? -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report -exit $rc diff --git a/compose/config/db-migrator/init.sh b/helm/policy/resources/config/init_pg.sh index a8eb25a3..7586a12b 100755..100644 --- a/compose/config/db-migrator/init.sh +++ b/helm/policy/resources/config/init_pg.sh @@ -1,6 +1,6 @@ #!/bin/sh # ============LICENSE_START==================================================== -# Copyright (C) 2021, 2024 Nordix Foundation. +# Copyright (C) 2025 Nordix Foundation. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,27 +17,21 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END====================================================== -export POLICY_HOME=/opt/app/policy -export SQL_USER=${MYSQL_USER} -export SQL_PASSWORD=${MYSQL_PASSWORD} -export SCRIPT_DIRECTORY=sql for schema in ${SQL_DB}; do echo "Initializing $schema..." /opt/app/policy/bin/prepare_upgrade.sh ${schema} - /opt/app/policy/bin/db-migrator -s ${schema} -o report + /opt/app/policy/bin/db-migrator-pg -s ${schema} -o report - /opt/app/policy/bin/db-migrator -s ${schema} -o upgrade + /opt/app/policy/bin/db-migrator-pg -s ${schema} -o upgrade rc=$? - /opt/app/policy/bin/db-migrator -s ${schema} -o report + /opt/app/policy/bin/db-migrator-pg -s ${schema} -o report if [ "$rc" != 0 ]; then break fi done -nc -l -p 6824 - exit $rc diff --git a/helm/policy/templates/job.yaml b/helm/policy/templates/job-pg.yaml index 7d3656cd..186bbfc5 100755..100644 --- a/helm/policy/templates/job.yaml +++ b/helm/policy/templates/job-pg.yaml @@ -1,5 +1,5 @@ {{/* -# Copyright (C) 2022 Nordix Foundation. +# Copyright (C) 2025 Nordix Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -7,6 +7,7 @@ # # http://www.apache.org/licenses/LICENSE-2.0 # +# SPDX-License-Identifier: Apache-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. @@ -18,27 +19,25 @@ apiVersion: batch/v1 kind: Job metadata: - name: policy-galera-init + name: policy-pg-init namespace: default labels: - app: policy-galera-init + app: policy-pg-init spec: template: metadata: labels: - app: policy-galera-init - name: policy-galera-init + app: policy-pg-init + name: policy-pg-init spec: - imagePullSecrets: - - name: "default-docker-registry-key" initContainers: - - name: policy-mariadb-readiness + - name: policy-pg-readiness image: {{ .Values.global.repository }}/{{ .Values.global.image.readiness }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} command: - /app/ready.py - --container-name - - {{ index .Values "mariadb-galera" "service" "name" }} + - postgres env: - name: NAMESPACE valueFrom: @@ -46,39 +45,31 @@ spec: apiVersion: v1 fieldPath: metadata.namespace containers: - - name: policy-galera-config - image: {{ .Values.global.dockerRepository }}/{{ .Values.mariadb.image }} + - name: policy-pg-config + image: {{ .Values.global.repository }}/{{ .Values.global.image.postgres}} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} volumeMounts: - - mountPath: /dbcmd-config/db.sh + - mountPath: /dbcmd-config/db-pg.sh name: {{ .Chart.Name }}-config - subPath: db.sh + subPath: db-pg.sh command: - /bin/sh - -cx - | - /dbcmd-config/db.sh + /dbcmd-config/db-pg.sh env: - - name: MYSQL_ROOT_PASSWORD - valueFrom: - secretKeyRef: - name: mariadb-galera-db-root-password - key: password - optional: false - - name: MYSQL_HOST - value: "{{ index .Values "mariadb-galera" "service" "name" }}" - - name: MYSQL_USER - valueFrom: - secretKeyRef: - name: mariadb-galera-db-user-credentials - key: login - optional: false - - name: MYSQL_PORT - value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}" + - name: PG_PASSWORD + value: {{ .Values.dbConfig.postgres.password }} + - name: PG_HOST + value: {{ .Values.dbConfig.postgres.service }} + - name: PG_USER + value: {{ .Values.dbConfig.postgres.user }} + - name: PG_PORT + value: "{{ .Values.dbConfig.postgres.port }}" resources: limits: cpu: 1 - memory: 4Gi + memory: 2Gi requests: cpu: 100m memory: 1Gi @@ -91,26 +82,24 @@ spec: name: {{ .Chart.Name }}-db-configmap defaultMode: 0755 items: - - key: db.sh - path: db.sh + - key: db-pg.sh + path: db-pg.sh --- apiVersion: batch/v1 kind: Job metadata: - name: policy-galera-config + name: policy-pg-config namespace: default labels: - app: policy-galera-config + app: policy-pg-config spec: template: metadata: labels: - app: policy-galera-config - name: policy-galera-config + app: policy-pg-config + name: policy-pg-config spec: - imagePullSecrets: - - name: "default-docker-registry-key" initContainers: - name: policy-init-readiness image: {{ .Values.global.repository }}/{{ .Values.global.image.readiness }} @@ -119,7 +108,7 @@ spec: - /app/ready.py args: - --job-name - - policy-galera-init + - policy-pg-init env: - name: NAMESPACE valueFrom: @@ -127,39 +116,33 @@ spec: apiVersion: v1 fieldPath: metadata.namespace containers: - - name: policy-galera-db-migrator-policy + - name: policy-pg-db-migrator-policy image: {{ .Values.global.repository }}/{{ .Values.dbmigrator.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} volumeMounts: - - mountPath: /dbcmd-config/db_migrator_policy_init.sh + - mountPath: /dbcmd-config/init_pg.sh name: {{ .Chart.Name }}-policy-config - subPath: db_migrator_policy_init.sh + subPath: init_pg.sh command: - /bin/sh - -cx - | - /dbcmd-config/db_migrator_policy_init.sh + /dbcmd-config/init_pg.sh env: - name: SQL_HOST - value: "{{ index .Values "mariadb-galera" "service" "name" }}" + value: {{ .Values.dbConfig.postgres.service }} - name: SQL_USER - valueFrom: - secretKeyRef: - name: mariadb-galera-db-user-credentials - key: login - optional: false + value: {{ .Values.dbConfig.postgres.user }} - name: SQL_PASSWORD - valueFrom: - secretKeyRef: - name: mariadb-galera-db-user-credentials - key: password - optional: false + value: {{ .Values.dbConfig.postgres.password }} - name: SQL_DB value: {{ .Values.dbmigrator.policyadmin.schema }} - name: POLICY_HOME value: {{ .Values.dbmigrator.policy_home }} - name: SCRIPT_DIRECTORY - value: "sql" + value: "postgres" + - name: PGPASSWORD + value: {{ .Values.dbConfig.postgres.password }} resources: limits: cpu: 1 @@ -175,26 +158,24 @@ spec: name: {{ .Chart.Name }}-db-configmap defaultMode: 0755 items: - - key: db_migrator_policy_init.sh - path: db_migrator_policy_init.sh + - key: init_pg.sh + path: init_pg.sh --- apiVersion: batch/v1 kind: Job metadata: - name: policy-galera-config-clamp + name: policy-pg-config-clamp namespace: default labels: - app: policy-galera-config-clamp + app: policy-pg-config-clamp spec: template: metadata: labels: - app: policy-galera-config-clamp - name: policy-galera-config-clamp + app: policy-pg-config-clamp + name: policy-pg-config-clamp spec: - imagePullSecrets: - - name: "default-docker-registry-key" initContainers: - name: policy-init-readiness image: {{ .Values.global.repository }}/{{ .Values.global.image.readiness }} @@ -203,7 +184,7 @@ spec: - /app/ready.py args: - --job-name - - policy-galera-config + - policy-pg-config env: - name: NAMESPACE valueFrom: @@ -211,39 +192,33 @@ spec: apiVersion: v1 fieldPath: metadata.namespace containers: - - name: policy-galera-db-migrator-clamp + - name: policy-pg-db-migrator-clamp image: {{ .Values.global.repository }}/{{ .Values.global.image.dbMigrator }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} volumeMounts: - - mountPath: /dbcmd-config/db_migrator_policy_init.sh + - mountPath: /dbcmd-config/init_pg.sh name: {{ .Chart.Name }}-clamp-config - subPath: db_migrator_policy_init.sh + subPath: init_pg.sh command: - /bin/sh - -cx - | - /dbcmd-config/db_migrator_policy_init.sh + /dbcmd-config/init_pg.sh env: - name: SQL_HOST - value: "{{ index .Values "mariadb-galera" "service" "name" }}" + value: {{ .Values.dbConfig.postgres.service }} - name: SQL_USER - valueFrom: - secretKeyRef: - name: mariadb-galera-db-user-credentials - key: login - optional: false + value: {{ .Values.dbConfig.postgres.user }} - name: SQL_PASSWORD - valueFrom: - secretKeyRef: - name: mariadb-galera-db-user-credentials - key: password - optional: false + value: {{ .Values.dbConfig.postgres.password }} - name: SQL_DB value: {{ .Values.dbmigrator.clampacm.schema }} - name: POLICY_HOME value: {{ .Values.dbmigrator.policy_home }} - name: SCRIPT_DIRECTORY - value: "sql" + value: "postgres" + - name: PGPASSWORD + value: {{ .Values.dbConfig.postgres.password }} resources: limits: cpu: 1 @@ -259,5 +234,5 @@ spec: name: {{ .Chart.Name }}-db-configmap defaultMode: 0755 items: - - key: db_migrator_policy_init.sh - path: db_migrator_policy_init.sh + - key: init_pg.sh + path: init_pg.sh diff --git a/helm/policy/values.yaml b/helm/policy/values.yaml index 13f1f903..0cb52873 100755..100644 --- a/helm/policy/values.yaml +++ b/helm/policy/values.yaml @@ -1,16 +1,22 @@ -# Copyright © 2022-2024 Nordix Foundation +# +# ===========LICENSE_START==================================================== +# Copyright © 2022-2025 Nordix Foundation +# Modifications Copyright 2024-2025 Deutsche Telekom # # 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 -# +# +# SPDX-License-Identifier: Apache-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===================================================== +# ################################################################# # Global configuration defaults. @@ -18,14 +24,6 @@ global: aafEnabled: false - mariadb: - # '&mariadbConfig' means we "store" the values for later use in the file - # with '*mariadbConfig' pointer. - config: &mariadbConfig - mysqlDatabase: policyadmin - service: &mariadbService - name: &mariadb-galera mariadb-galera - internalPort: 3306 prometheusEnabled: false kafkaServer: kafka repository: nexus3.onap.org:10001 @@ -34,14 +32,14 @@ global: image: readiness: onap/oom/readiness:3.0.1 - mariadb: bitnami/mariadb-galera:10.5.8 + postgres: library/postgres:16.4 api: onap/policy-api:$tag pap: onap/policy-pap:$tag apex: onap/policy-apex-pdp:$tag simulator: onap/policy-models-simulator:$tag pdpdcl: onap/policy-pdpd-cl:$tag xacml: onap/policy-xacml-pdp:$tag - opa: onap/policy-opa-pdp:1.0.0-SNAPSHOT + opa: onap/policy-opa-pdp:$tag distribution: onap/policy-distribution:$tag runtimeacm: onap/policy-clamp-runtime-acm:$tag kserveparticipant: onap/policy-clamp-ac-kserve-ppnt:$tag @@ -52,7 +50,7 @@ global: a1pmsparticipant: onap/policy-clamp-ac-a1pms-ppnt:$tag dbMigrator: onap/policy-db-migrator:$tag -policy-mariadb-galera: +postgres: enabled: true policy-models-simulator: enabled: true @@ -92,9 +90,12 @@ jaeger: # DB configuration defaults. ################################################################# - -mariadb: - image: mariadb:10.5.8 +dbConfig: + postgres: + user: "policy-user" + service: "postgres-service" + port: "5432" + password: "policy-user" dbmigrator: image: onap/policy-db-migrator:$tag @@ -117,21 +118,6 @@ nodeSelector: {} affinity: {} -mariadb-galera: - # mariadb-galera.config and global.mariadb.config must be equals - db: - user: policy-user - # password: - name: &mysqlDbName policyadmin - nameOverride: *mariadb-galera - # mariadb-galera.service and global.mariadb.service must be equals - service: *mariadbService - #replicaCount: 1 - persistence: - enabled: true - mountSubPath: policy/maria/data - serviceAccount: - nameOverride: *mariadb-galera # Resource Limit flavor -By Default using small # Segregation for Different environment (small, large, or unlimited) diff --git a/helm/prometheus/resources/prometheus.yml b/helm/prometheus/resources/prometheus.yml index b3f656fe..71ecdded 100644 --- a/helm/prometheus/resources/prometheus.yml +++ b/helm/prometheus/resources/prometheus.yml @@ -1,6 +1,7 @@ # # ===========LICENSE_START==================================================== # Copyright (C) 2023 Nordix Foundation. +# Modifications Copyright 2025 Deutsche Telekom # ============================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -78,6 +79,14 @@ scrape_configs: username: "policyadmin" password: "zb!XztG34" + - job_name: "opa-pdp-metrics" + static_configs: + - targets: + - "policy-opa-pdp:8282" + basic_auth: + username: "policyadmin" + password: "zb!XztG34" + - job_name: "xacml-pdp-metrics" static_configs: - targets: diff --git a/policy-db-migrator/pom.xml b/policy-db-migrator/pom.xml index 2846f4d5..59090df2 100644 --- a/policy-db-migrator/pom.xml +++ b/policy-db-migrator/pom.xml @@ -1,6 +1,6 @@ <!-- ============LICENSE_START======================================================= - Copyright (C) 2021-2022 Nordix Foundation + Copyright (C) 2021-2025 OpenInfra Foundation Europe. 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. @@ -24,7 +24,7 @@ <parent> <groupId>org.onap.policy.docker</groupId> <artifactId>docker</artifactId> - <version>4.1.0-SNAPSHOT</version> + <version>4.1.3-SNAPSHOT</version> </parent> <artifactId>policy-db-migrator</artifactId> diff --git a/policy-db-migrator/smoke-test/mariadb-clamp-tests.sh b/policy-db-migrator/smoke-test/mariadb-clamp-tests.sh deleted file mode 100644 index 052128d0..00000000 --- a/policy-db-migrator/smoke-test/mariadb-clamp-tests.sh +++ /dev/null @@ -1,219 +0,0 @@ -#!/bin/sh -# ============LICENSE_START==================================================== -# Copyright (C) 2024 Nordix Foundation. -# ============================================================================= -# 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. -# -# SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END====================================================== -# shellcheck disable=SC2039 -# shellcheck disable=SC2086 -# shellcheck disable=SC2012 -echo "Start of test $(date +%F-%T)" - -export POLICY_HOME=/opt/app/policy -export SQL_USER=${MYSQL_USER} -export SQL_PASSWORD=${MYSQL_PASSWORD} -export SCRIPT_DIRECTORY=sql -export SCHEMA=clampacm - -# Test variables -TOTAL_COUNT=0 -A_UPGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1400/upgrade/*.sql | wc -l) -A_DOWNGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1400/downgrade/*.sql | wc -l) -TOTAL_SQLS_UPGRADE=$A_UPGRADE_COUNT -TOTAL_SQLS_DOWNGRADE=$A_DOWNGRADE_COUNT - -B_UPGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1500/upgrade/*.sql | wc -l) -B_DOWNGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1500/downgrade/*.sql | wc -l) -TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$B_UPGRADE_COUNT)) -TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$B_DOWNGRADE_COUNT)) - -C_UPGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1600/upgrade/*.sql | wc -l) -C_DOWNGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1600/downgrade/*.sql | wc -l) -TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$C_UPGRADE_COUNT)) -TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$C_DOWNGRADE_COUNT)) - -NEW_SQL_EXECUTIONS=0 -START_VERSION="" -PREVIOUS_SQL_EXECUTIONS=0 -END_VERSION="" -RECENT_SQL_EXECUTIONS=0 -END_STATUS=0 -TEST_STATUS="FAIL" -TEST_MSG="" -TESTS=0 -PASSED=0 -FAILED=0 - -run_sql() { - local user="${1}" password="${2}" schema="${3}" sql="${4}" - MYSQL="mysql -u${user} -p${password} -h ${SQL_HOST} ${schema}" - ${MYSQL} --execute "${sql}" - return $? -} - -start_test() { - echo "" - echo "############################################################################################################" - echo "" - let TESTS=$TESTS+1 - reportStatus=$(/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report | tail -2) - echo "Starting test $TESTS" - echo "$reportStatus" - START_VERSION=$(echo $reportStatus | cut -f13 -d' ') - PREVIOUS_SQL_EXECUTIONS=$(echo $reportStatus | cut -f1 -d' ') - - if [ "${START_VERSION}" == "" ]; then - START_VERSION="0" - PREVIOUS_SQL_EXECUTIONS=0 - fi -} - -end_test() { - reportStatus=$(/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report | tail -2) - echo "Ending test $TESTS" - echo "$reportStatus" - END_VERSION=$(echo $reportStatus | cut -f13 -d' ') - RECENT_SQL_EXECUTIONS=$(echo $reportStatus | cut -f1 -d' ') - END_STATUS=$(echo $reportStatus | cut -f7 -d' ') -} - -check_results() { - local status="${1}" operation="${2}" startVer="${3}" endVer="${4}" newRecords="${5}" filesRan="${6}" - - echo "" - echo "Test summary: status:$status, operation:$operation, from:$startVer, to:$endVer, new executions:$newRecords, sqlFiles:$filesRan" - # Convert to number - startVer=$(echo ${startVer} | awk '{$0=int($0)}1') - endVer=$(echo ${endVer} | awk '{$0=int($0)}1') - - if [ ${startVer} -eq ${endVer} ] && [ $newRecords -eq $filesRan ] && [ $newRecords -eq 0 ]; then - TEST_MSG="No ${operation} required" - TEST_STATUS="PASS" - let PASSED=$PASSED+1 - elif [ $status -eq 1 ] && [ "${operation}" == "upgrade" ] && [ ${startVer} -le ${endVer} ] && [ $newRecords -eq $filesRan ]; then - TEST_MSG="Successful ${operation}" - TEST_STATUS="PASS" - let PASSED=$PASSED+1 - elif [ $status -eq 1 ] && [ "${operation}" == "downgrade" ] && [ ${startVer} -ge ${endVer} ] && [ $newRecords -eq $filesRan ]; then - TEST_MSG="Successful ${operation}" - TEST_STATUS="PASS" - let PASSED=$PASSED+1 - else - TEST_MSG="Errors occurred during ${operation}" - TEST_STATUS="FAIL" - let FAILED=$FAILED+1 - fi - echo "" - echo "*** Test $TESTS: $TEST_STATUS , $TEST_MSG, current version: $END_VERSION ***" - echo "" -} - -# Test 1 - Upgrade to 1600 -start_test -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -t 1600 -end_test -let TOTAL_COUNT=$A_UPGRADE_COUNT+$B_UPGRADE_COUNT+$C_UPGRADE_COUNT -check_results $END_STATUS 'upgrade' "${START_VERSION}" "${END_VERSION}" $RECENT_SQL_EXECUTIONS $TOTAL_COUNT - -sleep 5 - -# Test 2 - downgrade to 1500 -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 1600 -t 1500 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'downgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $C_DOWNGRADE_COUNT - -sleep 5 - -# Test 3 - downgrade to 1400 -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 1500 -t 1400 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'downgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $B_DOWNGRADE_COUNT - -sleep 5 - -# Test 4 - upgrade to 1500 -start_test -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -f 1400 -t 1500 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'upgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $B_UPGRADE_COUNT - -sleep 5 - -# Test 5 - upgrade to 1600 -start_test -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -f 1500 -t 1600 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'upgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $C_UPGRADE_COUNT - -sleep 5 - -# Test 6 - run upgrade on db where tables already exist and migration schema is empty -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 1600 -t 1400 -run_sql "root" "${MYSQL_ROOT_PASSWORD}" "${SCHEMA}" "DROP DATABASE IF EXISTS migration;" -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -t 1600 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -let TOTAL_COUNT=$C_DOWNGRADE_COUNT+$C_UPGRADE_COUNT+$B_DOWNGRADE_COUNT+$B_UPGRADE_COUNT -check_results $END_STATUS 'upgrade' "1400" "${END_VERSION}" $NEW_SQL_EXECUTIONS $TOTAL_COUNT - -sleep 5 - -# Test 7 - Full downgrade -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 1600 -t 0 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'downgrade' "${START_VERSION}" "0" $NEW_SQL_EXECUTIONS $TOTAL_SQLS_DOWNGRADE - -sleep 5 - -# Test 8 - Full upgrade -start_test -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'upgrade' "0" "${END_VERSION}" $NEW_SQL_EXECUTIONS $TOTAL_SQLS_UPGRADE - -# Install database -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report - -echo -echo "-----------------------------------------------------------------------" -echo "Number of Tests: $TESTS, Tests Passed: $PASSED, Tests Failed: $FAILED" -echo "-----------------------------------------------------------------------" - -echo "End of test $(date +%F-%T)" - -nc -lk -p 6824 - -exit 0 diff --git a/policy-db-migrator/smoke-test/mariadb-tests.sh b/policy-db-migrator/smoke-test/mariadb-tests.sh deleted file mode 100755 index 513300c0..00000000 --- a/policy-db-migrator/smoke-test/mariadb-tests.sh +++ /dev/null @@ -1,358 +0,0 @@ -#!/bin/sh -# ============LICENSE_START==================================================== -# Copyright (C) 2022 Nordix Foundation. -# ============================================================================= -# 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. -# -# SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END====================================================== -# shellcheck disable=SC2039 -# shellcheck disable=SC2086 -# shellcheck disable=SC2012 -echo "Start of test $(date +%F-%T)" - -export POLICY_HOME=/opt/app/policy -export SQL_USER=policy_user -export SQL_PASSWORD=policy_user -export SQL_HOST=mariadb -export MYSQL_ROOT_PASSWORD=secret -export SCHEMA=policyadmin -export SCRIPT_DIRECTORY=sql - -# Test variables -TOTAL_COUNT=0 -H_UPGRADE_COUNT=$(ls /home/policy/sql/0800/upgrade/*.sql | wc -l) -H_DOWNGRADE_COUNT=$(ls /home/policy/sql/0800/downgrade/*.sql | wc -l) -TOTAL_SQLS_UPGRADE=$H_UPGRADE_COUNT -TOTAL_SQLS_DOWNGRADE=$H_DOWNGRADE_COUNT - -I_UPGRADE_COUNT=$(ls /home/policy/sql/0900/upgrade/*.sql | wc -l) -I_DOWNGRADE_COUNT=$(ls /home/policy/sql/0900/downgrade/*.sql | wc -l) -TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$I_UPGRADE_COUNT)) -TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$I_DOWNGRADE_COUNT)) - -J_UPGRADE_COUNT=$(ls /home/policy/sql/1000/upgrade/*.sql | wc -l) -J_DOWNGRADE_COUNT=$(ls /home/policy/sql/1000/downgrade/*.sql | wc -l) -TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$J_UPGRADE_COUNT)) -TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$J_DOWNGRADE_COUNT)) - -K_UPGRADE_COUNT=$(ls /home/policy/sql/1100/upgrade/*.sql | wc -l) -K_DOWNGRADE_COUNT=$(ls /home/policy/sql/1100/downgrade/*.sql | wc -l) -TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$K_UPGRADE_COUNT)) -TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$K_DOWNGRADE_COUNT)) - -L_UPGRADE_COUNT=$(ls /home/policy/sql/1200/upgrade/*.sql | wc -l) -L_DOWNGRADE_COUNT=$(ls /home/policy/sql/1200/downgrade/*.sql | wc -l) -TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$L_UPGRADE_COUNT)) -TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$L_DOWNGRADE_COUNT)) - -M_UPGRADE_COUNT=$(ls /home/policy/sql/1300/upgrade/*.sql | wc -l) -M_DOWNGRADE_COUNT=$(ls /home/policy/sql/1300/downgrade/*.sql | wc -l) -TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$M_UPGRADE_COUNT)) -TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$M_DOWNGRADE_COUNT)) - -NEW_SQL_EXECUTIONS=0 -START_VERSION="" -PREVIOUS_SQL_EXECUTIONS=0 -END_VERSION="" -RECENT_SQL_EXECUTIONS=0 -END_STATUS=0 -TEST_STATUS="FAIL" -TEST_MSG="" -TESTS=0 -PASSED=0 -FAILED=0 - -# SQL statements -PDPSTATISTICS="CREATE TABLE IF NOT EXISTS pdpstatistics (" -PDPSTATISTICS=${PDPSTATISTICS}"PDPGROUPNAME VARCHAR(120) NULL, " -PDPSTATISTICS=${PDPSTATISTICS}"PDPSUBGROUPNAME VARCHAR(120) NULL, " -PDPSTATISTICS=${PDPSTATISTICS}"POLICYDEPLOYCOUNT BIGINT DEFAULT NULL NULL, " -PDPSTATISTICS=${PDPSTATISTICS}"POLICYDEPLOYFAILCOUNT BIGINT DEFAULT NULL NULL, " -PDPSTATISTICS=${PDPSTATISTICS}"POLICYDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL NULL, " -PDPSTATISTICS=${PDPSTATISTICS}"POLICYEXECUTEDCOUNT BIGINT DEFAULT NULL NULL, " -PDPSTATISTICS=${PDPSTATISTICS}"POLICYEXECUTEDFAILCOUNT BIGINT DEFAULT NULL NULL, " -PDPSTATISTICS=${PDPSTATISTICS}"POLICYEXECUTEDSUCCESSCOUNT BIGINT DEFAULT NULL NULL, " -PDPSTATISTICS2=${PDPSTATISTICS}"POLICYUNDEPLOYCOUNT BIGINT DEFAULT NULL NULL, " -PDPSTATISTICS2=${PDPSTATISTICS2}"POLICYUNDEPLOYFAILCOUNT BIGINT DEFAULT NULL NULL, " -PDPSTATISTICS2=${PDPSTATISTICS2}"POLICYUNDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL NULL, " -PDPSTATISTICS=${PDPSTATISTICS}"timeStamp datetime NOT NULL, " -PDPSTATISTICS2=${PDPSTATISTICS2}"timeStamp datetime DEFAULT NULL NULL, " -PDPSTATISTICS2=${PDPSTATISTICS2}"ID BIGINT NOT NULL, " -PDPSTATISTICS=${PDPSTATISTICS}"name VARCHAR(120) NOT NULL, " -PDPSTATISTICS2=${PDPSTATISTICS2}"name VARCHAR(120) NOT NULL, " -PDPSTATISTICS=${PDPSTATISTICS}"version VARCHAR(20) NOT NULL," -PDPSTATISTICS2=${PDPSTATISTICS2}"version VARCHAR(20) NOT NULL," -PDPSTATISTICS=${PDPSTATISTICS}"CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (timeStamp, name, version));" -PDPSTATISTICS2=${PDPSTATISTICS2}"CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID, name, version));" - -IDX_TSIDX1="CREATE INDEX IDX_TSIDX1 ON pdpstatistics(timeStamp, name, version);" -INSERT="INSERT INTO pdpstatistics(PDPGROUPNAME,PDPSUBGROUPNAME,POLICYDEPLOYCOUNT,POLICYDEPLOYFAILCOUNT,POLICYDEPLOYSUCCESSCOUNT," -INSERT1="${INSERT}""POLICYEXECUTEDCOUNT,POLICYEXECUTEDFAILCOUNT,POLICYEXECUTEDSUCCESSCOUNT,timeStamp,name,version)" -INSERT2="${INSERT}""POLICYEXECUTEDCOUNT,POLICYEXECUTEDFAILCOUNT,POLICYEXECUTEDSUCCESSCOUNT,POLICYUNDEPLOYCOUNT," -INSERT2="${INSERT2}""POLICYUNDEPLOYFAILCOUNT,POLICYUNDEPLOYSUCCESSCOUNT,timeStamp,ID,name,version)" -SQL1="${INSERT1}"" values('groupname', 'subgroup',1,1,1,1,1,1,now(),'test1', '1.0')" -SQL2="${INSERT1}"" values('groupname', 'subgroup',1,1,1,1,1,1,now(),'test1', '1.0')" -SQL3="${INSERT2}"" values('groupname', 'subgroup',1,1,1,1,1,1,1,1,1,now(),3,'test1', '1.0')" -SQL4="${INSERT2}"" values('groupname', 'subgroup',1,1,1,1,1,1,1,1,1,now(),4,'test1', '1.0')" -SQL5="${INSERT1}"" values('groupname', 'subgroup',1,1,1,1,1,1,now(),'test2', '1.0')" -SQL6="${INSERT1}"" values('groupname', 'subgroup',1,1,1,1,1,1,now(),'test2', '1.0')" - -run_sql() { - local user="${1}" password="${2}" schema="${3}" sql="${4}" - MYSQL="mysql -u${user} -p${password} -h ${SQL_HOST} ${schema}" - ${MYSQL} --execute "${sql}" - return $? -} - -start_test() { - echo "" - echo "############################################################################################################" - echo "" - let TESTS=$TESTS+1 - reportStatus=$(/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report | tail -2) - echo "Starting test $TESTS" - echo "$reportStatus" - START_VERSION=$(echo $reportStatus | cut -f13 -d' ') - PREVIOUS_SQL_EXECUTIONS=$(echo $reportStatus | cut -f1 -d' ') - - if [ "${START_VERSION}" == "" ]; then - START_VERSION="0" - PREVIOUS_SQL_EXECUTIONS=0 - fi -} - -end_test() { - reportStatus=$(/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report | tail -2) - echo "Ending test $TESTS" - echo "$reportStatus" - END_VERSION=$(echo $reportStatus | cut -f13 -d' ') - RECENT_SQL_EXECUTIONS=$(echo $reportStatus | cut -f1 -d' ') - END_STATUS=$(echo $reportStatus | cut -f7 -d' ') -} - -check_results() { - local status="${1}" operation="${2}" startVer="${3}" endVer="${4}" newRecords="${5}" filesRan="${6}" - - echo "" - echo "Test summary: status:$status, operation:$operation, from:$startVer, to:$endVer, new executions:$newRecords, sqlFiles:$filesRan" - # Convert to number - startVer=$(echo ${startVer} | awk '{$0=int($0)}1') - endVer=$(echo ${endVer} | awk '{$0=int($0)}1') - - if [ ${startVer} -eq ${endVer} ] && [ $newRecords -eq $filesRan ] && [ $newRecords -eq 0 ]; then - TEST_MSG="No ${operation} required" - TEST_STATUS="PASS" - let PASSED=$PASSED+1 - elif [ $status -eq 1 ] && [ "${operation}" == "upgrade" ] && [ ${startVer} -le ${endVer} ] && [ $newRecords -eq $filesRan ]; then - TEST_MSG="Successful ${operation}" - TEST_STATUS="PASS" - let PASSED=$PASSED+1 - elif [ $status -eq 1 ] && [ "${operation}" == "downgrade" ] && [ ${startVer} -ge ${endVer} ] && [ $newRecords -eq $filesRan ]; then - TEST_MSG="Successful ${operation}" - TEST_STATUS="PASS" - let PASSED=$PASSED+1 - else - TEST_MSG="Errors occurred during ${operation}" - TEST_STATUS="FAIL" - let FAILED=$FAILED+1 - fi - echo "" - echo "*** Test $TESTS: $TEST_STATUS , $TEST_MSG, current version: $END_VERSION ***" - echo "" -} - -# Test 1 - Upgrade to Istanbul -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -start_test -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -t 0900 -end_test -let TOTAL_COUNT=$H_UPGRADE_COUNT+$I_UPGRADE_COUNT -check_results $END_STATUS 'upgrade' "${START_VERSION}" "${END_VERSION}" $RECENT_SQL_EXECUTIONS $TOTAL_COUNT - -sleep 5 - -# Test 2 - downgrade to 0800 -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'downgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $I_UPGRADE_COUNT - -sleep 5 - -# Test 3 - upgrade to 0900 -start_test -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -f 0800 -t 0900 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'upgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $I_UPGRADE_COUNT - -sleep 5 - -# Test4 - run upgrade on db where tables already exist and migration schema is empty -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800 -run_sql "root" "${MYSQL_ROOT_PASSWORD}" "${SCHEMA}" "DROP DATABASE IF EXISTS migration;" -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -t 0900 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS -check_results $END_STATUS 'upgrade' "0800" "${END_VERSION}" $NEW_SQL_EXECUTIONS $I_UPGRADE_COUNT - -sleep 5 - -# Test5 - upgrade after failed downgrade -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "DROP table pdpstatistics;" -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800 -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${PDPSTATISTICS2}" -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${IDX_TSIDX1}" -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -f 0800 -t 0900 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -# (files run before error * 2) + 1 to run the file again -let TOTAL_COUNT=11 -check_results $END_STATUS 'upgrade' "0800" "0900" $NEW_SQL_EXECUTIONS $TOTAL_COUNT - -sleep 5 - -# Test6 - Downgrade after failed downgrade -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "DROP table pdpstatistics;" -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800 -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${PDPSTATISTICS2}" -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${IDX_TSIDX1}" -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -# +1 to run the file again -let TOTAL_COUNT=$I_UPGRADE_COUNT+1 -check_results $END_STATUS 'downgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $TOTAL_COUNT - -sleep 5 - -# Test7 - downgrade after failed upgrade -start_test -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "DROP table pdpstatistics;" -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -f 0800 -t 0900 -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${PDPSTATISTICS}" -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -# (files run before error * 2) + 1 to run the file again -let TOTAL_COUNT=3 -check_results $END_STATUS 'downgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $TOTAL_COUNT - -sleep 5 - -# Test 8 - Upgrade after failed upgrade -start_test -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "DROP table pdpstatistics;" -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -f 0800 -t 0900 -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${PDPSTATISTICS}" -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -t 0900 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -# +1 to run the file again -let TOTAL_COUNT=$I_UPGRADE_COUNT+1 -check_results $END_STATUS 'upgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $TOTAL_COUNT - -sleep 5 - -# Test 9 - Upgrade when pdpstatistics contains data -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800 -start_test -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${SQL1}" -sleep 1 -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${SQL2}" -sleep 1 -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -f 0800 -t 0900 -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${SQL3}" -sleep 1 -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${SQL4}" -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -# +1 to run the file again -let TOTAL_COUNT=$I_UPGRADE_COUNT -check_results $END_STATUS 'upgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $TOTAL_COUNT - -sleep 5 - -# Test 10 - downgrade to 0800 with records in pdpstatistics -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800 -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${SQL5}" -sleep 1 -run_sql "${SQL_USER}" "${SQL_PASSWORD}" "${SCHEMA}" "${SQL6}" -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'downgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $I_UPGRADE_COUNT - -sleep 5 - -# Test 11 - downgrade from 0800 -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0800 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'downgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $H_DOWNGRADE_COUNT - -sleep 5 - -# Test 12 - Full upgrade -start_test -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'upgrade' "0" "${END_VERSION}" $NEW_SQL_EXECUTIONS $TOTAL_SQLS_UPGRADE - -sleep 5 - -# Test 13 - Full downgrade -start_test -/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 1300 -t 0 -end_test -let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS -check_results $END_STATUS 'downgrade' "${START_VERSION}" "0" $NEW_SQL_EXECUTIONS $TOTAL_SQLS_DOWNGRADE - -# Install database -/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report - -echo -echo "-----------------------------------------------------------------------" -echo "Number of Tests: $TESTS, Tests Passed: $PASSED, Tests Failed: $FAILED" -echo "-----------------------------------------------------------------------" - -echo "End of test $(date +%F-%T)" - -nc -lk -p 6824 - -exit 0 diff --git a/policy-db-migrator/smoke-test/readme.md b/policy-db-migrator/smoke-test/readme.md index 5a00de12..c005f27a 100644 --- a/policy-db-migrator/smoke-test/readme.md +++ b/policy-db-migrator/smoke-test/readme.md @@ -1,7 +1,7 @@ # DB Migrator Smoke test CSIT docker compose for db-migrator can be used for this or any other docker compose. -- Check if `mariadb-tests.sh` and `postgres-test.sh` have the correct variables. +- Check if `*-tests.sh` have the correct variables. - Add any extras tests necessary for the test. - Change the `db_migrator_policy_init.sh` on db-migrator docker to the `*-test.sh` file. - Run docker compose diff --git a/policy-db-migrator/src/main/docker/Dockerfile b/policy-db-migrator/src/main/docker/Dockerfile index 4388081e..7e3746e0 100644 --- a/policy-db-migrator/src/main/docker/Dockerfile +++ b/policy-db-migrator/src/main/docker/Dockerfile @@ -1,8 +1,7 @@ #------------------------------------------------------------------------------- # Dockerfile # ============LICENSE_START======================================================= -# Copyright (C) 2021 Nordix Foundation. -# Modification Copyright 2021-2025 Nordix Foundation. +# Copyright (C) 2021-2025 OpenInfra Foundation Europe. 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. @@ -19,7 +18,7 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= #------------------------------------------------------------------------------- -FROM onap/policy-jre-alpine:4.1.0-SNAPSHOT +FROM onap/policy-jre-alpine:4.1.3-SNAPSHOT LABEL maintainer="Policy Team" LABEL org.opencontainers.image.title="Policy db-migrator" @@ -39,7 +38,6 @@ ENV POLICY_BIN /opt/app/policy/bin USER root RUN apk update && \ apk add --no-cache \ - mariadb-client \ postgresql-client \ net-tools \ netcat-openbsd \ @@ -50,7 +48,6 @@ RUN apk update && \ chown -R policy:policy $POLICY_ETC $POLICY_BIN COPY --chown=policy:policy ./env.sh $POLICY_PROFILE/ -COPY --chown=policy:policy ./db-migrator $POLICY_BIN/ COPY --chown=policy:policy ./db-migrator-pg $POLICY_BIN/ COPY --chown=policy:policy ./prepare_upgrade.sh $POLICY_BIN/ COPY --chown=policy:policy ./prepare_downgrade.sh $POLICY_BIN/ diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1601/upgrade/0100-automationcomposition.sql index a4263782..e4aae8fc 100644 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0100-automationcomposition.sql +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1601/upgrade/0100-automationcomposition.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -ALTER TABLE automationcomposition DROP lastMsg, DROP phase; + UPDATE automationcomposition SET substate=0 WHERE substate is NULL; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1601/upgrade/0200-automationcompositionelement.sql index ef6f3c79..ad9469cd 100644 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-automationcompositionelement.sql +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1601/upgrade/0200-automationcompositionelement.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,5 @@ * ============LICENSE_END========================================================= */ -ALTER TABLE automationcompositionelement DROP subState, DROP stage; + UPDATE automationcompositionelement SET subState=0 WHERE substate is NULL; + UPDATE automationcompositionelement SET stage=0 WHERE stage is NULL; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0220-sequence.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0100-message.sql index 6e3eb083..2bec3fb3 100644 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0220-sequence.sql +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0100-message.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation + * Copyright (C) 2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -DELETE from sequence; +DROP TABLE message; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0300-participantreplica.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0200-messagejob.sql index d5f7871b..e4b56251 100644 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0300-participantreplica.sql +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0200-messagejob.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -DROP TABLE participantreplica; +DROP TABLE messagejob; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0400-nodetemplatestate.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0300-messagejob_identificationId_index.sql index 7aee61ba..d54f5381 100644 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0400-nodetemplatestate.sql +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0300-messagejob_identificationId_index.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -DROP TABLE clampacm.nodetemplatestate;
\ No newline at end of file +DROP INDEX IF EXISTS messagejob_identificationId_index; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0300-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0100-message.sql index 2255d085..f13f3b8e 100644 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0300-automationcompositionelement.sql +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0100-message.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -DROP TABLE clampacm.automationcompositionelement;
\ No newline at end of file +CREATE TABLE IF NOT EXISTS message (messageId varchar(255) NOT NULL, identificationId varchar(255) NOT NULL, lastMsg timestamp without time zone NOT NULL DEFAULT now(), docMessage text NOT NULL, CONSTRAINT PK_MESSAGE PRIMARY KEY (messageId)); diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0200-messagejob.sql index 9ef6e9ca..ea6d7baa 100644 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0200-automationcompositiondefinition.sql +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0200-messagejob.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -DROP TABLE clampacm.automationcompositiondefinition;
\ No newline at end of file +CREATE TABLE IF NOT EXISTS messagejob (jobId varchar(255) NOT NULL, identificationId varchar(255) NOT NULL, jobStarted timestamp without time zone NOT NULL DEFAULT now(), CONSTRAINT PK_MESSAGE_JOB PRIMARY KEY (jobId)); diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0300-messagejob_identificationId_index.sql index f17216f9..4d512dc5 100644 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0100-automationcomposition.sql +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0300-messagejob_identificationId_index.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -DROP TABLE clampacm.automationcomposition;
\ No newline at end of file +CREATE UNIQUE INDEX messagejob_identificationId_index ON messagejob(identificationId); diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0500-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0500-participant.sql deleted file mode 100644 index 3f20fefb..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0500-participant.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE clampacm.participant;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0600-participantsupportedelements.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0600-participantsupportedelements.sql deleted file mode 100644 index e5ce88a6..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0600-participantsupportedelements.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE clampacm.participantsupportedacelements;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql deleted file mode 100644 index a699e565..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX ac_compositionId ON clampacm.automationcomposition; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0800-ac_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0800-ac_element_fk_index.sql deleted file mode 100644 index cadcea93..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0800-ac_element_fk_index.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX ac_element_fk ON clampacm.automationcompositionelement;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0900-dt_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0900-dt_element_fk_index.sql deleted file mode 100644 index 9a573697..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0900-dt_element_fk_index.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX dt_element_fk ON clampacm.nodetemplatestate;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1000-supported_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1000-supported_element_fk_index.sql deleted file mode 100644 index b5ecf01e..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1000-supported_element_fk_index.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX supported_element_fk ON clampacm.participantsupportedacelements;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1100-automationcompositionelement_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1100-automationcompositionelement_fk.sql deleted file mode 100644 index d37f4b11..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1100-automationcompositionelement_fk.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE clampacm.automationcompositionelement DROP FOREIGN KEY ac_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1200-nodetemplate_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1200-nodetemplate_fk.sql deleted file mode 100644 index c03da333..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1200-nodetemplate_fk.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE clampacm.nodetemplatestate DROP FOREIGN KEY dt_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1300-participantsupportedelements_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1300-participantsupportedelements_fk.sql deleted file mode 100644 index 5e61ef17..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1300-participantsupportedelements_fk.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE clampacm.participantsupportedacelements DROP FOREIGN KEY supported_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0100-automationcomposition.sql deleted file mode 100644 index edaf2f5b..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0100-automationcomposition.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE clampacm.automationcomposition (instanceId VARCHAR(255) NOT NULL, compositionId VARCHAR(255) NULL, compositionTargetId VARCHAR(255) NULL, deployState TINYINT DEFAULT NULL NULL, `description` VARCHAR(255) NULL, lockState TINYINT DEFAULT NULL NULL, name VARCHAR(255) NULL, restarting BIT NULL, stateChangeResult TINYINT DEFAULT NULL NULL, version VARCHAR(255) NULL, CONSTRAINT PK_AUTOMATIONCOMPOSITION PRIMARY KEY (instanceId));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0200-automationcompositiondefinition.sql deleted file mode 100644 index 22f70b0c..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0200-automationcompositiondefinition.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE clampacm.automationcompositiondefinition (compositionId VARCHAR(255) NOT NULL, name VARCHAR(255) NULL, restarting BIT NULL, serviceTemplate MEDIUMTEXT NULL, state TINYINT DEFAULT NULL NULL, stateChangeResult TINYINT DEFAULT NULL NULL, version VARCHAR(255) NULL, CONSTRAINT PK_AUTOMATIONCOMPOSITIONDEFINITION PRIMARY KEY (compositionId));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0300-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0300-automationcompositionelement.sql deleted file mode 100644 index 7bc18536..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0300-automationcompositionelement.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE clampacm.automationcompositionelement (elementId VARCHAR(255) NOT NULL, definition_name VARCHAR(255) NULL, definition_version VARCHAR(255) NULL, deployState TINYINT DEFAULT NULL NULL, `description` VARCHAR(255) NULL, instanceId VARCHAR(255) NULL, lockState TINYINT DEFAULT NULL NULL, message VARCHAR(255) NULL, operationalState VARCHAR(255) NULL, outProperties MEDIUMTEXT NULL, participantId VARCHAR(255) NULL, properties MEDIUMTEXT NULL, restarting BIT NULL, useState VARCHAR(255) NULL, CONSTRAINT PK_AUTOMATIONCOMPOSITIONELEMENT PRIMARY KEY (elementId));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0400-nodetemplatestate.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0400-nodetemplatestate.sql deleted file mode 100644 index 3ca27afc..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0400-nodetemplatestate.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE clampacm.nodetemplatestate (nodeTemplateStateId VARCHAR(255) NOT NULL, compositionId VARCHAR(255) NULL, message VARCHAR(255) NULL, nodeTemplate_name VARCHAR(255) NULL, nodeTemplate_version VARCHAR(255) NULL, outProperties MEDIUMTEXT NULL, participantId VARCHAR(255) NULL, restarting BIT NULL, state TINYINT DEFAULT NULL NULL, CONSTRAINT PK_NODETEMPLATESTATE PRIMARY KEY (nodeTemplateStateId));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0500-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0500-participant.sql deleted file mode 100644 index 0f5a673b..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0500-participant.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE clampacm.participant (participantId VARCHAR(255) NOT NULL, `description` VARCHAR(255) NULL, participantState TINYINT DEFAULT NULL NULL, CONSTRAINT PK_PARTICIPANT PRIMARY KEY (participantId));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0600-participantsupportedelements.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0600-participantsupportedelements.sql deleted file mode 100644 index cf0f4c23..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0600-participantsupportedelements.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE clampacm.participantsupportedacelements (id VARCHAR(255) NOT NULL, participantId VARCHAR(255) NULL, typeName VARCHAR(255) NULL, typeVersion VARCHAR(255) NULL, CONSTRAINT PK_PARTICIPANTSUPPORTEDACELEMENTS PRIMARY KEY (id));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0700-ac_compositionId_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0700-ac_compositionId_index.sql deleted file mode 100644 index e5785f9f..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0700-ac_compositionId_index.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX ac_compositionId ON clampacm.automationcomposition(compositionId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0800-ac_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0800-ac_element_fk_index.sql deleted file mode 100644 index 4c2c2bc2..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0800-ac_element_fk_index.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX ac_element_fk ON clampacm.automationcompositionelement(instanceId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0900-dt_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0900-dt_element_fk_index.sql deleted file mode 100644 index c67fdd62..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0900-dt_element_fk_index.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX dt_element_fk ON clampacm.nodetemplatestate(compositionId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1000-supported_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1000-supported_element_fk_index.sql deleted file mode 100644 index 2ecba6f1..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1000-supported_element_fk_index.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX supported_element_fk ON clampacm.participantsupportedacelements(participantId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1100-automationcompositionelement_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1100-automationcompositionelement_fk.sql deleted file mode 100644 index 6315271b..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1100-automationcompositionelement_fk.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE clampacm.automationcompositionelement ADD CONSTRAINT ac_element_fk FOREIGN KEY (instanceId) REFERENCES clampacm.automationcomposition (instanceId) ON UPDATE RESTRICT ON DELETE RESTRICT;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1200-nodetemplate_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1200-nodetemplate_fk.sql deleted file mode 100644 index 8581deb1..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1200-nodetemplate_fk.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE clampacm.nodetemplatestate ADD CONSTRAINT dt_element_fk FOREIGN KEY (compositionId) REFERENCES clampacm.automationcompositiondefinition (compositionId) ON UPDATE RESTRICT ON DELETE RESTRICT;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1300-participantsupportedelements_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1300-participantsupportedelements_fk.sql deleted file mode 100644 index 15f284a0..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1300-participantsupportedelements_fk.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE clampacm.participantsupportedacelements ADD CONSTRAINT supported_element_fk FOREIGN KEY (participantId) REFERENCES clampacm.participant (participantId) ON UPDATE RESTRICT ON DELETE RESTRICT;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0200-automationcompositiondefinition.sql deleted file mode 100644 index cac95376..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0200-automationcompositiondefinition.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE automationcompositiondefinition DROP lastMsg; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0400-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0400-participant.sql deleted file mode 100644 index 10ddaaf6..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0400-participant.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE participant DROP lastMsg; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0500-participant_replica_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0500-participant_replica_fk_index.sql deleted file mode 100644 index 61a5454c..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0500-participant_replica_fk_index.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX participant_replica_fk ON participantreplica; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0600-participant_replica_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0600-participant_replica_fk.sql deleted file mode 100644 index 6c5f30ee..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0600-participant_replica_fk.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE participantreplica DROP FOREIGN KEY participant_replica_fk; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.sql deleted file mode 100644 index 681b08a1..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE automationcomposition ADD lastMsg datetime(6) DEFAULT Now(), ADD phase TINYINT DEFAULT 0; -UPDATE automationcomposition SET restarting = NULL; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.sql deleted file mode 100644 index 5353558e..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE automationcompositiondefinition ADD lastMsg datetime(6) DEFAULT Now(); -UPDATE automationcompositiondefinition SET restarting = NULL; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0300-participantreplica.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0300-participantreplica.sql deleted file mode 100644 index cb5969d5..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0300-participantreplica.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE participantreplica (replicaId varchar(255) NOT NULL, lastMsg datetime(6) DEFAULT NULL, participantId varchar(255) DEFAULT NULL, participantState int(11) DEFAULT NULL, CONSTRAINT PK_PARTICIPANT_REPLICA PRIMARY KEY (replicaId)); diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0400-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0400-participant.sql deleted file mode 100644 index 042c454a..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0400-participant.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE participant ADD lastMsg datetime(6) DEFAULT Now(); diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0500-participant_replica_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0500-participant_replica_fk_index.sql deleted file mode 100644 index bc506e99..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0500-participant_replica_fk_index.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX participant_replica_fk ON participantreplica(participantId); diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0600-participant_replica_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0600-participant_replica_fk.sql deleted file mode 100644 index 3341d8e0..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0600-participant_replica_fk.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE participantreplica ADD CONSTRAINT participant_replica_fk FOREIGN KEY (participantId) REFERENCES participant (participantId) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0700-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0700-automationcompositionelement.sql deleted file mode 100644 index 03ab8a49..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0700-automationcompositionelement.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -UPDATE automationcompositionelement SET restarting = NULL; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0800-nodetemplatestate.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0800-nodetemplatestate.sql deleted file mode 100644 index 1114a597..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0800-nodetemplatestate.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -UPDATE nodetemplatestate SET restarting = NULL; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql deleted file mode 100644 index f0897cfe..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE automationcomposition DROP subState; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql deleted file mode 100644 index 7e0fd078..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE automationcomposition ADD subState TINYINT DEFAULT NULL NULL; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql deleted file mode 100644 index 06ce9a9d..00000000 --- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE automationcompositionelement ADD subState TINYINT DEFAULT NULL NULL, ADD stage TINYINT DEFAULT NULL NULL; diff --git a/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/downgrade/0100-ophistory_id_sequence.sql b/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/downgrade/0100-ophistory_id_sequence.sql deleted file mode 100644 index a1af817d..00000000 --- a/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/downgrade/0100-ophistory_id_sequence.sql +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* Copyright (C) 2024 Nordix Foundation. -* ================================================================================ -* 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========================================================= -*/ - -DROP TABLE IF EXISTS ophistory_id_sequence; diff --git a/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/downgrade/0110-operationshistory.sql b/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/downgrade/0110-operationshistory.sql deleted file mode 100644 index eb348002..00000000 --- a/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/downgrade/0110-operationshistory.sql +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* Copyright (C) 2024 Nordix Foundation. -* ================================================================================ -* 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========================================================= -*/ - -DROP TABLE IF EXISTS operationshistory; diff --git a/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/upgrade/0100-ophistory_id_sequence.sql b/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/upgrade/0100-ophistory_id_sequence.sql deleted file mode 100644 index cbb775b0..00000000 --- a/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/upgrade/0100-ophistory_id_sequence.sql +++ /dev/null @@ -1,28 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* Copyright (C) 2024 Nordix Foundation. -* ================================================================================ -* 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========================================================= -*/ - -CREATE TABLE ophistory_id_sequence -( - SEQ_NAME VARCHAR(50) NOT NULL, - SEQ_COUNT BIGINT NOT NULL, - PRIMARY KEY (SEQ_NAME) -); - --- Initialize the sequence -INSERT INTO ophistory_id_sequence (SEQ_NAME, SEQ_COUNT) -VALUES ('SEQ_GEN', 1); diff --git a/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/upgrade/0110-operationshistory.sql b/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/upgrade/0110-operationshistory.sql deleted file mode 100644 index d4e4aee2..00000000 --- a/policy-db-migrator/src/main/docker/config/operationshistory/sql/1600/upgrade/0110-operationshistory.sql +++ /dev/null @@ -1,36 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* Copyright (C) 2024 Nordix Foundation. -* ================================================================================ -* 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========================================================= -*/ - -CREATE TABLE operationshistory ( - id BIGINT NOT NULL, - closedLoopName VARCHAR(255), - requestId VARCHAR(50), - subrequestId VARCHAR(50), - actor VARCHAR(50), - operation VARCHAR(50), - target VARCHAR(50), - starttime DATETIME, - outcome VARCHAR(50), - message VARCHAR(255), - endtime DATETIME, - PRIMARY KEY (id) -); - -CREATE INDEX operationshistory_clreqid_index ON operationshistory (requestId, closedLoopName); -CREATE INDEX operationshistory_target_index ON operationshistory (target, operation, actor, endtime); - diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0100-jpapdpgroup_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0100-jpapdpgroup_properties.sql deleted file mode 100644 index 3210b9cd..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0100-jpapdpgroup_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpapdpgroup_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0110-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0110-jpapdpstatistics_enginestats.sql deleted file mode 100644 index 06c747cf..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0110-jpapdpstatistics_enginestats.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpapdpstatistics_enginestats`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0120-jpapdpsubgroup_policies.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0120-jpapdpsubgroup_policies.sql deleted file mode 100644 index 03e5e859..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0120-jpapdpsubgroup_policies.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpapdpsubgroup_policies`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0130-jpapdpsubgroup_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0130-jpapdpsubgroup_properties.sql deleted file mode 100644 index 7821a133..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0130-jpapdpsubgroup_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpapdpsubgroup_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql deleted file mode 100644 index 381bf55a..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpapdpsubgroup_supportedpolicytypes`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0150-jpatoscacapabilityassignment_attributes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0150-jpatoscacapabilityassignment_attributes.sql deleted file mode 100644 index dcc5c809..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0150-jpatoscacapabilityassignment_attributes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscacapabilityassignment_attributes`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0160-jpatoscacapabilityassignment_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0160-jpatoscacapabilityassignment_metadata.sql deleted file mode 100644 index c64fb42d..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0160-jpatoscacapabilityassignment_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscacapabilityassignment_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0170-jpatoscacapabilityassignment_occurrences.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0170-jpatoscacapabilityassignment_occurrences.sql deleted file mode 100644 index 60abbd66..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0170-jpatoscacapabilityassignment_occurrences.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscacapabilityassignment_occurrences`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0180-jpatoscacapabilityassignment_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0180-jpatoscacapabilityassignment_properties.sql deleted file mode 100644 index e9564712..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0180-jpatoscacapabilityassignment_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscacapabilityassignment_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0190-jpatoscacapabilitytype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0190-jpatoscacapabilitytype_metadata.sql deleted file mode 100644 index 9d271080..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0190-jpatoscacapabilitytype_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscacapabilitytype_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0200-jpatoscacapabilitytype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0200-jpatoscacapabilitytype_properties.sql deleted file mode 100644 index 288ba51b..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0200-jpatoscacapabilitytype_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscacapabilitytype_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0210-jpatoscadatatype_constraints.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0210-jpatoscadatatype_constraints.sql deleted file mode 100644 index 55f87939..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0210-jpatoscadatatype_constraints.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscadatatype_constraints`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0220-jpatoscadatatype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0220-jpatoscadatatype_metadata.sql deleted file mode 100644 index d20dbcdd..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0220-jpatoscadatatype_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscadatatype_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0230-jpatoscadatatype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0230-jpatoscadatatype_properties.sql deleted file mode 100644 index 68c9f2ee..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0230-jpatoscadatatype_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscadatatype_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0240-jpatoscanodetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0240-jpatoscanodetemplate_metadata.sql deleted file mode 100644 index 95f6796e..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0240-jpatoscanodetemplate_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscanodetemplate_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0250-jpatoscanodetemplate_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0250-jpatoscanodetemplate_properties.sql deleted file mode 100644 index ba2d5d87..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0250-jpatoscanodetemplate_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscanodetemplate_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0260-jpatoscanodetype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0260-jpatoscanodetype_metadata.sql deleted file mode 100644 index 706cbdce..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0260-jpatoscanodetype_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscanodetype_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0270-jpatoscanodetype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0270-jpatoscanodetype_properties.sql deleted file mode 100644 index 8102719b..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0270-jpatoscanodetype_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscanodetype_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0280-jpatoscapolicy_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0280-jpatoscapolicy_metadata.sql deleted file mode 100644 index 7879a58c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0280-jpatoscapolicy_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscapolicy_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0290-jpatoscapolicy_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0290-jpatoscapolicy_properties.sql deleted file mode 100644 index ac7f116c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0290-jpatoscapolicy_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscapolicy_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0300-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0300-jpatoscapolicy_targets.sql deleted file mode 100644 index 702def86..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0300-jpatoscapolicy_targets.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscapolicy_targets`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0310-jpatoscapolicytype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0310-jpatoscapolicytype_metadata.sql deleted file mode 100644 index cd7d7163..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0310-jpatoscapolicytype_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscapolicytype_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0320-jpatoscapolicytype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0320-jpatoscapolicytype_properties.sql deleted file mode 100644 index 4d4ec1dd..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0320-jpatoscapolicytype_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscapolicytype_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0330-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0330-jpatoscapolicytype_targets.sql deleted file mode 100644 index 9e80de71..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0330-jpatoscapolicytype_targets.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscapolicytype_targets`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0340-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0340-jpatoscapolicytype_triggers.sql deleted file mode 100644 index d260c5b5..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0340-jpatoscapolicytype_triggers.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscapolicytype_triggers`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0350-jpatoscaproperty_constraints.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0350-jpatoscaproperty_constraints.sql deleted file mode 100644 index 5c369968..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0350-jpatoscaproperty_constraints.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscaproperty_constraints`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0360-jpatoscaproperty_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0360-jpatoscaproperty_metadata.sql deleted file mode 100644 index 565a77a4..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0360-jpatoscaproperty_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscaproperty_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0370-jpatoscarelationshiptype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0370-jpatoscarelationshiptype_metadata.sql deleted file mode 100644 index b3e936c5..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0370-jpatoscarelationshiptype_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscarelationshiptype_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0380-jpatoscarelationshiptype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0380-jpatoscarelationshiptype_properties.sql deleted file mode 100644 index f015d5fd..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0380-jpatoscarelationshiptype_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscarelationshiptype_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0390-jpatoscarequirement_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0390-jpatoscarequirement_metadata.sql deleted file mode 100644 index de18e406..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0390-jpatoscarequirement_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscarequirement_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0400-jpatoscarequirement_occurrences.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0400-jpatoscarequirement_occurrences.sql deleted file mode 100644 index 3941567f..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0400-jpatoscarequirement_occurrences.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscarequirement_occurrences`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0410-jpatoscarequirement_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0410-jpatoscarequirement_properties.sql deleted file mode 100644 index 3fc645c6..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0410-jpatoscarequirement_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscarequirement_properties`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0420-jpatoscaservicetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0420-jpatoscaservicetemplate_metadata.sql deleted file mode 100644 index 554b4097..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0420-jpatoscaservicetemplate_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscaservicetemplate_metadata`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0430-jpatoscatopologytemplate_inputs.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0430-jpatoscatopologytemplate_inputs.sql deleted file mode 100644 index 134a9bb5..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0430-jpatoscatopologytemplate_inputs.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpatoscatopologytemplate_inputs`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0440-pdpgroup_pdpsubgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0440-pdpgroup_pdpsubgroup.sql deleted file mode 100644 index 65a35d40..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0440-pdpgroup_pdpsubgroup.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `pdpgroup_pdpsubgroup`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0450-pdpgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0450-pdpgroup.sql deleted file mode 100644 index 9409b0eb..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0450-pdpgroup.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `pdpgroup`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0460-pdppolicystatus.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0460-pdppolicystatus.sql deleted file mode 100644 index 44ad18c4..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0460-pdppolicystatus.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `pdppolicystatus`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0470-pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0470-pdp.sql deleted file mode 100644 index 83024b7d..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0470-pdp.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `pdp`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0480-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0480-pdpstatistics.sql deleted file mode 100644 index ba52071c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0480-pdpstatistics.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `pdpstatistics`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0490-pdpsubgroup_pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0490-pdpsubgroup_pdp.sql deleted file mode 100644 index 2812dc90..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0490-pdpsubgroup_pdp.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `pdpsubgroup_pdp`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0500-pdpsubgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0500-pdpsubgroup.sql deleted file mode 100644 index 8b30965a..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0500-pdpsubgroup.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `pdpsubgroup`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0510-toscacapabilityassignment.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0510-toscacapabilityassignment.sql deleted file mode 100644 index 47e55378..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0510-toscacapabilityassignment.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscacapabilityassignment`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0520-toscacapabilityassignments.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0520-toscacapabilityassignments.sql deleted file mode 100644 index b3c09cb7..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0520-toscacapabilityassignments.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscacapabilityassignments`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql deleted file mode 100644 index 9081377f..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscacapabilityassignments_toscacapabilityassignment`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0540-toscacapabilitytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0540-toscacapabilitytype.sql deleted file mode 100644 index e51f5a7c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0540-toscacapabilitytype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscacapabilitytype`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0550-toscacapabilitytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0550-toscacapabilitytypes.sql deleted file mode 100644 index 6ca7e239..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0550-toscacapabilitytypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscacapabilitytypes`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql deleted file mode 100644 index 27f2ad2e..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscacapabilitytypes_toscacapabilitytype`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0570-toscadatatype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0570-toscadatatype.sql deleted file mode 100644 index 71fcdedf..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0570-toscadatatype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscadatatype`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0580-toscadatatypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0580-toscadatatypes.sql deleted file mode 100644 index 1ca4e093..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0580-toscadatatypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscadatatypes`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0590-toscadatatypes_toscadatatype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0590-toscadatatypes_toscadatatype.sql deleted file mode 100644 index d012cc18..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0590-toscadatatypes_toscadatatype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscadatatypes_toscadatatype`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0600-toscanodetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0600-toscanodetemplate.sql deleted file mode 100644 index f02bd9a4..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0600-toscanodetemplate.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscanodetemplate`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0610-toscanodetemplates.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0610-toscanodetemplates.sql deleted file mode 100644 index 1d0c001b..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0610-toscanodetemplates.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscanodetemplates`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0620-toscanodetemplates_toscanodetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0620-toscanodetemplates_toscanodetemplate.sql deleted file mode 100644 index a1d561f1..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0620-toscanodetemplates_toscanodetemplate.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscanodetemplates_toscanodetemplate`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0630-toscanodetype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0630-toscanodetype.sql deleted file mode 100644 index 00e7fb0c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0630-toscanodetype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscanodetype`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0640-toscanodetypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0640-toscanodetypes.sql deleted file mode 100644 index 745ae524..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0640-toscanodetypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscanodetypes`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0650-toscanodetypes_toscanodetype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0650-toscanodetypes_toscanodetype.sql deleted file mode 100644 index c57acbd0..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0650-toscanodetypes_toscanodetype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscanodetypes_toscanodetype`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0660-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0660-toscaparameter.sql deleted file mode 100644 index fc09aa72..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0660-toscaparameter.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscaparameter`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0670-toscapolicies.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0670-toscapolicies.sql deleted file mode 100644 index e5838d8d..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0670-toscapolicies.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscapolicies`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0680-toscapolicies_toscapolicy.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0680-toscapolicies_toscapolicy.sql deleted file mode 100644 index badb1685..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0680-toscapolicies_toscapolicy.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscapolicies_toscapolicy`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0690-toscapolicy.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0690-toscapolicy.sql deleted file mode 100644 index 0dcf3913..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0690-toscapolicy.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscapolicy`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0700-toscapolicytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0700-toscapolicytype.sql deleted file mode 100644 index a13b9015..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0700-toscapolicytype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscapolicytype`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0710-toscapolicytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0710-toscapolicytypes.sql deleted file mode 100644 index 9967dc60..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0710-toscapolicytypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscapolicytypes`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0720-toscapolicytypes_toscapolicytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0720-toscapolicytypes_toscapolicytype.sql deleted file mode 100644 index b17c4658..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0720-toscapolicytypes_toscapolicytype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscapolicytypes_toscapolicytype`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0730-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0730-toscaproperty.sql deleted file mode 100644 index 3673bb38..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0730-toscaproperty.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscaproperty`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0740-toscarelationshiptype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0740-toscarelationshiptype.sql deleted file mode 100644 index cf2d4ee0..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0740-toscarelationshiptype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscarelationshiptype`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0750-toscarelationshiptypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0750-toscarelationshiptypes.sql deleted file mode 100644 index 9d91d513..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0750-toscarelationshiptypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscarelationshiptypes`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql deleted file mode 100644 index 7a1ed97a..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscarelationshiptypes_toscarelationshiptype`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0770-toscarequirement.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0770-toscarequirement.sql deleted file mode 100644 index 27dea650..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0770-toscarequirement.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscarequirement`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0780-toscarequirements.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0780-toscarequirements.sql deleted file mode 100644 index 5947ee02..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0780-toscarequirements.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscarequirements`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0790-toscarequirements_toscarequirement.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0790-toscarequirements_toscarequirement.sql deleted file mode 100644 index 855a39cc..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0790-toscarequirements_toscarequirement.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscarequirements_toscarequirement`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0800-toscaservicetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0800-toscaservicetemplate.sql deleted file mode 100644 index 0ff16713..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0800-toscaservicetemplate.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscaservicetemplate`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0810-toscatopologytemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0810-toscatopologytemplate.sql deleted file mode 100644 index d2807853..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0810-toscatopologytemplate.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscatopologytemplate`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0820-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0820-toscatrigger.sql deleted file mode 100644 index 8282e52b..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0820-toscatrigger.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `toscatrigger`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql deleted file mode 100644 index d4310729..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql +++ /dev/null @@ -1,20 +0,0 @@ - /* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX FK_ToscaNodeTemplate_capabilitiesName ON toscanodetemplate; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql deleted file mode 100644 index b6bf0c08..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX FK_ToscaNodeTemplate_requirementsName ON toscanodetemplate; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0850-FK_ToscaNodeType_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0850-FK_ToscaNodeType_requirementsName.sql deleted file mode 100644 index 2d0f6d41..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0850-FK_ToscaNodeType_requirementsName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX FK_ToscaNodeType_requirementsName ON toscanodetype; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql deleted file mode 100644 index 860b1703..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX FK_ToscaServiceTemplate_capabilityTypesName ON toscaservicetemplate; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql deleted file mode 100644 index a34639cf..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX FK_ToscaServiceTemplate_dataTypesName ON toscaservicetemplate; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql deleted file mode 100644 index 729fb460..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX FK_ToscaServiceTemplate_nodeTypesName ON toscaservicetemplate; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql deleted file mode 100644 index 14da31be..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX FK_ToscaServiceTemplate_policyTypesName ON toscaservicetemplate; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql deleted file mode 100644 index 4bba2ba2..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX FK_ToscaServiceTemplate_relationshipTypesName ON toscaservicetemplate; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql deleted file mode 100644 index b50cb73a..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX FK_ToscaTopologyTemplate_nodeTemplatesName ON toscatopologytemplate; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0920-FK_ToscaTopologyTemplate_policyName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0920-FK_ToscaTopologyTemplate_policyName.sql deleted file mode 100644 index 528610a5..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0920-FK_ToscaTopologyTemplate_policyName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX FK_ToscaTopologyTemplate_policyName ON toscatopologytemplate; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0940-PdpPolicyStatus_PdpGroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0940-PdpPolicyStatus_PdpGroup.sql deleted file mode 100644 index 3ab3ffee..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0940-PdpPolicyStatus_PdpGroup.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX PdpPolicyStatus_PdpGroup ON pdppolicystatus; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql deleted file mode 100644 index 843a30b2..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX TscaServiceTemplatetopologyTemplateParentLocalName ON toscaservicetemplate; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0960-FK_ToscaNodeTemplate_capabilitiesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0960-FK_ToscaNodeTemplate_capabilitiesName.sql deleted file mode 100644 index fa180f20..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0960-FK_ToscaNodeTemplate_capabilitiesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscanodetemplate DROP CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0970-FK_ToscaNodeTemplate_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0970-FK_ToscaNodeTemplate_requirementsName.sql deleted file mode 100644 index 7677f001..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0970-FK_ToscaNodeTemplate_requirementsName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscanodetemplate DROP CONSTRAINT FK_ToscaNodeTemplate_requirementsName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0980-FK_ToscaNodeType_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0980-FK_ToscaNodeType_requirementsName.sql deleted file mode 100644 index 29e7ba60..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0980-FK_ToscaNodeType_requirementsName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscanodetype DROP CONSTRAINT FK_ToscaNodeType_requirementsName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0990-FK_ToscaServiceTemplate_capabilityTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0990-FK_ToscaServiceTemplate_capabilityTypesName.sql deleted file mode 100644 index 4a13c709..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0990-FK_ToscaServiceTemplate_capabilityTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate DROP CONSTRAINT FK_ToscaServiceTemplate_capabilityTypesName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1000-FK_ToscaServiceTemplate_dataTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1000-FK_ToscaServiceTemplate_dataTypesName.sql deleted file mode 100644 index 0f5f67a2..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1000-FK_ToscaServiceTemplate_dataTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate DROP CONSTRAINT FK_ToscaServiceTemplate_dataTypesName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1010-FK_ToscaServiceTemplate_nodeTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1010-FK_ToscaServiceTemplate_nodeTypesName.sql deleted file mode 100644 index 49ab3064..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1010-FK_ToscaServiceTemplate_nodeTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate DROP CONSTRAINT FK_ToscaServiceTemplate_nodeTypesName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1020-FK_ToscaServiceTemplate_policyTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1020-FK_ToscaServiceTemplate_policyTypesName.sql deleted file mode 100644 index 63a233c6..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1020-FK_ToscaServiceTemplate_policyTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate DROP CONSTRAINT FK_ToscaServiceTemplate_policyTypesName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1030-FK_ToscaServiceTemplate_relationshipTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1030-FK_ToscaServiceTemplate_relationshipTypesName.sql deleted file mode 100644 index eca7ac66..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1030-FK_ToscaServiceTemplate_relationshipTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate DROP CONSTRAINT FK_ToscaServiceTemplate_relationshipTypesName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql deleted file mode 100644 index 427435de..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscatopologytemplate DROP CONSTRAINT FK_ToscaTopologyTemplate_nodeTemplatesName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1050-FK_ToscaTopologyTemplate_policyName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1050-FK_ToscaTopologyTemplate_policyName.sql deleted file mode 100644 index 8d9627cc..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1050-FK_ToscaTopologyTemplate_policyName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscatopologytemplate DROP CONSTRAINT FK_ToscaTopologyTemplate_policyName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql deleted file mode 100644 index 8b9f863b..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate DROP CONSTRAINT TscaServiceTemplatetopologyTemplateParentLocalName; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0100-jpapdpgroup_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0100-jpapdpgroup_properties.sql deleted file mode 100644 index d503999a..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0100-jpapdpgroup_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpapdpgroup_properties (name VARCHAR(120) DEFAULT NULL, version VARCHAR(20) DEFAULT NULL, PROPERTIES VARCHAR(255) DEFAULT NULL, PROPERTIES_KEY VARCHAR(255) DEFAULT NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0110-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0110-jpapdpstatistics_enginestats.sql deleted file mode 100644 index 0adad152..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0110-jpapdpstatistics_enginestats.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpapdpstatistics_enginestats (AVERAGEEXECUTIONTIME DOUBLE DEFAULT NULL, ENGINEID VARCHAR(255) DEFAULT NULL, ENGINETIMESTAMP BIGINT DEFAULT NULL, ENGINEWORKERSTATE INT DEFAULT NULL, EVENTCOUNT BIGINT DEFAULT NULL, LASTENTERTIME BIGINT DEFAULT NULL, LASTEXECUTIONTIME BIGINT DEFAULT NULL, LASTSTART BIGINT DEFAULT NULL, UPTIME BIGINT DEFAULT NULL, timeStamp datetime DEFAULT NULL, name VARCHAR(120) DEFAULT NULL, version VARCHAR(20) DEFAULT NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0120-jpapdpsubgroup_policies.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0120-jpapdpsubgroup_policies.sql deleted file mode 100644 index 8258cc49..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0120-jpapdpsubgroup_policies.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpapdpsubgroup_policies (name VARCHAR(120) DEFAULT NULL, version VARCHAR(20) DEFAULT NULL, parentLocalName VARCHAR(120) DEFAULT NULL, localName VARCHAR(120) DEFAULT NULL, parentKeyVersion VARCHAR(15) DEFAULT NULL, parentKeyName VARCHAR(120) DEFAULT NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0130-jpapdpsubgroup_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0130-jpapdpsubgroup_properties.sql deleted file mode 100644 index 2c3f74c3..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0130-jpapdpsubgroup_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpapdpsubgroup_properties (parentLocalName VARCHAR(120) DEFAULT NULL, localName VARCHAR(120) DEFAULT NULL, parentKeyVersion VARCHAR(15) DEFAULT NULL, parentKeyName VARCHAR(120) DEFAULT NULL, PROPERTIES VARCHAR(255) DEFAULT NULL, PROPERTIES_KEY VARCHAR(255) DEFAULT NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql deleted file mode 100644 index 40e29421..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpapdpsubgroup_supportedpolicytypes (name VARCHAR(120) DEFAULT NULL, version VARCHAR(20) DEFAULT NULL, parentLocalName VARCHAR(120) DEFAULT NULL, localName VARCHAR(120) DEFAULT NULL, parentKeyVersion VARCHAR(15) DEFAULT NULL, parentKeyName VARCHAR(120) DEFAULT NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.sql deleted file mode 100644 index 932c2d01..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscacapabilityassignment_attributes (name VARCHAR(120) DEFAULT NULL, version VARCHAR(20) DEFAULT NULL, ATTRIBUTES LONGTEXT DEFAULT NULL, ATTRIBUTES_KEY VARCHAR(255) DEFAULT NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.sql deleted file mode 100644 index b7e22389..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscacapabilityassignment_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.sql deleted file mode 100644 index b3851a41..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscacapabilityassignment_occurrences (name VARCHAR(120) NULL, version VARCHAR(20) NULL, OCCURRENCES INT DEFAULT NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0180-jpatoscacapabilityassignment_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0180-jpatoscacapabilityassignment_properties.sql deleted file mode 100644 index 4abf7708..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0180-jpatoscacapabilityassignment_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscacapabilityassignment_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0190-jpatoscacapabilitytype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0190-jpatoscacapabilitytype_metadata.sql deleted file mode 100644 index 48dac4a0..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0190-jpatoscacapabilitytype_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscacapabilitytype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0200-jpatoscacapabilitytype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0200-jpatoscacapabilitytype_properties.sql deleted file mode 100644 index 7ef9dd73..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0200-jpatoscacapabilitytype_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscacapabilitytype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL, PROPERTIES_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0210-jpatoscadatatype_constraints.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0210-jpatoscadatatype_constraints.sql deleted file mode 100644 index 7b541244..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0210-jpatoscadatatype_constraints.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscadatatype_constraints (name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINTS VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0220-jpatoscadatatype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0220-jpatoscadatatype_metadata.sql deleted file mode 100644 index 578c0411..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0220-jpatoscadatatype_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscadatatype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0230-jpatoscadatatype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0230-jpatoscadatatype_properties.sql deleted file mode 100644 index 77d5049c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0230-jpatoscadatatype_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscadatatype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL, PROPERTIES_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0240-jpatoscanodetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0240-jpatoscanodetemplate_metadata.sql deleted file mode 100644 index f1bb5dfd..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0240-jpatoscanodetemplate_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscanodetemplate_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0250-jpatoscanodetemplate_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0250-jpatoscanodetemplate_properties.sql deleted file mode 100644 index 36b297e6..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0250-jpatoscanodetemplate_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscanodetemplate_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0260-jpatoscanodetype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0260-jpatoscanodetype_metadata.sql deleted file mode 100644 index 16741e3c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0260-jpatoscanodetype_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscanodetype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0270-jpatoscanodetype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0270-jpatoscanodetype_properties.sql deleted file mode 100644 index 17d71144..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0270-jpatoscanodetype_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscanodetype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL, PROPERTIES_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0280-jpatoscapolicy_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0280-jpatoscapolicy_metadata.sql deleted file mode 100644 index 8b3cdb78..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0280-jpatoscapolicy_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscapolicy_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0290-jpatoscapolicy_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0290-jpatoscapolicy_properties.sql deleted file mode 100644 index 880cfbe2..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0290-jpatoscapolicy_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscapolicy_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0300-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0300-jpatoscapolicy_targets.sql deleted file mode 100644 index 0d910081..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0300-jpatoscapolicy_targets.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscapolicy_targets (name VARCHAR(120) NULL, version VARCHAR(20) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0310-jpatoscapolicytype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0310-jpatoscapolicytype_metadata.sql deleted file mode 100644 index 221baf9b..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0310-jpatoscapolicytype_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscapolicytype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0320-jpatoscapolicytype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0320-jpatoscapolicytype_properties.sql deleted file mode 100644 index 2c6a7f7a..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0320-jpatoscapolicytype_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscapolicytype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL, PROPERTIES_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0330-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0330-jpatoscapolicytype_targets.sql deleted file mode 100644 index 65b37002..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0330-jpatoscapolicytype_targets.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscapolicytype_targets (name VARCHAR(120) NULL, version VARCHAR(20) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0340-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0340-jpatoscapolicytype_triggers.sql deleted file mode 100644 index 61ea0dea..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0340-jpatoscapolicytype_triggers.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscapolicytype_triggers (name VARCHAR(120) NULL, version VARCHAR(20) NULL, TRIGGERS VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0350-jpatoscaproperty_constraints.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0350-jpatoscaproperty_constraints.sql deleted file mode 100644 index 942c594c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0350-jpatoscaproperty_constraints.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscaproperty_constraints (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, CONSTRAINTS VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0360-jpatoscaproperty_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0360-jpatoscaproperty_metadata.sql deleted file mode 100644 index 96b519c3..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0360-jpatoscaproperty_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscaproperty_metadata (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0370-jpatoscarelationshiptype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0370-jpatoscarelationshiptype_metadata.sql deleted file mode 100644 index 2fd1ad64..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0370-jpatoscarelationshiptype_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscarelationshiptype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0380-jpatoscarelationshiptype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0380-jpatoscarelationshiptype_properties.sql deleted file mode 100644 index 660b9bc0..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0380-jpatoscarelationshiptype_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscarelationshiptype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL, PROPERTIES_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0390-jpatoscarequirement_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0390-jpatoscarequirement_metadata.sql deleted file mode 100644 index 272227bd..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0390-jpatoscarequirement_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscarequirement_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0400-jpatoscarequirement_occurrences.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0400-jpatoscarequirement_occurrences.sql deleted file mode 100644 index 8677964b..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0400-jpatoscarequirement_occurrences.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscarequirement_occurrences (name VARCHAR(120) NULL, version VARCHAR(20) NULL, OCCURRENCES INT DEFAULT NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0410-jpatoscarequirement_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0410-jpatoscarequirement_properties.sql deleted file mode 100644 index 173fb4d0..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0410-jpatoscarequirement_properties.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscarequirement_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0420-jpatoscaservicetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0420-jpatoscaservicetemplate_metadata.sql deleted file mode 100644 index 4267887d..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0420-jpatoscaservicetemplate_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscaservicetemplate_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0430-jpatoscatopologytemplate_inputs.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0430-jpatoscatopologytemplate_inputs.sql deleted file mode 100644 index d5f6e7cc..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0430-jpatoscatopologytemplate_inputs.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscatopologytemplate_inputs (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, INPUTS LONGBLOB DEFAULT NULL, INPUTS_KEY VARCHAR(255) NULL); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0440-pdpgroup_pdpsubgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0440-pdpgroup_pdpsubgroup.sql deleted file mode 100644 index d07479c9..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0440-pdpgroup_pdpsubgroup.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS pdpgroup_pdpsubgroup (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, PRIMARY KEY PK_PDPGROUP_PDPSUBGROUP (name, version, parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0450-pdpgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0450-pdpgroup.sql deleted file mode 100644 index 369f9a0d..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0450-pdpgroup.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS pdpgroup (`DESCRIPTION` VARCHAR(255) NULL, PDPGROUPSTATE INT DEFAULT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_PDPGROUP (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0460-pdppolicystatus.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0460-pdppolicystatus.sql deleted file mode 100644 index c6541e97..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0460-pdppolicystatus.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS pdppolicystatus (DEPLOY BOOLEAN DEFAULT 0, PDPGROUP VARCHAR(255) DEFAULT NULL, PDPTYPE VARCHAR(255) DEFAULT NULL, STATE INT DEFAULT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) DEFAULT NULL, version VARCHAR(20) DEFAULT NULL, PRIMARY KEY PK_PDPPOLICYSTATUS (parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0470-pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0470-pdp.sql deleted file mode 100644 index cb4a2911..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0470-pdp.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS pdp (HEALTHY INT DEFAULT NULL, MESSAGE VARCHAR(255) DEFAULT NULL, PDPSTATE INT DEFAULT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, PRIMARY KEY PK_PDP (parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0480-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0480-pdpstatistics.sql deleted file mode 100644 index 60111fe8..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0480-pdpstatistics.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS pdpstatistics (PDPGROUPNAME VARCHAR(120) NULL, PDPSUBGROUPNAME VARCHAR(120) NULL, POLICYDEPLOYCOUNT BIGINT DEFAULT NULL, POLICYDEPLOYFAILCOUNT BIGINT DEFAULT NULL, POLICYDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL, POLICYEXECUTEDCOUNT BIGINT DEFAULT NULL, POLICYEXECUTEDFAILCOUNT BIGINT DEFAULT NULL, POLICYEXECUTEDSUCCESSCOUNT BIGINT DEFAULT NULL, timeStamp datetime NOT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_PDPSTATISTICS (timeStamp, name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0490-pdpsubgroup_pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0490-pdpsubgroup_pdp.sql deleted file mode 100644 index f5ee1640..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0490-pdpsubgroup_pdp.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS pdpsubgroup_pdp (pdpParentKeyName VARCHAR(120) NOT NULL, pdpParentKeyVersion VARCHAR(15) NOT NULL, pdpParentLocalName VARCHAR(120) NOT NULL, pdpLocalName VARCHAR(120) NOT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, PRIMARY KEY PK_PDPSUBGROUP_PDP (pdpParentKeyName, pdpParentKeyVersion, pdpParentLocalName, pdpLocalName, parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0500-pdpsubgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0500-pdpsubgroup.sql deleted file mode 100644 index a762c86c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0500-pdpsubgroup.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS pdpsubgroup (CURRENTINSTANCECOUNT INT DEFAULT NULL, DESIREDINSTANCECOUNT INT DEFAULT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, PRIMARY KEY PK_PDPSUBGROUP (parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0510-toscacapabilityassignment.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0510-toscacapabilityassignment.sql deleted file mode 100644 index 3bc2c2ea..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0510-toscacapabilityassignment.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscacapabilityassignment (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, PRIMARY KEY PK_TOSCACAPABILITYASSIGNMENT(name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0520-toscacapabilityassignments.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0520-toscacapabilityassignments.sql deleted file mode 100644 index 963cbb7c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0520-toscacapabilityassignments.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscacapabilityassignments (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCACAPABILITYASSIGNMENTS (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql deleted file mode 100644 index c8965d78..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscacapabilityassignments_toscacapabilityassignment (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCACAPABILITYASSIGNMENTS_TOSCACAPABILITYASSIGNMENT (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0540-toscacapabilitytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0540-toscacapabilitytype.sql deleted file mode 100644 index 26f7fe42..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0540-toscacapabilitytype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscacapabilitytype (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCACAPABILITYTYPE (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0550-toscacapabilitytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0550-toscacapabilitytypes.sql deleted file mode 100644 index be906e8f..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0550-toscacapabilitytypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscacapabilitytypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCACAPABILITYTYPES (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql deleted file mode 100644 index bef95709..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscacapabilitytypes_toscacapabilitytype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCACAPABILITYTYPES_TOSCACAPABILITYTYPE (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0570-toscadatatype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0570-toscadatatype.sql deleted file mode 100644 index 31237a30..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0570-toscadatatype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscadatatype (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCADATATYPE (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0580-toscadatatypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0580-toscadatatypes.sql deleted file mode 100644 index b18b5b0a..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0580-toscadatatypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscadatatypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCADATATYPES (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0590-toscadatatypes_toscadatatype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0590-toscadatatypes_toscadatatype.sql deleted file mode 100644 index b45828e5..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0590-toscadatatypes_toscadatatype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscadatatypes_toscadatatype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCADATATYPES_TOSCADATATYPE (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0600-toscanodetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0600-toscanodetemplate.sql deleted file mode 100644 index 6b8d3f5e..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0600-toscanodetemplate.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscanodetemplate (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, capabilitiesName VARCHAR(120) NULL, capabilitiesVersion VARCHAR(20) NULL, requirementsVersion VARCHAR(20) NULL, requirementsName VARCHAR(120) NULL, PRIMARY KEY PK_TOSCANODETEMPLATE (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0610-toscanodetemplates.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0610-toscanodetemplates.sql deleted file mode 100644 index e813ba8d..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0610-toscanodetemplates.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscanodetemplates (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCANODETEMPLATES (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.sql deleted file mode 100644 index 6ed201ca..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscanodetemplates_toscanodetemplate (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCANODETEMPLATES_TOSCANODETEMPLATE (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0630-toscanodetype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0630-toscanodetype.sql deleted file mode 100644 index 6c168704..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0630-toscanodetype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscanodetype (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, requirementsVersion VARCHAR(20) NULL, requirementsName VARCHAR(120) NULL, PRIMARY KEY PK_TOSCANODETYPE (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0640-toscanodetypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0640-toscanodetypes.sql deleted file mode 100644 index 5aed2a32..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0640-toscanodetypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscanodetypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCANODETYPES (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0650-toscanodetypes_toscanodetype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0650-toscanodetypes_toscanodetype.sql deleted file mode 100644 index 4139e179..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0650-toscanodetypes_toscanodetype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscanodetypes_toscanodetype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCANODETYPES_TOSCANODETYPE (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0660-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0660-toscaparameter.sql deleted file mode 100644 index de6380e8..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0660-toscaparameter.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscaparameter (VALUE VARCHAR(255) NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCAPARAMETER (parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0670-toscapolicies.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0670-toscapolicies.sql deleted file mode 100644 index dcb9bdc9..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0670-toscapolicies.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscapolicies (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCAPOLICIES (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0680-toscapolicies_toscapolicy.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0680-toscapolicies_toscapolicy.sql deleted file mode 100644 index 46ff20e9..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0680-toscapolicies_toscapolicy.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscapolicies_toscapolicy (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCAPOLICIES_TOSCAPOLICY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0690-toscapolicy.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0690-toscapolicy.sql deleted file mode 100644 index ec7dd6e3..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0690-toscapolicy.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscapolicy (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, PRIMARY KEY PK_TOSCAPOLICY (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0700-toscapolicytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0700-toscapolicytype.sql deleted file mode 100644 index d54eeb66..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0700-toscapolicytype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscapolicytype (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCAPOLICYTYPE (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0710-toscapolicytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0710-toscapolicytypes.sql deleted file mode 100644 index e9edf3f6..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0710-toscapolicytypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscapolicytypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCAPOLICYTYPES (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0720-toscapolicytypes_toscapolicytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0720-toscapolicytypes_toscapolicytype.sql deleted file mode 100644 index 9a1a6d15..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0720-toscapolicytypes_toscapolicytype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscapolicytypes_toscapolicytype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCAPOLICYTYPES_TOSCAPOLICYTYPE (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0730-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0730-toscaproperty.sql deleted file mode 100644 index 9ea23427..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0730-toscaproperty.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscaproperty (DEFAULTVALUE VARCHAR(255) DEFAULT NULL, `DESCRIPTION` VARCHAR(255) DEFAULT NULL, ENTRYSCHEMA LONGBLOB DEFAULT NULL, REQUIRED BOOLEAN DEFAULT 0, STATUS INT DEFAULT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) DEFAULT NULL, version VARCHAR(20) DEFAULT NULL, PRIMARY KEY PK_TOSCAPROPERTY (parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0740-toscarelationshiptype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0740-toscarelationshiptype.sql deleted file mode 100644 index b70015e4..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0740-toscarelationshiptype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscarelationshiptype (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCARELATIONSHIPTYPE (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0750-toscarelationshiptypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0750-toscarelationshiptypes.sql deleted file mode 100644 index 37e46fb3..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0750-toscarelationshiptypes.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscarelationshiptypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCARELATIONSHIPTYPES (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql deleted file mode 100644 index 174513d8..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscarelationshiptypes_toscarelationshiptype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCARELATIONSHIPTYPES_TOSCARELATIONSHIPTYPE (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0770-toscarequirement.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0770-toscarequirement.sql deleted file mode 100644 index e87703b7..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0770-toscarequirement.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscarequirement (CAPABILITY VARCHAR(255) NULL, `DESCRIPTION` VARCHAR(255) NULL, NODE VARCHAR(255) NULL, RELATIONSHIP VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, PRIMARY KEY PK_TOSCAREQUIREMENT (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0780-toscarequirements.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0780-toscarequirements.sql deleted file mode 100644 index 7ad0bda6..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0780-toscarequirements.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscarequirements (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_TOSCAREQUIREMENTS (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0790-toscarequirements_toscarequirement.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0790-toscarequirements_toscarequirement.sql deleted file mode 100644 index 68a74a96..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0790-toscarequirements_toscarequirement.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscarequirements_toscarequirement (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCAREQUIREMENTS_TOSCAREQUIREMENT (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0800-toscaservicetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0800-toscaservicetemplate.sql deleted file mode 100644 index 4eb31d34..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0800-toscaservicetemplate.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscaservicetemplate (`DESCRIPTION` VARCHAR(255) NULL, TOSCADEFINITIONSVERSION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, capabilityTypesVersion VARCHAR(20) NULL, capabilityTypesName VARCHAR(120) NULL, dataTypesName VARCHAR(120) NULL, dataTypesVersion VARCHAR(20) NULL, nodeTypesVersion VARCHAR(20) NULL, nodeTypesName VARCHAR(120) NULL, policyTypesName VARCHAR(120) NULL, policyTypesVersion VARCHAR(20) NULL, relationshipTypesVersion VARCHAR(20) NULL, relationshipTypesName VARCHAR(120) NULL, topologyTemplateLocalName VARCHAR(120) NULL, topologyTemplateParentKeyName VARCHAR(120) NULL, topologyTemplateParentKeyVersion VARCHAR(15) NULL, topologyTemplateParentLocalName VARCHAR(120) NULL, PRIMARY KEY PK_TOSCASERVICETEMPLATE (name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0810-toscatopologytemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0810-toscatopologytemplate.sql deleted file mode 100644 index cbb6dbd8..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0810-toscatopologytemplate.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscatopologytemplate (`description` VARCHAR(255) NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, nodeTemplatessVersion VARCHAR(20) NULL, nodeTemplatesName VARCHAR(120) NULL, policyVersion VARCHAR(20) NULL, policyName VARCHAR(120) NULL, PRIMARY KEY PK_TOSCATOPOLOGYTEMPLATE (parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0820-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0820-toscatrigger.sql deleted file mode 100644 index 279e05dc..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0820-toscatrigger.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscatrigger (ACTION VARCHAR(255) NULL, toscaCondition LONGBLOB DEFAULT NULL, toscaConstraint LONGBLOB DEFAULT NULL, `DESCRIPTION` VARCHAR(255) NULL, EVALUATIONS INT DEFAULT NULL, EVENTTYPE VARCHAR(255) NULL, METHOD VARCHAR(255) NULL, `PERIOD` LONGBLOB DEFAULT NULL, SCHEDULE LONGBLOB DEFAULT NULL, TARGETFILTER LONGBLOB DEFAULT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, PRIMARY KEY PK_TOSCATRIGGER (parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql deleted file mode 100644 index e3597b48..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX FK_ToscaNodeTemplate_capabilitiesName ON toscanodetemplate(capabilitiesName, capabilitiesVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql deleted file mode 100644 index 06c389c1..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX FK_ToscaNodeTemplate_requirementsName ON toscanodetemplate(requirementsName, requirementsVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0850-FK_ToscaNodeType_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0850-FK_ToscaNodeType_requirementsName.sql deleted file mode 100644 index 1ee32de8..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0850-FK_ToscaNodeType_requirementsName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX FK_ToscaNodeType_requirementsName ON toscanodetype(requirementsName, requirementsVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql deleted file mode 100644 index 89d0a95f..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX FK_ToscaServiceTemplate_capabilityTypesName ON toscaservicetemplate(capabilityTypesName, capabilityTypesVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql deleted file mode 100644 index 23b1d8ca..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX FK_ToscaServiceTemplate_dataTypesName ON toscaservicetemplate(dataTypesName, dataTypesVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql deleted file mode 100644 index b8701265..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX FK_ToscaServiceTemplate_nodeTypesName ON toscaservicetemplate(nodeTypesName, nodeTypesVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql deleted file mode 100644 index 247cd817..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX FK_ToscaServiceTemplate_policyTypesName ON toscaservicetemplate(policyTypesName, policyTypesVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql deleted file mode 100644 index f9ca8b99..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX FK_ToscaServiceTemplate_relationshipTypesName ON toscaservicetemplate(relationshipTypesName, relationshipTypesVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql deleted file mode 100644 index b538f8ee..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX FK_ToscaTopologyTemplate_nodeTemplatesName ON toscatopologytemplate(nodeTemplatesName, nodeTemplatessVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.sql deleted file mode 100644 index bd25f3a5..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX FK_ToscaTopologyTemplate_policyName ON toscatopologytemplate(policyName, policyVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0940-PdpPolicyStatus_PdpGroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0940-PdpPolicyStatus_PdpGroup.sql deleted file mode 100644 index d16c3ced..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0940-PdpPolicyStatus_PdpGroup.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX PdpPolicyStatus_PdpGroup ON pdppolicystatus(PDPGROUP); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql deleted file mode 100644 index 0fe51970..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX TscaServiceTemplatetopologyTemplateParentLocalName ON toscaservicetemplate(topologyTemplateParentLocalName, topologyTemplateLocalName, topologyTemplateParentKeyVersion, topologyTemplateParentKeyName); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0960-FK_ToscaNodeTemplate_capabilitiesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0960-FK_ToscaNodeTemplate_capabilitiesName.sql deleted file mode 100644 index d96393d7..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0960-FK_ToscaNodeTemplate_capabilitiesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscanodetemplate ADD CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName FOREIGN KEY (capabilitiesName, capabilitiesVersion) REFERENCES toscacapabilityassignments (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0970-FK_ToscaNodeTemplate_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0970-FK_ToscaNodeTemplate_requirementsName.sql deleted file mode 100644 index 491a6b70..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0970-FK_ToscaNodeTemplate_requirementsName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscanodetemplate ADD CONSTRAINT FK_ToscaNodeTemplate_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES toscarequirements (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0980-FK_ToscaNodeType_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0980-FK_ToscaNodeType_requirementsName.sql deleted file mode 100644 index c6f37f5c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0980-FK_ToscaNodeType_requirementsName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscanodetype ADD CONSTRAINT FK_ToscaNodeType_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES toscarequirements (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0990-FK_ToscaServiceTemplate_capabilityTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0990-FK_ToscaServiceTemplate_capabilityTypesName.sql deleted file mode 100644 index 2942032d..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0990-FK_ToscaServiceTemplate_capabilityTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_capabilityTypesName FOREIGN KEY (capabilityTypesName, capabilityTypesVersion) REFERENCES toscacapabilitytypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1000-FK_ToscaServiceTemplate_dataTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1000-FK_ToscaServiceTemplate_dataTypesName.sql deleted file mode 100644 index 42d1b16d..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1000-FK_ToscaServiceTemplate_dataTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_dataTypesName FOREIGN KEY (dataTypesName, dataTypesVersion) REFERENCES toscadatatypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1010-FK_ToscaServiceTemplate_nodeTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1010-FK_ToscaServiceTemplate_nodeTypesName.sql deleted file mode 100644 index ff40a80f..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1010-FK_ToscaServiceTemplate_nodeTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_nodeTypesName FOREIGN KEY (nodeTypesName, nodeTypesVersion) REFERENCES toscanodetypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1020-FK_ToscaServiceTemplate_policyTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1020-FK_ToscaServiceTemplate_policyTypesName.sql deleted file mode 100644 index ac0aad0c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1020-FK_ToscaServiceTemplate_policyTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_policyTypesName FOREIGN KEY (policyTypesName, policyTypesVersion) REFERENCES toscapolicytypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1030-FK_ToscaServiceTemplate_relationshipTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1030-FK_ToscaServiceTemplate_relationshipTypesName.sql deleted file mode 100644 index a7526670..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1030-FK_ToscaServiceTemplate_relationshipTypesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_relationshipTypesName FOREIGN KEY (relationshipTypesName, relationshipTypesVersion) REFERENCES toscarelationshiptypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql deleted file mode 100644 index 97bf345d..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscatopologytemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_nodeTemplatesName FOREIGN KEY (nodeTemplatesName, nodeTemplatessVersion) REFERENCES toscanodetemplates (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1050-FK_ToscaTopologyTemplate_policyName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1050-FK_ToscaTopologyTemplate_policyName.sql deleted file mode 100644 index 3a973499..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1050-FK_ToscaTopologyTemplate_policyName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscatopologytemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_policyName FOREIGN KEY (policyName, policyVersion) REFERENCES toscapolicies (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql deleted file mode 100644 index ca03af86..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE toscaservicetemplate ADD CONSTRAINT TscaServiceTemplatetopologyTemplateParentLocalName FOREIGN KEY (topologyTemplateParentLocalName, topologyTemplateLocalName, topologyTemplateParentKeyVersion, topologyTemplateParentKeyName) REFERENCES toscatopologytemplate (parentLocalName, localName, parentKeyVersion, parentKeyName) ON UPDATE RESTRICT ON DELETE RESTRICT; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0100-pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0100-pdp.sql deleted file mode 100644 index f10c8501..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0100-pdp.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdp DROP COLUMN LASTUPDATE; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0110-idx_tsidx1.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0110-idx_tsidx1.sql deleted file mode 100644 index bf9927a3..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0110-idx_tsidx1.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX IDX_TSIDX1 ON pdpstatistics; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0120-pk_pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0120-pk_pdpstatistics.sql deleted file mode 100644 index b3d4767d..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0120-pk_pdpstatistics.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (timeStamp, name, version); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0130-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0130-pdpstatistics.sql deleted file mode 100644 index 461f147b..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0130-pdpstatistics.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdpstatistics DROP COLUMN POLICYUNDEPLOYCOUNT, DROP COLUMN POLICYUNDEPLOYFAILCOUNT, DROP COLUMN POLICYUNDEPLOYSUCCESSCOUNT, DROP COLUMN ID; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0140-pk_pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0140-pk_pdpstatistics.sql deleted file mode 100644 index 548b26de..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0140-pk_pdpstatistics.sql +++ /dev/null @@ -1,22 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdpstatistics DROP PRIMARY KEY; - -UPDATE pdpstatistics set ID = 0; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0150-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0150-pdpstatistics.sql deleted file mode 100644 index 1174fce7..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0150-pdpstatistics.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdpstatistics MODIFY COLUMN timeStamp datetime(6) NOT NULL; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0160-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0160-jpapdpstatistics_enginestats.sql deleted file mode 100644 index e3b5a487..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0160-jpapdpstatistics_enginestats.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpapdpstatistics_enginestats DROP COLUMN ID; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0170-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0170-jpapdpstatistics_enginestats.sql deleted file mode 100644 index 7163431b..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0170-jpapdpstatistics_enginestats.sql +++ /dev/null @@ -1,22 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -UPDATE jpapdpstatistics_enginestats a - JOIN pdpstatistics b - ON a.name = b.name AND a.version = b.version AND a.id = b.id - SET a.timeStamp = b.timeStamp; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0180-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0180-jpapdpstatistics_enginestats.sql deleted file mode 100644 index bd66524e..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0180-jpapdpstatistics_enginestats.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpapdpstatistics_enginestats ADD COLUMN timeStamp datetime(6) DEFAULT NULL AFTER UPTIME; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0190-jpapolicyaudit.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0190-jpapolicyaudit.sql deleted file mode 100644 index b51d8769..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0190-jpapolicyaudit.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `jpapolicyaudit`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0200-JpaPolicyAuditIndex_timestamp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0200-JpaPolicyAuditIndex_timestamp.sql deleted file mode 100644 index 68265c5b..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0200-JpaPolicyAuditIndex_timestamp.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpapolicyaudit DROP INDEX JpaPolicyAuditIndex_timestamp; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0210-sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0210-sequence.sql deleted file mode 100644 index 553b1f16..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0210-sequence.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS `sequence`; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0100-pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0100-pdp.sql deleted file mode 100644 index 934d89e8..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0100-pdp.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdp ADD COLUMN LASTUPDATE datetime NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER HEALTHY; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0110-idx_tsidx1.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0110-idx_tsidx1.sql deleted file mode 100644 index 864e4f03..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0110-idx_tsidx1.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX IDX_TSIDX1 ON pdpstatistics(timeStamp, name, version); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0120-pk_pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0120-pk_pdpstatistics.sql deleted file mode 100644 index 4066c012..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0120-pk_pdpstatistics.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdpstatistics DROP PRIMARY KEY; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0130-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0130-pdpstatistics.sql deleted file mode 100644 index 51dcd3b1..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0130-pdpstatistics.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdpstatistics ADD COLUMN POLICYUNDEPLOYCOUNT BIGINT DEFAULT NULL AFTER POLICYEXECUTEDSUCCESSCOUNT, ADD COLUMN POLICYUNDEPLOYFAILCOUNT BIGINT DEFAULT NULL, ADD COLUMN POLICYUNDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL, ADD COLUMN ID BIGINT NOT NULL; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0140-pk_pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0140-pk_pdpstatistics.sql deleted file mode 100644 index b8a96b68..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0140-pk_pdpstatistics.sql +++ /dev/null @@ -1,22 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -UPDATE pdpstatistics as p JOIN (SELECT name, version, timeStamp, ROW_NUMBER() OVER (ORDER BY timeStamp ASC) AS row_num FROM pdpstatistics GROUP BY name, version, timeStamp) AS t ON (p.name=t.name AND p.version=t.version AND p.timeStamp = t.timeStamp) SET p.id=t.row_num; - -ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID, name, version); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0150-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0150-pdpstatistics.sql deleted file mode 100644 index 256c31a7..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0150-pdpstatistics.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdpstatistics MODIFY COLUMN timeStamp datetime(6) NULL; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0160-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0160-jpapdpstatistics_enginestats.sql deleted file mode 100644 index cc3f9a82..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0160-jpapdpstatistics_enginestats.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpapdpstatistics_enginestats ADD COLUMN ID BIGINT DEFAULT NULL AFTER UPTIME; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0170-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0170-jpapdpstatistics_enginestats.sql deleted file mode 100644 index ce78c340..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0170-jpapdpstatistics_enginestats.sql +++ /dev/null @@ -1,22 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -UPDATE jpapdpstatistics_enginestats a - JOIN pdpstatistics b - ON a.name = b.name AND a.version = b.version AND a.timeStamp = b.timeStamp - SET a.id = b.id; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0180-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0180-jpapdpstatistics_enginestats.sql deleted file mode 100644 index 16825f4f..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0180-jpapdpstatistics_enginestats.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpapdpstatistics_enginestats DROP COLUMN timeStamp; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0190-jpapolicyaudit.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0190-jpapolicyaudit.sql deleted file mode 100644 index ca5137de..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0190-jpapolicyaudit.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpapolicyaudit (ACTION INT DEFAULT NULL, PDPGROUP VARCHAR(255) NULL, PDPTYPE VARCHAR(255) NULL, TIMESTAMP datetime DEFAULT NULL, USER VARCHAR(255) NULL, ID BIGINT NOT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, PRIMARY KEY PK_JPAPOLICYAUDIT (ID, name, version)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0200-JpaPolicyAuditIndex_timestamp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0200-JpaPolicyAuditIndex_timestamp.sql deleted file mode 100644 index d789d118..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0200-JpaPolicyAuditIndex_timestamp.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE INDEX JpaPolicyAuditIndex_timestamp ON jpapolicyaudit(TIMESTAMP); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0210-sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0210-sequence.sql deleted file mode 100644 index 43dfe42a..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0210-sequence.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS sequence (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(38) DEFAULT NULL, PRIMARY KEY PK_SEQUENCE (SEQ_NAME)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0220-sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0220-sequence.sql deleted file mode 100644 index c90905ef..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0220-sequence.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -INSERT INTO sequence(SEQ_NAME, SEQ_COUNT) VALUES('SEQ_GEN', (SELECT IFNULL(max(id),0) FROM pdpstatistics)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0100-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0100-jpatoscapolicy_targets.sql deleted file mode 100644 index ec1da675..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0100-jpatoscapolicy_targets.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpatoscapolicy_targets DROP COLUMN toscaPolicyName, DROP COLUMN toscaPolicyVersion; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0110-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0110-jpatoscapolicytype_targets.sql deleted file mode 100644 index b08a2ab4..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0110-jpatoscapolicytype_targets.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpatoscapolicytype_targets DROP COLUMN toscaPolicyTypeName, DROP COLUMN toscaPolicyTypeVersion; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0120-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0120-toscatrigger.sql deleted file mode 100644 index 5aa86c03..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0120-toscatrigger.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. All rights reserved. - * Modifications Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscatrigger (ACTION VARCHAR(255) NULL, toscaCondition LONGBLOB DEFAULT NULL, toscaConstraint LONGBLOB DEFAULT NULL, `DESCRIPTION` VARCHAR(255) NULL, EVALUATIONS INT DEFAULT NULL, EVENTTYPE VARCHAR(255) NULL, METHOD VARCHAR(255) NULL, `PERIOD` LONGBLOB DEFAULT NULL, SCHEDULE LONGBLOB DEFAULT NULL, TARGETFILTER LONGBLOB DEFAULT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, PRIMARY KEY PK_TOSCATRIGGER (parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0130-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0130-jpatoscapolicytype_triggers.sql deleted file mode 100644 index 35864300..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0130-jpatoscapolicytype_triggers.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpatoscapolicytype_triggers MODIFY COLUMN triggers VARCHAR(255); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0140-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0140-toscaparameter.sql deleted file mode 100644 index da2e66f7..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0140-toscaparameter.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. All rights reserved. - * Modifications Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS toscaparameter (VALUE VARCHAR(255) NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCAPARAMETER (parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0150-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0150-toscaproperty.sql deleted file mode 100644 index c99ae0e7..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0150-toscaproperty.sql +++ /dev/null @@ -1,23 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. All rights reserved. - * Modifications Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpatoscaproperty_constraints (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, CONSTRAINTS VARCHAR(255) NULL); -CREATE TABLE IF NOT EXISTS jpatoscaproperty_metadata (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL); -CREATE TABLE IF NOT EXISTS toscaproperty (DEFAULTVALUE VARCHAR(255) NULL, `DESCRIPTION` VARCHAR(255) NULL, ENTRYSCHEMA LONGBLOB DEFAULT NULL, REQUIRED BIT DEFAULT 0 NULL, STATUS INT DEFAULT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, PRIMARY KEY PK_TOSCAPROPERTY (parentLocalName, localName, parentKeyVersion, parentKeyName)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0160-jpapolicyaudit_pk.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0160-jpapolicyaudit_pk.sql deleted file mode 100644 index 328a40e7..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0160-jpapolicyaudit_pk.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpapolicyaudit DROP PRIMARY KEY; -ALTER TABLE jpapolicyaudit ADD CONSTRAINT PK_JPAPOLICYAUDIT PRIMARY KEY (ID, name, version); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0170-pdpstatistics_pk.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0170-pdpstatistics_pk.sql deleted file mode 100644 index d086a520..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0170-pdpstatistics_pk.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdpstatistics DROP PRIMARY KEY; -ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID, name, version); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0180-jpatoscanodetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0180-jpatoscanodetemplate_metadata.sql deleted file mode 100644 index 0aafd387..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0180-jpatoscanodetemplate_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpatoscanodetemplate_metadata MODIFY COLUMN METADATA VARCHAR(255);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0100-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0100-jpatoscapolicy_targets.sql deleted file mode 100644 index aab9f360..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0100-jpatoscapolicy_targets.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpatoscapolicy_targets ADD COLUMN toscaPolicyName VARCHAR(120) NOT NULL, ADD COLUMN toscaPolicyVersion VARCHAR(20) NOT NULL, ADD CONSTRAINT PK_JPATOSCAPOLICY_TARGETS PRIMARY KEY (toscaPolicyName, toscaPolicyVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0110-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0110-jpatoscapolicytype_targets.sql deleted file mode 100644 index e4a5d750..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0110-jpatoscapolicytype_targets.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpatoscapolicytype_targets ADD COLUMN toscaPolicyTypeName VARCHAR(120) NOT NULL, ADD COLUMN toscaPolicyTypeVersion VARCHAR(20) NOT NULL, ADD CONSTRAINT PK_JPATOSCAPOLICYTYPE_TARGETS PRIMARY KEY (toscaPolicyTypeName, toscaPolicyTypeVersion); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0120-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0120-toscatrigger.sql deleted file mode 100644 index 2d5d6e87..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0120-toscatrigger.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS toscatrigger; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0130-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0130-jpatoscapolicytype_triggers.sql deleted file mode 100644 index b0907e16..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0130-jpatoscapolicytype_triggers.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpatoscapolicytype_triggers MODIFY COLUMN triggers LONGBLOB; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0140-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0140-toscaparameter.sql deleted file mode 100644 index 82ec7a21..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0140-toscaparameter.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS toscaparameter; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0150-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0150-toscaproperty.sql deleted file mode 100644 index f270ae43..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0150-toscaproperty.sql +++ /dev/null @@ -1,22 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE IF EXISTS jpatoscaproperty_constraints; -DROP TABLE IF EXISTS jpatoscaproperty_metadata; -DROP TABLE IF EXISTS toscaproperty; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0160-jpapolicyaudit_pk.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0160-jpapolicyaudit_pk.sql deleted file mode 100644 index 03addfa2..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0160-jpapolicyaudit_pk.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpapolicyaudit DROP PRIMARY KEY; -ALTER TABLE jpapolicyaudit ADD CONSTRAINT PK_JPAPOLICYAUDIT PRIMARY KEY (ID); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0170-pdpstatistics_pk.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0170-pdpstatistics_pk.sql deleted file mode 100644 index 0ec69d84..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0170-pdpstatistics_pk.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Bell Canada. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE pdpstatistics DROP PRIMARY KEY; -ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0180-jpatoscanodetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0180-jpatoscanodetemplate_metadata.sql deleted file mode 100644 index 426613de..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0180-jpatoscanodetemplate_metadata.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpatoscanodetemplate_metadata MODIFY COLUMN METADATA LONGTEXT;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1100/downgrade/0100-downgrade.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1100/downgrade/0100-downgrade.sql deleted file mode 100644 index c9eda3d9..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1100/downgrade/0100-downgrade.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -select 'downgrade from 1100 completed' as msg; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1100/upgrade/0100-upgrade.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1100/upgrade/0100-upgrade.sql deleted file mode 100644 index 85385219..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1100/upgrade/0100-upgrade.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -select 'upgrade to 1100 completed' as msg; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0100-jpapolicyaudit_renameuser.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0100-jpapolicyaudit_renameuser.sql deleted file mode 100644 index 8384df72..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0100-jpapolicyaudit_renameuser.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpapolicyaudit RENAME COLUMN USERNAME TO USER; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0110-idx_tsidx1.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0110-idx_tsidx1.sql deleted file mode 100644 index 8026e4b3..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0110-idx_tsidx1.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX IDXTSIDX1 ON pdpstatistics; -CREATE INDEX IDX_TSIDX1 ON pdpstatistics(timeStamp, name, version); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0120-audit_sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0120-audit_sequence.sql deleted file mode 100644 index c1cc38bb..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0120-audit_sequence.sql +++ /dev/null @@ -1,27 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -INSERT INTO sequence(SEQ_NAME, SEQ_COUNT) -VALUES('SEQ_GEN', (SELECT IFNULL(MAX(id), 0) FROM ( - SELECT MAX(id) as id FROM pdpstatistics - UNION - SELECT MAX(id) as id FROM jpapolicyaudit -) AS subquery)); - -DROP TABLE audit_sequence; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0130-statistics_sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0130-statistics_sequence.sql deleted file mode 100644 index aea12698..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/downgrade/0130-statistics_sequence.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE statistics_sequence; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0100-jpapolicyaudit_renameuser.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0100-jpapolicyaudit_renameuser.sql deleted file mode 100644 index 9c6bfe6f..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0100-jpapolicyaudit_renameuser.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -ALTER TABLE jpapolicyaudit RENAME COLUMN USER TO USERNAME; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0110-idx_tsidx1.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0110-idx_tsidx1.sql deleted file mode 100644 index 334b6609..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0110-idx_tsidx1.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX IDX_TSIDX1 ON pdpstatistics; -CREATE INDEX IDXTSIDX1 ON pdpstatistics(timeStamp, name, version); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0120-audit_sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0120-audit_sequence.sql deleted file mode 100644 index 6f7b62a1..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0120-audit_sequence.sql +++ /dev/null @@ -1,22 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS audit_sequence (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(38) DEFAULT NULL, PRIMARY KEY PK_SEQUENCE (SEQ_NAME)); - -INSERT INTO audit_sequence(SEQ_NAME, SEQ_COUNT) VALUES('SEQ_GEN', (SELECT IFNULL(max(id),0) FROM jpapolicyaudit)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0130-statistics_sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0130-statistics_sequence.sql deleted file mode 100644 index 6c74bba0..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1200/upgrade/0130-statistics_sequence.sql +++ /dev/null @@ -1,24 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS statistics_sequence (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(38) DEFAULT NULL, PRIMARY KEY PK_SEQUENCE (SEQ_NAME)); - -INSERT INTO statistics_sequence(SEQ_NAME, SEQ_COUNT) VALUES('SEQ_GEN', (SELECT IFNULL(max(id),0) FROM pdpstatistics)); - -TRUNCATE TABLE sequence; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/downgrade/0100-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/downgrade/0100-pdpstatistics.sql deleted file mode 100644 index e4d41339..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/downgrade/0100-pdpstatistics.sql +++ /dev/null @@ -1,38 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS pdpstatistics ( - PDPGROUPNAME VARCHAR(120) NULL, - PDPSUBGROUPNAME VARCHAR(120) NULL, - POLICYDEPLOYCOUNT BIGINT DEFAULT NULL, - POLICYDEPLOYFAILCOUNT BIGINT DEFAULT NULL, - POLICYDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL, - POLICYEXECUTEDCOUNT BIGINT DEFAULT NULL, - POLICYEXECUTEDFAILCOUNT BIGINT DEFAULT NULL, - POLICYEXECUTEDSUCCESSCOUNT BIGINT DEFAULT NULL, - POLICYUNDEPLOYCOUNT BIGINT DEFAULT NULL, - POLICYUNDEPLOYFAILCOUNT BIGINT DEFAULT NULL, - POLICYUNDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL, - ID BIGINT NOT NULL, - timeStamp datetime NOT NULL, - name VARCHAR(120) NOT NULL, - version VARCHAR(20) NOT NULL, - PRIMARY KEY PK_PDPSTATISTICS (ID)); - -CREATE INDEX IDXTSIDX1 ON pdpstatistics(timeStamp, name, version); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/downgrade/0110-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/downgrade/0110-jpapdpstatistics_enginestats.sql deleted file mode 100644 index 6faa4b8c..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/downgrade/0110-jpapdpstatistics_enginestats.sql +++ /dev/null @@ -1,33 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS jpapdpstatistics_enginestats ( - AVERAGEEXECUTIONTIME DOUBLE DEFAULT NULL, - ENGINEID VARCHAR(255) DEFAULT NULL, - ENGINETIMESTAMP BIGINT DEFAULT NULL, - ENGINEWORKERSTATE INT DEFAULT NULL, - EVENTCOUNT BIGINT DEFAULT NULL, - LASTENTERTIME BIGINT DEFAULT NULL, - LASTEXECUTIONTIME BIGINT DEFAULT NULL, - LASTSTART BIGINT DEFAULT NULL, - UPTIME BIGINT DEFAULT NULL, - ID BIGINT DEFAULT NULL, - name VARCHAR(120) DEFAULT NULL, - version VARCHAR(20) DEFAULT NULL); - diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/downgrade/0120-statistics_sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/downgrade/0120-statistics_sequence.sql deleted file mode 100644 index d5f9b215..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/downgrade/0120-statistics_sequence.sql +++ /dev/null @@ -1,23 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -CREATE TABLE IF NOT EXISTS statistics_sequence ( - SEQ_NAME VARCHAR(50) NOT NULL, - SEQ_COUNT DECIMAL(38) DEFAULT NULL, - PRIMARY KEY PK_SEQUENCE (SEQ_NAME)); diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/upgrade/0100-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/upgrade/0100-pdpstatistics.sql deleted file mode 100644 index f6b8d958..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/upgrade/0100-pdpstatistics.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP INDEX IDXTSIDX1 ON pdpstatistics; -DROP TABLE pdpstatistics; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/upgrade/0110-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/upgrade/0110-jpapdpstatistics_enginestats.sql deleted file mode 100644 index 48300cc5..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/upgrade/0110-jpapdpstatistics_enginestats.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE jpapdpstatistics_enginestats; diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/upgrade/0120-statistics_sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/upgrade/0120-statistics_sequence.sql deleted file mode 100644 index aea12698..00000000 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1300/upgrade/0120-statistics_sequence.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -DROP TABLE statistics_sequence; diff --git a/policy-db-migrator/src/main/docker/config/pooling/sql/1600/downgrade/0100-distributed.locking.sql b/policy-db-migrator/src/main/docker/config/pooling/sql/1600/downgrade/0100-distributed.locking.sql deleted file mode 100644 index 75676767..00000000 --- a/policy-db-migrator/src/main/docker/config/pooling/sql/1600/downgrade/0100-distributed.locking.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* feature-distributed-locking -* ================================================================================ -* Copyright (C) 2024 Nordix Foundation. -* ================================================================================ -* 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========================================================= -*/ - -drop table if exists locks; diff --git a/policy-db-migrator/src/main/docker/config/pooling/sql/1600/upgrade/0100-distributed.locking.sql b/policy-db-migrator/src/main/docker/config/pooling/sql/1600/upgrade/0100-distributed.locking.sql deleted file mode 100644 index e7250bac..00000000 --- a/policy-db-migrator/src/main/docker/config/pooling/sql/1600/upgrade/0100-distributed.locking.sql +++ /dev/null @@ -1,32 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* feature-distributed-locking -* ================================================================================ -* Copyright (C) 2024 Nordix Foundation. -* ================================================================================ -* 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========================================================= -*/ - -SET foreign_key_checks=0; - -CREATE TABLE if NOT EXISTS locks( - resourceId VARCHAR(128), - host VARCHAR(128), - owner VARCHAR(128), - expirationTime TIMESTAMP DEFAULT '1971-01-01 00:00:00.000000', - PRIMARY KEY (resourceId), - INDEX idx_expirationTime(expirationTime), - INDEX idx_host(host)); - -SET foreign_key_checks=1; diff --git a/policy-db-migrator/src/main/docker/db-migrator b/policy-db-migrator/src/main/docker/db-migrator deleted file mode 100755 index 4e1a3df7..00000000 --- a/policy-db-migrator/src/main/docker/db-migrator +++ /dev/null @@ -1,771 +0,0 @@ -#!/usr/bin/env sh - -# ============LICENSE_START======================================================= -# ONAP -# ================================================================================ -# Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. -# Modifications Copyright (C) 2021-2024 Nordix Foundation. -# ================================================================================ -# 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========================================================= - -# ##################################################################### -# -# Upgrade/Downgrade SQL File Name Format: -# -# <VERSION>-<pdp|feature-name>[-description](.upgrade|.downgrade).sql -# -# This tool operates on a migration working directory at -# -# $POLICY_HOME/etc/db/migration -# -# Upgrade/Downgrade files for each schema (aka database) names to be maintained -# by this tool are located at -# -# $POLICY_HOME/etc/db/migration/<schema-name>/sql -# -# The nature of the migration directories is dynamic. -# A number of environment variables needs to be initialized -# prior to running db-migrator. -# These variables specify the connection details for the database -# to be upgraded/downgraded. -# -# The repository of upgrade/downgrade scripts is located in the -# /home/${SCHEMA}/sql directory. -# Two additional scripts have been provided to prepare the directories/files -# needed to perform the upgrade/downgrade. -# -# At any given time the following invariant must be preserved in any given -# $POLICY_HOME/etc/db/migration/<schema-name>/sql directory -# -# There is only upgrade scripts, or only downgrade scripts, or none. -# -# ##################################################################### - -source ${POLICY_HOME}/etc/profile.d/env.sh - -METADATA_DB=migration -METADATA_TABLE=${METADATA_DB}.schema_versions -MIGRATION_DIR=${POLICY_HOME}/etc/db/migration -ZERO_VERSION="0" -BASE_VERSION="0800" -UPGRADE_SQL_SUFFIX=".upgrade.sql" -DOWNGRADE_SQL_SUFFIX=".downgrade.sql" - -SQL_QUOTES="SET SESSION SQL_MODE=ANSI_QUOTES;" - -##################################################### -# usage -##################################################### - -function usage() { - echo - echo -e "syntax: $(basename "$0") " - echo -e "\t -s <schema-name> " - echo -e "\t [-b <migration-dir>] " - echo -e "\t [-f <from-version>]" - echo -e "\t [-t <target-version>]" - echo -e "\t -o <operations> " - echo - echo -e "\t where <operations>=upgrade|downgrade|auto|version|erase|report" - echo - echo - echo -e "Configuration Options:" - echo -e "\t -s|--schema|--database: schema to operate on ('ALL' to apply on all)" - echo -e "\t -b|--basedir: overrides base DB migration directory" - echo -e "\t -f|--from: overrides current release version for operations" - echo -e "\t -t|--target: overrides target release to upgrade/downgrade" - echo - echo -e "Operations:" - echo -e "\t upgrade: upgrade operation" - echo -e "\t downgrade: performs a downgrade operation" - echo -e "\t auto: autonomous operation, determines upgrade or downgrade" - echo -e "\t version: returns current version, and in conjunction if '-f' sets the current version" - echo -e "\t erase: erase all data related <schema> (use with care)" - echo -e "\t report: migration detailed report on an schema" - echo -e "\t ok: is the migration status valid" - echo - echo -} - -##################################################### -# current_schema -##################################################### - -function current_schema() { - if [ "${DEBUG}" = "y" ]; then - echo "-- current_schema --" - set -x - fi - - local rc - local query="SELECT count(table_name) from information_schema.tables where table_schema='${SCHEMA}'" - - TABLES_IN_SCHEMA=$(${MYSQL} --skip-column-names --silent --execute "${query}") - if [ ${TABLES_IN_SCHEMA} -gt 0 ] && [ "${BASE_VERSION}" \> "${CURRENT_RELEASE}" ]; then - set_current_release "${BASE_VERSION}" - return $? - fi - - return 0 -} - -##################################################### -# ensure global metadata -##################################################### - -function ensure_metadata() { - if [ "${DEBUG}" = "y" ]; then - echo "-- ensure_metadata --" - set -x - fi - - local sql rc - - sql="CREATE DATABASE IF NOT EXISTS ${METADATA_DB};" - ${MYSQL} --execute "${sql}" - rc=$? - if [ ${rc} -ne 0 ]; then - return ${rc} - fi - - sql="CREATE TABLE IF NOT EXISTS ${METADATA_TABLE} " - sql=${sql}"(name VARCHAR(60) NOT NULL, version VARCHAR(20), " - sql=${sql}"PRIMARY KEY(name));" - ${MYSQL} --execute "${sql}" - return $? -} - -##################################################### -# ensure metadata on a per schema basis -##################################################### - -function ensure_metadata_schema() { - if [ "${DEBUG}" = "y" ]; then - echo "-- ensure_metadata_schema --" - set -x - fi - - local sql rc - - sql="CREATE TABLE IF NOT EXISTS ${METADATA_HISTORY} " - sql=${sql}"(ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, script VARCHAR(80) NOT NULL, " - sql=${sql}"operation VARCHAR(10), from_version VARCHAR(20), to_version VARCHAR(20), tag VARCHAR(20), " - sql=${sql}"success VARCHAR(1), atTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, " - sql=${sql}"PRIMARY KEY(ID));" - ${MYSQL} --execute "${sql}" - rc=$? - if [ ${rc} -ne 0 ]; then - return ${rc} - fi - - sql="CREATE DATABASE IF NOT EXISTS ${SCHEMA_DB};" - ${MYSQL} --execute "${sql}" - return $? -} - -##################################################### -# target_release -##################################################### - -function target_release() { - if [ "${DEBUG}" = "y" ]; then - echo "-- target_release --" - set -x - fi - - local sql sqlName upgradeSqls downgradeSqls - - TARGET_UPGRADE_RELEASE=${ZERO_VERSION} - TARGET_DOWNGRADE_RELEASE=${ZERO_VERSION} - - upgradeSqls=$(ls -v -r "${UPGRADE_DIR}"/*/upgrade/*.sql 2>/dev/null) - for sql in ${upgradeSqls}; do - TARGET_UPGRADE_RELEASE="$(basename $(dirname $(dirname $sql)))" - break - done - - # default unless overriden - TARGET_DOWNGRADE_RELEASE="${ZERO_VERSION}" -} - -##################################################### -# is_upgrade -##################################################### - -function is_upgrade() { - if [ "${DEBUG}" = "y" ]; then - echo "-- is_upgrade --" - set -x - fi - - local upgradeSqls - - upgradeSqls=$(ls -v "${UPGRADE_DIR}"/*/upgrade/*.sql 2>/dev/null) - if [ -z "${upgradeSqls}" ]; then - return 1 - else - return 0 - fi -} - -##################################################### -# is_downgrade -##################################################### - -function is_downgrade() { - if [ "${DEBUG}" = "y" ]; then - echo "-- is_downgrade --" - set -x - fi - - local downgradeSqls - - downgradeSqls=$(ls -v -r "${DOWNGRADE_DIR}"/*/downgrade/*.sql 2>/dev/null) - if [ -z "${downgradeSqls}" ]; then - return 1 - else - return 0 - fi -} - -##################################################### -# set_current_release -##################################################### - -function set_current_release() { - if [ "${DEBUG}" = "y" ]; then - echo "-- set_current_release --" - set -x - fi - - CURRENT_RELEASE="${1}" - - local sql - sql="INSERT INTO ${METADATA_TABLE} (name, version) " - sql=${sql}"VALUES('${SCHEMA}', '${CURRENT_RELEASE}') " - sql=${sql}"ON DUPLICATE KEY UPDATE version='${CURRENT_RELEASE}';" - - ${MYSQL} --execute "${sql}" - return $? -} - -##################################################### -# current_release -##################################################### - -function current_release() { - if [ "${DEBUG}" = "y" ]; then - echo "-- current_release --" - set -x - fi - - local rc - local query="SELECT version FROM ${METADATA_TABLE} WHERE name='${SCHEMA}'" - - CURRENT_RELEASE=$(${MYSQL} --skip-column-names --silent --execute "${query}") - if [ -z "${CURRENT_RELEASE}" ]; then - set_current_release "${ZERO_VERSION}" - return $? - fi - - return 0 -} - -##################################################### -# previous_release -##################################################### - -function previous_release() { - if [ "${DEBUG}" = "y" ]; then - echo "-- previous_release --" - set -x - fi - local current_release="${1}" - local current_release_int_val previous_release_int_val previous_release - - if [ $current_release == $ZERO_VERSION ] || [ $current_release == $BASE_VERSION ]; then - PREVIOUS_RELEASE=$ZERO_VERSION - else - current_release_int_val=$(echo $current_release | awk '{$0=int($0)}1') - let previous_release_int_val=$current_release_int_val-100 - if [ $previous_release_int_val -lt 1000 ]; then - previous_release="0"$previous_release_int_val - else - previous_release=$previous_release_int_val - fi - PREVIOUS_RELEASE=$previous_release - fi - - return 0 -} - -##################################################### -# last_operation_status -##################################################### - -function last_operation_status() { - if [ "${DEBUG}" = "y" ]; then - echo "-- last_operation_status --" - set -x - fi - - local query rc row - - query="SELECT script, operation, from_version, to_version, success FROM " - query=${query}"${METADATA_HISTORY} WHERE id=" - query=${query}"(SELECT MAX(id) from ${METADATA_HISTORY}) " - query=${query}"AND success=0" - - row=$(${MYSQL} --skip-column-names --silent --execute "${query}") - - if [ "${row}" != "" ]; then - LAST_SCRIPT=$(echo $row | awk '{print $1}') - LAST_OPERATION=$(echo $row | awk '{print $2}') - LAST_FROM_VERSION=$(echo $row | awk '{print $3}') - LAST_TO_VERSION=$(echo $row | awk '{print $4}') - LAST_STATUS=$(echo $row | awk '{print $5}') - rc=0 - else - rc=1 - fi - - return $rc -} - -##################################################### -# execute sql script history -##################################################### - -function track_script() { - if [ "${DEBUG}" = "y" ]; then - echo "-- track_script $* --" - set -x - fi - - local script="${1}" operation="${2}" success="${3}" from_version="${4}" to_version="${5}" tag="${6}" - if [ $operation == "downgrade" ]; then - to_version=${TARGET_DOWNGRADE_RELEASE} - fi - - local sql="INSERT INTO ${METADATA_HISTORY}(script,operation,from_version,to_version,tag,success,atTime) " - sql=${sql}"VALUES ('${script}','${operation}','${from_version}','${to_version}','${tag}','${success}',now()) " - - ${MYSQL} --execute "${sql}" - return $? -} - -##################################################### -# execute sql script -##################################################### - -function run_script() { - if [ "${DEBUG}" == "y" ]; then - echo "-- run_script $* --" - set -x - fi - - local operation="${1}" script="${2}" scriptPath="${3}" fromVersion="${4}" toVersion="${5}" tag="${6}" - - echo - echo "> ${operation} ${script}" - - ${MYSQL} ${SCHEMA} --verbose <"${scriptPath}" - local rc=$? - if [ ${rc} -ne 0 ]; then - success="0" - else - success="1" - fi - - track_script "${script}" "${operation}" "${success}" "${fromVersion}" "${toVersion}" "${tag}" - - return ${rc} -} - -##################################################### -# upgrade -##################################################### - -function upgrade() { - if [ "${DEBUG}" = "y" ]; then - echo "-- upgrade --" - set -x - fi - - local sqlName sqlFile schemaVersion upgradeSqls rc tagDate tag - tagDate=$(date +%d%m%y%H%M%S) - - echo "upgrade: ${CURRENT_RELEASE} -> ${TARGET_UPGRADE_RELEASE}" - - if [ ${CURRENT_RELEASE} \< ${TARGET_UPGRADE_RELEASE} ]; then - upgradeSqls=$(ls -v "${UPGRADE_DIR}"/*/upgrade/*.sql 2>/dev/null) - for sqlFile in ${upgradeSqls}; do - sqlName=$(basename "${sqlFile}") - schemaVersion="$(basename $(dirname $(dirname $sqlFile)))" - previous_release $schemaVersion - if [ "${schemaVersion}" -gt "${CURRENT_RELEASE}" ] && - [ "${schemaVersion}" -le "${TARGET_UPGRADE_RELEASE}" ]; then - tag=${tagDate}"${schemaVersion}u" - if [ $RETRY -eq 1 ] && - # Compare the numeric portion of the filename because shell doesn't support string comparison - [ $(echo ${sqlName} | awk -F- '{print $1}') -${COMPARE} $(echo ${LAST_SCRIPT} | awk -F- '{print $1}') ]; then - rc=1 - else - rc=0 - fi - if [ ${rc} -eq 0 ]; then - run_script "upgrade" "${sqlName}" "${sqlFile}" "${PREVIOUS_RELEASE}" "${schemaVersion}" "${tag}" - rc=$? - if [ ${rc} -ne 0 ]; then - echo "${SCHEMA}: upgrade aborted at ${schemaVersion} by script ${sqlName}" - set_current_release "${schemaVersion}" - return ${rc} - fi - fi - fi - done - - set_current_release "${TARGET_UPGRADE_RELEASE}" - fi - - return 0 -} - -##################################################### -# downgrade -##################################################### - -function downgrade() { - if [ "${DEBUG}" = "y" ]; then - echo "-- downgrade --" - set -x - fi - - local sqlName sqlFile schemaVersion downgradeSqls rc tagDate tag - tagDate=$(date +%d%m%y%H%M%S) - - echo "downgrade: ${CURRENT_RELEASE} -> ${TARGET_DOWNGRADE_RELEASE}" - - if [ ${CURRENT_RELEASE} \> ${TARGET_DOWNGRADE_RELEASE} ]; then - downgradeSqls=$(ls -v -r "${DOWNGRADE_DIR}"/*/downgrade/*.sql 2>/dev/null) - for sqlFile in ${downgradeSqls}; do - sqlName=$(basename "${sqlFile}") - schemaVersion="$(basename $(dirname $(dirname $sqlFile)))" - if [ "${schemaVersion}" -le "${CURRENT_RELEASE}" ] && - [ "${schemaVersion}" -gt "${TARGET_DOWNGRADE_RELEASE}" ]; then - tag=${tagDate}"${schemaVersion}d" - if [ $RETRY -eq 1 ] && - # Compare the numeric portion of the filename because shell doesn't support string comparison - [ $(echo ${sqlName} | awk -F- '{print $1}') -${COMPARE} $(echo ${LAST_SCRIPT} | awk -F- '{print $1}') ]; then - rc=1 - else - rc=0 - fi - if [ ${rc} -eq 0 ]; then - run_script "downgrade" "${sqlName}" "${sqlFile}" "${schemaVersion}" "${PREVIOUS_RELEASE}" ${tag} - rc=$? - if [ ${rc} -ne 0 ]; then - echo "${SCHEMA}: downgrade aborted at ${schemaVersion} by script ${sqlName}" - set_current_release "${schemaVersion}" - return ${rc} - fi - fi - fi - done - - set_current_release "${TARGET_DOWNGRADE_RELEASE}" - fi - - return 0 -} - -##################################################### -# erase -##################################################### - -function erase() { - if [ "${DEBUG}" = "y" ]; then - echo "-- erase --" - set -x - fi - - local updateMetadata="UPDATE ${METADATA_TABLE} SET version='${ZERO_VERSION}';" - ${MYSQL} --execute "${updateMetadata}" - - local deleteHistory="DELETE FROM ${METADATA_HISTORY};" - ${MYSQL} --execute "${deleteHistory}" - - local dropDB="DROP DATABASE IF EXISTS ${SCHEMA_DB}" - ${MYSQL} --execute "${dropDB}" -} - -##################################################### -# report -##################################################### - -function report() { - if [ "${DEBUG}" = "y" ]; then - echo "-- report --" - set -x - fi - - local versionSql="SELECT * FROM ${METADATA_TABLE} WHERE name='${SCHEMA}';" - ${MYSQL} --execute "${versionSql}" - - local historySql="SELECT * FROM ${METADATA_HISTORY} ORDER BY id, atTime ASC;" - ${MYSQL} --execute "${historySql}" - - okay -} - -function okay() { - if [ "${DEBUG}" = "y" ]; then - echo "-- okay --" - set -x - fi - - local rc=0 - if is_upgrade; then - if [ "${CURRENT_RELEASE}" = "${TARGET_UPGRADE_RELEASE}" ]; then - echo "${SCHEMA}: OK @ ${CURRENT_RELEASE}" - else - echo "${SCHEMA}: upgrade available: ${CURRENT_RELEASE} -> ${TARGET_UPGRADE_RELEASE}" - rc=1 - fi - else - if [ "${CURRENT_RELEASE}" = "${TARGET_DOWNGRADE_RELEASE}" ]; then - echo "${SCHEMA}: OK @ ${CURRENT_RELEASE}" - else - echo "${SCHEMA}: downgrade available: ${CURRENT_RELEASE} -> ${TARGET_DOWNGRADE_RELEASE}" - rc=1 - fi - fi - - return ${rc} -} - -##################################################### -# MAIN -##################################################### - -if [ "${DEBUG}" = "y" ]; then - echo "-- $0 $* --" - set -x -fi -until [ -z "$1" ]; do - case $1 in - -s | --schema | --database) - shift - SCHEMA=$1 - ;; - -b | --basedir) - shift - MIGRATION_DIR=$1 - ;; - -t | --target) - shift - INPUT_TARGET_RELEASE=$1 - ;; - -f | --from) - shift - INPUT_FROM_RELEASE=$1 - ;; - -o | --operation) - shift - OPERATION=$1 - ;; - *) - usage - exit 1 - ;; - esac - shift -done - -case ${OPERATION} in -upgrade) ;; -downgrade) ;; -auto) ;; -version) ;; -erase) ;; -report) ;; -ok) ;; -*) - echo "error: invalid operation provided" - usage - exit 1 - ;; -esac - -if [ -z "${SCHEMA}" ]; then - echo "error: a database name must be provided" - usage - exit 2 -fi - -source "${POLICY_HOME}"/etc/profile.d/env.sh - -if [ -z "${SQL_HOST}" ] || [ -z "${SQL_USER}" ] || [ -z "${SQL_PASSWORD}" ]; then - echo "error: no database has been set up" - exit 4 -fi - -if [ -z "$MYSQL_CMD" ]; then - MYSQL_CMD="mysql" -fi - -MYSQL="${MYSQL_CMD} -u${SQL_USER} -p${SQL_PASSWORD} -h ${SQL_HOST}" -if ! ${MYSQL} -h"${SQL_HOST}" --execute "show databases;" >/dev/null 2>&1; then - echo "error: No DB connectivity to ${SQL_HOST} for ${SQL_USER}" - exit 5 -fi - -if [ "${SCHEMA}" = "ALL" ]; then - SCHEMA="*" -fi - -SCHEMA_S=$(ls -d "${MIGRATION_DIR}"/${SCHEMA}/ 2>/dev/null) -if [ -z "${SCHEMA_S}" ]; then - echo "error: no databases available" - exit 0 -fi - -if ! ensure_metadata; then - echo "error: migration metadata not accessible" - exit 7 -fi - -rc=0 -for dbPath in ${SCHEMA_S}; do - SCHEMA=$(basename "${dbPath}") - SCHEMA_DB="\`${SCHEMA}\`" - UPGRADE_DIR="${MIGRATION_DIR}"/"${SCHEMA}"/sql - DOWNGRADE_DIR=${UPGRADE_DIR} - METADATA_HISTORY="${METADATA_DB}.\`${SCHEMA}_schema_changelog\`" - TARGET_RELEASE=${INPUT_TARGET_RELEASE} - - if is_upgrade && is_downgrade; then - echo "${SCHEMA}: failure: invalid configuration: ${UPGRADE_SQL_SUFFIX} and " \ - "${DOWNGRADE_SQL_SUFFIX} exist under ${DOWNGRADE_DIR}" - rc=1 - continue - fi - - if [ "${operation}" = "auto" ]; then - if is_upgrade; then - operation=upgrade - else - operation=downgrade - fi - fi - - if ! ensure_metadata_schema; then - echo "${SCHEMA}: failure: metadata not accessible for this schema" - continue - fi - - if [ -z "${TARGET_RELEASE}" ]; then - target_release - else - # user asked to override - TARGET_UPGRADE_RELEASE="${TARGET_RELEASE}" - TARGET_DOWNGRADE_RELEASE="${TARGET_RELEASE}" - fi - - if [ -z "${CURRENT_RELEASE}" ]; then - if ! current_release; then - echo "${SCHEMA}: failure: cannot obtain current release" - continue - fi - else - if ! set_current_release "${CURRENT_RELEASE}"; then - echo "${SCHEMA}: failure: cannot set current release" - continue - fi - fi - - # Check if the schema has already been installed - current_schema - RETRY=0 - COMPARE="" - last_operation_status - last_status=$? - if [ $last_status -eq 0 ]; then - echo "Partial $LAST_OPERATION detected" - RETRY=1 - if [ "${OPERATION}" == 'downgrade' ] && [ "${LAST_OPERATION}" == 'downgrade' ]; then - CURRENT_RELEASE="${LAST_FROM_VERSION}" - # greater than - COMPARE="gt" - echo "Downgrade will attempt to resume at $LAST_SCRIPT" - elif [ "${OPERATION}" == 'downgrade' ] && [ "${LAST_OPERATION}" == 'upgrade' ]; then - CURRENT_RELEASE="${LAST_TO_VERSION}" - # greater than or equal to - COMPARE="ge" - echo "Downgrade will attempt to resume before $LAST_SCRIPT" - elif [ "${OPERATION}" == 'upgrade' ] && [ "${LAST_OPERATION}" == 'upgrade' ]; then - CURRENT_RELEASE="${LAST_FROM_VERSION}" - # less than - COMPARE="lt" - echo "Upgrade will attempt to resume at $LAST_SCRIPT" - else - CURRENT_RELEASE="${LAST_TO_VERSION}" - # less than or equal - COMPARE="le" - echo "Upgrade will attempt to resume after $LAST_SCRIPT" - fi - fi - - if [ -n "${INPUT_FROM_RELEASE}" ]; then - if [ "${CURRENT_RELEASE}" \> "${INPUT_FROM_RELEASE}" ] || [ "${CURRENT_RELEASE}" \< "${INPUT_FROM_RELEASE}" ]; then - echo "${SCHEMA}: On version ${CURRENT_RELEASE} cannot ${OPERATION} from ${INPUT_FROM_RELEASE}" - continue - else - CURRENT_RELEASE=${INPUT_FROM_RELEASE} - fi - fi - - case ${OPERATION} in - upgrade) - if upgrade; then - echo "${SCHEMA}: OK: upgrade (${CURRENT_RELEASE})" - else - rc=1 - echo "${SCHEMA}: failure: upgrade to release ${TARGET_UPGRADE_RELEASE} (${CURRENT_RELEASE})" - fi - ;; - downgrade) - if downgrade; then - echo "${SCHEMA}: OK: downgrade (${CURRENT_RELEASE})" - else - rc=1 - echo "${SCHEMA}: failure: downgrade to release ${TARGET_DOWNGRADE_RELEASE} (${CURRENT_RELEASE})" - fi - ;; - version) - echo "${SCHEMA}: ${CURRENT_RELEASE}" - ;; - erase) - erase - ;; - report) - report - ;; - ok) - okay - ;; - esac - -done -exit $rc diff --git a/policy-db-migrator/src/main/docker/suse.Dockerfile b/policy-db-migrator/src/main/docker/suse.Dockerfile index 033c8a83..15697fd9 100644 --- a/policy-db-migrator/src/main/docker/suse.Dockerfile +++ b/policy-db-migrator/src/main/docker/suse.Dockerfile @@ -1,8 +1,7 @@ #------------------------------------------------------------------------------- # Dockerfile # ============LICENSE_START======================================================= -# Copyright (C) 2022 Nordix Foundation. -# Modification Copyright 2022-2024 Nordix Foundation. +# Copyright (C) 2022-2025 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -36,7 +35,7 @@ ENV POLICY_ETC /opt/app/policy/etc ENV POLICY_PROFILE /opt/app/policy/etc/profile.d ENV POLICY_BIN /opt/app/policy/bin -RUN zypper -n -q install --no-recommends cpio findutils mariadb-client netcat-openbsd postgresql util-linux && \ +RUN zypper -n -q install --no-recommends cpio findutils netcat-openbsd postgresql util-linux && \ zypper -n -q update && \ zypper -n -q clean --all && \ groupadd --system policy && \ @@ -45,14 +44,10 @@ RUN zypper -n -q install --no-recommends cpio findutils mariadb-client netcat-op chown -R policy:policy $POLICY_ETC $POLICY_BIN COPY --chown=policy:policy ./env.sh $POLICY_PROFILE/ -COPY --chown=policy:policy ./db-migrator $POLICY_BIN/ COPY --chown=policy:policy ./db-migrator-pg $POLICY_BIN/ COPY --chown=policy:policy ./prepare_upgrade.sh $POLICY_BIN/ COPY --chown=policy:policy ./prepare_downgrade.sh $POLICY_BIN/ -COPY --chown=policy:policy ./config/policyadmin/sql /home/policyadmin/sql -COPY --chown=policy:policy ./config/policyadmin/postgres /home/policyadmin/postgres -COPY --chown=policy:policy ./config/clampacm/sql /home/clampacm/sql -COPY --chown=policy:policy ./config/clampacm/postgres /home/clampacm/postgres +COPY --chown=policy:policy ./config /home WORKDIR $POLICY_BIN USER policy:policy diff --git a/policy-jdk/alpine/pom.xml b/policy-jdk/alpine/pom.xml index fe5022a8..b0ef65be 100644 --- a/policy-jdk/alpine/pom.xml +++ b/policy-jdk/alpine/pom.xml @@ -2,7 +2,7 @@ ============LICENSE_START======================================================= Copyright (C) 2019 Ericsson, Tieto. All rights reserved. Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2022-2023 Nordix Foundation. + Modifications Copyright (C) 2022-2025 OpenInfra Foundation Europe. 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. @@ -27,7 +27,7 @@ <parent> <groupId>org.onap.policy.docker</groupId> <artifactId>policy-jdk</artifactId> - <version>4.1.0-SNAPSHOT</version> + <version>4.1.3-SNAPSHOT</version> </parent> <packaging>pom</packaging> @@ -132,4 +132,4 @@ </plugin> </plugins> </build> -</project>
\ No newline at end of file +</project> diff --git a/policy-jdk/pom.xml b/policy-jdk/pom.xml index 3a8a4544..283c5440 100644 --- a/policy-jdk/pom.xml +++ b/policy-jdk/pom.xml @@ -2,6 +2,7 @@ ============LICENSE_START======================================================= Copyright (C) 2019 Ericsson, Tieto. All rights reserved. Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. + Modifications Copyright (C) 2025 OpenInfra Foundation Europe. 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. @@ -24,7 +25,7 @@ <parent> <groupId>org.onap.policy.docker</groupId> <artifactId>docker</artifactId> - <version>4.1.0-SNAPSHOT</version> + <version>4.1.3-SNAPSHOT</version> </parent> <artifactId>policy-jdk</artifactId> diff --git a/policy-jre/alpine/pom.xml b/policy-jre/alpine/pom.xml index 2ec9fd77..4c3ca923 100644 --- a/policy-jre/alpine/pom.xml +++ b/policy-jre/alpine/pom.xml @@ -2,7 +2,7 @@ ============LICENSE_START======================================================= Copyright (C) 2019 Ericsson, Tieto. All rights reserved. Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2022-2023 Nordix Foundation. + Modifications Copyright (C) 2022-2025 OpenInfra Foundation Europe. 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. @@ -27,7 +27,7 @@ <parent> <groupId>org.onap.policy.docker</groupId> <artifactId>policy-jre</artifactId> - <version>4.1.0-SNAPSHOT</version> + <version>4.1.3-SNAPSHOT</version> </parent> <packaging>pom</packaging> @@ -132,4 +132,4 @@ </plugin> </plugins> </build> -</project>
\ No newline at end of file +</project> diff --git a/policy-jre/pom.xml b/policy-jre/pom.xml index 9756c272..7a51882b 100644 --- a/policy-jre/pom.xml +++ b/policy-jre/pom.xml @@ -2,6 +2,7 @@ ============LICENSE_START======================================================= Copyright (C) 2019 Ericsson, Tieto. All rights reserved. Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. + Modifications Copyright (C) 2025 OpenInfra Foundation Europe. 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. @@ -24,7 +25,7 @@ <parent> <groupId>org.onap.policy.docker</groupId> <artifactId>docker</artifactId> - <version>4.1.0-SNAPSHOT</version> + <version>4.1.3-SNAPSHOT</version> </parent> <artifactId>policy-jre</artifactId> diff --git a/policy-regression-tests/pom.xml b/policy-regression-tests/pom.xml index f30dbe7a..0414b5fa 100644 --- a/policy-regression-tests/pom.xml +++ b/policy-regression-tests/pom.xml @@ -1,5 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + ============LICENSE_START======================================================= + Copyright (C) 2025 OpenInfra Foundation Europe. 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. + + SPDX-License-Identifier: Apache-2.0 + ============LICENSE_END========================================================= +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -7,7 +25,7 @@ <parent> <groupId>org.onap.policy.docker</groupId> <artifactId>docker</artifactId> - <version>4.1.0-SNAPSHOT</version> + <version>4.1.3-SNAPSHOT</version> </parent> <groupId>org.onap.policy.regression</groupId> @@ -2,7 +2,7 @@ ============LICENSE_START======================================================= Copyright (C) 2018 Ericsson, Tieto. All rights reserved. Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2021-2022 Nordix Foundation. + Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe. 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. @@ -25,13 +25,13 @@ <parent> <groupId>org.onap.policy.parent</groupId> <artifactId>integration</artifactId> - <version>5.1.0-SNAPSHOT</version> + <version>5.1.3-SNAPSHOT</version> <relativePath /> </parent> <groupId>org.onap.policy.docker</groupId> <artifactId>docker</artifactId> - <version>4.1.0-SNAPSHOT</version> + <version>4.1.3-SNAPSHOT</version> <packaging>pom</packaging> <name>policy-docker</name> diff --git a/releases/4.1.0-container.yaml b/releases/4.1.0-container.yaml new file mode 100644 index 00000000..8e85e216 --- /dev/null +++ b/releases/4.1.0-container.yaml @@ -0,0 +1,12 @@ +distribution_type: 'container' +container_release_tag: '4.1.0' +project: 'policy-docker' +log_dir: 'policy-docker-maven-docker-stage-master/1049' +ref: a8828d286aecc4b33011ab498172955545b085b5 +containers: + - name: 'policy-jre-alpine' + version: '4.1.0-20250127T1446' + - name: 'policy-jdk-alpine' + version: '4.1.0-20250127T1446' + - name: 'policy-db-migrator' + version: '4.1.0-20250127T1446' diff --git a/releases/4.1.1-container.yaml b/releases/4.1.1-container.yaml new file mode 100644 index 00000000..cc49bb71 --- /dev/null +++ b/releases/4.1.1-container.yaml @@ -0,0 +1,12 @@ +distribution_type: 'container' +container_release_tag: '4.1.1' +project: 'policy-docker' +log_dir: 'policy-docker-maven-docker-stage-master/1050' +ref: f7c642c8c2b20876526584c0e07ab326628c5c13 +containers: + - name: 'policy-jre-alpine' + version: '4.1.1-20250311T1542' + - name: 'policy-jdk-alpine' + version: '4.1.1-20250311T1542' + - name: 'policy-db-migrator' + version: '4.1.1-20250311T1542' diff --git a/releases/4.1.2-container.yaml b/releases/4.1.2-container.yaml new file mode 100644 index 00000000..2788528b --- /dev/null +++ b/releases/4.1.2-container.yaml @@ -0,0 +1,12 @@ +distribution_type: 'container' +container_release_tag: '4.1.2' +project: 'policy-docker' +log_dir: 'policy-docker-maven-docker-stage-master/1051' +ref: a2b04910d79d653996c67a04a05bf35a9b9765aa +containers: + - name: 'policy-jre-alpine' + version: '4.1.2-20250422T1403' + - name: 'policy-jdk-alpine' + version: '4.1.2-20250422T1403' + - name: 'policy-db-migrator' + version: '4.1.2-20250422T1403' diff --git a/version.properties b/version.properties index b0ccfcd7..68aaed8b 100644 --- a/version.properties +++ b/version.properties @@ -4,7 +4,7 @@ major=4 minor=1 -patch=0 +patch=3 base_version=${major}.${minor}.${patch} |