K8s participant and SME producer service for Hello World rApp 16/12516/5
authorambrishest <ambrish.singh@est.tech>
Thu, 8 Feb 2024 10:41:11 +0000 (10:41 +0000)
committerambrishest <ambrish.singh@est.tech>
Thu, 15 Feb 2024 11:54:05 +0000 (11:54 +0000)
Issue-ID: NONRTRIC-965
Change-Id: Ibd37256e1b15d735a760c2a1e1956cebb9707eb7
Signed-off-by: ambrishest <ambrish.singh@est.tech>
sample-rapp-generator/rapp-hello-world/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz [new file with mode: 0644]
sample-rapp-generator/rapp-hello-world/Definitions/asd.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-hello-world/Definitions/asd_types.yaml [new file with mode: 0644]
sample-rapp-generator/rapp-hello-world/Files/Acm/definition/compositions.json [new file with mode: 0644]
sample-rapp-generator/rapp-hello-world/Files/Acm/instances/k8s-instance.json [new file with mode: 0644]
sample-rapp-generator/rapp-hello-world/Files/Sme/providers/provider-function-1.json [new file with mode: 0644]
sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-1.json [new file with mode: 0644]
sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-2.json [new file with mode: 0644]
sample-rapp-generator/rapp-hello-world/TOSCA-Metadata/TOSCA.meta [new file with mode: 0644]
sample-rapp-generator/rapp-hello-world/asd.mf [new file with mode: 0644]

