Fix sonar issue 44/12944/1 master
authoraravind.est <aravindhan.a@est.tech>
Fri, 7 Jun 2024 12:11:52 +0000 (13:11 +0100)
committeraravind.est <aravindhan.a@est.tech>
Fri, 7 Jun 2024 12:11:52 +0000 (13:11 +0100)
Sonar maintainability issue fixed

Issue-ID: NONRTRIC-872
Change-Id: Ie298a3286eab3b6ae86709f719b6a7ca03ce9295
Signed-off-by: aravind.est <aravindhan.a@est.tech>
34 files changed:
README.md
docs/developer-guide.rst
docs/images/application-lifecycle.png
docs/overview.rst
docs/uml/application-lifecycle.puml
rapp-manager-dme/src/test/java/com/oransc/rappmanager/dme/service/DmeDeployerTest.java
sample-rapp-generator/generate.bat
sample-rapp-generator/generate.sh
sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/.helmignore [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/Chart.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-deployment.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-service.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/values.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/Definitions/asd.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/Definitions/asd_types.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/Files/Acm/definition/compositions.json [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/Files/Acm/instances/k8s-instance.json [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/Files/Dme/consumerinfotypes/type1.json [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/Files/Dme/infoconsumers/ics-sample-consumer.json [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/TOSCA-Metadata/TOSCA.meta [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-consumer/asd.mf [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/.helmignore [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/Chart.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-deployment.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-service.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/values.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Definitions/asd.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Definitions/asd_types.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Files/Acm/definition/compositions.json [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Files/Acm/instances/k8s-instance.json [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Files/Dme/infoproducers/ics-sample-producer.json [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/Files/Dme/producerinfotypes/type1.json [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/TOSCA-Metadata/TOSCA.meta [new file with mode: 0644]
sample-rapp-generator/rapp-sample-ics-producer/asd.mf [new file with mode: 0644]

index 233c17b..02f43bc 100755 (executable)
--- a/README.md
+++ b/README.md
@@ -37,9 +37,9 @@ ONAP ACM is used here as a backend of rApp manager to lifecycle manage the deplo
 ONAP ACM related details can be found [here](https://docs.onap.org/projects/onap-policy-parent/en/london/clamp/clamp.html).
 
 
-### Integration of SME (CAPIF)
+### Integration of SME (Service Manager)
 
-This integration is based on the CAPIF function developed as part of O-RAN SC. It is available [here](https://github.com/o-ran-sc/nonrtric-plt-sme/blob/master/capifcore/README.md)
+This integration is based on the Service Manager function developed as part of O-RAN SC. It is available [here](https://github.com/o-ran-sc/nonrtric-plt-sme/blob/master/servicemanager/README.md)
 
 ### Integration of DME (ICS)
 
index e1dea3c..0584ca1 100755 (executable)
@@ -1,6 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. SPDX-License-Identifier: CC-BY-4.0
-.. Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
+.. Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
 
 Developer Guide
 ===============
@@ -27,26 +27,32 @@ command in the *rappmanager/rapp-manager-application* directory:
 There are a few service endpoints that needs to be available to run. These are referred to from the application.yaml file.
 The following properties have to be modified:
 
-* rappmanager.acm.baseurl=http://policy-clamp-runtime-acm.default:6969/onap/policy/clamp/acm/v2/
-* rappmanager.sme.baseurl=http://capifcore:8090
-* rappmanager.dme.baseurl=http://informationservice:9082
+.. code-block:: yaml
+
+    rappmanager.acm.baseurl=http://policy-clamp-runtime-acm.default:6969/onap/policy/clamp/acm/v2/
+    rappmanager.sme.baseurl=http://servicemanager:8095
+    rappmanager.dme.baseurl=http://informationservice:9082
+    rappmanager.rapps.env.smeDiscoveryEndpoint=http://servicemanager:8095/service-apis/v1/allServiceAPIs
 
 
 Start in Docker
 +++++++++++++++
 
-To build and deploy the rApp Manager, go to the *rappmanager/rapp-manager-application* folder and run the
+To build and deploy the rApp Manager, go to the *rappmanager* folder and run the
 following command:
 
     +-----------------------------+
     | mvn clean install           |
     +-----------------------------+
 
+.. note::
+    The rApp packages for the unit tests are generated as part of the build process at the rappmanager level.
+
 Then start the container by running the following command:
 
-    +-------------------------------------+
-    | docker run nonrtric-plt-rappmanager |
-    +-------------------------------------+
+    +----------------------------------------------+
+    | docker run o-ran-sc/nonrtric-plt-rappmanager |
+    +----------------------------------------------+
 
 Kubernetes deployment
 +++++++++++++++++++++
@@ -55,6 +61,8 @@ Non-RT RIC can be also deployed in a Kubernetes cluster, `it/dep repository <htt
 hosts deployment and integration artifacts. Instructions and helm charts to deploy the Non-RT-RIC functions in the
 OSC NONRTRIC integrated test environment can be found in the *./nonrtric* directory.
 
+The scripts located in *rappmanager/scripts/install* can be used for an automatic installation in the Kubernetes Cluster, see `Automatic Installation in Kubernetes <https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-rappmanager/en/latest/installation-guide.html>`_.
+
 For more information on installation of NonRT-RIC in Kubernetes, see `Deploy NONRTRIC in Kubernetes <https://wiki.o-ran-sc.org/display/RICNR/Release+I+-+Run+in+Kubernetes>`_.
 
 For more information see `Integration and Testing documentation in the O-RAN-SC <https://docs.o-ran-sc.org/projects/o-ran-sc-it-dep/en/latest/index.html>`_.
index 583143a..727acbd 100755 (executable)
Binary files a/docs/images/application-lifecycle.png and b/docs/images/application-lifecycle.png differ
index 1d8c5bc..6bfb31f 100755 (executable)
@@ -1,6 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. SPDX-License-Identifier: CC-BY-4.0
-.. Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
+.. Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
 
 rApp Manager
 ~~~~~~~~~~~~
@@ -60,10 +60,12 @@ Information type, and Data producer/consumer information can be provided as part
 
 SME
 ---
+Service Manager is a Go implementation of a service that calls the CAPIF Core function. When publishing a service it creates a Kong route and Kong service.
+
 The CAPIF stands for Common API framework and it was developed by 3GPP to enable a unified Northbound API framework across 3GPP network functions, and to ensure that there is a single and harmonized approach for API development.
 More details about SME can be found in `SME <https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-sme/en/latest/overview.html>`_.
 
-It is integrated with rApp manager to enable the rApp to expose/access/discover endpoints.
+Service Manager is integrated with rApp manager to enable the rApp to expose/access/discover endpoints.
 
 Service exposure/access related configurations can be provided as part of rApp package and the package structure can be found in `Sample rApp package structure`_.
 
index 3a13740..51b23ea 100755 (executable)
@@ -1,18 +1,18 @@
 @startuml
 participant "rApp Manager"
 participant "ACM Runtime"
-participant "CAPIF"
+participant "SME"
 
 autonumber
 
 group Application Startup
-"rApp Manager"->"CAPIF": Create "rApp Manager" as AMF
+"rApp Manager"->"SME": Create "rApp Manager" as AMF
 end
 
 autonumber
 
 group Application Stop
-"rApp Manager"->"CAPIF": Delete "rApp Manager" as AMF
+"rApp Manager"->"SME": Delete "rApp Manager" as AMF
 end
 
 @enduml
\ No newline at end of file
index 7961cc2..f3080e5 100755 (executable)
@@ -148,7 +148,7 @@ class DmeDeployerTest {
     }
 
     @Test
-    void testPrimeRappWithoutDme() throws JsonProcessingException {
+    void testPrimeRappWithoutDme() {
         RappResources rappResources = rappDmeResourceBuilder.getResources();
         rappResources.setDme(null);
         Rapp rapp = getRapp(Optional.empty());
index ccf3049..b9047a9 100755 (executable)
@@ -6,7 +6,7 @@
 ::  you may not use this file except in compliance with the License.
 ::  You may obtain a copy of the License at
 ::
-::       http:\\www.apache.org\licenses\LICENSE-2.0
+::       http://www.apache.org/licenses/LICENSE-2.0
 ::
 ::  Unless required by applicable law or agreed to in writing, software
 ::  distributed under the License is distributed on an "AS IS" BASIS,
 ::
 
 @echo off
+setlocal enabledelayedexpansion
 
 if [%1]==[] goto usage
 SET DIRECTORY=%1
 if %DIRECTORY:~-1%==\ (
     SET DIRECTORY=%DIRECTORY:~0,-1%
 )
+
+SET HELM_DIR=%DIRECTORY%/Artifacts/Deployment/HELM
+SET CSARFILE=%DIRECTORY%.csar
+SET ZIPFILE=%DIRECTORY%.zip
+SET EXCLUDE_DIRS=
+
 if exist %DIRECTORY% (
-    SET CSARFILE=%DIRECTORY%.csar
-    SET ZIPFILE=%DIRECTORY%.zip
+    if exist "%HELM_DIR%" (
+        echo Helm directory exists: %HELM_DIR%
+        for /d %%D in ("%HELM_DIR%\*") do (
+            if exist "%%D" (
+                echo Checking directory: %%D
+                echo Packaging Helm chart in directory: %%~nxD
+                helm package %%D -d %HELM_DIR%
+                SET EXCLUDE_DIRS=!EXCLUDE_DIRS!--exclude=Artifacts/Deployment/HELM/%%~nxD/*
+                echo Excluding directory: %HELM_DIR%\%%~nxD
+            )
+        )
+    ) else (
+        echo Helm directory %HELM_DIR% doesn't exist.
+    )
+
     del %CSARFILE% 2>nul
     pushd %DIRECTORY%
-    tar -a -cf ..\%ZIPFILE% *
+    tar !EXCLUDE_DIRS! -a -cf ..\%ZIPFILE% *
     popd
     rename %ZIPFILE% %CSARFILE%
     @echo rApp package %CSARFILE% generated.
 ) else (
-    @echo Directory %DIRECTORY% doesn't exists.
+    @echo Directory %DIRECTORY% doesn't exist.
 )
 goto :eof
 
index d606186..b7118a0 100755 (executable)
@@ -28,15 +28,39 @@ if ! command -v zip &> /dev/null; then
   exit 1
 fi
 
+if ! command -v helm &> /dev/null; then
+  echo "Helm command not found. Please install helm to proceed."
+  exit 1
+fi
+
 DIRECTORY=${1%/}
 PACKAGENAME="$DIRECTORY.csar"
+HELM_DIR="$DIRECTORY/Artifacts/Deployment/HELM"
+EXCLUDE_DIRS=()
+
+checkHelmPackage() {
+  if [ -d "$HELM_DIR" ]; then
+    for dir in "$HELM_DIR"/*/ ; do
+      if [ -d "$dir" ]; then
+        HELM_PACKAGE_NAME=$(basename "$dir")
+        pushd "$HELM_DIR"
+        helm package "$HELM_PACKAGE_NAME"
+        popd
+        EXCLUDE_DIRS+=("*/$HELM_PACKAGE_NAME/*")
+      fi
+    done
+  else
+    echo "Helm directory $HELM_DIR doesn't exist."
+  fi
+}
 
 if [ -d "$DIRECTORY" ]; then
-  rm $PACKAGENAME 2> /dev/null
+  checkHelmPackage
+  rm -f $PACKAGENAME 2> /dev/null
   pushd $DIRECTORY
-  zip -r ../$PACKAGENAME *
+  zip -r ../$PACKAGENAME * $(printf " -x %s" "${EXCLUDE_DIRS[@]}")
   popd
   echo -e "rApp package $PACKAGENAME generated."
 else
-  echo "Directory $DIRECTORY doesn't exists."
+  echo "Directory $DIRECTORY doesn't exist."
 fi
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/.helmignore b/sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/.helmignore
new file mode 100644 (file)
index 0000000..0e8a0eb
--- /dev/null
@@ -0,0 +1,23 @@
+# 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
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/Chart.yaml b/sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/Chart.yaml
new file mode 100644 (file)
index 0000000..8b972e8
--- /dev/null
@@ -0,0 +1,6 @@
+apiVersion: v2
+name: ics-consumer
+description: A Helm chart for Kubernetes
+type: application
+version: 0.1.0
+appVersion: "1.16.0"
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-deployment.yaml b/sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-deployment.yaml
new file mode 100644 (file)
index 0000000..9c107fe
--- /dev/null
@@ -0,0 +1,41 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT 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===================================
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ .Values.consumer.name }}
+spec:
+  replicas: {{ .Values.consumer.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ .Values.consumer.name }}
+  template:
+    metadata:
+      labels:
+        app: {{ .Values.consumer.name }}
+    spec:
+      containers:
+      - name: {{ .Values.consumer.name }}
+        image: "{{ .Values.consumer.image.repository }}:{{ .Values.consumer.image.tag }}"
+        ports:
+        - containerPort: {{ .Values.consumer.service.port }}
+        env:
+        - name: KAFKA_SERVERS
+          value: "{{ .Values.kafka.host }}:{{ .Values.kafka.port }}"
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-service.yaml b/sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-service.yaml
new file mode 100644 (file)
index 0000000..6b33838
--- /dev/null
@@ -0,0 +1,31 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT 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===================================
+#
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ .Values.consumer.name }}
+spec:
+  type: NodePort
+  ports:
+    - port: {{ .Values.consumer.service.port }}
+      targetPort: {{ .Values.consumer.service.port }}
+      nodePort: {{ .Values.consumer.service.nodePort }}
+  selector:
+    app: {{ .Values.consumer.name }}
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/values.yaml b/sample-rapp-generator/rapp-sample-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/values.yaml
new file mode 100644 (file)
index 0000000..a81ec45
--- /dev/null
@@ -0,0 +1,32 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT 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===================================
+#
+consumer:
+  name: kafka-consumer
+  replicaCount: 1
+  image:
+    repository: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-sample-icsconsumer
+    tag: 0.0.1
+  service:
+    port: 8081
+    nodePort: 30081
+
+kafka:
+  host: kafka.default.svc.cluster.local
+  port: 9092
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Definitions/asd.yaml b/sample-rapp-generator/rapp-sample-ics-consumer/Definitions/asd.yaml
new file mode 100644 (file)
index 0000000..824deda
--- /dev/null
@@ -0,0 +1,48 @@
+#  ============LICENSE_START=======================================================\r
+#  Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.\r
+#  ================================================================================\r
+#  Licensed under the Apache License, Version 2.0 (the "License");\r
+#  you may not use this file except in compliance with the License.\r
+#  You may obtain a copy of the License at\r
+#\r
+#        http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+#  Unless required by applicable law or agreed to in writing, software\r
+#  distributed under the License is distributed on an "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+#  See the License for the specific language governing permissions and\r
+#  limitations under the License.\r
+#\r
+#  SPDX-License-Identifier: Apache-2.0\r
+#  ============LICENSE_END=========================================================\r
+\r
+tosca_definitions_version: tosca_simple_yaml_1_2\r
+\r
+description: rApp ICS Consumer\r
+\r
+imports:\r
+  - asd_types.yaml\r
+\r
+topology_template:\r
+  node_templates:\r
+    applicationServiceDescriptor:\r
+      type: tosca.nodes.asd\r
+      description: "rapp-ics-consumer"\r
+      properties:\r
+        descriptor_id: 9be3038d-d0ed-4d8a-b3f8-13c5329aae17\r
+        descriptor_invariant_id: 9be3038d-d0ed-4d8a-b3f8-13c5329aae18\r
+        descriptor_version: 1.0\r
+        schema_version: 2.0\r
+        function_description: rApp description\r
+        provider: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
+        application_name: rapp-ics-consumer\r
+        application_version: 1.0\r
+      artifacts:\r
+        consumer:\r
+          type: tosca.artifacts.asd.deploymentItem\r
+          file: "Artifacts/Deployment/HELM/ics-consumer-0.1.0.tgz"\r
+          properties:\r
+            artifact_type: "helm_chart"\r
+            target_server: "chartmuseum"\r
+            target_server_uri: "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI"\r
+            item_id: 1\r
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Definitions/asd_types.yaml b/sample-rapp-generator/rapp-sample-ics-consumer/Definitions/asd_types.yaml
new file mode 100644 (file)
index 0000000..c4de6ad
--- /dev/null
@@ -0,0 +1,90 @@
+#  ============LICENSE_START=======================================================\r
+#  Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.\r
+#  ================================================================================\r
+#  Licensed under the Apache License, Version 2.0 (the "License");\r
+#  you may not use this file except in compliance with the License.\r
+#  You may obtain a copy of the License at\r
+#\r
+#        http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+#  Unless required by applicable law or agreed to in writing, software\r
+#  distributed under the License is distributed on an "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+#  See the License for the specific language governing permissions and\r
+#  limitations under the License.\r
+#\r
+#  SPDX-License-Identifier: Apache-2.0\r
+#  ============LICENSE_END=========================================================\r
+\r
+tosca_definitions_version: tosca_simple_yaml_1_2\r
+description: ASD types definitions version 0.1\r
+node_types:\r
+  tosca.nodes.asd:\r
+    derived_from: tosca.nodes.Root\r
+    description: "The ASD node type"\r
+    version: 0.1\r
+    properties:\r
+      descriptor_id:\r
+        type: string # UUID\r
+        required: true\r
+        description: Identifier of this ASD. It is in UUID format as specified in RFC 4122\r
+      descriptor_invariant_id:\r
+        type: string # UUID\r
+        required: true\r
+        description: >\r
+          Identifier of this descriptor in a version independent manner. This attribute\r
+          is invariant across versions of ASD. It is in UUID format as specified in RFC 4122\r
+      descriptor_version:\r
+        type: string\r
+        required: true\r
+        description: Identifies the version of the ASD.\r
+      schema_version:\r
+        type: string\r
+        required: true\r
+        description: Identifies the Identifies the version of this ASD’s schema.\r
+      function_description:\r
+        type: string\r
+        required: false\r
+        description: Description of the application service described by this ASD.\r
+      provider:\r
+        type: string\r
+        required: true\r
+        description: Identifies the provider of the ASD.\r
+      application_name:\r
+        type: string\r
+        required: true\r
+        description: Name to identify the application service described by this ASD\r
+      application_version:\r
+        type: string\r
+        required: true\r
+        description: Identifies the version of the application service described by this ASD.\r
+\r
+artifact_types:\r
+tosca.artifacts.asd.deploymentItem:\r
+  version: 0.1\r
+  derived_from: tosca.artifacts.Root\r
+  description: "Describes the artifact type of asd deployment item"\r
+  file: "Relative path of the artifact in the package"\r
+  properties:\r
+    item_id:\r
+      description: "The identifier of this asd deployment item"\r
+      required: true\r
+      type: string\r
+    artifact_type:\r
+      description: >\r
+        Specify artifact type.\r
+      required: true\r
+      type: string\r
+      constraints:\r
+        - valid_values: ["helm_chart"]\r
+    target_server:\r
+      description: >\r
+        Specify target server for artifact.\r
+      required: true\r
+      type: string\r
+      constraints:\r
+        - valid_values: [ "chartmuseum" ]\r
+    target_server_uri:\r
+      description: "URI of the target server"\r
+      required: true\r
+      type: string
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Files/Acm/definition/compositions.json b/sample-rapp-generator/rapp-sample-ics-consumer/Files/Acm/definition/compositions.json
new file mode 100644 (file)
index 0000000..e64d882
--- /dev/null
@@ -0,0 +1,320 @@
+{
+  "tosca_definitions_version": "tosca_simple_yaml_1_3",
+  "data_types": {
+    "onap.datatypes.ToscaConceptIdentifier": {
+      "derived_from": "tosca.datatypes.Root",
+      "properties": {
+        "name": {
+          "type": "string",
+          "required": true
+        },
+        "version": {
+          "type": "string",
+          "required": true
+        }
+      }
+    },
+    "org.onap.datatypes.policy.clamp.acm.kserveAutomationCompositionElement.KserveInferenceEntity": {
+      "version": "1.0.0",
+      "derived_from": "tosca.datatypes.Root",
+      "properties": {
+        "kserveEntityId": {
+          "type": "onap.datatypes.ToscaConceptIdentifier",
+          "required": true,
+          "description": "The name and version of a Configuration Entity to be handled by the Kserve Automation Composition Element"
+        },
+        "name": {
+          "type": "string",
+          "required": true,
+          "description": "Inference service name to be created"
+        },
+        "payload": {
+          "type": "string",
+          "required": true,
+          "description": "Inference Service payload"
+        }
+      }
+    },
+    "org.onap.datatypes.policy.clamp.acm.a1pmsAutomationCompositionElement.A1PolicyServiceEntity": {
+      "version": "1.0.0",
+      "derived_from": "tosca.datatypes.Root",
+      "properties": {
+        "a1PolicyServiceEntityId": {
+          "type": "onap.datatypes.ToscaConceptIdentifier",
+          "required": true,
+          "description": "The name and version of a Configuration Entity to be handled by the A1 PMS Automation Composition Element"
+        },
+        "clientId": {
+          "type": "string",
+          "required": true,
+          "description": "Client Id to be created"
+        },
+        "callbackUrl": {
+          "type": "string",
+          "required": true,
+          "description": "The callback URL to get registered"
+        },
+        "keepAliveIntervalSeconds": {
+          "type": "integer",
+          "required": true,
+          "description": "Keep alive interval time for the callback URL"
+        }
+      }
+    }
+  },
+  "node_types": {
+    "org.onap.policy.clamp.acm.Participant": {
+      "version": "1.0.1",
+      "derived_from": "tosca.nodetypes.Root",
+      "properties": {
+        "provider": {
+          "type": "string",
+          "required": false
+        }
+      }
+    },
+    "org.onap.policy.clamp.acm.AutomationCompositionElement": {
+      "version": "1.0.1",
+      "derived_from": "tosca.nodetypes.Root",
+      "properties": {
+        "provider": {
+          "type": "string",
+          "required": false
+        },
+        "participantType": {
+          "type": "onap.datatypes.ToscaConceptIdentifier",
+          "required": true
+        },
+        "startPhase": {
+          "type": "integer",
+          "required": false,
+          "constraints": [
+            {
+              "greater-or-equal": 0
+            }
+          ],
+          "metadata": {
+            "common": true
+          },
+          "description": "A value indicating the start phase in which this automation composition element will be started, the first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously"
+        },
+        "passiveToRunningTimeout": {
+          "type": "integer",
+          "required": false,
+          "constraints": [
+            {
+              "greater_or_equal": 0
+            }
+          ],
+          "default": 60,
+          "metadata": {
+            "common": true
+          },
+          "description": "The maximum time in seconds to wait for a state chage from passive to running"
+        },
+        "runningToPassiveTimeout": {
+          "type": "integer",
+          "required": false,
+          "constraints": [
+            {
+              "greater_or_equal": 0
+            }
+          ],
+          "default": 60,
+          "metadata": {
+            "common": true
+          },
+          "description": "The maximum time in seconds to wait for a state chage from running to passive"
+        },
+        "passiveToUninitializedTimeout": {
+          "type": "integer",
+          "required": false,
+          "constraints": [
+            {
+              "greater_or_equal": 0
+            }
+          ],
+          "default": 60,
+          "metadata": {
+            "common": true
+          },
+          "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized"
+        }
+      }
+    },
+    "org.onap.policy.clamp.acm.AutomationComposition": {
+      "version": "1.0.1",
+      "derived_from": "tosca.nodetypes.Root",
+      "properties": {
+        "provider": {
+          "type": "string",
+          "required": false,
+          "metadata": {
+            "common": true
+          }
+        },
+        "elements": {
+          "type": "list",
+          "required": true,
+          "metadata": {
+            "common": true
+          },
+          "entry_schema": {
+            "type": "onap.datatypes.ToscaConceptIdentifier"
+          }
+        }
+      }
+    },
+    "org.onap.policy.clamp.acm.KserveAutomationCompositionElement": {
+      "version": "1.0.1",
+      "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",
+      "properties": {
+        "kserveInferenceEntities": {
+          "type": "list",
+          "required": true,
+          "entry_schema": {
+            "type": "org.onap.datatypes.policy.clamp.acm.kserveAutomationCompositionElement.KserveInferenceEntity",
+            "type_version": "1.0.0"
+          },
+          "description": "The configuration entities of Kserve inference service"
+        }
+      }
+    },
+    "org.onap.policy.clamp.acm.A1PMSAutomationCompositionElement": {
+      "version": "1.0.1",
+      "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",
+      "properties": {
+        "policyServiceEntities": {
+          "type": "list",
+          "required": true,
+          "entry_schema": {
+            "type": "org.onap.datatypes.policy.clamp.acm.a1pmsAutomationCompositionElement.A1PolicyServiceEntity",
+            "type_version": "1.0.0"
+          },
+          "description": "The configuration entities of A1 policy services"
+        }
+      }
+    },
+    "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement": {
+      "version": "1.0.0",
+      "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",
+      "properties": {
+        "chart": {
+          "type": "string",
+          "required": true
+        },
+        "configs": {
+          "type": "list",
+          "required": false
+        },
+        "requirements": {
+          "type": "string",
+          "required": false
+        },
+        "templates": {
+          "type": "list",
+          "required": false,
+          "entry_schema": null
+        },
+        "values": {
+          "type": "string",
+          "required": true
+        }
+      }
+    }
+  },
+  "topology_template": {
+    "node_templates": {
+      "org.onap.policy.clamp.acm.KserveParticipant": {
+        "version": "2.3.4",
+        "type": "org.onap.policy.clamp.acm.Participant",
+        "type_version": "1.0.1",
+        "description": "Participant for Kserve requests",
+        "properties": {
+          "provider": "ONAP"
+        }
+      },
+      "org.onap.policy.clamp.acm.A1PMSAutomationCompositionParticipant": {
+        "version": "2.3.4",
+        "type": "org.onap.policy.clamp.acm.Participant",
+        "type_version": "1.0.1",
+        "description": "Participant for A1 PMS requests",
+        "properties": {
+          "provider": "ONAP"
+        }
+      },
+      "org.onap.k8s.acm.K8SAutomationCompositionParticipant": {
+        "version": "2.3.4",
+        "type": "org.onap.policy.clamp.acm.Participant",
+        "type_version": "1.0.1",
+        "description": "Participant for K8S",
+        "properties": {
+          "provider": "ONAP"
+        }
+      },
+      "onap.policy.clamp.ac.element.KserveAutomationCompositionElement": {
+        "version": "1.2.3",
+        "type": "org.onap.policy.clamp.acm.KserveAutomationCompositionElement",
+        "type_version": "1.0.1",
+        "description": "Automation composition element for the Kserve Requests",
+        "properties": {
+          "provider": "ONAP",
+          "participantType": {
+            "name": "org.onap.policy.clamp.acm.KserveParticipant",
+            "version": "2.3.4"
+          },
+          "uninitializedToPassiveTimeout": 300,
+          "statusCheckInterval": 30
+        }
+      },
+      "onap.policy.clamp.ac.element.A1PMSAutomationCompositionElement": {
+        "version": "1.2.3",
+        "type": "org.onap.policy.clamp.acm.A1PMSAutomationCompositionElement",
+        "type_version": "1.0.1",
+        "description": "Automation composition element for the A1 PMS Requests",
+        "properties": {
+          "provider": "ONAP",
+          "participantType": {
+            "name": "org.onap.policy.clamp.acm.A1PMSParticipant",
+            "version": "2.3.4"
+          }
+        }
+      },
+      "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement": {
+        "version": "1.2.3",
+        "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",
+        "type_version": "1.0.0",
+        "description": "Automation composition element for the K8S microservice for AC Element Starter",
+        "properties": {
+          "provider": "ONAP",
+          "startPhase": 0,
+          "uninitializedToPassiveTimeout": 300,
+          "podStatusCheckInterval": 30
+        }
+      },
+      "onap.policy.clamp.ac.element.AutomationCompositionDefinition": {
+        "version": "1.2.3",
+        "type": "org.onap.policy.clamp.acm.AutomationComposition",
+        "type_version": "1.0.1",
+        "description": "Automation composition for rapp deployment",
+        "properties": {
+          "provider": "ONAP",
+          "elements": [
+            {
+              "name": "onap.policy.clamp.ac.element.KserveAutomationCompositionElement",
+              "version": "1.2.3"
+            },
+            {
+              "name": "onap.policy.clamp.ac.element.A1PMSAutomationCompositionElement",
+              "version": "1.2.3"
+            },
+            {
+              "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
+              "version": "1.2.3"
+            }
+          ]
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Files/Acm/instances/k8s-instance.json b/sample-rapp-generator/rapp-sample-ics-consumer/Files/Acm/instances/k8s-instance.json
new file mode 100644 (file)
index 0000000..6748b29
--- /dev/null
@@ -0,0 +1,31 @@
+{
+  "name": "DemoInstance1",
+  "version": "1.0.1",
+  "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID",
+  "description": "Demo automation composition instance 1",
+  "elements": {
+    "ce96b012-90a0-4eb5-ac81-df174f540119": {
+      "id": "ce96b012-90a0-4eb5-ac81-df174f540119",
+      "definition": {
+        "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
+        "version": "1.2.3"
+      },
+      "description": "Starter Automation Composition Element for ICS Consumer",
+      "properties": {
+        "chart": {
+          "chartId": {
+            "name": "ics-consumer",
+            "version": "0.1.0"
+          },
+          "namespace": "nonrtric",
+          "releaseName": "ics-consumer",
+          "podName": "ics-consumer",
+          "repository": {
+            "repoName": "local",
+            "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
+          }
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Files/Dme/consumerinfotypes/type1.json b/sample-rapp-generator/rapp-sample-ics-consumer/Files/Dme/consumerinfotypes/type1.json
new file mode 100644 (file)
index 0000000..7869860
--- /dev/null
@@ -0,0 +1,9 @@
+{
+  "info_job_data_schema": {
+    "$schema":"http://json-schema.org/draft-07/schema#",
+    "title":"STD_Type1_1.0.0",
+    "description":"Type 1",
+    "topic": "mytopic",
+    "bootStrapServers": "kafka.default.svc.cluster.local:9092"
+    }
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/Files/Dme/infoconsumers/ics-sample-consumer.json b/sample-rapp-generator/rapp-sample-ics-consumer/Files/Dme/infoconsumers/ics-sample-consumer.json
new file mode 100644 (file)
index 0000000..c6d5ef4
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "info_type_id": "type1",
+  "job_owner": "demo",
+  "job_definition": {
+    "deliveryInfo": {
+      "topic": "mytopic",
+      "bootStrapServers": "kafka.default.svc.cluster.local:9092"
+    }
+  },
+  "job_result_uri": "http://kafka-producer:8080/producer/job",
+  "status_notification_uri": "http://kafka-producer:8080/producer/supervision"
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/TOSCA-Metadata/TOSCA.meta b/sample-rapp-generator/rapp-sample-ics-consumer/TOSCA-Metadata/TOSCA.meta
new file mode 100644 (file)
index 0000000..3da5f0d
--- /dev/null
@@ -0,0 +1,5 @@
+TOSCA-Meta-File-Version: 1.0\r
+CSAR-Version: 1.0\r
+Created-By: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
+Entry-Definitions: Definitions/asd.yaml\r
+ETSI-Entry-Manifest: asd.mf
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-consumer/asd.mf b/sample-rapp-generator/rapp-sample-ics-consumer/asd.mf
new file mode 100644 (file)
index 0000000..215a27b
--- /dev/null
@@ -0,0 +1,15 @@
+metadata:
+  application_name: rapp-sample-ics-consumer
+  application_provider: Ericsson Software Technology (O-RAN SC NONRTRIC team)
+  release_date_time: 2024-05-23T12:00:00+00:00
+  entry_definition_type: asd
+
+Source: asd.mf
+Source: Artifacts/Deployment/HELM/ics-consumer-0.1.0.tgz
+Source: Definitions/asd.yaml
+Source: Definitions/asd_types.yaml
+Source: TOSCA-Metadata/TOSCA.meta
+Source: Files/Dme/infoconsumers/ics-sample-consumer.json
+Source: Files/Dme/consumerinfotypes/type1.json
+Source: Files/Acm/definition/compositions.json
+Source: Files/Acm/instances/k8s-instance.json
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/.helmignore b/sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/.helmignore
new file mode 100644 (file)
index 0000000..0e8a0eb
--- /dev/null
@@ -0,0 +1,23 @@
+# 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
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/Chart.yaml b/sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/Chart.yaml
new file mode 100644 (file)
index 0000000..e26165b
--- /dev/null
@@ -0,0 +1,6 @@
+apiVersion: v2
+name: ics-producer
+description: A Helm chart for Kubernetes
+type: application
+version: 0.1.0
+appVersion: "1.16.0"
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-deployment.yaml b/sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-deployment.yaml
new file mode 100644 (file)
index 0000000..b7433fc
--- /dev/null
@@ -0,0 +1,41 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT 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===================================
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ .Values.producer.name }}
+spec:
+  replicas: {{ .Values.producer.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ .Values.producer.name }}
+  template:
+    metadata:
+      labels:
+        app: {{ .Values.producer.name }}
+    spec:
+      containers:
+      - name: {{ .Values.producer.name }}
+        image: "{{ .Values.producer.image.repository }}:{{ .Values.producer.image.tag }}"
+        ports:
+        - containerPort: {{ .Values.producer.service.port }}
+        env:
+        - name: KAFKA_SERVERS
+          value: "{{ .Values.kafka.host }}:{{ .Values.kafka.port }}"
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-service.yaml b/sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-service.yaml
new file mode 100644 (file)
index 0000000..8e17906
--- /dev/null
@@ -0,0 +1,31 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT 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===================================
+#
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ .Values.producer.name }}
+spec:
+  type: NodePort
+  ports:
+    - port: {{ .Values.producer.service.port }}
+      targetPort: {{ .Values.producer.service.port }}
+      nodePort: {{ .Values.producer.service.nodePort }}
+  selector:
+    app: {{ .Values.producer.name }}
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/values.yaml b/sample-rapp-generator/rapp-sample-ics-producer/Artifacts/Deployment/HELM/ics-producer/values.yaml
new file mode 100644 (file)
index 0000000..cc0a720
--- /dev/null
@@ -0,0 +1,32 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT 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===================================
+#
+producer:
+  name: kafka-producer
+  replicaCount: 1
+  image:
+    repository: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-sample-icsproducer
+    tag: 0.0.1
+  service:
+    port: 8080
+    nodePort: 30080
+
+kafka:
+  host: kafka.default.svc.cluster.local
+  port: 9092
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Definitions/asd.yaml b/sample-rapp-generator/rapp-sample-ics-producer/Definitions/asd.yaml
new file mode 100644 (file)
index 0000000..a2ace96
--- /dev/null
@@ -0,0 +1,48 @@
+#  ============LICENSE_START=======================================================\r
+#  Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.\r
+#  ================================================================================\r
+#  Licensed under the Apache License, Version 2.0 (the "License");\r
+#  you may not use this file except in compliance with the License.\r
+#  You may obtain a copy of the License at\r
+#\r
+#        http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+#  Unless required by applicable law or agreed to in writing, software\r
+#  distributed under the License is distributed on an "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+#  See the License for the specific language governing permissions and\r
+#  limitations under the License.\r
+#\r
+#  SPDX-License-Identifier: Apache-2.0\r
+#  ============LICENSE_END=========================================================\r
+\r
+tosca_definitions_version: tosca_simple_yaml_1_2\r
+\r
+description: rApp ICS Producer\r
+\r
+imports:\r
+  - asd_types.yaml\r
+\r
+topology_template:\r
+  node_templates:\r
+    applicationServiceDescriptor:\r
+      type: tosca.nodes.asd\r
+      description: "rapp-ics-producer"\r
+      properties:\r
+        descriptor_id: 2cd6a567-2e33-4960-8ef7-1cc519c998c5\r
+        descriptor_invariant_id: 3f8a5e1b-68f1-42e5-89d0-47090dd0ef5b\r
+        descriptor_version: 1.0\r
+        schema_version: 2.0\r
+        function_description: rApp description\r
+        provider: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
+        application_name: rapp-ics-producer\r
+        application_version: 1.0\r
+      artifacts:\r
+        producer:\r
+          type: tosca.artifacts.asd.deploymentItem\r
+          file: "Artifacts/Deployment/HELM/ics-producer-0.1.0.tgz"\r
+          properties:\r
+            artifact_type: "helm_chart"\r
+            target_server: "chartmuseum"\r
+            target_server_uri: "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI"\r
+            item_id: 1\r
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Definitions/asd_types.yaml b/sample-rapp-generator/rapp-sample-ics-producer/Definitions/asd_types.yaml
new file mode 100644 (file)
index 0000000..c4de6ad
--- /dev/null
@@ -0,0 +1,90 @@
+#  ============LICENSE_START=======================================================\r
+#  Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.\r
+#  ================================================================================\r
+#  Licensed under the Apache License, Version 2.0 (the "License");\r
+#  you may not use this file except in compliance with the License.\r
+#  You may obtain a copy of the License at\r
+#\r
+#        http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+#  Unless required by applicable law or agreed to in writing, software\r
+#  distributed under the License is distributed on an "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+#  See the License for the specific language governing permissions and\r
+#  limitations under the License.\r
+#\r
+#  SPDX-License-Identifier: Apache-2.0\r
+#  ============LICENSE_END=========================================================\r
+\r
+tosca_definitions_version: tosca_simple_yaml_1_2\r
+description: ASD types definitions version 0.1\r
+node_types:\r
+  tosca.nodes.asd:\r
+    derived_from: tosca.nodes.Root\r
+    description: "The ASD node type"\r
+    version: 0.1\r
+    properties:\r
+      descriptor_id:\r
+        type: string # UUID\r
+        required: true\r
+        description: Identifier of this ASD. It is in UUID format as specified in RFC 4122\r
+      descriptor_invariant_id:\r
+        type: string # UUID\r
+        required: true\r
+        description: >\r
+          Identifier of this descriptor in a version independent manner. This attribute\r
+          is invariant across versions of ASD. It is in UUID format as specified in RFC 4122\r
+      descriptor_version:\r
+        type: string\r
+        required: true\r
+        description: Identifies the version of the ASD.\r
+      schema_version:\r
+        type: string\r
+        required: true\r
+        description: Identifies the Identifies the version of this ASD’s schema.\r
+      function_description:\r
+        type: string\r
+        required: false\r
+        description: Description of the application service described by this ASD.\r
+      provider:\r
+        type: string\r
+        required: true\r
+        description: Identifies the provider of the ASD.\r
+      application_name:\r
+        type: string\r
+        required: true\r
+        description: Name to identify the application service described by this ASD\r
+      application_version:\r
+        type: string\r
+        required: true\r
+        description: Identifies the version of the application service described by this ASD.\r
+\r
+artifact_types:\r
+tosca.artifacts.asd.deploymentItem:\r
+  version: 0.1\r
+  derived_from: tosca.artifacts.Root\r
+  description: "Describes the artifact type of asd deployment item"\r
+  file: "Relative path of the artifact in the package"\r
+  properties:\r
+    item_id:\r
+      description: "The identifier of this asd deployment item"\r
+      required: true\r
+      type: string\r
+    artifact_type:\r
+      description: >\r
+        Specify artifact type.\r
+      required: true\r
+      type: string\r
+      constraints:\r
+        - valid_values: ["helm_chart"]\r
+    target_server:\r
+      description: >\r
+        Specify target server for artifact.\r
+      required: true\r
+      type: string\r
+      constraints:\r
+        - valid_values: [ "chartmuseum" ]\r
+    target_server_uri:\r
+      description: "URI of the target server"\r
+      required: true\r
+      type: string
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Files/Acm/definition/compositions.json b/sample-rapp-generator/rapp-sample-ics-producer/Files/Acm/definition/compositions.json
new file mode 100644 (file)
index 0000000..e64d882
--- /dev/null
@@ -0,0 +1,320 @@
+{
+  "tosca_definitions_version": "tosca_simple_yaml_1_3",
+  "data_types": {
+    "onap.datatypes.ToscaConceptIdentifier": {
+      "derived_from": "tosca.datatypes.Root",
+      "properties": {
+        "name": {
+          "type": "string",
+          "required": true
+        },
+        "version": {
+          "type": "string",
+          "required": true
+        }
+      }
+    },
+    "org.onap.datatypes.policy.clamp.acm.kserveAutomationCompositionElement.KserveInferenceEntity": {
+      "version": "1.0.0",
+      "derived_from": "tosca.datatypes.Root",
+      "properties": {
+        "kserveEntityId": {
+          "type": "onap.datatypes.ToscaConceptIdentifier",
+          "required": true,
+          "description": "The name and version of a Configuration Entity to be handled by the Kserve Automation Composition Element"
+        },
+        "name": {
+          "type": "string",
+          "required": true,
+          "description": "Inference service name to be created"
+        },
+        "payload": {
+          "type": "string",
+          "required": true,
+          "description": "Inference Service payload"
+        }
+      }
+    },
+    "org.onap.datatypes.policy.clamp.acm.a1pmsAutomationCompositionElement.A1PolicyServiceEntity": {
+      "version": "1.0.0",
+      "derived_from": "tosca.datatypes.Root",
+      "properties": {
+        "a1PolicyServiceEntityId": {
+          "type": "onap.datatypes.ToscaConceptIdentifier",
+          "required": true,
+          "description": "The name and version of a Configuration Entity to be handled by the A1 PMS Automation Composition Element"
+        },
+        "clientId": {
+          "type": "string",
+          "required": true,
+          "description": "Client Id to be created"
+        },
+        "callbackUrl": {
+          "type": "string",
+          "required": true,
+          "description": "The callback URL to get registered"
+        },
+        "keepAliveIntervalSeconds": {
+          "type": "integer",
+          "required": true,
+          "description": "Keep alive interval time for the callback URL"
+        }
+      }
+    }
+  },
+  "node_types": {
+    "org.onap.policy.clamp.acm.Participant": {
+      "version": "1.0.1",
+      "derived_from": "tosca.nodetypes.Root",
+      "properties": {
+        "provider": {
+          "type": "string",
+          "required": false
+        }
+      }
+    },
+    "org.onap.policy.clamp.acm.AutomationCompositionElement": {
+      "version": "1.0.1",
+      "derived_from": "tosca.nodetypes.Root",
+      "properties": {
+        "provider": {
+          "type": "string",
+          "required": false
+        },
+        "participantType": {
+          "type": "onap.datatypes.ToscaConceptIdentifier",
+          "required": true
+        },
+        "startPhase": {
+          "type": "integer",
+          "required": false,
+          "constraints": [
+            {
+              "greater-or-equal": 0
+            }
+          ],
+          "metadata": {
+            "common": true
+          },
+          "description": "A value indicating the start phase in which this automation composition element will be started, the first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously"
+        },
+        "passiveToRunningTimeout": {
+          "type": "integer",
+          "required": false,
+          "constraints": [
+            {
+              "greater_or_equal": 0
+            }
+          ],
+          "default": 60,
+          "metadata": {
+            "common": true
+          },
+          "description": "The maximum time in seconds to wait for a state chage from passive to running"
+        },
+        "runningToPassiveTimeout": {
+          "type": "integer",
+          "required": false,
+          "constraints": [
+            {
+              "greater_or_equal": 0
+            }
+          ],
+          "default": 60,
+          "metadata": {
+            "common": true
+          },
+          "description": "The maximum time in seconds to wait for a state chage from running to passive"
+        },
+        "passiveToUninitializedTimeout": {
+          "type": "integer",
+          "required": false,
+          "constraints": [
+            {
+              "greater_or_equal": 0
+            }
+          ],
+          "default": 60,
+          "metadata": {
+            "common": true
+          },
+          "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized"
+        }
+      }
+    },
+    "org.onap.policy.clamp.acm.AutomationComposition": {
+      "version": "1.0.1",
+      "derived_from": "tosca.nodetypes.Root",
+      "properties": {
+        "provider": {
+          "type": "string",
+          "required": false,
+          "metadata": {
+            "common": true
+          }
+        },
+        "elements": {
+          "type": "list",
+          "required": true,
+          "metadata": {
+            "common": true
+          },
+          "entry_schema": {
+            "type": "onap.datatypes.ToscaConceptIdentifier"
+          }
+        }
+      }
+    },
+    "org.onap.policy.clamp.acm.KserveAutomationCompositionElement": {
+      "version": "1.0.1",
+      "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",
+      "properties": {
+        "kserveInferenceEntities": {
+          "type": "list",
+          "required": true,
+          "entry_schema": {
+            "type": "org.onap.datatypes.policy.clamp.acm.kserveAutomationCompositionElement.KserveInferenceEntity",
+            "type_version": "1.0.0"
+          },
+          "description": "The configuration entities of Kserve inference service"
+        }
+      }
+    },
+    "org.onap.policy.clamp.acm.A1PMSAutomationCompositionElement": {
+      "version": "1.0.1",
+      "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",
+      "properties": {
+        "policyServiceEntities": {
+          "type": "list",
+          "required": true,
+          "entry_schema": {
+            "type": "org.onap.datatypes.policy.clamp.acm.a1pmsAutomationCompositionElement.A1PolicyServiceEntity",
+            "type_version": "1.0.0"
+          },
+          "description": "The configuration entities of A1 policy services"
+        }
+      }
+    },
+    "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement": {
+      "version": "1.0.0",
+      "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",
+      "properties": {
+        "chart": {
+          "type": "string",
+          "required": true
+        },
+        "configs": {
+          "type": "list",
+          "required": false
+        },
+        "requirements": {
+          "type": "string",
+          "required": false
+        },
+        "templates": {
+          "type": "list",
+          "required": false,
+          "entry_schema": null
+        },
+        "values": {
+          "type": "string",
+          "required": true
+        }
+      }
+    }
+  },
+  "topology_template": {
+    "node_templates": {
+      "org.onap.policy.clamp.acm.KserveParticipant": {
+        "version": "2.3.4",
+        "type": "org.onap.policy.clamp.acm.Participant",
+        "type_version": "1.0.1",
+        "description": "Participant for Kserve requests",
+        "properties": {
+          "provider": "ONAP"
+        }
+      },
+      "org.onap.policy.clamp.acm.A1PMSAutomationCompositionParticipant": {
+        "version": "2.3.4",
+        "type": "org.onap.policy.clamp.acm.Participant",
+        "type_version": "1.0.1",
+        "description": "Participant for A1 PMS requests",
+        "properties": {
+          "provider": "ONAP"
+        }
+      },
+      "org.onap.k8s.acm.K8SAutomationCompositionParticipant": {
+        "version": "2.3.4",
+        "type": "org.onap.policy.clamp.acm.Participant",
+        "type_version": "1.0.1",
+        "description": "Participant for K8S",
+        "properties": {
+          "provider": "ONAP"
+        }
+      },
+      "onap.policy.clamp.ac.element.KserveAutomationCompositionElement": {
+        "version": "1.2.3",
+        "type": "org.onap.policy.clamp.acm.KserveAutomationCompositionElement",
+        "type_version": "1.0.1",
+        "description": "Automation composition element for the Kserve Requests",
+        "properties": {
+          "provider": "ONAP",
+          "participantType": {
+            "name": "org.onap.policy.clamp.acm.KserveParticipant",
+            "version": "2.3.4"
+          },
+          "uninitializedToPassiveTimeout": 300,
+          "statusCheckInterval": 30
+        }
+      },
+      "onap.policy.clamp.ac.element.A1PMSAutomationCompositionElement": {
+        "version": "1.2.3",
+        "type": "org.onap.policy.clamp.acm.A1PMSAutomationCompositionElement",
+        "type_version": "1.0.1",
+        "description": "Automation composition element for the A1 PMS Requests",
+        "properties": {
+          "provider": "ONAP",
+          "participantType": {
+            "name": "org.onap.policy.clamp.acm.A1PMSParticipant",
+            "version": "2.3.4"
+          }
+        }
+      },
+      "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement": {
+        "version": "1.2.3",
+        "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",
+        "type_version": "1.0.0",
+        "description": "Automation composition element for the K8S microservice for AC Element Starter",
+        "properties": {
+          "provider": "ONAP",
+          "startPhase": 0,
+          "uninitializedToPassiveTimeout": 300,
+          "podStatusCheckInterval": 30
+        }
+      },
+      "onap.policy.clamp.ac.element.AutomationCompositionDefinition": {
+        "version": "1.2.3",
+        "type": "org.onap.policy.clamp.acm.AutomationComposition",
+        "type_version": "1.0.1",
+        "description": "Automation composition for rapp deployment",
+        "properties": {
+          "provider": "ONAP",
+          "elements": [
+            {
+              "name": "onap.policy.clamp.ac.element.KserveAutomationCompositionElement",
+              "version": "1.2.3"
+            },
+            {
+              "name": "onap.policy.clamp.ac.element.A1PMSAutomationCompositionElement",
+              "version": "1.2.3"
+            },
+            {
+              "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
+              "version": "1.2.3"
+            }
+          ]
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Files/Acm/instances/k8s-instance.json b/sample-rapp-generator/rapp-sample-ics-producer/Files/Acm/instances/k8s-instance.json
new file mode 100644 (file)
index 0000000..c04f816
--- /dev/null
@@ -0,0 +1,31 @@
+{
+  "name": "DemoInstance0",
+  "version": "1.0.1",
+  "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID",
+  "description": "Demo automation composition instance 0",
+  "elements": {
+    "ea40d074-17c6-4f34-a6ea-6e464ac4cc37": {
+      "id": "ea40d074-17c6-4f34-a6ea-6e464ac4cc37",
+      "definition": {
+        "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
+        "version": "1.2.3"
+      },
+      "description": "Starter Automation Composition Element for ICS Producer",
+      "properties": {
+        "chart": {
+          "chartId": {
+            "name": "ics-producer",
+            "version": "0.1.0"
+          },
+          "namespace": "nonrtric",
+          "releaseName": "ics-producer",
+          "podName": "ics-producer",
+          "repository": {
+            "repoName": "local",
+            "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
+          }
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Files/Dme/infoproducers/ics-sample-producer.json b/sample-rapp-generator/rapp-sample-ics-producer/Files/Dme/infoproducers/ics-sample-producer.json
new file mode 100644 (file)
index 0000000..a1d7212
--- /dev/null
@@ -0,0 +1,7 @@
+{
+  "info_producer_supervision_callback_url": "http://kafka-producer:8080/producer/supervision",
+  "supported_info_types": [
+    "type1"
+  ],
+  "info_job_callback_url": "http://kafka-producer:8080/producer/job"
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/Files/Dme/producerinfotypes/type1.json b/sample-rapp-generator/rapp-sample-ics-producer/Files/Dme/producerinfotypes/type1.json
new file mode 100644 (file)
index 0000000..7869860
--- /dev/null
@@ -0,0 +1,9 @@
+{
+  "info_job_data_schema": {
+    "$schema":"http://json-schema.org/draft-07/schema#",
+    "title":"STD_Type1_1.0.0",
+    "description":"Type 1",
+    "topic": "mytopic",
+    "bootStrapServers": "kafka.default.svc.cluster.local:9092"
+    }
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/TOSCA-Metadata/TOSCA.meta b/sample-rapp-generator/rapp-sample-ics-producer/TOSCA-Metadata/TOSCA.meta
new file mode 100644 (file)
index 0000000..3da5f0d
--- /dev/null
@@ -0,0 +1,5 @@
+TOSCA-Meta-File-Version: 1.0\r
+CSAR-Version: 1.0\r
+Created-By: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
+Entry-Definitions: Definitions/asd.yaml\r
+ETSI-Entry-Manifest: asd.mf
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-sample-ics-producer/asd.mf b/sample-rapp-generator/rapp-sample-ics-producer/asd.mf
new file mode 100644 (file)
index 0000000..caabf92
--- /dev/null
@@ -0,0 +1,13 @@
+metadata:\r
+  application_name: rapp-sample-ics-producer\r
+  application_provider: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
+  release_date_time: 2024-05-03T12:00:00+00:00\r
+  entry_definition_type: asd\r
+\r
+Source: asd.mf\r
+Source: Artifacts/Deployment/HELM/ics-producer-0.1.0.tgz\r
+Source: Definitions/asd.yaml\r
+Source: Definitions/asd_types.yaml\r
+Source: TOSCA-Metadata/TOSCA.meta\r
+Source: Files/Dme/infoproducers/ics-sample-producer.json\r
+Source: Files/Dme/producerinfotypes/type1.json
\ No newline at end of file