diff --git a/sample-rapp-generator/rapp-hello-world/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz b/sample-rapp-generator/rapp-hello-world/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz
new file mode 100644 (file)
index 0000000..141ad8a
Binary files /dev/null and b/sample-rapp-generator/rapp-hello-world/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz differ
diff --git a/sample-rapp-generator/rapp-hello-world/Definitions/asd.yaml b/sample-rapp-generator/rapp-hello-world/Definitions/asd.yaml
new file mode 100644 (file)
index 0000000..2968ce8
--- /dev/null
@@ -0,0 +1,46 @@
+#  ============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 Hello World\r
+\r
+imports:\r
+  - asd_types.yaml\r
+\r
+topology_template:\r
+  node_templates:\r
+    applicationServiceDescriptor:\r
+      type: tosca.nodes.asd\r
+      description: "rapp-hello-world"\r
+      properties:\r
+        descriptor_id: 2cd6a567-2e33-4960-8ef7-1cc519c998c4\r
+        descriptor_invariant_id: 3f8a5e1b-68f1-42e5-89d0-47090dd0ef5a\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-hello-world\r
+        application_version: 1.0\r
+      artifacts:\r
+        helloworld:\r
+          type: tosca.artifacts.asd.deploymentItem\r
+          file: "Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz"\r
+          properties:\r
+            artifact_type: "helm_chart"\r
+            itemId: 1\r
diff --git a/sample-rapp-generator/rapp-hello-world/Definitions/asd_types.yaml b/sample-rapp-generator/rapp-hello-world/Definitions/asd_types.yaml
new file mode 100644 (file)
index 0000000..237ccfd
--- /dev/null
@@ -0,0 +1,79 @@
+#  ============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
diff --git a/sample-rapp-generator/rapp-hello-world/Files/Acm/definition/compositions.json b/sample-rapp-generator/rapp-hello-world/Files/Acm/definition/compositions.json
new file mode 100644 (file)
index 0000000..f7b0401
--- /dev/null
@@ -0,0 +1,189 @@
+{\r
+  "tosca_definitions_version": "tosca_simple_yaml_1_3",\r
+  "data_types": {\r
+    "onap.datatypes.ToscaConceptIdentifier": {\r
+      "derived_from": "tosca.datatypes.Root",\r
+      "properties": {\r
+        "name": {\r
+          "type": "string",\r
+          "required": true\r
+        },\r
+        "version": {\r
+          "type": "string",\r
+          "required": true\r
+        }\r
+      }\r
+    }\r
+  },\r
+  "node_types": {\r
+    "org.onap.policy.clamp.acm.Participant": {\r
+      "version": "1.0.1",\r
+      "derived_from": "tosca.nodetypes.Root",\r
+      "properties": {\r
+        "provider": {\r
+          "type": "string",\r
+          "required": false\r
+        }\r
+      }\r
+    },\r
+    "org.onap.policy.clamp.acm.AutomationCompositionElement": {\r
+      "version": "1.0.1",\r
+      "derived_from": "tosca.nodetypes.Root",\r
+      "properties": {\r
+        "provider": {\r
+          "type": "string",\r
+          "required": false\r
+        },\r
+        "participantType": {\r
+          "type": "onap.datatypes.ToscaConceptIdentifier",\r
+          "required": true\r
+        },\r
+        "startPhase": {\r
+          "type": "integer",\r
+          "required": false,\r
+          "constraints": [\r
+            {\r
+              "greater-or-equal": 0\r
+            }\r
+          ],\r
+          "metadata": {\r
+            "common": true\r
+          },\r
+          "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"\r
+        },\r
+        "passiveToRunningTimeout": {\r
+          "type": "integer",\r
+          "required": false,\r
+          "constraints": [\r
+            {\r
+              "greater_or_equal": 0\r
+            }\r
+          ],\r
+          "default": 60,\r
+          "metadata": {\r
+            "common": true\r
+          },\r
+          "description": "The maximum time in seconds to wait for a state chage from passive to running"\r
+        },\r
+        "runningToPassiveTimeout": {\r
+          "type": "integer",\r
+          "required": false,\r
+          "constraints": [\r
+            {\r
+              "greater_or_equal": 0\r
+            }\r
+          ],\r
+          "default": 60,\r
+          "metadata": {\r
+            "common": true\r
+          },\r
+          "description": "The maximum time in seconds to wait for a state chage from running to passive"\r
+        },\r
+        "passiveToUninitializedTimeout": {\r
+          "type": "integer",\r
+          "required": false,\r
+          "constraints": [\r
+            {\r
+              "greater_or_equal": 0\r
+            }\r
+          ],\r
+          "default": 60,\r
+          "metadata": {\r
+            "common": true\r
+          },\r
+          "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized"\r
+        }\r
+      }\r
+    },\r
+    "org.onap.policy.clamp.acm.AutomationComposition": {\r
+      "version": "1.0.1",\r
+      "derived_from": "tosca.nodetypes.Root",\r
+      "properties": {\r
+        "provider": {\r
+          "type": "string",\r
+          "required": false,\r
+          "metadata": {\r
+            "common": true\r
+          }\r
+        },\r
+        "elements": {\r
+          "type": "list",\r
+          "required": true,\r
+          "metadata": {\r
+            "common": true\r
+          },\r
+          "entry_schema": {\r
+            "type": "onap.datatypes.ToscaConceptIdentifier"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement": {\r
+      "version": "1.0.0",\r
+      "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",\r
+      "properties": {\r
+        "chart": {\r
+          "type": "string",\r
+          "required": true\r
+        },\r
+        "configs": {\r
+          "type": "list",\r
+          "required": false\r
+        },\r
+        "requirements": {\r
+          "type": "string",\r
+          "required": false\r
+        },\r
+        "templates": {\r
+          "type": "list",\r
+          "required": false,\r
+          "entry_schema": null\r
+        },\r
+        "values": {\r
+          "type": "string",\r
+          "required": true\r
+        }\r
+      }\r
+    }\r
+  },\r
+  "topology_template": {\r
+    "node_templates": {\r
+      "org.onap.k8s.acm.K8SAutomationCompositionParticipant": {\r
+        "version": "2.3.4",\r
+        "type": "org.onap.policy.clamp.acm.Participant",\r
+        "type_version": "1.0.1",\r
+        "description": "Participant for K8S",\r
+        "properties": {\r
+          "provider": "ONAP"\r
+        }\r
+      },\r
+      "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement": {\r
+        "version": "1.2.3",\r
+        "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",\r
+        "type_version": "1.0.0",\r
+        "description": "Automation composition element for the K8S microservice for AC Element Starter",\r
+        "properties": {\r
+          "provider": "ONAP",\r
+          "startPhase": 0,\r
+          "uninitializedToPassiveTimeout": 300,\r
+          "podStatusCheckInterval": 30\r
+        }\r
+      },\r
+      "onap.policy.clamp.ac.element.AutomationCompositionDefinition": {\r
+        "version": "1.2.3",\r
+        "type": "org.onap.policy.clamp.acm.AutomationComposition",\r
+        "type_version": "1.0.1",\r
+        "description": "Automation composition for rapp deployment",\r
+        "properties": {\r
+          "provider": "ONAP",\r
+          "elements": [\r
+            {\r
+              "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",\r
+              "version": "1.2.3"\r
+            }\r
+          ]\r
+        }\r
+      }\r
+    }\r
+  }\r
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-hello-world/Files/Acm/instances/k8s-instance.json b/sample-rapp-generator/rapp-hello-world/Files/Acm/instances/k8s-instance.json
new file mode 100644 (file)
index 0000000..734f0d1
--- /dev/null
@@ -0,0 +1,31 @@
+{\r
+  "name": "K8DemoInstance0",\r
+  "version": "1.0.1",\r
+  "compositionId": "COMPOSITIONID",\r
+  "description": "Demo automation composition instance 0",\r
+  "elements": {\r
+    "d7be552e-bcc5-4478-b64d-797dbaec8f55": {\r
+      "id": "d7be552e-bcc5-4478-b64d-797dbaec8f55",\r
+      "definition": {\r
+        "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",\r
+        "version": "1.2.3"\r
+      },\r
+      "description": "Starter Automation Composition Element for the Hello World",\r
+      "properties": {\r
+        "chart": {\r
+          "chartId": {\r
+            "name": "hello-world-chart",\r
+            "version": "0.1.0"\r
+          },\r
+          "namespace": "nonrtric",\r
+          "releaseName": "hello-world-chart",\r
+          "podName": "hello-world-chart",\r
+          "repository": {\r
+            "repoName": "local",\r
+            "address": "http://10.101.1.90:8879/charts"\r
+          }\r
+        }\r
+      }\r
+    }\r
+  }\r
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-hello-world/Files/Sme/providers/provider-function-1.json b/sample-rapp-generator/rapp-hello-world/Files/Sme/providers/provider-function-1.json
new file mode 100644 (file)
index 0000000..f647cdc
--- /dev/null
@@ -0,0 +1,20 @@
+{\r
+  "apiProvDomInfo": "Provider domain",\r
+  "apiProvFuncs": [\r
+    {\r
+      "apiProvFuncInfo": "Hello World as APF",\r
+      "apiProvFuncRole": "APF",\r
+      "regInfo": {\r
+        "apiProvPubKey": "NOT USED here"\r
+      }\r
+    },\r
+    {\r
+      "apiProvFuncInfo": "Hello World as AEF",\r
+      "apiProvFuncRole": "AEF",\r
+      "regInfo": {\r
+        "apiProvPubKey": "NOT USED here"\r
+      }\r
+    }\r
+  ],\r
+  "regSec": "plain"\r
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-1.json b/sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-1.json
new file mode 100644 (file)
index 0000000..cd8b414
--- /dev/null
@@ -0,0 +1,32 @@
+{\r
+  "apiName": "Hello World API Set 1",\r
+  "description": "Simple Hello World API",\r
+  "aefProfiles": [\r
+    {\r
+      "aefId": "Hello World as AEF",\r
+      "description": "Simple Hello World API",\r
+      "versions": [\r
+        {\r
+          "apiVersion": "v1",\r
+          "resources": [\r
+            {\r
+              "resourceName": "helloworld",\r
+              "commType": "REQUEST_RESPONSE",\r
+              "uri": "/helloworld/v1",\r
+              "operations": [\r
+                "GET"\r
+              ]\r
+            }\r
+          ]\r
+        }\r
+      ],\r
+      "protocol": "HTTP_1_1",\r
+      "interfaceDescriptions": [\r
+        {\r
+          "ipv4Addr": "hello-world-chart.nonrtric.svc.cluster.local",\r
+          "port": 8080\r
+        }\r
+      ]\r
+    }\r
+  ]\r
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-2.json b/sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-2.json
new file mode 100644 (file)
index 0000000..11694c9
--- /dev/null
@@ -0,0 +1,32 @@
+{\r
+  "apiName": "Hello World API Set 2",\r
+  "description": "Simple Hello World API for Subpath",\r
+  "aefProfiles": [\r
+    {\r
+      "aefId": "Hello World as AEF",\r
+      "description": "Simple Hello World API for Subpath",\r
+      "versions": [\r
+        {\r
+          "apiVersion": "v1",\r
+          "resources": [\r
+            {\r
+              "resourceName": "helloworld",\r
+              "commType": "REQUEST_RESPONSE",\r
+              "uri": "/helloworld/v1/subpath1",\r
+              "operations": [\r
+                "GET"\r
+              ]\r
+            }\r
+          ]\r
+        }\r
+      ],\r
+      "protocol": "HTTP_1_1",\r
+      "interfaceDescriptions": [\r
+        {\r
+          "ipv4Addr": "hello-world-chart.nonrtric.svc.cluster.local",\r
+          "port": 8080\r
+        }\r
+      ]\r
+    }\r
+  ]\r
+}
\ No newline at end of file
diff --git a/sample-rapp-generator/rapp-hello-world/TOSCA-Metadata/TOSCA.meta b/sample-rapp-generator/rapp-hello-world/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-hello-world/asd.mf b/sample-rapp-generator/rapp-hello-world/asd.mf
new file mode 100644 (file)
index 0000000..a26c676
--- /dev/null
@@ -0,0 +1,16 @@
+metadata:\r
+  application_name: rapp-hello-world\r
+  application_provider: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
+  release_date_time: 2024-02-12T11:30:00+00:00\r
+  entry_definition_type: asd\r
+\r
+Source: asd.mf\r
+Source: Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz\r
+Source: Definitions/asd.yaml\r
+Source: Definitions/asd_types.yaml\r
+Source: TOSCA-Metadata/TOSCA.meta\r
+Source: Files/Acm/definition/compositions.json\r
+Source: Files/Acm/instances/k8s-instance.json\r
+Source: Files/Sme/provider/provider-function-1.json\r
+Source: Files/Sme/serviceapis/api-set-1.json\r
+Source: Files/Sme/serviceapis/api-set-2.json\r