summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/src/main/resources/tosca/ApplicationServiceDescriptorTypes.yaml74
-rw-r--r--common/src/test/resources/asd/MyDomainASDDefintion.yaml131
-rw-r--r--common/src/test/resources/gentleguidance/GentleGuidanceMultipleTopologyTemplates.yaml299
-rw-r--r--docs/.gitignore3
-rw-r--r--docs/_static/css/ribbon.css63
-rw-r--r--docs/_static/favicon.icobin2102 -> 0 bytes
-rw-r--r--docs/_static/logo_onap_2017.pngbin12278 -> 0 bytes
-rw-r--r--docs/architecture.rst48
-rw-r--r--docs/conf.py15
-rw-r--r--docs/conf.yaml7
-rw-r--r--docs/images/architecture/ONAP-closedloop.pngbin220944 -> 0 bytes
-rw-r--r--docs/images/architecture/distdepl.pngbin94338 -> 0 bytes
-rw-r--r--docs/images/clamp-policy_archi.pngbin89501 -> 0 bytes
-rw-r--r--docs/images/html.pngbin4086 -> 0 bytes
-rw-r--r--docs/images/pdf.pngbin1946 -> 0 bytes
-rw-r--r--docs/images/swagger.pngbin3590 -> 0 bytes
-rw-r--r--docs/images/user-guide/add-operational-policies.pngbin115060 -> 0 bytes
-rw-r--r--docs/images/user-guide/blueprint_node_type.pngbin65898 -> 0 bytes
-rw-r--r--docs/images/user-guide/clamp-cds-operation.pngbin62357 -> 0 bytes
-rw-r--r--docs/images/user-guide/config-policy-tca.pngbin49477 -> 0 bytes
-rw-r--r--docs/images/user-guide/create-loop.pngbin54351 -> 0 bytes
-rw-r--r--docs/images/user-guide/deploy-params.pngbin45138 -> 0 bytes
-rw-r--r--docs/images/user-guide/loop-menu.pngbin38587 -> 0 bytes
-rw-r--r--docs/images/user-guide/loop-operation-menu.pngbin116408 -> 0 bytes
-rw-r--r--docs/images/user-guide/loop-properties.pngbin43060 -> 0 bytes
-rw-r--r--docs/images/user-guide/op-policy-box-policy.pngbin67750 -> 0 bytes
-rw-r--r--docs/images/user-guide/open-loop.pngbin42481 -> 0 bytes
-rw-r--r--docs/images/user-guide/open-menu-prop.pngbin59422 -> 0 bytes
-rw-r--r--docs/images/user-guide/opened-loop.pngbin104515 -> 0 bytes
-rw-r--r--docs/images/user-guide/policy-model-menu.pngbin43925 -> 0 bytes
-rw-r--r--docs/images/user-guide/policy-submitted.pngbin47028 -> 0 bytes
-rw-r--r--docs/images/user-guide/remove-operational-policies.pngbin108698 -> 0 bytes
-rw-r--r--docs/images/user-guide/template-menu.pngbin39685 -> 0 bytes
-rw-r--r--docs/index.rst203
-rw-r--r--docs/release-notes.rst504
-rw-r--r--docs/requirements-docs.txt15
-rw-r--r--docs/tox.ini22
-rw-r--r--docs/user-guide.rst157
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProvider.java226
-rw-r--r--models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopElementTest.java34
-rw-r--r--models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java68
-rw-r--r--models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java72
-rw-r--r--models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProviderTest.java161
-rw-r--r--models/src/test/resources/examples/controlloop/PMSubscriptionHandling.yaml3325
-rw-r--r--models/src/test/resources/providers/tosca-for-smoke-testing.yaml966
-rw-r--r--packages/policy-clamp-docker/src/main/docker/ClRuntimeDockerfile2
-rw-r--r--packages/policy-clamp-docker/src/main/docker/HttpParticipantDockerfile2
-rw-r--r--packages/policy-clamp-docker/src/main/docker/KubernetesParticipantDockerfile2
-rw-r--r--packages/policy-clamp-docker/src/main/docker/PolicyParticipantDockerfile2
-rw-r--r--pom.xml8
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProvider.java214
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionAspect.java20
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java21
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionScanner.java2
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java75
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProviderTest.java29
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java4
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandlerTest.java8
-rw-r--r--runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml21
-rw-r--r--runtime/src/main/resources/clds/camel/routes/dcae-flows.xml12
-rw-r--r--runtime/src/main/resources/logback-default.xml1
-rw-r--r--runtime/src/test/java/org/onap/policy/clamp/loop/DeployFlowItTestCase.java4
-rw-r--r--runtime/ui-react/src/api/LoopActionService.js2
63 files changed, 5511 insertions, 1311 deletions
diff --git a/common/src/main/resources/tosca/ApplicationServiceDescriptorTypes.yaml b/common/src/main/resources/tosca/ApplicationServiceDescriptorTypes.yaml
new file mode 100644
index 000000000..ad16173b9
--- /dev/null
+++ b/common/src/main/resources/tosca/ApplicationServiceDescriptorTypes.yaml
@@ -0,0 +1,74 @@
+# ============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=========================================================
+tosca_definitions_version: tosca_simple_yaml_1_3
+node_types:
+ org.oran.asd.DeploymentItem:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.KubernetesControlLoopElement
+ properties:
+ deployemntItemId:
+ type: onap.datatypes.ToscaConceptIdentifier
+ required: true
+ description: The identifier of this deployment item
+ artifactId:
+ type: onap.datatypes.ToscaConceptIdentifier
+ required: true
+ description: Reference to a DeploymentArtifact
+ lifecycleParameters:
+ type: string
+ required: false
+ description: List of parameters that can be overridden at deployment time
+ (e.g. values for values.yaml in the chart this item references)
+ org.oran.asd.ASD:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoop
+ properties:
+ asdId:
+ type: onap.datatypes.ToscaConceptIdentifier
+ required: true
+ description: The identifier of this deployment item
+ asdSchemaVersion:
+ type: onap.datatypes.ToscaConceptIdentifier
+ required: true
+ description: Reference to a DeploymentArtifact
+ asdApplication:
+ type: onap.datatypes.ToscaConceptIdentifier
+ required: true
+ description: Reference to a DeploymentArtifact
+ asdApplicationInfoName:
+ type: string
+ required: false
+ description: Human readable name for the Application service. Can change during the AS lifetime.
+ asdExtCpd:
+ type: string
+ required: false
+ description: Describes external interface(s) exposed by this AS enabling connection with a VL.
+ (Similar to VnfExtCpd on VNF-D, but only describing L3 and above interfaces, since
+ K8S can’t do <L3)
+ enhancedClusterCapabilities:
+ type: string
+ required: false
+ description: Describes expected capabilities of the target Kubernetes cluster to aid placement of the
+ application service on a suitable cluster. Examples of capabilities are; required networking
+ characteristics, Kubernetes API extensions or quantifiable node specific resources. This attribute
+ can contain information complementing information provided in the referenced DeploymentArtifacts.
+ Note; Modeling of enhancedClusterCapabilities is subject to standardization but is ffs. Alignment
+ between O2-IMS and O2-DMS of these values is required.
+
+
+
diff --git a/common/src/test/resources/asd/MyDomainASDDefintion.yaml b/common/src/test/resources/asd/MyDomainASDDefintion.yaml
new file mode 100644
index 000000000..f354ea075
--- /dev/null
+++ b/common/src/test/resources/asd/MyDomainASDDefintion.yaml
@@ -0,0 +1,131 @@
+# ============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=========================================================
+tosca_definitions_version: tosca_simple_yaml_1_3
+topology_template:
+ node_templates:
+ org.oran.asd.MyApplicationServiceDeploymentItem0:
+ version: 1.0.0
+ type: org.oran.asd.DeploymentItem
+ type_version: 1.0.1
+ description: The first Deployment Item in our Application Service
+ properties:
+ deployemntItemId: org.oran.asd.MyApplicationServiceDeploymentItem0:1.0.0
+ artifactId: org.oran.asd.MyApplicationServiceDeploymentArtifact0:1.0.0
+ lifecycleParameters: To be defined
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Kubernetes:1.0.0
+ startPhase: 2
+ uninitializedToPassiveTimeout: 180
+ chart:
+ chartId: MyApplicationServiceDeploymentItem0Chart:1.0.0
+ releaseName: SomeRelease
+ namespace: org.oran.asd.MyApplicationService
+ org.oran.asd.MyApplicationServiceDeploymentItem1:
+ version: 1.0.0
+ type: org.oran.asd.DeploymentItem
+ type_version: 1.0.1
+ description: The second Deployment Item in our Application Service
+ properties:
+ deployemntItemId: org.oran.asd.MyApplicationServiceDeploymentItem1:1.0.0
+ artifactId: org.oran.asd.MyApplicationServiceDeploymentArtifact1:1.0.0
+ lifecycleParameters: To be defined
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Kubernetes:1.0.0
+ startPhase: 4
+ uninitializedToPassiveTimeout: 10
+ chart:
+ chartId: MyApplicationServiceDeploymentItem1Chart:1.0.0
+ releaseName: SomeRelease
+ namespace: org.oran.asd.MyApplicationService
+ org.oran.asd.MyApplicationRestConfig:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.HttpControlLoopElement
+ type_version: 1.0.1
+ description: The REST configuration for My Application
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Http:1.0.0
+ startPhase: 1
+ baseUrl: https://10.10.10.10:12345/MyApplicationServiceDeploymentItem0RestEndpoint
+ httpHeaders:
+ "Content-Type": "application/json"
+ "Accept": "application/json"
+ configurationEntities:
+ org.onap.policy.controlloop.gentleguidance.setDomainConfig:1.0.0:
+ configurationEntityId: org.onap.policy.controlloop.gentleguidance.setDomainConfig:1.0.0
+ restSequence:
+ - restRequestId: org.oran.asd.myapplication.setDomainConfig.CreateConfig:1.0.0
+ httpMethd: POST
+ path: "gentle/create"
+ body:
+ gentleLevel: veryGentle
+ gentleType: softAndFurry
+ expectedResponse: 200
+ - restRequestId: org.oran.asd.myapplication.setDomainConfig.CreateConfig:1.0.0
+ httpMethd: POST
+ path: "guidance/create"
+ body:
+ guidanceLevel: high
+ guidanceType: subtle
+ expectedResponse: 200
+ org.oran.asd.myapplication.updateDomainConfig:1.0.0:
+ configurationEntityId: org.oran.asd.myapplication.updateDomainConfig:1.0.0
+ restSequence:
+ - restRequestId: org.oran.asd.myapplication.updateDomainConfig.UpdateConfig:1.0.0
+ httpMethd: PUT
+ path: "gentle/update]"
+ body:
+ gentleLevel: robust
+ gentleType: hardAndGritty
+ expectedResponse: 200
+ - restRequestId: org.oran.asd.myapplication.updateDomainConfig.UpdateConfig:1.0.0
+ httpMethd: PUT
+ path: "guidance/update"
+ body:
+ guidanceLevel: low
+ guidanceType: terse
+ expectedResponse: 200
+ org.oran.asd.MyApplicationPolicy:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
+ type_version: 1.0.1
+ description: My Application Operational Policy
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Policy:1.0.0
+ startPhase: 0
+ policyType: onap.policies.controlloop.operational.common.Apex:1.0.0
+ policyId: org.oran.asd.myapplication.ServiceControlPolicy:1.0.0
+ org.org.oran.asd.MyApplicationService:
+ version: 1.0.0
+ type: org.oran.asd.ASD
+ type_version: 1.0.1
+ description: ASD Definition of the My Application Service
+ properties:
+ asdId: org.org.oran.asd.MyApplicationService:1.0.0
+ asdSchemaVersion: 2.3.2
+ provider: Ericsson
+ asdApplication: org.oran.asd.MyWonderfulApplicationService:1.2.1
+ asdApplicationInfoName: The wonderful ASD service that does everything imaginable
+ asdExtCpd: To be defined
+ enhancedCludterCapabilities: To be defined
+ elements:
+ - org.oran.asd.MyApplicationServiceDeploymentItem0:1.0.0
+ - org.oran.asd.MyApplicationServiceDeploymentItem1:1.0.0
+ - org.oran.asd.MyApplicationRestConfig:1.0.0
+ - org.oran.asd.MyApplicationPolicy:1.0.0
diff --git a/common/src/test/resources/gentleguidance/GentleGuidanceMultipleTopologyTemplates.yaml b/common/src/test/resources/gentleguidance/GentleGuidanceMultipleTopologyTemplates.yaml
new file mode 100644
index 000000000..93b5ba5a5
--- /dev/null
+++ b/common/src/test/resources/gentleguidance/GentleGuidanceMultipleTopologyTemplates.yaml
@@ -0,0 +1,299 @@
+tosca_definitions_version: tosca_simple_yaml_1_3
+topology_template:
+ node_templates:
+ org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.KubernetesControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Kubernetes Microservice
+ org.onap.domain.gentleguidance.RestControlLoopElementDefinition:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.HttpControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Microservice REST configuration
+ org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Operational Policy
+ org.onap.domain.gentleguidance.CdsControlLoopElementDefinition:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.CDSControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance CDS blueprint
+ org.onap.domain.gentleguidance.ControlLoopDefinition:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.ControlLoop
+ type_version: 1.0.1
+ description: Control loop definition for the Gentle Guidance domain
+ properties:
+ provider: Ericsson
+ elements:
+ - org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition:1.0.0
+ - org.onap.domain.gentleguidance.RestControlLoopElementDefinition:1.0.0
+ - org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition:1.0.0
+ - org.onap.domain.gentleguidance.CdsControlLoopElementDefinition:1.0.0
+
+After Commissioning:
+
+tosca_definitions_version: tosca_simple_yaml_1_3
+topology_template:
+ node_templates:
+ org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.KubernetesControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Kubernetes Microservice
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Kubernetes:1.0.0
+ startPhase: 2
+ uninitializedToPassiveTimeout: 180
+ org.onap.domain.gentleguidance.RestControlLoopElementDefinition:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.HttpControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Microservice REST configuration
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Http:1.0.0
+ startPhase: 1
+ baseUrl: https://10.10.10.10:12345/gentleguidancemicroservice
+ org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Operational Policy
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Policy:1.0.0
+ startPhase: 0
+ org.onap.domain.gentleguidance.CdsControlLoopElementDefinition:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.CDSControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance CDS blueprint
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Cds:1.0.0
+ startPhase: 0
+ org.onap.domain.gentleguidance.ControlLoopDefinition:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.ControlLoop
+ type_version: 1.0.1
+ description: Control loop definition for the Gentle Guidance domain
+ properties:
+ provider: Ericsson
+ elements:
+ - org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition:1.0.0
+ - org.onap.domain.gentleguidance.RestControlLoopElementDefinition:1.0.0
+ - org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition:1.0.0
+ - org.onap.domain.gentleguidance.CdsControlLoopElementDefinition:1.0.0
+
+
+After Instantiation:
+
+(Instance 1)
+
+tosca_definitions_version: tosca_simple_yaml_1_3
+topology_template:
+ node_templates:
+ org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition_Instance1:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.KubernetesControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Kubernetes Microservice
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Kubernetes:1.0.0
+ startPhase: 2
+ uninitializedToPassiveTimeout: 180
+ chart:
+ chartId: GentleGuidance:1.0.0
+ releaseName: Istanbul
+ namespace: org.onap.policy.controlloop.gentleguidance
+ org.onap.domain.gentleguidance.RestControlLoopElementDefinition_Instance1:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.HttpControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Microservice REST configuration
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Http:1.0.0
+ startPhase: 1
+ baseUrl: https://10.10.10.10:12345/gentleguidancemicroservice
+ httpHeaders:
+ "Content-Type": "application/json"
+ "Accept": "application/json"
+ configurationEntities:
+ org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0:
+ configurationEntityId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0
+ restSequence:
+ - restRequestId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig.CreateGentle:1.0.0
+ httpMethd: POST
+ path: "gentle/create"
+ body:
+ gentleLevel: veryGentle
+ gentleType: softAndFurry
+ expectedResponse: 200
+ - restRequestId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig.CreateGuidance:1.0.0
+ httpMethd: POST
+ path: "guidance/create"
+ body:
+ guidanceLevel: high
+ guidanceType: subtle
+ expectedResponse: 200
+ org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig:1.0.0:
+ configurationEntityId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig:1.0.0
+ restSequence:
+ - restRequestId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig.CreateGentle:1.0.0
+ httpMethd: PUT
+ path: "gentle/update]"
+ body:
+ gentleLevel: robust
+ gentleType: hardAndGritty
+ expectedResponse: 200
+ - restRequestId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig.CreateGuidance:1.0.0
+ httpMethd: PUT
+ path: "guidance/update"
+ body:
+ guidanceLevel: low
+ guidanceType: terse
+ expectedResponse: 200
+ org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition_Instance1:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Operational Policy
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Policy:1.0.0
+ startPhase: 0
+ policyType: onap.policies.controlloop.operational.common.Apex:1.0.0
+ policyId: org.onap.domain.gentleguidance.policy.GentleGuidanceAssertive:1.0.0
+ org.onap.domain.gentleguidance.CdsControlLoopElementDefinition_Instance1:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.CDSControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance CDS blueprint
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Cds:1.0.0
+ startPhase: 0
+ cdsBlueprint: "Placeholder for the CDS blueprint"
+ org.onap.domain.gentleguidance.ControlLoopDefinition_Instance1:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.ControlLoop
+ type_version: 1.0.1
+ description: Control loop definition for the Gentle Guidance domain
+ properties:
+ provider: Ericsson
+ elements:
+ - org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition_Instance1:1.0.0
+ - org.onap.domain.gentleguidance.RestControlLoopElementDefinition_Instance1:1.0.0
+ - org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition_Instance1:1.0.0
+ - org.onap.domain.gentleguidance.CdsControlLoopElementDefinition_Instance1:1.0.0
+
+
+(Instance 2)
+
+tosca_definitions_version: tosca_simple_yaml_1_3
+topology_template:
+ node_templates:
+ org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition_Instance2:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.KubernetesControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Kubernetes Microservice
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Kubernetes:1.0.0
+ startPhase: 2
+ uninitializedToPassiveTimeout: 180
+ chart:
+ chartId: GentleGuidance:1.0.0
+ releaseName: Istanbul
+ namespace: org.onap.policy.controlloop.gentleguidance
+ org.onap.domain.gentleguidance.RestControlLoopElementDefinition_Instance2:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.HttpControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Microservice REST configuration
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Http:1.0.0
+ startPhase: 1
+ baseUrl: https://10.10.10.10:12345/gentleguidancemicroservice
+ httpHeaders:
+ "Content-Type": "application/json"
+ "Accept": "application/json"
+ configurationEntities:
+ org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0:
+ configurationEntityId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0
+ restSequence:
+ - restRequestId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig.CreateGentle:1.0.0
+ httpMethd: POST
+ path: "gentle/create"
+ body:
+ gentleLevel: veryGentle
+ gentleType: softAndFurry
+ expectedResponse: 200
+ - restRequestId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig.CreateGuidance:1.0.0
+ httpMethd: POST
+ path: "guidance/create"
+ body:
+ guidanceLevel: low
+ guidanceType: subtle
+ expectedResponse: 200
+ org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig:1.0.0:
+ configurationEntityId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig:1.0.0
+ restSequence:
+ - restRequestId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig.CreateGentle:1.0.0
+ httpMethd: PUT
+ path: "gentle/update]"
+ body:
+ gentleLevel: robust
+ gentleType: SoftandRobust
+ expectedResponse: 200
+ - restRequestId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig.CreateGuidance:1.0.0
+ httpMethd: PUT
+ path: "guidance/update"
+ body:
+ guidanceLevel: low
+ guidanceType: terse
+ expectedResponse: 200
+ org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition_Instance2:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance Operational Policy
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Policy:1.0.0
+ startPhase: 0
+ policyType: onap.policies.controlloop.operational.common.Apex:1.0.0
+ policyId: org.onap.domain.gentleguidance.policy.GentleGuidanceAssertive:1.0.0
+ org.onap.domain.gentleguidance.CdsControlLoopElementDefinition_Instance2:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.CDSControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the Gentle Guidance CDS blueprint
+ properties:
+ provider: Ericsson
+ participantType: org.onap.policy.controlloop.participant.Cds:1.0.0
+ startPhase: 0
+ cdsBlueprint: "Placeholder for the CDS blueprint"
+ org.onap.domain.gentleguidance.ControlLoopDefinition_Instance2:
+ version: 1.0.0
+ type: org.onap.policy.clamp.controlloop.ControlLoop
+ type_version: 1.0.1
+ description: Control loop definition for the Gentle Guidance domain
+ properties:
+ provider: Ericsson
+ elements:
+ - org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition_Instance2:1.0.0
+ - org.onap.domain.gentleguidance.RestControlLoopElementDefinition_Instance2:1.0.0
+ - org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition_Instance2:1.0.0
+ - org.onap.domain.gentleguidance.CdsControlLoopElementDefinition_Instance2:1.0.0
+
+
diff --git a/docs/.gitignore b/docs/.gitignore
deleted file mode 100644
index 43ca5b671..000000000
--- a/docs/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/.tox
-/_build/*
-/__pycache__/*
diff --git a/docs/_static/css/ribbon.css b/docs/_static/css/ribbon.css
deleted file mode 100644
index 6008cb1a0..000000000
--- a/docs/_static/css/ribbon.css
+++ /dev/null
@@ -1,63 +0,0 @@
-.ribbon {
- z-index: 1000;
- background-color: #a00;
- overflow: hidden;
- white-space: nowrap;
- position: fixed;
- top: 25px;
- right: -50px;
- -webkit-transform: rotate(45deg);
- -moz-transform: rotate(45deg);
- -ms-transform: rotate(45deg);
- -o-transform: rotate(45deg);
- transform: rotate(45deg);
- -webkit-box-shadow: 0 0 10px #888;
- -moz-box-shadow: 0 0 10px #888;
- box-shadow: 0 0 10px #888;
-
-}
-
-.ribbon a {
- border: 1px solid #faa;
- color: #fff;
- display: block;
- font: bold 81.25% 'Helvetica Neue', Helvetica, Arial, sans-serif;
- margin: 1px 0;
- padding: 10px 50px;
- text-align: center;
- text-decoration: none;
- text-shadow: 0 0 5px #444;
- transition: 0.5s;
-}
-
-.ribbon a:hover {
- background: #c11;
- color: #fff;
-}
-
-
-/* override table width restrictions */
-@media screen and (min-width: 767px) {
-
- .wy-table-responsive table td, .wy-table-responsive table th {
- /* !important prevents the common CSS stylesheets from overriding
- this as on RTD they are loaded after this stylesheet */
- white-space: normal !important;
- }
-
- .wy-table-responsive {
- overflow: visible !important;
- }
-}
-
-@media screen and (max-width: 767px) {
- .wy-table-responsive table td {
- white-space: nowrap;
- }
-}
-
-/* fix width of the screen */
-
-.wy-nav-content {
- max-width: none;
-}
diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico
deleted file mode 100644
index cb712ebd2..000000000
--- a/docs/_static/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/docs/_static/logo_onap_2017.png b/docs/_static/logo_onap_2017.png
deleted file mode 100644
index 5d064f431..000000000
--- a/docs/_static/logo_onap_2017.png
+++ /dev/null
Binary files differ
diff --git a/docs/architecture.rst b/docs/architecture.rst
deleted file mode 100644
index b65eb1c1d..000000000
--- a/docs/architecture.rst
+++ /dev/null
@@ -1,48 +0,0 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved.
-.. _architecture:
-
-Policy/Clamp in ONAP Architecture
----------------------------------
-
-CLAMP platform has been integrated into the Policy framework project, starting as a POC during
-Honolulu release and as a official feature with Istanbul release. So CLAMP must be seen now
-as a function provided by the Policy Framework project.
-
-CLAMP is a function for designing and managing control loops and a UI to manage Policies.
- It is used to visualize a control loop, configure it with specific parameters for a particular network
-service, then deploying and undeploying it. Once deployed, the user can also
-update the loop with new parameters during runtime, as well as suspending and
-restarting it.
-
-Starting with Istanbul release, CLAMP GUI can also be used to create/read/update/delete/list policies
-outside of a control loop, and therefore CLAMP is also the front-end for Policies management in ONAP.
-
-CLAMP interacts with other systems to deploy and execute the control loop. For
-example, it extracts the control loop blueprint from CSAR distributed by SDC.
-CLAMP also calls the internal Policy framework API to get the Policy Models(Model Driven Control Loop)
-It requests from DCAE the instantiation of microservices.
-to manage the control loop flow. Furthermore, it creates and updates multiple
-policies (for DCAE mS configuration and actual Control Operations) in the Policy Engine
-that define the closed loop flow.
-
-|clamp-flow|
-
-The ONAP CLAMP function abstracts the details of these systems under the concept
-of a control loop model. The design of a control loop and its management is
-represented by a workflow in which all relevant system interactions take
-place. This is essential for a self-service model of creating and managing
-control loops, where no low-level user interaction with other components is
-required.
-
-At a higher level, CLAMP is about supporting and managing the broad operational
-life cycle of VNFs/VMs and ultimately ONAP components itself. It will offer the
-ability to design, test, deploy and update control loop automation - both closed
-and open. Automating these functions would represent a significant saving on
-operational costs compared to traditional methods.
-
-|closed-loop|
-
-.. |clamp-flow| image:: images/architecture/distdepl.png
-.. |closed-loop| image:: images/architecture/ONAP-closedloop.png
diff --git a/docs/conf.py b/docs/conf.py
deleted file mode 100644
index 5371015c6..000000000
--- a/docs/conf.py
+++ /dev/null
@@ -1,15 +0,0 @@
-from docs_conf.conf import *
-
-branch = 'latest'
-master_doc = 'index'
-
-linkcheck_ignore = [
- 'http://localhost',
-]
-
-intersphinx_mapping = {}
-
-html_last_updated_fmt = '%d-%b-%y %H:%M'
-
-def setup(app):
- app.add_stylesheet("css/ribbon.css")
diff --git a/docs/conf.yaml b/docs/conf.yaml
deleted file mode 100644
index ab5928131..000000000
--- a/docs/conf.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-project_cfg: onap
-project: onap
-
-# Change this to ReleaseBranchName to modify the header
-default-version: latest
-#
diff --git a/docs/images/architecture/ONAP-closedloop.png b/docs/images/architecture/ONAP-closedloop.png
deleted file mode 100644
index 7d3a2cac8..000000000
--- a/docs/images/architecture/ONAP-closedloop.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/architecture/distdepl.png b/docs/images/architecture/distdepl.png
deleted file mode 100644
index 27a39302e..000000000
--- a/docs/images/architecture/distdepl.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/clamp-policy_archi.png b/docs/images/clamp-policy_archi.png
deleted file mode 100644
index f384dddcd..000000000
--- a/docs/images/clamp-policy_archi.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/html.png b/docs/images/html.png
deleted file mode 100644
index f1bda8835..000000000
--- a/docs/images/html.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/pdf.png b/docs/images/pdf.png
deleted file mode 100644
index fed52f963..000000000
--- a/docs/images/pdf.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/swagger.png b/docs/images/swagger.png
deleted file mode 100644
index f5a9e0c0c..000000000
--- a/docs/images/swagger.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/add-operational-policies.png b/docs/images/user-guide/add-operational-policies.png
deleted file mode 100644
index 3d5224aec..000000000
--- a/docs/images/user-guide/add-operational-policies.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/blueprint_node_type.png b/docs/images/user-guide/blueprint_node_type.png
deleted file mode 100644
index 1e5ef6a4a..000000000
--- a/docs/images/user-guide/blueprint_node_type.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/clamp-cds-operation.png b/docs/images/user-guide/clamp-cds-operation.png
deleted file mode 100644
index edc4c63aa..000000000
--- a/docs/images/user-guide/clamp-cds-operation.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/config-policy-tca.png b/docs/images/user-guide/config-policy-tca.png
deleted file mode 100644
index ce5f79bc8..000000000
--- a/docs/images/user-guide/config-policy-tca.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/create-loop.png b/docs/images/user-guide/create-loop.png
deleted file mode 100644
index 40cdb4c39..000000000
--- a/docs/images/user-guide/create-loop.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/deploy-params.png b/docs/images/user-guide/deploy-params.png
deleted file mode 100644
index 9d003258f..000000000
--- a/docs/images/user-guide/deploy-params.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/loop-menu.png b/docs/images/user-guide/loop-menu.png
deleted file mode 100644
index b6056349d..000000000
--- a/docs/images/user-guide/loop-menu.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/loop-operation-menu.png b/docs/images/user-guide/loop-operation-menu.png
deleted file mode 100644
index 2a2dbf899..000000000
--- a/docs/images/user-guide/loop-operation-menu.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/loop-properties.png b/docs/images/user-guide/loop-properties.png
deleted file mode 100644
index 5c266155d..000000000
--- a/docs/images/user-guide/loop-properties.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/op-policy-box-policy.png b/docs/images/user-guide/op-policy-box-policy.png
deleted file mode 100644
index 89c6265ba..000000000
--- a/docs/images/user-guide/op-policy-box-policy.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/open-loop.png b/docs/images/user-guide/open-loop.png
deleted file mode 100644
index a763ad133..000000000
--- a/docs/images/user-guide/open-loop.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/open-menu-prop.png b/docs/images/user-guide/open-menu-prop.png
deleted file mode 100644
index 046e2a3d3..000000000
--- a/docs/images/user-guide/open-menu-prop.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/opened-loop.png b/docs/images/user-guide/opened-loop.png
deleted file mode 100644
index c955deee8..000000000
--- a/docs/images/user-guide/opened-loop.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/policy-model-menu.png b/docs/images/user-guide/policy-model-menu.png
deleted file mode 100644
index 838fcf8d9..000000000
--- a/docs/images/user-guide/policy-model-menu.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/policy-submitted.png b/docs/images/user-guide/policy-submitted.png
deleted file mode 100644
index 04a9df358..000000000
--- a/docs/images/user-guide/policy-submitted.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/remove-operational-policies.png b/docs/images/user-guide/remove-operational-policies.png
deleted file mode 100644
index fbc680d04..000000000
--- a/docs/images/user-guide/remove-operational-policies.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/user-guide/template-menu.png b/docs/images/user-guide/template-menu.png
deleted file mode 100644
index cc2cdf78b..000000000
--- a/docs/images/user-guide/template-menu.png
+++ /dev/null
Binary files differ
diff --git a/docs/index.rst b/docs/index.rst
deleted file mode 100644
index 4fd4def67..000000000
--- a/docs/index.rst
+++ /dev/null
@@ -1,203 +0,0 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved.
-.. _master_index:
-
-Policy/CLAMP - Control Loop Automation Management Platform
-==========================================================
-.. High level architecture, design, and packaging information for release planning and delivery.
-
-.. include:: architecture.rst
-
-
-Offered APIs
-------------
-The list of APIs that Policy/CLAMP has offered could be find in the following table:
-
-.. |pdf-icon| image:: images/pdf.png
- :width: 40px
-
-.. |swagger-icon| image:: images/swagger.png
- :width: 40px
-
-.. |html-icon| image:: images/html.png
- :width: 40px
-
-.. csv-table::
- :header: "|Swagger-icon|", "|html-icon|", "|pdf-icon|"
- :widths: 60,60,60
-
- "swagger json file", "html doc", "pdf doc"
- ":download:`link <swagger/swagger.json>`", ":download:`link <swagger/swagger.html>`", ":download:`link <swagger/swagger.pdf>`"
-
-
-Consumed APIs
--------------
-Policy/CLAMP uses the API's exposed by the following ONAP components:
-
-- SDC : REST based interface exposed by the SDC, Distribution of service to DCAE
-- DCAE: REST based interface exposed by DCAE, Common Controller Framework, DCAE microservices onboarded (TCA, Stringmatch, Holmes (optional))
-- Policy Core: REST based interface, Policy Core engine target both XACML and Drools PDP, Policy Engine trigger operations to App-C/VF-C/SDN-C
-- CDS: REST based interface, to retrieve list of operations/actions with their corresponding payload at runtime for Operational Policies where the field 'actor' is 'CDS'.
-
-Delivery
---------
-Policy/CLAMP component is composed of a UI layer and a backend layer, each layer having its own container.
-Policy/CLAMP also requires a database instance with 1 DB, it uses MariaDB, which is the same DB as for the core Policy.
-
-.. |clamp-policy-archi| image:: images/clamp-policy_archi.png
-
-|clamp-policy-archi|
-
-Logging & Diagnostic Information
---------------------------------
-CLAMP uses logback framework to generate logs. The logback.xml file can be found under the [src/main/resources/ folder](src/main/resources).
-
-With the default log settings, all logs will be generated into console and into root.log file under the CLAMP root folder. The root.log file is not allowed to be appended, thus restarting the CLAMP will result in cleaning of the old log files.
-
-
-.. _index-clamp-installation:
-
-Installation
-------------
-A [docker-compose example file](extra/docker/clamp/docker-compose.yml) can be found under the [extra/docker/clamp/ folder](extra/docker/).
-
-Once the image has been built and is available locally, you can use the `docker-compose up` command to deploy a pre-populated database and a CLAMP instance available on [https://localhost:3000](https://localhost:3000).
-
-Configuration
--------------
-.. Where are they provided?
-.. What are parameters and values?
-
-
-Currently, the CLAMP docker images can be deployed with small configuration needs. Though, you might need to make small adjustments to the configuration. As CLAMP is spring based, you can use the SPRING_APPLICATION_JSON environment variable to update its parameters.
-
-.. TODO detail config parameters and the usage
-
-
-There are one datasource for Clamp. By default, it will try to connect to the localhost server using the credentials available in the example SQL files. If you need to change the default database host and/or credentials, you can do it by using the following json as SPRING_APPLICATION_JSON environment variable :
-
-.. code-block:: json
-
- {
- "spring.datasource.cldsdb.url": "jdbc:mariadb:sequential://clampdb.{{ include "common.namespace" . }}:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3",
- "clamp.config.files.sdcController": "file:/opt/clamp/sdc-controllers-config.json",
- "clamp.config.dcae.inventory.url": "https://inventory.{{ include "common.namespace" . }}:8080",
- "clamp.config.dcae.dispatcher.url": "https://deployment-handler.{{ include "common.namespace" . }}:8443",
- "clamp.config.dcae.deployment.url": "https://deployment-handler.{{ include "common.namespace" . }}:8443",
- "clamp.config.dcae.deployment.userName": "none",
- "clamp.config.dcae.deployment.password": "none",
- "clamp.config.policy.api.url": "https://policy-api.{{ include "common.namespace" . }}:6969",
- "clamp.config.policy.api.userName": "healthcheck",
- "clamp.config.policy.api.password": "zb!XztG34",
- "clamp.config.policy.pap.url": "https://policy-pap.{{ include "common.namespace" . }}:6969",
- "clamp.config.policy.pap.userName": "healthcheck",
- "clamp.config.policy.pap.password": "zb!XztG34",
- "clamp.config.cadi.aafLocateUrl": "https://aaf-locate.{{ include "common.namespace" . }}:8095",
- "com.att.eelf.logging.path": "/opt/clamp",
- "com.att.eelf.logging.file": "logback.xml"
- }
-
-SDC-Controllers config
-----------------------
-This file is a JSON that must be specified to Spring config, here is an example:
-
-.. code-block:: json
-
- {
- "sdc-connections":{
- "sdc-controller1":{
- "user": "clamp",
- "consumerGroup": "consumerGroup1",
- "consumerId": "consumerId1",
- "environmentName": "AUTO",
- "sdcAddress": "localhost:8443",
- "password": "b7acccda32b98c5bb7acccda32b98c5b05D511BD6D93626E90D18E9D24D9B78CD34C7EE8012F0A189A28763E82271E50A5D4EC10C7D93E06E0A2D27CAE66B981",
- "pollingInterval":30,
- "pollingTimeout":30,
- "activateServerTLSAuth":"false",
- "keyStorePassword":"",
- "keyStorePath":"",
- "messageBusAddresses":["dmaaphost.com"]
- },
- "sdc-controller2":{
- "user": "clamp",
- "consumerGroup": "consumerGroup1",
- "consumerId": "consumerId1",
- "environmentName": "AUTO",
- "sdcAddress": "localhost:8443",
- "password": "b7acccda32b98c5bb7acccda32b98c5b05D511BD6D93626E90D18E9D24D9B78CD34C7EE8012F0A189A28763E82271E50A5D4EC10C7D93E06E0A2D27CAE66B981",
- "pollingInterval":30,
- "pollingTimeout":30,
- "activateServerTLSAuth":"false",
- "keyStorePassword":"",
- "keyStorePath":"",
- "messageBusAddresses":["dmaaphost.com"]
- }
- }
- }
-
-Multiple controllers can be configured so that Clamp is able to receive the notifications from different SDC servers.
-Each Clamp existing in a cluster should have different consumerGroup and consumerId so that they can each consume the SDC notification.
-The environmentName is normally the Dmaap Topic used by SDC.
-If the sdcAddress is not specified or not available (connection failure) the messageBusAddresses will be used (Dmaap servers)
-
-Administration
---------------
-
-A user can access Policy/CLAMP UI at the following URL : https://localhost:3000.
-(in this URL 'localhost' must be replaced by the actual host where Policy/CLAMP has been installed if it is not your current localhost)
-For OOM, the URL is https://<host-ip>:30258
-
-.. code-block:: html
-
- - Without AAF, the credentials are
- Default username : admin
- Default password : password
-
- - With AAF enabled, the certificate p12 must be added to the browser
- ca path: src/main/resources/clds/aaf/org.onap.clamp.p12, password "China in the Spring"
- Or get it from this page : https://wiki.onap.org/display/DW/Control+Loop+Flows+and+Models+for+Casablanca
-
-Human Interfaces
-----------------
-.. Basic info on the interface type, ports/protocols provided over, etc.
-
-User Interface - serve to configure control loop
-Policy/CLAMP UI is used to configure the Control Loop designed and distributed by SDC. From that UI it's possible to distribute the configuration policies and control the life-cycle of the DCAE Micro Services.
-Policy/CLAMP UI is also used to manage Policies outside of a Control Loop.
-
-The following actions are done using the UI:
-
-* Design a control loop flow by selecting a predefined template from a list
- (a template is an orchestration chain of Micro-services, so the template
- defines how the micro-services of the control loop are chained together)
-
-* Give value to the configuration the parameters of each micro-service of
- the control loop
-
-* Select the service and VNF(of that service) to which the control loop
- will be attached
-
-* Configure the operational policy(the actual operation resulting from
- the control loop)
-
-* Send the “TOSCA” blueprint parameters that will be used by DCAE to start the
- control loop (The blueprint will be sent first to SDC and SDC will
- publish it to DCAE)
-
-* Trigger the deployment of the Control loop in DCAE
-
-* Control (start/stop) the operation of the control loop in DCAE
-
-HealthCheck API - serve to verify CLAMP status (see offered API's section)
-* https://<host-ip>:8443/restservices/clds/v1/healthcheck
-This one does not require the certificate
-
-Walk-through can be found here: https://wiki.onap.org/display/DW/CLAMP+videos
-
-.. toctree::
- :maxdepth: 1
- :titlesonly:
-
- CLAMP User Guide <user-guide.rst> \ No newline at end of file
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
deleted file mode 100644
index 18c1aa6b9..000000000
--- a/docs/release-notes.rst
+++ /dev/null
@@ -1,504 +0,0 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
-.. _release_notes:
-
-Release Notes
-=============
-
-Version: 5.1.0 (Guilin)
---------------------------
-
-:Release Date: 2020-11-19
-
-**New Features**
-
-The Guilin release of the Control Loop Automation Management Platform (CLAMP).
-
-The main goal of the Guilin release was to:
-
- - Complete integration to CDS for Actor/Action selection.
- - SECCOM Perform Software Composition Analysis - Vulnerability tables (TSC must have).
- - SECCOM Password removal from OOM HELM charts (TSC must have) - implementation of certinInitializer to get AAF certificates at oom deployment time.
-
-**Bug Fixes**
-
- - The full list of implemented user stories and epics is available on `CLAMP R7 - M1 release planning <https://wiki.onap.org/display/DW/CLAMP+R7+-+M1+Release+Planning>`_
- - The full list of issues(bugs) solved, is available on `CLAMP R7 - Guilin list of solved issues(bugs) <https://wiki.onap.org/pages/viewpage.action?pageId=93000705>`_
-
-**Known Issues**
-
-**Security Notes**
-
-*Fixed Security Issues*
-
-*Known Security Issues*
-
-*Known Vulnerabilities in Used Modules*
-
-CLAMP code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and actions to be taken in future release.
-
-Quick Links:
- - `CLAMP project page <https://wiki.onap.org/display/DW/CLAMP+Project>`_
-
- - `Passing Badge information for CLAMP <https://bestpractices.coreinfrastructure.org/en/projects/1197>`_
-
-**Upgrade Notes**
-
- - The Upgrade strategy for Guilin can be found here:`<https://wiki.onap.org/display/DW/Frankfurt+CLAMP+Container+upgrade+strategy>`_
- - New Docker Containers are available. the list of containers composing this release are below:
- - clamp-backend: nexus3.onap.org:10001/onap/clamp-backend 5.1.5
- - clamp-frontend: nexus3.onap.org:10001/onap/clamp-frontend 5.1.5
- - clamp-dash-es: nexus3.onap.org:10001/onap/clamp-dashboard-elasticsearch 5.0.4
- - clamp-dash-kibana: nexus3.onap.org:10001/onap/clamp-dashboard-kibana 5.0.4
- - clamp-dash-logstash: nexus3.onap.org:10001/onap/clamp-dashboard-logstash 5.0.4
-
-
-Version: 5.0.7 (Frankfurt maintenance release tag 6.0.0)
---------------------------------------------------------
-
-:Release Date: 2020-08-17
-
-**Bug Fixes**
-
- - `CLAMP-878 <https://jira.onap.org/browse/CLAMP-885>`_ Clamp backend pod fails with mariaDB server error
- - `CLAMP-885 <https://jira.onap.org/browse/CLAMP-885>`_ CLAMP update documentation
-
-**Known Issues**
- - `CLAMP-856 <https://jira.onap.org/browse/CLAMP-856>`_ CLAMP should not display all CDS workflow properties
- - Other more minor issues are captured in the following page:`CLAMP known Frankfurt issues <https://wiki.onap.org/display/DW/CLAMP+R6+-+Frankfurt+known+issues%28bugs%29+-+to+be+solved+in+futur+Releases>`_
-
-**Security Notes**
-
-N/A
-
-*Fixed Security Issues*
-
-*Known Security Issues*
-
-*Known Vulnerabilities in Used Modules*
-
-CLAMP code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and actions to be taken in future release.
-
-Quick Links:
- - `CLAMP project page <https://wiki.onap.org/display/DW/CLAMP+Project>`_
- - `Passing Badge information for CLAMP <https://bestpractices.coreinfrastructure.org/en/projects/1197>`_
-
-**Upgrade Notes**
-
- - The Upgrade strategy for Frankfurt can be found here:`<https://wiki.onap.org/display/DW/Frankfurt+CLAMP+Container+upgrade+strategy>`_
- - New Docker Containers are available. the list of containers composing this release are below:
-
- - clamp-backend-filebeat-onap: docker.elastic.co/beats/filebeat 5.5.0
- - clamp-backend: nexus3.onap.org:10001/onap/clamp-backend 5.0.7
- - clamp-frontend: nexus3.onap.org:10001/onap/clamp-frontend 5.0.7
- - clamp-dash-es: nexus3.onap.org:10001/onap/clamp-dashboard-elasticsearch 5.0.3
- - clamp-dash-kibana: nexus3.onap.org:10001/onap/clamp-dashboard-kibana 5.0.3
- - clamp-dash-logstash: nexus3.onap.org:10001/onap/clamp-dashboard-logstash 5.0.3
-
-Version: 5.0.1 (Frankfurt)
---------------------------
-
-:Release Date: 2020-05-12
-
-**New Features**
-
-The Frankfurt release is the seventh release of the Control Loop Automation Management Platform (CLAMP).
-
-The main goal of the Frankfurt release was to:
-
- - implementing a new Control Loop creation flow: Self Serve Control Loop(partially done will be continued in next release).
- - Add Tosca policy-model support for Operational Policies definitions.
- - Add integration to CDS for Actor/Action selection.
- - Move from SearchGuard to OpenDistro.
- - Document(high level) current upgrade component strategy (TSC must have).
- - SECCOM Perform Software Composition Analysis - Vulnerability tables (TSC must have).
- - SECCOM Password removal from OOM HELM charts (TSC must have).
- - SECCOM HTTPS communication vs. HTTP (TSC must have)
-
-**Bug Fixes**
-
- - The full list of implemented user stories and epics is available on `Frankfurt CLAMP M1 release planning <https://wiki.onap.org/display/DW/CLAMP+R6+-+M1+Release+Planning>`_
- - The full list of issues(bugs) solved, is available on `CLAMP R6 - Frankfurt list of solved issues(bugs) <https://wiki.onap.org/pages/viewpage.action?pageId=84648915>`_
-
-**Known Issues**
- - `CLAMP-856 <https://jira.onap.org/browse/CLAMP-856>`_ CLAMP should not display all CDS workflow properties
-
-**Security Notes**
-
-*Fixed Security Issues*
-
-*Known Security Issues*
-
-*Known Vulnerabilities in Used Modules*
-
-CLAMP code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and actions to be taken in future release.
-
-Quick Links:
- - `CLAMP project page <https://wiki.onap.org/display/DW/CLAMP+Project>`_
-
- - `Passing Badge information for CLAMP <https://bestpractices.coreinfrastructure.org/en/projects/1197>`_
-
-**Upgrade Notes**
-
- - The Upgrade strategy for Frankfurt can be found here:`<https://wiki.onap.org/display/DW/Frankfurt+CLAMP+Container+upgrade+strategy>`_
- - New Docker Containers are available. the list of containers composing this release are below:
- - clamp-backend-filebeat-onap: docker.elastic.co/beats/filebeat 5.5.0
- - clamp-backend: nexus3.onap.org:10001/onap/clamp-backend 5.0.6
- - clamp-frontend: nexus3.onap.org:10001/onap/clamp-frontend 5.0.6
- - clamp-dash-es: nexus3.onap.org:10001/onap/clamp-dashboard-elasticsearch 5.0.3
- - clamp-dash-kibana: nexus3.onap.org:10001/onap/clamp-dashboard-kibana 5.0.3
- - clamp-dash-logstash: nexus3.onap.org:10001/onap/clamp-dashboard-logstash 5.0.3
-
-
-Version: 4.1.3 (El-Alto)
-------------------------
-
-:Release Date: 2019-10-11
-
-**New Features**
-
-The El Alto release is the sixth release of the Control Loop Automation Management Platform (CLAMP).
-
-The main goal of the El Alto release was to:
-
- - _.Fix a maximum a security issues, especially the angular related issues by moving to React.
-
-**Bug Fixes**
-
- - The full list of implemented user stories and epics is available on `El Alto CLAMP user stories done <https://wiki.onap.org/display/DW/El+Alto+CLAMP+user+stories+done>`_
- This includes the list of bugs that were fixed during the course of this release.
-
-**Known Issues**
-
- - `CLAMP-506 <https://jira.onap.org/browse/CLAMP-506>`_ Elastic Search Clamp image cannot be built anymore(SearchGuard DMCA issue)
- - Due to the uncertainties with the DMCA SearchGuard issue, the ELK stack has been removed from El Alto release, meaning the CLAMP "Control Loop Dashboard" is not part of the El Alto release.
- - `CLAMP-519 <https://jira.onap.org/browse/CLAMP-519>`_ Clamp cannot authenticate to AAF(Local authentication as workaround)
-
-
-**Security Notes**
-
-*Fixed Security Issues*
-
-*Known Security Issues*
-
-*Known Vulnerabilities in Used Modules*
-
-CLAMP code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and actions to be taken in future release.
-The CLAMP open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=68540334>`_.
-
-Quick Links:
- - `CLAMP project page <https://wiki.onap.org/display/DW/CLAMP+Project>`_
-
- - `Passing Badge information for CLAMP <https://bestpractices.coreinfrastructure.org/en/projects/1197>`_
-
- - `Project Vulnerability Review Table for CLAMP <https://wiki.onap.org/pages/viewpage.action?pageId=68540334>`_
-
-**Upgrade Notes**
-
- New Docker Containers are available.
-
-
-Version: 4.1.0 (El-Alto Early Drop)
------------------------------------
-
-:Release Date: 2019-08-19
-
-**New Features**
-
-The El Alto-Early Drop release is the fifth release of the Control Loop Automation Management Platform (CLAMP).
-
-The main goal of the El Alto-Early Drop release was to:
-
- - _.Fix a maximum a security issues, especially the angular related issues by moving to React.
-
-**Bug Fixes**
-
- - The full list of implemented user stories and epics is available on `CLAMP R5 - Early Drop RELEASE <https://wiki.onap.org/display/DW/CLAMP+R5+-+Early+Drop>`_
- This includes the list of bugs that were fixed during the course of this release.
-
-**Known Issues**
-
- - `CLAMP-384 <https://jira.onap.org/browse/CLAMP-384>`_ Loop State in UI is not reflecting the current state
-
-**Security Notes**
-
-*Fixed Security Issues*
-
- - `OJSI-166 <https://jira.onap.org/browse/OJSI-166>`_ Port 30290 exposes unprotected service outside of cluster.
-
-*Known Security Issues*
-
-*Known Vulnerabilities in Used Modules*
-
-CLAMP code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and actions to be taken in future release.
-The CLAMP open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=68540334>`_.
-
-Quick Links:
- - `CLAMP project page <https://wiki.onap.org/display/DW/CLAMP+Project>`_
-
- - `Passing Badge information for CLAMP <https://bestpractices.coreinfrastructure.org/en/projects/1197>`_
-
- - `Project Vulnerability Review Table for CLAMP <https://wiki.onap.org/pages/viewpage.action?pageId=68540334>`_
-
-**Upgrade Notes**
-
- New Docker Containers are available.
-
-
-
-Version: 4.0.5 (Dublin)
------------------------
-
-:Release Date: 2019-06-06
-
-**New Features**
-
-The Dublin release is the fourth release of the Control Loop Automation Management Platform (CLAMP).
-
-The main goal of the Dublin release was to:
-
- - Stabilize Platform maturity by stabilizing CLAMP maturity matrix see `Wiki <https://wiki.onap.org/display/DW/Dublin+Release+Platform+Maturity>`_.
- - CLAMP supports of Policy-model based Configuration Policy
- - CLAMP supports new Policy Engine direct Rest API (no longer based on jar provided by Policy Engine)
- - CLAMP main Core/UI have been reworked, removal of security issues reported by Nexus IQ.
-
-**Bug Fixes**
-
- - The full list of implemented user stories and epics is available on `DUBLIN RELEASE <https://jira.onap.org/projects/CLAMP/versions/10427>`_
- This includes the list of bugs that were fixed during the course of this release.
-
-**Known Issues**
-
- - `CLAMP-384 <https://jira.onap.org/browse/CLAMP-384>`_ Loop State in UI is not reflecting the current state
-
-**Security Notes**
-
-*Fixed Security Issues*
-
- - `OJSI-128 <https://jira.onap.org/browse/OJSI-128>`_ In default deployment CLAMP (clamp) exposes HTTP port 30258 outside of cluster.
- - `OJSI-147 <https://jira.onap.org/browse/OJSI-147>`_ In default deployment CLAMP (cdash-kibana) exposes HTTP port 30290 outside of cluster.
- - `OJSI-152 <https://jira.onap.org/browse/OJSI-152>`_ In default deployment CLAMP (clamp) exposes HTTP port 30295 outside of cluster.
-
-*Known Security Issues*
-
-*Known Vulnerabilities in Used Modules*
-
-CLAMP code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and actions to be taken in future release.
-The CLAMP open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=64003444>`_.
-
-Quick Links:
- - `CLAMP project page <https://wiki.onap.org/display/DW/CLAMP+Project>`_
-
- - `Passing Badge information for CLAMP <https://bestpractices.coreinfrastructure.org/en/projects/1197>`_
-
- - `Project Vulnerability Review Table for CLAMP <https://wiki.onap.org/pages/viewpage.action?pageId=64003444>`_
-
-**Upgrade Notes**
-
- New Docker Containers are available.
-
-
-Version: 3.0.4 - maintenance release
-------------------------------------
-
-:Release Date: 2019-04-06
-
-**New Features**
-none
-
-**Bug Fixes**
-none
-
-**Known Issues**
-CLAMP certificates have been renewed to extend their expiry dates
- - `CLAMP-335 <https://jira.onap.org/browse/CLAMP-335>`_ Update Certificates on Casablanca release.
-
-
-Version: 3.0.3 - maintenance release
-------------------------------------
-
-:Release Date: 2019-02-06
-
-**New Features**
-none
-
-**Bug Fixes**
-none
-
-**Known Issues**
-one documentation issue was fixed, this issue does not require a new docker image:
- - `CLAMP-257 <https://jira.onap.org/browse/CLAMP-257>`_ User Manual for CLAMP : nothing on readthedocs.
-
-Version: 3.0.3 (Casablanca)
----------------------------
-
-:Release Date: 2018-11-30
-
-**New Features**
-
-The Casablanca release is the third release of the Control Loop Automation Management Platform (CLAMP).
-
-The main goal of the Casablanca release was to:
-
- - Enhance Platform maturity by improving CLAMP maturity matrix see `Wiki <https://wiki.onap.org/display/DW/Casablanca+Release+Platform+Maturity>`_.
- - CLAMP Dashboard improvements for the monitoring of active Closed Loops
- - CLAMP logs alignment on the ONAP platform.
- - CLAMP is now integrated with AAF for authentication and permissions retrieval (AAF server is pre-loaded by default with the required permissions)
- - CLAMP improvement for configuring the policies (support of Scale Out use case)
- - CLAMP main Core/UI have been reworked, removal of security issues reported by Nexus IQ on JAVA/JAVASCRIPT code (Libraries upgrade or removal/replacement when possible)
- - As a POC, the javascript coverage can now be enabled in SONAR (Disabled for now)
-
-**Bug Fixes**
-
- - The full list of implemented user stories and epics is available on `CASABLANCA RELEASE <https://jira.onap.org/projects/CLAMP/versions/10408>`_
- This includes the list of bugs that were fixed during the course of this release.
-
-**Known Issues**
-
- - None
-
-**Security Notes**
-
-CLAMP code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and actions to be taken in future release.
-The CLAMP open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=42598587>`_.
-
-Quick Links:
- - `CLAMP project page <https://wiki.onap.org/display/DW/CLAMP+Project>`_
-
- - `Passing Badge information for CLAMP <https://bestpractices.coreinfrastructure.org/en/projects/1197>`_
-
- - `Project Vulnerability Review Table for CLAMP <https://wiki.onap.org/pages/viewpage.action?pageId=42598587>`_
-
-**Upgrade Notes**
-
- New Docker Containers are available, an ELK stack is also now part of CLAMP deployments.
-
-**Deprecation Notes**
-
- The CLAMP Designer Menu (in CLAMP UI) is deprecated since Beijing, the design time is being onboarded into SDC - DCAE D.
-
-**Other**
-
- CLAMP Dashboard is now implemented, allows to monitor Closed Loops that are running by retrieving CL events on DMAAP.
-
-**How to - Videos**
-
- https://wiki.onap.org/display/DW/CLAMP+videos
-
-Version: 2.0.2 (Beijing)
-------------------------
-
-:Release Date: 2018-06-07
-
-**New Features**
-
-The Beijing release is the second release of the Control Loop Automation Management Platform (CLAMP).
-
-The main goal of the Beijing release was to:
-
- - Enhance Platform maturity by improving CLAMP maturity matrix see `Wiki <https://wiki.onap.org/display/DW/Beijing+Release+Platform+Maturity>`_.
- - Focus CLAMP on Closed loop runtime operations and control - this is reflected by the move of the design part to DCAE-D.
- - Introduce CLAMP Dashboard for monitoring of active Closed Loops.
- - CLAMP is integrated with MSB.
- - CLAMP has integrated SWAGGER.
- - CLAMP main Core has been reworked for improved flexibility.
-
-**Bug Fixes**
-
- - The full list of implemented user stories and epics is available on `BEIJING RELEASE <https://jira.onap.org/projects/CLAMP/versions/10314>`_
- This includes the list of bugs that were fixed during the course of this release.
-
-**Known Issues**
-
- - `CLAMP-69 <https://jira.onap.org/browse/CLAMP-69>`_ Deploy action does not always work.
-
- The "Deploy" action does not work directly after submitting it.
-
- Workaround:
-
- You have to close the CL and reopen it again. In that case the Deploy action will do something.
-
-**Security Notes**
-
-CLAMP code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and determined to be false positive. The CLAMP open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=25440749>`_.
-
-Quick Links:
- - `CLAMP project page <https://wiki.onap.org/display/DW/CLAMP+Project>`_
-
- - `Passing Badge information for CLAMP <https://bestpractices.coreinfrastructure.org/en/projects/1197>`_
-
- - `Project Vulnerability Review Table for CLAMP <https://wiki.onap.org/pages/viewpage.action?pageId=25440749>`_
-
-**Upgrade Notes**
-
- New Docker Containers are avaialble, an ELK stack is also now part of CLAMP deployments.
-
-**Deprecation Notes**
-
- The CLAMP Designer UI is now deprecated and unavailable, the design time is being onboarded into SDC - DCAE D.
-
-**Other**
-
- CLAMP Dashboard is now implemented, allows to monitor Closed Loops that are running by retrieving CL events on DMAAP.
-
-Version: 1.1.0 (Amsterdam)
---------------------------
-
-:Release Date: 2017-11-16
-
-**New Features**
-
-The Amsterdam release is the first release of the Control Loop Automation Management Platform (CLAMP).
-
-The main goal of the Amsterdam release was to:
-
- - Support the automation of provisionning for the Closed loops of the vFW, vDNW and vCPE through TCA.
- - Support the automation of provisionning for the Closed loops of VVolte (Holmes)
- - Demonstrate complete interaction with Policy, DCAE, SDC and Holmes.
-
-**Bug Fixes**
-
- - The full list of implemented user stories and epics is available on `AMSTERDAM RELEASE <https://jira.onap.org/projects/CLAMP/versions/10313>`_
- This is technically the first release of CLAMP, previous release was the seed code contribution.
- As such, the defects fixed in this release were raised during the course of the release.
- Anything not closed is captured below under Known Issues. If you want to review the defects fixed in the Amsterdam release, refer to Jira link above.
-
-**Known Issues**
- - `CLAMP-68 <https://jira.onap.org/browse/CLAMP-68>`_ ResourceVF not always provisioned.
-
- In Closed Loop -> Properties CL: When opening the popup window, the first service in the list does not show Resource-VF even though in SDC there is a resource instance in the service.
-
- Workaround:
-
- If you have multiple service available (if not create a dummy one on SDC), just click on another one and then click back on the first one in the list. The ResourceVF should be provisioned now.
-
- - `CLAMP-69 <https://jira.onap.org/browse/CLAMP-69>`_ Deploy action does not always work.
-
- The "Deploy" action does not work directly after submitting it.
-
- Workaround:
-
- You have to close the CL and reopen it again. In that case the Deploy action will do something
-
-
-**Security Issues**
- CLAMP is following the CII Best Practices Badge Program, results including security assesment can be found on the
- `project page <https://bestpractices.coreinfrastructure.org/projects/1197>`_
-
-
-**Upgrade Notes**
-
- N/A
-
-**Deprecation Notes**
-
- N/A
-
-**Other**
-
-
-
-===========
-
-End of Release Notes
diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt
deleted file mode 100644
index b3188ddd3..000000000
--- a/docs/requirements-docs.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-tox
-Sphinx
-doc8
-docutils
-setuptools
-six
-sphinx_rtd_theme>=0.4.3
-sphinxcontrib-blockdiag
-sphinxcontrib-needs>=0.2.3
-sphinxcontrib-nwdiag
-sphinxcontrib-seqdiag
-sphinxcontrib-swaggerdoc
-sphinxcontrib-plantuml
-sphinx_bootstrap_theme
-lfdocs-conf
diff --git a/docs/tox.ini b/docs/tox.ini
deleted file mode 100644
index edac8c35f..000000000
--- a/docs/tox.ini
+++ /dev/null
@@ -1,22 +0,0 @@
-[tox]
-minversion = 1.6
-envlist = docs,
-skipsdist = true
-
-[testenv:docs]
-basepython = python3
-deps = -r{toxinidir}/requirements-docs.txt
-commands =
- sphinx-build -b html -n -d {envtmpdir}/doctrees ./ {toxinidir}/_build/html
- echo "Generated docs available in {toxinidir}/_build/html"
-whitelist_externals =
- echo
- git
- sh
-
-[testenv:docs-linkcheck]
-basepython = python3
-#deps = -r{toxinidir}/requirements-docs.txt
-commands = echo "Link Checking not enforced"
-#commands = sphinx-build -b linkcheck -d {envtmpdir}/doctrees ./ {toxinidir}/_build/linkcheck
-whitelist_externals = echo
diff --git a/docs/user-guide.rst b/docs/user-guide.rst
deleted file mode 100644
index 5cfcf1abd..000000000
--- a/docs/user-guide.rst
+++ /dev/null
@@ -1,157 +0,0 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved.
-
-Control loop in Policy/CLAMP
-----------------------------
-There are 2 control loop levels in Policy/CLAMP:
-
-- Control loop template: This is created from the DCAE blueprint (designed in the DCAE designer), and distributed by SDC to CLAMP.
-- Control loop instance: Based on the template, it represents a physical control loop in the platform related to a service and a VNF.
-
-There is no way to design the microservice components of the control loop from scratch in CLAMP, you can only configure it and manage its life-cycle.
-For more info on how to design the service in SDC, check this: https://wiki.onap.org/display/DW/CLAMP+videos#CLAMPvideos-DesignpartinSDC
-
-
-There is a specific menu to view the available Control loop templates.
-
-|clamp-template-menu|
-
-
-Each microservice policies and operational policies is related to a Policy Model.
-Clamp either communicates with Policy Engine periodically to download the available Policy Models automatically or user can upload the Policy Model manually.
-Policy Models related operations could be found under Policy Models menu.
-
-|clamp-policy-model-menu|
-
-
-Under the menu *Loop Instance*, there's a list of actions to perform regarding to the loops.
-
-|clamp-loop-menu|
-
-
-Option *Create* creates the loop from the templates distributed by SDC.
-
-|clamp-create-loop|
-
-
-Option *Open* opens the saved loops. Once the distributed control loop has been chosen, the control loop is shown to the user.
-
-|clamp-open-loop|
-
-
-Option *Close* will close the current opened loop.
-
-
-Option *Modify* opens the window to add/remove different Operational Policies to the loop.
-Tab *Add Operational Policies* lists all the available operational policies.
-Click *Add* button to add the selected operational policies to the loop.
-
-|clamp-add-operational-policies|
-
-Tab *Remove Operational Policies* lists all the operational policies added to the loop.
-Click *Remove* button to remove the selected operational policies from the loop.
-
-|clamp-remove-operational-policies|
-
-
-Once opened, the user can start configure empty control loop using **Closed loop modeller**.
-
-|clamp-opened-loop|
-
-
-Loop modeler has 3 main parts:
-
-#. Loop configuration view
- Visualizes event flow in Control Loop. This view is auto-generated by Clamp. To generate it Clamp parses DCAE_INVENTORY_BLUEPRINT from CSAR distributed by SDC.
- It Always consists of **VES -> <nodes from blueprint> -> OperationalPolicy**. Not all nodes are visualized. Only those with type **dcae.nodes.\***
- |blueprint-node|
-
-#. Loop status
- Visualizes status of opened loop.
-#. Loop logs
- Table with log data of opened loop
-
-
-Control Loop properties
------------------------
-In Dublin release this view shows what are deployment parameters or control Loop.
-To open it from *Loop Instance* menu select *Properties*
-
-|clamp-menu-prop|
-
-This opens a box with JSON object. It contains deployment parameters extracted from DCAE_INVENTORY_BLUEPRINT.
-It's not recommended to edit this JSON. Each of this parameters should be available in view shown to deploy analytic application.
-
-|clamp-prop-box|
-
-
-Operational policy properties
----------------------------------------
-Operational policies are added by the user using *Modify* window. The configuration view is generated using Policy Type assigned to selected operational policy.
-
-To configure operational policies, user has to click the corresponding operational policy boxes. Example popup dialog for operational policy looks like:
-
-|clamp-op-policy-box-policy|
-
-Operations and payload for CDS actor is fetched from CDS.
-Clamp receives CDS blueprint name and version information from sdnc_model_name and sdnc_model_version properties in CSAR distributed by SDC and queries CDS to get list of operations and payload for the corresponding CDS blueprint.
-
-|clamp-cds-operation|
-
-Micro-service policy properties
--------------------------------
-Boxes between `VES` and `Operational Policies` are generated from blueprint. They can be one of ONAP predefined analytic microservices or custom analytics.
-Each of the boxes is clickable. Microservice configuration view is generated using Policy Type assigned to selected microservice.
-Clamp by default assumes that microservices have policy type **onap.policies.monitoring.cdap.tca.hi.lo.app**.
-
-After clicking microservice box Clamp opens popup dialog. Example popup dialog for microservice with default type looks like:
-
-|clamp-config-policy-tca|
-
-
-
-In the *Loop Operations* menu, lists the operations to be perform to the loop.
-
-|clamp-loop-operation-menu|
-
-
-Submitting the Control loop to core policy
-------------------------------------------
-The SUBMIT operation can be used to send the configuration to policy engine.
-If everything is successful, the status to the policy will become *SENT*. Clamp should also show proper logs in logs view.
-
-|clamp-policy-submitted|
-
-After Policies are submitted they should be visible in Policy PAP component.
-Please check `Policy GUI <https://docs.onap.org/en/dublin/submodules/policy/engine.git/docs/platform/policygui.html>`_
-
-
-Deploy/undeploy the Control Loop to DCAE
------------------------------------------
-Once sent to policy engine, Clamp can ask to DCAE to DEPLOY the micro service
-
-This opens a window where the parameters of the DCAE micro service can be configured/tuned.
-The policy_id is automatically generated by Clamp in the previous steps.
-
-|clamp-deploy-params|
-
-Once deployed on DCAE the status of DCAE goes to *MICROSERVICE_INSTALLED_SUCCESSFULLY*, it can then be Undeployed/Stopped/Restart.
-
-.. |clamp-template-menu| image:: images/user-guide/template-menu.png
-.. |clamp-policy-model-menu| image:: images/user-guide/policy-model-menu.png
-.. |clamp-loop-menu| image:: images/user-guide/loop-menu.png
-.. |clamp-create-loop| image:: images/user-guide/create-loop.png
-.. |clamp-open-loop| image:: images/user-guide/open-loop.png
-.. |clamp-add-operational-policies| image:: images/user-guide/add-operational-policies.png
-.. |clamp-remove-operational-policies| image:: images/user-guide/remove-operational-policies.png
-.. |clamp-opened-loop| image:: images/user-guide/opened-loop.png
-.. |clamp-menu-prop| image:: images/user-guide/open-menu-prop.png
-.. |clamp-prop-box| image:: images/user-guide/loop-properties.png
-.. |clamp-op-policy-box-policy| image:: images/user-guide/op-policy-box-policy.png
-.. |clamp-config-policy-tca| image:: images/user-guide/config-policy-tca.png
-.. |clamp-loop-operation-menu| image:: images/user-guide/loop-operation-menu.png
-.. |clamp-policy-submitted| image:: images/user-guide/policy-submitted.png
-.. |clamp-deploy-params| image:: images/user-guide/deploy-params.png
-.. |blueprint-node| image:: images/user-guide/blueprint_node_type.png
-.. |clamp-cds-operation| image:: images/user-guide/clamp-cds-operation.png
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProvider.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProvider.java
new file mode 100644
index 000000000..6a6d20fe7
--- /dev/null
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProvider.java
@@ -0,0 +1,226 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.ws.rs.core.Response.Status;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.provider.PolicyModelsProvider;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeType;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
+import org.springframework.stereotype.Component;
+
+@Component
+@RequiredArgsConstructor
+public class ServiceTemplateProvider {
+
+ private final PolicyModelsProvider modelsProvider;
+
+ /**
+ * Create service template.
+ *
+ * @param serviceTemplate the service template to be created
+ * @return the created service template
+ * @throws PfModelException on errors creating the service template
+ */
+ public ToscaServiceTemplate createServiceTemplate(final ToscaServiceTemplate serviceTemplate)
+ throws PfModelException {
+ return modelsProvider.createServiceTemplate(serviceTemplate);
+ }
+
+ /**
+ * Delete service template.
+ *
+ * @param name the name of the service template to delete.
+ * @param version the version of the service template to delete.
+ * @return the TOSCA service template that was deleted
+ * @throws PfModelException on errors deleting policy types
+ */
+ public ToscaServiceTemplate deleteServiceTemplate(final String name, final String version) throws PfModelException {
+ return modelsProvider.deleteServiceTemplate(name, version);
+ }
+
+ /**
+ * Get the requested control loop definitions.
+ *
+ * @param name the name of the definition to get, null for all definitions
+ * @param version the version of the definition to get, null for all definitions
+ * @return the control loop definitions
+ * @throws PfModelException on errors getting control loop definitions
+ */
+ public ToscaServiceTemplate getToscaServiceTemplate(String name, String version) throws PfModelException {
+ var serviceTemplates = modelsProvider.getServiceTemplateList(name, version);
+ if (serviceTemplates.isEmpty()) {
+ throw new PfModelException(Status.NOT_FOUND, "Control Loop definitions not found");
+ }
+ return serviceTemplates.get(0);
+ }
+
+ /**
+ * Get service templates.
+ *
+ * @param name the name of the topology template to get, set to null to get all service templates
+ * @param version the version of the service template to get, set to null to get all service templates
+ * @return the topology templates found
+ * @throws PfModelException on errors getting service templates
+ */
+ public List<ToscaServiceTemplate> getServiceTemplateList(final String name, final String version)
+ throws PfModelException {
+ return modelsProvider.getServiceTemplateList(name, version);
+ }
+
+ /**
+ * Get the initial node types with common or instance properties.
+ *
+ * @param fullNodeTypes map of all the node types in the specified template
+ * @param common boolean to indicate whether common or instance properties are required
+ * @return node types map that only has common properties
+ * @throws PfModelException on errors getting node type with common properties
+ */
+ private Map<String, ToscaNodeType> getInitialNodeTypesMap(Map<String, ToscaNodeType> fullNodeTypes,
+ boolean common) {
+
+ var tempNodeTypesMap = new HashMap<String, ToscaNodeType>();
+
+ fullNodeTypes.forEach((key, nodeType) -> {
+ var tempToscaNodeType = new ToscaNodeType();
+ tempToscaNodeType.setName(key);
+
+ var resultantPropertyMap = findCommonOrInstancePropsInNodeTypes(nodeType, common);
+
+ if (!resultantPropertyMap.isEmpty()) {
+ tempToscaNodeType.setProperties(resultantPropertyMap);
+ tempNodeTypesMap.put(key, tempToscaNodeType);
+ }
+ });
+ return tempNodeTypesMap;
+ }
+
+ private Map<String, ToscaProperty> findCommonOrInstancePropsInNodeTypes(ToscaNodeType nodeType, boolean common) {
+
+ var tempCommonPropertyMap = new HashMap<String, ToscaProperty>();
+ var tempInstancePropertyMap = new HashMap<String, ToscaProperty>();
+
+ nodeType.getProperties().forEach((propKey, prop) -> {
+
+ if (prop.getMetadata() != null) {
+ prop.getMetadata().forEach((k, v) -> {
+ if (k.equals("common") && v.equals("true") && common) {
+ tempCommonPropertyMap.put(propKey, prop);
+ } else if (k.equals("common") && v.equals("false") && !common) {
+ tempInstancePropertyMap.put(propKey, prop);
+ }
+
+ });
+ } else {
+ tempInstancePropertyMap.put(propKey, prop);
+ }
+ });
+
+ if (tempCommonPropertyMap.isEmpty() && !common) {
+ return tempInstancePropertyMap;
+ } else {
+ return tempCommonPropertyMap;
+ }
+ }
+
+ /**
+ * Get the node types derived from those that have common properties.
+ *
+ * @param initialNodeTypes map of all the node types in the specified template
+ * @param filteredNodeTypes map of all the node types that have common or instance properties
+ * @return all node types that have common properties including their children
+ * @throws PfModelException on errors getting node type with common properties
+ */
+ private Map<String, ToscaNodeType> getFinalNodeTypesMap(Map<String, ToscaNodeType> initialNodeTypes,
+ Map<String, ToscaNodeType> filteredNodeTypes) {
+ for (var i = 0; i < initialNodeTypes.size(); i++) {
+ initialNodeTypes.forEach((key, nodeType) -> {
+ var tempToscaNodeType = new ToscaNodeType();
+ tempToscaNodeType.setName(key);
+
+ if (filteredNodeTypes.get(nodeType.getDerivedFrom()) != null) {
+ tempToscaNodeType.setName(key);
+
+ var finalProps = new HashMap<String, ToscaProperty>(
+ filteredNodeTypes.get(nodeType.getDerivedFrom()).getProperties());
+
+ tempToscaNodeType.setProperties(finalProps);
+ } else {
+ return;
+ }
+ filteredNodeTypes.putIfAbsent(key, tempToscaNodeType);
+
+ });
+ }
+ return filteredNodeTypes;
+ }
+
+ /**
+ * Get the requested node types with common or instance properties.
+ *
+ * @param common boolean indicating common or instance properties
+ * @param serviceTemplate the ToscaServiceTemplate
+ * @return the node types with common or instance properties
+ * @throws PfModelException on errors getting node type properties
+ */
+ public Map<String, ToscaNodeType> getCommonOrInstancePropertiesFromNodeTypes(boolean common,
+ ToscaServiceTemplate serviceTemplate) throws PfModelException {
+ var tempNodeTypesMap = this.getInitialNodeTypesMap(serviceTemplate.getNodeTypes(), common);
+
+ return this.getFinalNodeTypesMap(serviceTemplate.getNodeTypes(), tempNodeTypesMap);
+
+ }
+
+ /**
+ * Get node templates with appropriate common or instance properties added.
+ *
+ * @param initialNodeTemplates map of all the node templates in the specified template
+ * @param nodeTypeProps map of all the node types that have common or instance properties including children
+ * @return all node templates with appropriate common or instance properties added
+ * @throws PfModelException on errors getting map of node templates with common or instance properties added
+ */
+ public Map<String, ToscaNodeTemplate> getDerivedCommonOrInstanceNodeTemplates(
+ Map<String, ToscaNodeTemplate> initialNodeTemplates, Map<String, ToscaNodeType> nodeTypeProps) {
+
+ var finalNodeTemplatesMap = new HashMap<String, ToscaNodeTemplate>();
+
+ initialNodeTemplates.forEach((templateKey, template) -> {
+ if (nodeTypeProps.containsKey(template.getType())) {
+ var finalMergedProps = new HashMap<String, Object>();
+
+ nodeTypeProps.get(template.getType()).getProperties().forEach(finalMergedProps::putIfAbsent);
+
+ template.setProperties(finalMergedProps);
+
+ finalNodeTemplatesMap.put(templateKey, template);
+ } else {
+ return;
+ }
+ });
+ return finalNodeTemplatesMap;
+ }
+}
diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopElementTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopElementTest.java
index 9e285a4f0..ed579febb 100644
--- a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopElementTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopElementTest.java
@@ -25,6 +25,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import java.util.UUID;
import org.junit.jupiter.api.Test;
@@ -33,24 +34,45 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
class ControlLoopElementTest {
@Test
void testControlLoopElement() {
+ var cle0 = new ControlLoopElement();
+ var cle1 = new ControlLoopElement(cle0);
+ assertEquals(cle0, cle1);
- ControlLoopElement cle0 = new ControlLoopElement();
+ cle1.setDefinition(new ToscaConceptIdentifier("defName", "0.0.1"));
+ cle1.setDescription("Description");
+ cle1.setId(UUID.randomUUID());
+ cle1.setOrderedState(ControlLoopOrderedState.UNINITIALISED);
+ cle1.setParticipantId(new ToscaConceptIdentifier("id", "1.2.3"));
+ cle1.setState(ControlLoopState.UNINITIALISED);
- ControlLoopElement cle1 = new ControlLoopElement(cle0);
- assertEquals(cle0, cle1);
+ var cle2 = new ControlLoopElement(cle1);
+ assertEquals(cle1, cle2);
+ }
+
+ @Test
+ void testControlLoopState() {
+ var cle0 = new ControlLoopElement();
+
+ assertTrue(
+ cle0.getOrderedState()
+ .equalsControlLoopState(ControlLoopState.UNINITIALISED));
+
+ assertTrue(
+ cle0.getOrderedState().asState()
+ .equalsControlLoopOrderedState(ControlLoopOrderedState.UNINITIALISED));
}
@Test
void testControlLoopElementLombok() {
assertNotNull(new ControlLoopElement());
- ControlLoopElement cle0 = new ControlLoopElement();
+ var cle0 = new ControlLoopElement();
assertThat(cle0.toString()).contains("ControlLoopElement(");
assertThat(cle0.hashCode()).isNotZero();
assertEquals(true, cle0.equals(cle0));
assertEquals(false, cle0.equals(null));
- ControlLoopElement cle1 = new ControlLoopElement();
+ var cle1 = new ControlLoopElement();
cle1.setDefinition(new ToscaConceptIdentifier("defName", "0.0.1"));
cle1.setDescription("Description");
@@ -66,7 +88,7 @@ class ControlLoopElementTest {
assertNotEquals(cle1, cle0);
- ControlLoopElement cle2 = new ControlLoopElement();
+ var cle2 = new ControlLoopElement();
// @formatter:off
assertThatThrownBy(() -> cle2.setDefinition(null)). isInstanceOf(NullPointerException.class);
diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java
index 243d8dcd5..51a4fc7ae 100644
--- a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java
@@ -27,7 +27,9 @@ import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import java.time.Instant;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.UUID;
import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfKey;
@@ -36,12 +38,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
class ControlLoopTest {
@Test
void testControlLoop() {
- ControlLoop cl0 = new ControlLoop();
+ var cl0 = new ControlLoop();
cl0.setDefinition(new ToscaConceptIdentifier("dfName", "1.2.3"));
assertEquals("dfName", cl0.getType());
assertEquals("1.2.3", cl0.getTypeVersion());
- ControlLoop cl1 = new ControlLoop(cl0);
+ var cl1 = new ControlLoop(cl0);
assertEquals(cl0, cl1);
assertEquals(0, cl0.compareTo(cl1));
@@ -50,7 +52,7 @@ class ControlLoopTest {
@Test
void testControlLoopLombok() {
assertNotNull(new ControlLoop());
- ControlLoop cl0 = new ControlLoop();
+ var cl0 = new ControlLoop();
cl0.setElements(new LinkedHashMap<>());
assertThat(cl0.toString()).contains("ControlLoop(");
@@ -58,7 +60,7 @@ class ControlLoopTest {
assertEquals(true, cl0.equals(cl0));
assertEquals(false, cl0.equals(null));
- ControlLoop cl1 = new ControlLoop();
+ var cl1 = new ControlLoop();
cl1.setDefinition(new ToscaConceptIdentifier("defName", "0.0.1"));
cl1.setDescription("Description");
@@ -75,7 +77,7 @@ class ControlLoopTest {
assertNotEquals(cl1, cl0);
- ControlLoop cl2 = new ControlLoop();
+ var cl2 = new ControlLoop();
cl2.setElements(new LinkedHashMap<>());
// @formatter:off
@@ -98,5 +100,61 @@ class ControlLoopTest {
assertNull(cl1.getElements().get(UUID.randomUUID()));
assertEquals(PfKey.NULL_KEY_NAME, cl0.getDefinition().getName());
+
+ }
+
+ @Test
+ void testControlLoopElementStatisticsList() {
+ var cl = new ControlLoop();
+ List<ClElementStatistics> emptylist = cl.getControlLoopElementStatisticsList(cl);
+ assertNull(emptylist);
+
+ var cl1 = getControlLoopTest();
+ List<ClElementStatistics> list = cl1.getControlLoopElementStatisticsList(cl1);
+ assertNotNull(list);
+ assertEquals(2, list.size());
+ assertEquals(ControlLoopState.UNINITIALISED, list.get(0).getControlLoopState());
+ }
+
+ private ControlLoop getControlLoopTest() {
+ var cl = new ControlLoop();
+ cl.setDefinition(new ToscaConceptIdentifier("defName", "1.2.3"));
+ cl.setDescription("Description");
+ cl.setElements(new LinkedHashMap<>());
+ cl.setName("Name");
+ cl.setOrderedState(ControlLoopOrderedState.UNINITIALISED);
+ cl.setState(ControlLoopState.UNINITIALISED);
+ cl.setVersion("0.0.1");
+
+ var uuid = UUID.randomUUID();
+ var id = new ToscaConceptIdentifier(
+ "org.onap.policy.controlloop.PolicyControlLoopParticipant", "1.0.1");
+ var clElement = getControlLoopElementTest(uuid, id);
+
+ var uuid2 = UUID.randomUUID();
+ var id2 = new ToscaConceptIdentifier(
+ "org.onap.policy.controlloop.PolicyControlLoopParticipantIntermediary", "0.0.1");
+ var clElement2 = getControlLoopElementTest(uuid2, id2);
+
+ cl.getElements().put(uuid, clElement);
+ cl.getElements().put(uuid2, clElement2);
+ return cl;
+ }
+
+ private ControlLoopElement getControlLoopElementTest(UUID uuid, ToscaConceptIdentifier id) {
+ var clElement = new ControlLoopElement();
+ clElement.setId(uuid);
+ clElement.setParticipantId(id);
+ clElement.setDefinition(id);
+ clElement.setOrderedState(ControlLoopOrderedState.UNINITIALISED);
+
+ var clElementStatistics = new ClElementStatistics();
+ clElementStatistics.setParticipantId(id);
+ clElementStatistics.setControlLoopState(ControlLoopState.UNINITIALISED);
+ clElementStatistics.setTimeStamp(Instant.now());
+
+ clElement.setClElementStatistics(clElementStatistics);
+
+ return clElement;
}
}
diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java
index 8aec568b2..9805edb86 100644
--- a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java
@@ -23,6 +23,7 @@ package org.onap.policy.clamp.controlloop.models.controlloop.persistence.provide
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.util.List;
@@ -35,9 +36,12 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop
import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoops;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.StandardCoder;
+import org.onap.policy.common.utils.coder.YamlJsonTranslator;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.provider.PolicyModelsProviderParameters;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaTypedEntityFilter;
class ControlLoopProviderTest {
@@ -46,7 +50,9 @@ class ControlLoopProviderTest {
private static final Coder CODER = new StandardCoder();
private static final String CONTROL_LOOP_JSON = "src/test/resources/providers/TestControlLoops.json";
private static final String UPDATE_CL_JSON = "src/test/resources/providers/UpdateControlLoops.json";
+ private static final String TOSCA_TEMPLATE_YAML = "examples/controlloop/PMSubscriptionHandling.yaml";
+ private static final YamlJsonTranslator yamlTranslator = new YamlJsonTranslator();
private static AtomicInteger dbNameCounter = new AtomicInteger();
private PolicyModelsProviderParameters parameters;
@@ -85,7 +91,7 @@ class ControlLoopProviderTest {
controlLoopProvider.createControlLoops(null);
}).hasMessageMatching(LIST_IS_NULL);
- ControlLoops createdControlLoops = new ControlLoops();
+ var createdControlLoops = new ControlLoops();
createdControlLoops
.setControlLoopList(controlLoopProvider.createControlLoops(inputControlLoops.getControlLoopList()));
@@ -102,11 +108,11 @@ class ControlLoopProviderTest {
assertThat(getResponse).isEmpty();
controlLoopProvider.createControlLoops(inputControlLoops.getControlLoopList());
- String name = inputControlLoops.getControlLoopList().get(0).getName();
- String version = inputControlLoops.getControlLoopList().get(0).getVersion();
+ var name = inputControlLoops.getControlLoopList().get(0).getName();
+ var version = inputControlLoops.getControlLoopList().get(0).getVersion();
assertEquals(1, controlLoopProvider.getControlLoops(name, version).size());
- ControlLoop cl = new ControlLoop();
+ var cl = new ControlLoop();
cl = controlLoopProvider.getControlLoop(new ToscaConceptIdentifier("PMSHInstance1", "1.0.1"));
assertEquals(inputControlLoops.getControlLoopList().get(1), cl);
@@ -127,10 +133,10 @@ class ControlLoopProviderTest {
controlLoopProvider.updateControlLoops(null);
}).hasMessageMatching("controlLoops is marked .*ull but is null");
- ControlLoops existingControlLoops = new ControlLoops();
+ var existingControlLoops = new ControlLoops();
existingControlLoops
.setControlLoopList(controlLoopProvider.createControlLoops(inputControlLoops.getControlLoopList()));
- ControlLoop updateResponse = new ControlLoop();
+ var updateResponse = new ControlLoop();
updateResponse = controlLoopProvider.updateControlLoop(updateControlLoops.getControlLoopList().get(0));
assertEquals(ControlLoopOrderedState.RUNNING, updateResponse.getOrderedState());
@@ -144,11 +150,61 @@ class ControlLoopProviderTest {
ControlLoop deletedCl;
List<ControlLoop> clList = controlLoopProvider.createControlLoops(inputControlLoops.getControlLoopList());
- String name = inputControlLoops.getControlLoopList().get(0).getName();
- String version = inputControlLoops.getControlLoopList().get(0).getVersion();
+ var name = inputControlLoops.getControlLoopList().get(0).getName();
+ var version = inputControlLoops.getControlLoopList().get(0).getVersion();
deletedCl = controlLoopProvider.deleteControlLoop(name, version);
assertEquals(clList.get(0), deletedCl);
+ }
+
+ @Test
+ void testDeleteAllInstanceProperties() throws Exception {
+ var toscaServiceTemplate = testControlLoopRead();
+ controlLoopProvider.deleteInstanceProperties(
+ controlLoopProvider.saveInstanceProperties(toscaServiceTemplate),
+ controlLoopProvider.getNodeTemplates(null, null));
+ assertThat(controlLoopProvider.getControlLoops(null, null)).isEmpty();
+ }
+
+ @Test
+ void testSaveAndDeleteInstanceProperties() throws Exception {
+ var toscaServiceTest = testControlLoopRead();
+ controlLoopProvider.createControlLoops(inputControlLoops.getControlLoopList());
+
+ controlLoopProvider.saveInstanceProperties(toscaServiceTest);
+ assertThat(controlLoopProvider.getNodeTemplates(
+ "org.onap.policy.controlloop.PolicyControlLoopParticipant",
+ "2.3.1")).isNotEmpty();
+
+ controlLoopProvider.deleteInstanceProperties(
+ controlLoopProvider.saveInstanceProperties(toscaServiceTest),
+ controlLoopProvider.getNodeTemplates(
+ "org.onap.policy.controlloop.PolicyControlLoopParticipant",
+ "2.3.1"));
+
+ assertThat(controlLoopProvider.getNodeTemplates(
+ "org.onap.policy.controlloop.PolicyControlLoopParticipant",
+ "2.3.1")).isEmpty();
+ }
+
+ @Test
+ void testGetNodeTemplates() throws Exception {
+ //Getting all nodes
+ List<ToscaNodeTemplate> listNodes = controlLoopProvider.getNodeTemplates(null, null);
+ assertNotNull(listNodes);
+
+ assertThatThrownBy(() -> {
+ controlLoopProvider.getFilteredNodeTemplates(null);
+ }).hasMessageMatching("filter is marked non-null but is null");
+ }
+
+ private static ToscaServiceTemplate testControlLoopRead() {
+ return testControlLoopYamlSerialization(TOSCA_TEMPLATE_YAML);
+ }
+ private static ToscaServiceTemplate testControlLoopYamlSerialization(String controlLoopFilePath) {
+ String controlLoopString = ResourceUtils.getResourceAsString(controlLoopFilePath);
+ ToscaServiceTemplate serviceTemplate = yamlTranslator.fromYaml(controlLoopString, ToscaServiceTemplate.class);
+ return serviceTemplate;
}
}
diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProviderTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProviderTest.java
new file mode 100644
index 000000000..a4cbbfb0b
--- /dev/null
+++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProviderTest.java
@@ -0,0 +1,161 @@
+/*-
+ * ============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=========================================================
+ */
+
+package org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+import org.junit.jupiter.api.Test;
+import org.onap.policy.common.utils.coder.CoderException;
+import org.onap.policy.common.utils.coder.StandardYamlCoder;
+import org.onap.policy.common.utils.resources.ResourceUtils;
+import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.provider.PolicyModelsProvider;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
+
+class ServiceTemplateProviderTest {
+
+ private static final String TOSCA_SERVICE_TEMPLATE_YAML =
+ "src/test/resources/providers/tosca-for-smoke-testing.yaml";
+
+ private static final StandardYamlCoder YAML_TRANSLATOR = new StandardYamlCoder();
+
+ @Test
+ void testGetCommonOrInstancePropertiesFromNodeTypes() throws PfModelException {
+ var serviceTemplateProvider = new ServiceTemplateProvider(mock(PolicyModelsProvider.class));
+
+ var serviceTemplate = getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML);
+
+ var result = serviceTemplateProvider.getCommonOrInstancePropertiesFromNodeTypes(true, serviceTemplate);
+ assertNotNull(result);
+ assertThat(result).hasSize(8);
+ }
+
+ @Test
+ void testGetDerivedCommonOrInstanceNodeTemplates() throws PfModelException {
+ var serviceTemplateProvider = new ServiceTemplateProvider(mock(PolicyModelsProvider.class));
+
+ var serviceTemplate = getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML);
+
+ var commonOrInstanceNodeTypeProps =
+ serviceTemplateProvider.getCommonOrInstancePropertiesFromNodeTypes(true, serviceTemplate);
+
+ var result = serviceTemplateProvider.getDerivedCommonOrInstanceNodeTemplates(
+ serviceTemplate.getToscaTopologyTemplate().getNodeTemplates(), commonOrInstanceNodeTypeProps);
+
+ assertNotNull(result);
+ assertThat(result).hasSize(8);
+ }
+
+ @Test
+ void testCreateServiceTemplate() throws PfModelException {
+ var modelsProvider = mock(PolicyModelsProvider.class);
+ var serviceTemplateProvider = new ServiceTemplateProvider(modelsProvider);
+
+ var serviceTemplate = new ToscaServiceTemplate();
+ when(modelsProvider.createServiceTemplate(eq(serviceTemplate))).thenReturn(serviceTemplate);
+
+ var result = serviceTemplateProvider.createServiceTemplate(serviceTemplate);
+
+ assertThat(result).isEqualTo(serviceTemplate);
+ }
+
+ @Test
+ void testDeleteServiceTemplate() throws PfModelException {
+ var serviceTemplate = new ToscaServiceTemplate();
+ serviceTemplate.setName("Name");
+ serviceTemplate.setVersion("1.0.0");
+ var modelsProvider = mock(PolicyModelsProvider.class);
+ when(modelsProvider.deleteServiceTemplate(eq(serviceTemplate.getName()), eq(serviceTemplate.getVersion())))
+ .thenReturn(serviceTemplate);
+
+ var serviceTemplateProvider = new ServiceTemplateProvider(modelsProvider);
+ var result =
+ serviceTemplateProvider.deleteServiceTemplate(serviceTemplate.getName(), serviceTemplate.getVersion());
+
+ assertThat(result).isEqualTo(serviceTemplate);
+ }
+
+ @Test
+ void testGetServiceTemplateListEmpty() throws PfModelException {
+ var modelsProvider = mock(PolicyModelsProvider.class);
+ when(modelsProvider.getServiceTemplateList(any(String.class), any(String.class))).thenReturn(List.of());
+
+ var serviceTemplateProvider = new ServiceTemplateProvider(modelsProvider);
+ assertThatThrownBy(() -> serviceTemplateProvider.getToscaServiceTemplate("Name", "1.0.0"))
+ .hasMessage("Control Loop definitions not found");
+ }
+
+ @Test
+ void testGetServiceTemplateList() throws PfModelException {
+ var serviceTemplate = new ToscaServiceTemplate();
+ serviceTemplate.setName("Name");
+ serviceTemplate.setVersion("1.0.0");
+ var modelsProvider = mock(PolicyModelsProvider.class);
+ when(modelsProvider.getServiceTemplateList(eq(serviceTemplate.getName()), eq(serviceTemplate.getVersion())))
+ .thenReturn(List.of(serviceTemplate));
+
+ var serviceTemplateProvider = new ServiceTemplateProvider(modelsProvider);
+ var result = serviceTemplateProvider.getToscaServiceTemplate(serviceTemplate.getName(),
+ serviceTemplate.getVersion());
+
+ assertThat(result).isEqualTo(serviceTemplate);
+ }
+
+ @Test
+ void testGetServiceTemplate() throws PfModelException {
+ var serviceTemplate = new ToscaServiceTemplate();
+ serviceTemplate.setName("Name");
+ serviceTemplate.setVersion("1.0.0");
+ var modelsProvider = mock(PolicyModelsProvider.class);
+ when(modelsProvider.getServiceTemplateList(eq(serviceTemplate.getName()), eq(serviceTemplate.getVersion())))
+ .thenReturn(List.of(serviceTemplate));
+
+ var serviceTemplateProvider = new ServiceTemplateProvider(modelsProvider);
+ var result =
+ serviceTemplateProvider.getServiceTemplateList(serviceTemplate.getName(), serviceTemplate.getVersion());
+
+ assertThat(result).hasSize(1);
+ assertThat(result.get(0)).isEqualTo(serviceTemplate);
+ }
+
+ /**
+ * Get ToscaServiceTemplate from resource.
+ *
+ * @param path path of the resource
+ */
+ public static ToscaServiceTemplate getToscaServiceTemplate(String path) {
+
+ try {
+ return YAML_TRANSLATOR.decode(ResourceUtils.getResourceAsStream(path), ToscaServiceTemplate.class);
+ } catch (CoderException e) {
+ fail("Cannot read or decode " + path);
+ return null;
+ }
+ }
+}
diff --git a/models/src/test/resources/examples/controlloop/PMSubscriptionHandling.yaml b/models/src/test/resources/examples/controlloop/PMSubscriptionHandling.yaml
new file mode 100644
index 000000000..8e8f3cd39
--- /dev/null
+++ b/models/src/test/resources/examples/controlloop/PMSubscriptionHandling.yaml
@@ -0,0 +1,3325 @@
+# ============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=========================================================
+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.controlloop.DCAEMicroserviceControlLoopElementConsulInfo:
+ name: org.onap.datatypes.policy.clamp.controlloop.DCAEMicroserviceControlLoopElementConsulInfo
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ properties:
+ consulUrl:
+ name: consulUrl
+ type: string
+ typeVersion: 0.0.0
+ description: Consul url for this entry
+ required: true
+ consul_body:
+ name: consulBody
+ type: string
+ typeVersion: 0.0.0
+ description: Body of Consul entry
+ required: true
+ onap.datatypes.monitoring.managedObjectDNsBasic:
+ constraints: []
+ properties:
+ DN:
+ name: DN
+ type: string
+ typeVersion: 0.0.0
+ description: Managed object distinguished name
+ required: true
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.managedObjectDNsBasic
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.managedObjectDNsBasics:
+ constraints: []
+ properties:
+ managedObjectDNsBasic:
+ name: managedObjectDNsBasic
+ type: map
+ typeVersion: 0.0.0
+ description: Managed object distinguished name object
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.managedObjectDNsBasic
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.managedObjectDNsBasics
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.measurementGroup:
+ constraints: []
+ properties:
+ measurementTypes:
+ name: measurementTypes
+ type: list
+ typeVersion: 0.0.0
+ description: List of measurement types
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.measurementTypes
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ managedObjectDNsBasic:
+ name: managedObjectDNsBasic
+ type: list
+ typeVersion: 0.0.0
+ description: List of managed object distinguished names
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.managedObjectDNsBasics
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.measurementGroup
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.measurementGroups:
+ constraints: []
+ properties:
+ measurementGroup:
+ name: measurementGroup
+ type: map
+ typeVersion: 0.0.0
+ description: Measurement Group
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.measurementGroup
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.measurementGroups
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.measurementType:
+ constraints: []
+ properties:
+ measurementType:
+ name: measurementType
+ type: string
+ typeVersion: 0.0.0
+ description: Measurement type
+ required: true
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.measurementType
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.measurementTypes:
+ constraints: []
+ properties:
+ measurementType:
+ name: measurementType
+ type: map
+ typeVersion: 0.0.0
+ description: Measurement type object
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.measurementType
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.measurementTypes
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.nfFilter:
+ constraints: []
+ properties:
+ modelNames:
+ name: modelNames
+ type: list
+ typeVersion: 0.0.0
+ description: List of model names
+ required: true
+ constraints: []
+ entry_schema:
+ type: string
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ modelInvariantIDs:
+ name: modelInvariantIDs
+ type: list
+ typeVersion: 0.0.0
+ description: List of model invariant IDs
+ required: true
+ constraints: []
+ entry_schema:
+ type: string
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ modelVersionIDs:
+ name: modelVersionIDs
+ type: list
+ typeVersion: 0.0.0
+ description: List of model version IDs
+ required: true
+ constraints: []
+ entry_schema:
+ type: string
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ nfNames:
+ name: nfNames
+ type: list
+ typeVersion: 0.0.0
+ description: List of network functions
+ required: true
+ constraints: []
+ entry_schema:
+ type: string
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.nfFilter
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.subscription:
+ constraints: []
+ properties:
+ measurementGroups:
+ name: measurementGroups
+ type: list
+ typeVersion: 0.0.0
+ description: Measurement Groups
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.measurementGroups
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ fileBasedGP:
+ name: fileBasedGP
+ type: integer
+ typeVersion: 0.0.0
+ description: File based granularity period
+ required: true
+ constraints: []
+ metadata: {}
+ fileLocation:
+ name: fileLocation
+ type: string
+ typeVersion: 0.0.0
+ description: ROP file location
+ required: true
+ constraints: []
+ metadata: {}
+ subscriptionName:
+ name: subscriptionName
+ type: string
+ typeVersion: 0.0.0
+ description: Name of the subscription
+ required: true
+ constraints: []
+ metadata: {}
+ administrativeState:
+ name: administrativeState
+ type: string
+ typeVersion: 0.0.0
+ description: State of the subscription
+ required: true
+ constraints:
+ - valid_values:
+ - LOCKED
+ - UNLOCKED
+ metadata: {}
+ nfFilter:
+ name: nfFilter
+ type: map
+ typeVersion: 0.0.0
+ description: Network function filter
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.nfFilter
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.subscription
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+policy_types:
+ onap.policies.Monitoring:
+ derived_from: tosca.policies.Root
+ description: a base policy type for all policies that govern monitoring provisioning
+ version: 1.0.0
+ name: onap.policies.Monitoring
+ onap.policies.monitoring.dcae-pm-subscription-handler:
+ properties:
+ pmsh_policy:
+ name: pmsh_policy
+ type: onap.datatypes.monitoring.subscription
+ typeVersion: 0.0.0
+ description: PMSH Policy JSON
+ required: false
+ constraints: []
+ metadata: {}
+ name: onap.policies.monitoring.dcae-pm-subscription-handler
+ version: 1.0.0
+ derived_from: onap.policies.Monitoring
+ metadata: {}
+node_types:
+ org.onap.policy.clamp.controlloop.Participant:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ required: false
+ org.onap.policy.clamp.controlloop.ControlLoopElement:
+ 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 control loop element will be started, the
+ first start phase is zero. Control Loop Elements are started in their start_phase order and stopped
+ in reverse start phase order. Control Loop Elements with the same start phase are started and
+ stopped simultaneously
+ org.onap.policy.clamp.controlloop.ControlLoop:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ required: false
+ elements:
+ type: list
+ required: true
+ entry_schema:
+ type: onap.datatypes.ToscaConceptIdentifier
+ org.onap.policy.clamp.controlloop.DCAEMicroserviceControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ properties:
+ dcae_blueprint_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ required: false
+ dcae_blueprint:
+ type: onap.dcae.cloudify_blueprint
+ required: false
+ consul_info:
+ type: list
+ required: false
+ entry_schema:
+ type: org.onap.datatypes.policy.clamp.controlloop.DCAEMicroserviceControlLoopElementConsulInfo
+ org.onap.policy.clamp.controlloop.PolicyControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ properties:
+ policy_type_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ required: true
+ policy_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ required: false
+ org.onap.policy.clamp.controlloop.CDSControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ properties:
+ cds_blueprint_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ required: true
+topology_template:
+ inputs:
+ pmsh_monitoring_policy:
+ type: onap.datatypes.ToscaConceptIdentifier
+ description: The ID of the PMSH monitoring policy to use
+ default:
+ name: MICROSERVICE_vLoadBalancerMS_v1_0_dcae-pm-subscription-handler_1_0_0test
+ version: 1.0.0
+ pmsh_operational_policy:
+ type: onap.datatypes.ToscaConceptIdentifier
+ description: The ID of the PMSH operational policy to use
+ default:
+ name: operational.apex.pmcontrol
+ version: 1.0.0
+ node_templates:
+ org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant:
+ version: 2.3.4
+ type: org.onap.policy.clamp.controlloop.Participant
+ type_version: 1.0.1
+ description: Participant for DCAE microservices
+ properties:
+ provider: ONAP
+ org.onap.policy.controlloop.PolicyControlLoopParticipant:
+ version: 2.3.1
+ type: org.onap.policy.clamp.controlloop.Participant
+ type_version: 1.0.1
+ description: Participant for DCAE microservices
+ properties:
+ provider: ONAP
+ org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant:
+ version: 2.2.1
+ type: org.onap.policy.clamp.controlloop.Participant
+ type_version: 1.0.1
+ description: Participant for DCAE microservices
+ properties:
+ provider: ONAP
+ org.onap.domain.pmsh.PMSH_DCAEMicroservice:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.DCAEMicroserviceControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the DCAE microservice for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participantType:
+ name: org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant
+ version: 2.3.4
+ dcae_blueprint:
+ tosca_definitions_version: cloudify_dsl_1_3
+ imports:
+ - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+ - plugin:k8splugin?version=3.7.0
+ - plugin:pgaas?version=1.3.0
+ - plugin:clamppolicyplugin?version=1.1.0
+ inputs:
+ tag_version:
+ type: string
+ description: Docker image to be used
+ default: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pmsh:1.1.2
+ replicas:
+ type: integer
+ description: Number of instances
+ default: 1
+ operational_policy_name:
+ type: string
+ default: operational.apex.pmcontrol
+ control_loop_name:
+ type: string
+ default: pmsh-control-loop
+ pmsh_publish_topic_name:
+ type: string
+ default: unauthenticated.DCAE_CL_OUTPUT
+ policy_feedback_topic_name:
+ type: string
+ default: unauthenticated.PMSH_CL_INPUT
+ aai_notification_topic_name:
+ type: string
+ default: AAI-EVENT
+ publisher_client_role:
+ type: string
+ description: Client role to request secure access to topic
+ default: org.onap.dcae.pmPublisher
+ subscriber_client_role:
+ type: string
+ description: Client role to request secure access to topic
+ default: org.onap.dcae.pmSubscriber
+ dcae_location:
+ type: string
+ description: DCAE location for the subscriber, used to set up routing
+ default: san-francisco
+ cpu_limit:
+ type: string
+ default: 1000m
+ cpu_request:
+ type: string
+ default: 1000m
+ memory_limit:
+ type: string
+ default: 1024Mi
+ memory_request:
+ type: string
+ default: 1024Mi
+ pgaas_cluster_name:
+ type: string
+ default: dcae-pg-primary.onap
+ enable_tls:
+ type: boolean
+ default: true
+ protocol:
+ type: string
+ description: PMSH protocol. If enable_tls is false, set to http
+ default: https
+ policy_model_id:
+ type: string
+ default: onap.policies.monitoring.dcae-pm-subscription-handler
+ policy_id:
+ type: string
+ default: MICROSERVICE_vLoadBalancerMS_v1_0_dcae-pm-subscription-handler_1_0_0test
+ node_templates:
+ pgaasvm:
+ type: dcae.nodes.pgaas.database
+ properties:
+ writerfqdn:
+ get_input: pgaas_cluster_name
+ name: pmsh
+ pmsh:
+ type: dcae.nodes.ContainerizedServiceComponentUsingDmaap
+ interfaces:
+ cloudify.interfaces.lifecycle:
+ create:
+ inputs:
+ ports:
+ - '8443:0'
+ envs:
+ PMSH_PG_URL:
+ get_attribute:
+ - pgaasvm
+ - admin
+ - host
+ PMSH_PG_PASSWORD:
+ get_attribute:
+ - pgaasvm
+ - admin
+ - password
+ PMSH_PG_USERNAME:
+ get_attribute:
+ - pgaasvm
+ - admin
+ - user
+ PMSH_DB_NAME:
+ get_attribute:
+ - pgaasvm
+ - admin
+ - database
+ relationships:
+ - target: pmsh-policy
+ type: cloudify.relationships.depends_on
+ properties:
+ service_component_type: dcae-pmsh
+ service_component_name_override: dcae-pmsh
+ application_config:
+ enable_tls:
+ get_input: enable_tls
+ aaf_identity: dcae@dcae.onap.org
+ aaf_password: demo123456!
+ operational_policy_name:
+ get_input: operational_policy_name
+ control_loop_name:
+ get_input: control_loop_name
+ cert_path: /opt/app/pmsh/etc/certs/cert.pem
+ key_path: /opt/app/pmsh/etc/certs/key.pem
+ ca_cert_path: /opt/app/pmsh/etc/certs/cacert.pem
+ streams_publishes:
+ policy_pm_publisher:
+ type: message_router
+ dmaap_info:
+ topic_url:
+ concat:
+ - http://message-router:3904/events/
+ - get_input: pmsh_publish_topic_name
+ streams_subscribes:
+ policy_pm_subscriber:
+ type: message_router
+ dmaap_info:
+ topic_url:
+ concat:
+ - http://message-router:3904/events/
+ - get_input: policy_feedback_topic_name
+ aai_subscriber:
+ type: message_router
+ dmaap_info:
+ topic_url:
+ concat:
+ - http://message-router:3904/events/
+ - get_input: aai_notification_topic_name
+ resource_config:
+ limits:
+ cpu:
+ get_input: cpu_limit
+ memory:
+ get_input: memory_limit
+ requests:
+ cpu:
+ get_input: cpu_request
+ memory:
+ get_input: memory_request
+ docker_config:
+ healthcheck:
+ endpoint: /healthcheck
+ interval: 15s
+ timeout: 1s
+ type:
+ get_input: protocol
+ image:
+ get_input: tag_version
+ replicas:
+ get_input: replicas
+ log_info:
+ log_directory: /var/log/ONAP/dcaegen2/services/pmsh
+ tls_info:
+ cert_directory: /opt/app/pmsh/etc/certs
+ use_tls:
+ get_input: enable_tls
+ pmsh-policy:
+ type: clamp.nodes.policy
+ properties:
+ policy_model_id:
+ get_input: policy_model_id
+ policy_id:
+ get_input: policy_id
+ consul_info:
+ - consulUrl: http://consul:31321/v1/kv/dcae-pmsh:policy
+ consulBody:
+ subscription:
+ subscriptionName: subscriptiona
+ administrativeState: UNLOCKED
+ fileBasedGP: 15
+ fileLocation: /pm/pm.xml
+ nfFilter:
+ nfNames:
+ - ^pnf1.*
+ modelInvariantIDs:
+ - 5845y423-g654-6fju-po78-8n53154532k6
+ - 7129e420-d396-4efb-af02-6b83499b12f8
+ modelVersionIDs:
+ - e80a6ae3-cafd-4d24-850d-e14c084a5ca9
+ measurementGroups:
+ - measurementGroup:
+ measurementTypes:
+ - measurementType: countera
+ - measurementType: counterb
+ managedObjectDNsBasic:
+ - DN: dna
+ - DN: dnb
+ - measurementGroup:
+ measurementTypes:
+ - measurementType: counterc
+ - measurementType: counterd
+ managedObjectDNsBasic:
+ - DN: dnc
+ - DN: dnd
+ org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the monitoring policy for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participantType:
+ name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+ version: 2.3.1
+ policy_type_id:
+ name: onap.policies.monitoring.pm-subscription-handler
+ version: 1.0.0
+ policy_id:
+ get_input: pmsh_monitoring_policy
+ org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the operational policy for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participantType:
+ name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+ version: 2.2.1
+ policy_type_id:
+ name: onap.policies.operational.pm-subscription-handler
+ version: 1.0.0
+ policy_id:
+ get_input: pmsh_operational_policy
+ org.onap.domain.pmsh.PMSH_CDS_ControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.CDSControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for CDS for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participantType:
+ name: org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant
+ version: 3.2.1
+ cds_blueprint_id:
+ name: org.onap.ccsdk.cds.PMSHCdsBlueprint
+ version: 1.0.0
+ org.onap.domain.pmsh.PMSHControlLoopDefinition:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.ControlLoop
+ type_version: 1.0.0
+ description: Control loop for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ elements:
+ - name: org.onap.domain.pmsh.PMSH_DCAEMicroservice
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSH_CDS_ControlLoopElement
+ version: 1.2.3
+ policies:
+ - MICROSERVICE_vLoadBalancerMS_v1_0_dcae-pm-subscription-handler_1_0_0test:
+ type: onap.policies.monitoring.dcae-pm-subscription-handler
+ type_version: 1.0.0
+ name: MICROSERVICE_vLoadBalancerMS_v1_0_dcae-pm-subscription-handler_1_0_0test
+ version: 1.0.0
+ metadata:
+ policy-id: MICROSERVICE_vLoadBalancerMS_v1_0_dcae-pm-subscription-handler_1_0_0test
+ policy-version: 1.0.0
+ properties:
+ pmsh_policy:
+ fileBasedGP: 15
+ fileLocation: /pm/pm.xml
+ subscriptionName: subscriptiona
+ administrativeState: UNLOCKED
+ nfFilter:
+ onap.datatypes.monitoring.nfFilter:
+ modelVersionIDs:
+ - e80a6ae3-cafd-4d24-850d-e14c084a5ca9
+ modelInvariantIDs:
+ - 5845y423-g654-6fju-po78-8n53154532k6
+ - 7129e420-d396-4efb-af02-6b83499b12f8
+ modelNames: []
+ nfNames:
+ - '"^pnf1.*"'
+ measurementGroups:
+ - measurementGroup:
+ onap.datatypes.monitoring.measurementGroup:
+ measurementTypes:
+ - measurementType:
+ onap.datatypes.monitoring.measurementType:
+ measurementType: countera
+ - measurementType:
+ onap.datatypes.monitoring.measurementType:
+ measurementType: counterb
+ managedObjectDNsBasic:
+ - managedObjectDNsBasic:
+ onap.datatypes.monitoring.managedObjectDNsBasic:
+ DN: dna
+ - managedObjectDNsBasic:
+ onap.datatypes.monitoring.managedObjectDNsBasic:
+ DN: dnb
+ - measurementGroup:
+ onap.datatypes.monitoring.measurementGroup:
+ measurementTypes:
+ - measurementType:
+ onap.datatypes.monitoring.measurementType:
+ measurementType: counterc
+ - measurementType:
+ onap.datatypes.monitoring.measurementType:
+ measurementType: counterd
+ managedObjectDNsBasic:
+ - managedObjectDNsBasic:
+ onap.datatypes.monitoring.managedObjectDNsBasic:
+ DN: dnc
+ - managedObjectDNsBasic:
+ onap.datatypes.monitoring.managedObjectDNsBasic:
+ DN: dnd
+ - operational.apex.pmcontrol:
+ type: onap.policies.controlloop.operational.common.Apex
+ type_version: 1.0.0
+ version: 1.0.0
+ metadata:
+ policy-id: operational.apex.pmcontrol
+ policy-version: 1
+ properties:
+ engineServiceParameters:
+ name: MyApexEngine
+ version: 0.0.1
+ id: 45
+ instanceCount: 2
+ deploymentPort: 12561
+ policy_type_impl:
+ apexPolicyModel:
+ key:
+ name: PMControlPolicy
+ version: 0.0.1
+ keyInformation:
+ key:
+ name: PMControlPolicy_KeyInfo
+ version: 0.0.1
+ keyInfoMap:
+ entry:
+ - key:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ UUID: 6e5fa19b-14df-37e3-a4ae-8c537e861a82
+ description: Generated description for concept referred to by key "CDSActionIdentifiersType:0.0.1"
+ - key:
+ name: CDSCreateResponseEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateResponseEvent
+ version: 0.0.1
+ UUID: 14b29e38-ac75-3273-aa4e-8583c0aa7dad
+ description: Generated description for concept referred to by key "CDSCreateResponseEvent:0.0.1"
+ - key:
+ name: CDSCreateResponsePayloadType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateResponsePayloadType
+ version: 0.0.1
+ UUID: 04573f8f-e772-30a5-b1d9-d7318d4a1e13
+ description: Generated description for concept referred to by key "CDSCreateResponsePayloadType:0.0.1"
+ - key:
+ name: CDSCreateResponsePolicy
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateResponsePolicy
+ version: 0.0.1
+ UUID: e126c965-fc09-3bfe-8f55-70f380a4a49c
+ description: Generated description for concept referred to by key "CDSCreateResponsePolicy:0.0.1"
+ - key:
+ name: CDSCreateResponseTask
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateResponseTask
+ version: 0.0.1
+ UUID: 6165ee82-afd2-3aab-a517-f00b3f2461d2
+ description: Generated description for concept referred to by key "CDSCreateResponseTask:0.0.1"
+ - key:
+ name: CDSCreateSubscriptionPayloadType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateSubscriptionPayloadType
+ version: 0.0.1
+ UUID: 8350ac5e-c157-38b9-9614-a0f93a830e60
+ description: Generated description for concept referred to by key "CDSCreateSubscriptionPayloadType:0.0.1"
+ - key:
+ name: CDSCreateSubscriptionRequestEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateSubscriptionRequestEvent
+ version: 0.0.1
+ UUID: cfa325ba-226b-3a31-9183-ec43e2b6e9a2
+ description: Generated description for concept referred to by key "CDSCreateSubscriptionRequestEvent:0.0.1"
+ - key:
+ name: CDSDeleteResponseEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteResponseEvent
+ version: 0.0.1
+ UUID: 8be9c0fa-7437-3841-aff2-b3cec6ae3bd8
+ description: Generated description for concept referred to by key "CDSDeleteResponseEvent:0.0.1"
+ - key:
+ name: CDSDeleteResponsePayloadType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteResponsePayloadType
+ version: 0.0.1
+ UUID: 3fbfe0c9-152e-34d3-a504-09cd13c058d0
+ description: Generated description for concept referred to by key "CDSDeleteResponsePayloadType:0.0.1"
+ - key:
+ name: CDSDeleteResponsePolicy
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteResponsePolicy
+ version: 0.0.1
+ UUID: a780251c-edd5-3132-b865-04313246b43c
+ description: Generated description for concept referred to by key "CDSDeleteResponsePolicy:0.0.1"
+ - key:
+ name: CDSDeleteResponseTask
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteResponseTask
+ version: 0.0.1
+ UUID: afce4555-3aa3-3521-a7d8-ee8cdf0d3efc
+ description: Generated description for concept referred to by key "CDSDeleteResponseTask:0.0.1"
+ - key:
+ name: CDSDeleteSubscriptionPayloadType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteSubscriptionPayloadType
+ version: 0.0.1
+ UUID: 12658406-9147-3c9d-a38c-5ad5e30b092b
+ description: Generated description for concept referred to by key "CDSDeleteSubscriptionPayloadType:0.0.1"
+ - key:
+ name: CDSDeleteSubscriptionRequestEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteSubscriptionRequestEvent
+ version: 0.0.1
+ UUID: 24380c95-9289-36e6-8cbf-0edefa15ccd9
+ description: Generated description for concept referred to by key "CDSDeleteSubscriptionRequestEvent:0.0.1"
+ - key:
+ name: CDSRequestCommonHeaderType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSRequestCommonHeaderType
+ version: 0.0.1
+ UUID: 35590ac0-062c-39f1-8786-b4ff716e30b1
+ description: Generated description for concept referred to by key "CDSRequestCommonHeaderType:0.0.1"
+ - key:
+ name: CDSResponseCommonHeaderType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSResponseCommonHeaderType
+ version: 0.0.1
+ UUID: dd7e1805-885a-350b-aaf9-ed541321ae3c
+ description: Generated description for concept referred to by key "CDSResponseCommonHeaderType:0.0.1"
+ - key:
+ name: CDSResponseStatusEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CDSResponseStatusEvent
+ version: 0.0.1
+ UUID: 7986e21b-32f7-302e-9554-31f21b673493
+ description: Generated description for concept referred to by key "CDSResponseStatusEvent:0.0.1"
+ - key:
+ name: CDSResponseStatusType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSResponseStatusType
+ version: 0.0.1
+ UUID: 92b8a2cf-344e-3ce1-8cc0-2b7d3cb695fa
+ description: Generated description for concept referred to by key "CDSResponseStatusType:0.0.1"
+ - key:
+ name: CreateSubscriptionPayloadEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CreateSubscriptionPayloadEvent
+ version: 0.0.1
+ UUID: 92162397-1a8e-3a3f-a469-d2af7700af4a
+ description: Generated description for concept referred to by key "CreateSubscriptionPayloadEvent:0.0.1"
+ - key:
+ name: CreateSubscriptionPayloadTask
+ version: 0.0.1
+ value:
+ key:
+ name: CreateSubscriptionPayloadTask
+ version: 0.0.1
+ UUID: bc0c69f0-52ed-38ea-b468-ae4a6fd1730d
+ description: Generated description for concept referred to by key "CreateSubscriptionPayloadTask:0.0.1"
+ - key:
+ name: CreateSubscriptionRequestTask
+ version: 0.0.1
+ value:
+ key:
+ name: CreateSubscriptionRequestTask
+ version: 0.0.1
+ UUID: 89cb75e9-f06c-30d3-b4ff-698d45f63869
+ description: Generated description for concept referred to by key "CreateSubscriptionRequestTask:0.0.1"
+ - key:
+ name: DeleteSubscriptionPayloadEvent
+ version: 0.0.1
+ value:
+ key:
+ name: DeleteSubscriptionPayloadEvent
+ version: 0.0.1
+ UUID: 994fa441-04ab-33bb-832d-1cd12ab5d074
+ description: Generated description for concept referred to by key "DeleteSubscriptionPayloadEvent:0.0.1"
+ - key:
+ name: DeleteSubscriptionPayloadTask
+ version: 0.0.1
+ value:
+ key:
+ name: DeleteSubscriptionPayloadTask
+ version: 0.0.1
+ UUID: 0f519117-5fea-3e4b-941f-8f778100465f
+ description: Generated description for concept referred to by key "DeleteSubscriptionPayloadTask:0.0.1"
+ - key:
+ name: DeleteSubscriptionRequestTask
+ version: 0.0.1
+ value:
+ key:
+ name: DeleteSubscriptionRequestTask
+ version: 0.0.1
+ UUID: acb772fe-d442-39e3-98f9-b1080caf4150
+ description: Generated description for concept referred to by key "DeleteSubscriptionRequestTask:0.0.1"
+ - key:
+ name: MRResponseEvent
+ version: 0.0.1
+ value:
+ key:
+ name: MRResponseEvent
+ version: 0.0.1
+ UUID: 13c747a3-6bae-3bcf-9c80-b152e01dc194
+ description: Generated description for concept referred to by key "MRResponseEvent:0.0.1"
+ - key:
+ name: PMControlPolicy
+ version: 0.0.1
+ value:
+ key:
+ name: PMControlPolicy
+ version: 0.0.1
+ UUID: acf1e55c-7bc5-3bd5-975a-0ca54afcd8a4
+ description: Generated description for concept referred to by key "PMControlPolicy:0.0.1"
+ - key:
+ name: PMControlPolicy_Albums
+ version: 0.0.1
+ value:
+ key:
+ name: PMControlPolicy_Albums
+ version: 0.0.1
+ UUID: b38ad204-c2c8-32f4-9b5a-dda0aeb0145b
+ description: Generated description for concept referred to by key "PMControlPolicy_Albums:0.0.1"
+ - key:
+ name: PMControlPolicy_Events
+ version: 0.0.1
+ value:
+ key:
+ name: PMControlPolicy_Events
+ version: 0.0.1
+ UUID: be3871a0-c42a-3113-a066-82d192840eca
+ description: Generated description for concept referred to by key "PMControlPolicy_Events:0.0.1"
+ - key:
+ name: PMControlPolicy_KeyInfo
+ version: 0.0.1
+ value:
+ key:
+ name: PMControlPolicy_KeyInfo
+ version: 0.0.1
+ UUID: ced37634-28a4-3178-b7f6-2980794927b0
+ description: Generated description for concept referred to by key "PMControlPolicy_KeyInfo:0.0.1"
+ - key:
+ name: PMControlPolicy_Policies
+ version: 0.0.1
+ value:
+ key:
+ name: PMControlPolicy_Policies
+ version: 0.0.1
+ UUID: be3d180d-ef9c-3a75-8e9c-84271a038bed
+ description: Generated description for concept referred to by key "PMControlPolicy_Policies:0.0.1"
+ - key:
+ name: PMControlPolicy_Schemas
+ version: 0.0.1
+ value:
+ key:
+ name: PMControlPolicy_Schemas
+ version: 0.0.1
+ UUID: e61973f1-189c-39e5-82f6-0d3afe298a20
+ description: Generated description for concept referred to by key "PMControlPolicy_Schemas:0.0.1"
+ - key:
+ name: PMControlPolicy_Tasks
+ version: 0.0.1
+ value:
+ key:
+ name: PMControlPolicy_Tasks
+ version: 0.0.1
+ UUID: 5658adb3-2962-30a3-a241-fae75bb8eb4a
+ description: Generated description for concept referred to by key "PMControlPolicy_Tasks:0.0.1"
+ - key:
+ name: PMSubscriptionAlbum
+ version: 0.0.1
+ value:
+ key:
+ name: PMSubscriptionAlbum
+ version: 0.0.1
+ UUID: c2bd6f0d-6854-317a-9be2-97c08338428c
+ description: Generated description for concept referred to by key "PMSubscriptionAlbum:0.0.1"
+ - key:
+ name: PMSubscriptionOutputEvent
+ version: 0.0.1
+ value:
+ key:
+ name: PMSubscriptionOutputEvent
+ version: 0.0.1
+ UUID: 992b7819-9f69-3aa0-bb0f-6e45ea15ce05
+ description: Generated description for concept referred to by key "PMSubscriptionOutputEvent:0.0.1"
+ - key:
+ name: PMSubscriptionType
+ version: 0.0.1
+ value:
+ key:
+ name: PMSubscriptionType
+ version: 0.0.1
+ UUID: 73c1c397-4fc3-357f-93b6-a8ad707fbaae
+ description: Generated description for concept referred to by key "PMSubscriptionType:0.0.1"
+ - key:
+ name: ReceiveEventPolicy
+ version: 0.0.1
+ value:
+ key:
+ name: ReceiveEventPolicy
+ version: 0.0.1
+ UUID: 568b7345-9de1-36d3-b6a3-9b857e6809a1
+ description: Generated description for concept referred to by key "ReceiveEventPolicy:0.0.1"
+ - key:
+ name: ReceiveSubscriptionTask
+ version: 0.0.1
+ value:
+ key:
+ name: ReceiveSubscriptionTask
+ version: 0.0.1
+ UUID: f596afc8-100c-35eb-92c8-352355ea457d
+ description: Generated description for concept referred to by key "ReceiveSubscriptionTask:0.0.1"
+ - key:
+ name: SimpleIntType
+ version: 0.0.1
+ value:
+ key:
+ name: SimpleIntType
+ version: 0.0.1
+ UUID: 153791fd-ae0a-36a7-88a5-309a7936415d
+ description: Generated description for concept referred to by key "SimpleIntType:0.0.1"
+ - key:
+ name: SimpleStringType
+ version: 0.0.1
+ value:
+ key:
+ name: SimpleStringType
+ version: 0.0.1
+ UUID: 8a4957cf-9493-3a76-8c22-a208e23259af
+ description: Generated description for concept referred to by key "SimpleStringType:0.0.1"
+ - key:
+ name: SubscriptionStatusType
+ version: 0.0.1
+ value:
+ key:
+ name: SubscriptionStatusType
+ version: 0.0.1
+ UUID: 597643b1-9db1-31ce-85d0-e1c63c43b30b
+ description: Generated description for concept referred to by key "SubscriptionStatusType:0.0.1"
+ - key:
+ name: SubscriptionType
+ version: 0.0.1
+ value:
+ key:
+ name: SubscriptionType
+ version: 0.0.1
+ UUID: 184547bb-7d64-3cb2-a273-d7185102c5ce
+ description: Generated description for concept referred to by key "SubscriptionType:0.0.1"
+ - key:
+ name: UUIDType
+ version: 0.0.1
+ value:
+ key:
+ name: UUIDType
+ version: 0.0.1
+ UUID: 6a8cc68e-dfc8-3403-9c6d-071c886b319c
+ description: Generated description for concept referred to by key "UUIDType:0.0.1"
+ - key:
+ name: pmsh-operational-policy
+ version: 0.0.1
+ value:
+ key:
+ name: pmsh-operational-policy
+ version: 0.0.1
+ UUID: fdf2c9ff-6422-3ea6-b6b6-49b12116265d
+ description: Generated description for concept referred to by key "pmsh-operational-policy:0.0.1"
+ policies:
+ key:
+ name: PMControlPolicy_Policies
+ version: 0.0.1
+ policyMap:
+ entry:
+ - key:
+ name: CDSCreateResponsePolicy
+ version: 0.0.1
+ value:
+ policyKey:
+ name: CDSCreateResponsePolicy
+ version: 0.0.1
+ template: Freestyle
+ state:
+ entry:
+ - key: CDSCreateResponseState
+ value:
+ stateKey:
+ parentKeyName: CDSCreateResponsePolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: 'NULL'
+ localName: CDSCreateResponseState
+ trigger:
+ name: CDSCreateResponseEvent
+ version: 0.0.1
+ stateOutputs:
+ entry:
+ - key: ResponseOutput
+ value:
+ key:
+ parentKeyName: CDSCreateResponsePolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CDSCreateResponseState
+ localName: ResponseOutput
+ outgoingEvent:
+ name: CDSResponseStatusEvent
+ version: 0.0.1
+ nextState:
+ parentKeyName: 'NULL'
+ parentKeyVersion: 0.0.0
+ parentLocalName: 'NULL'
+ localName: 'NULL'
+ contextAlbumReference: []
+ taskSelectionLogic:
+ key: 'NULL'
+ logicFlavour: UNDEFINED
+ logic: ''
+ stateFinalizerLogicMap:
+ entry: []
+ defaultTask:
+ name: CDSCreateResponseTask
+ version: 0.0.1
+ taskReferences:
+ entry:
+ - key:
+ name: CDSCreateResponseTask
+ version: 0.0.1
+ value:
+ key:
+ parentKeyName: CDSCreateResponsePolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CDSCreateResponseState
+ localName: CDSCreateResponsePolicy
+ outputType: DIRECT
+ output:
+ parentKeyName: CDSCreateResponsePolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CDSCreateResponseState
+ localName: ResponseOutput
+ firstState: CDSCreateResponseState
+ - key:
+ name: CDSDeleteResponsePolicy
+ version: 0.0.1
+ value:
+ policyKey:
+ name: CDSDeleteResponsePolicy
+ version: 0.0.1
+ template: Freestyle
+ state:
+ entry:
+ - key: CDSDeleteResponseState
+ value:
+ stateKey:
+ parentKeyName: CDSDeleteResponsePolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: 'NULL'
+ localName: CDSDeleteResponseState
+ trigger:
+ name: CDSDeleteResponseEvent
+ version: 0.0.1
+ stateOutputs:
+ entry:
+ - key: ResponseOutput
+ value:
+ key:
+ parentKeyName: CDSDeleteResponsePolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CDSDeleteResponseState
+ localName: ResponseOutput
+ outgoingEvent:
+ name: CDSResponseStatusEvent
+ version: 0.0.1
+ nextState:
+ parentKeyName: 'NULL'
+ parentKeyVersion: 0.0.0
+ parentLocalName: 'NULL'
+ localName: 'NULL'
+ contextAlbumReference: []
+ taskSelectionLogic:
+ key: 'NULL'
+ logicFlavour: UNDEFINED
+ logic: ''
+ stateFinalizerLogicMap:
+ entry: []
+ defaultTask:
+ name: CDSDeleteResponseTask
+ version: 0.0.1
+ taskReferences:
+ entry:
+ - key:
+ name: CDSDeleteResponseTask
+ version: 0.0.1
+ value:
+ key:
+ parentKeyName: CDSDeleteResponsePolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CDSDeleteResponseState
+ localName: CDSDeleteResponsePolicy
+ outputType: DIRECT
+ output:
+ parentKeyName: CDSDeleteResponsePolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CDSDeleteResponseState
+ localName: ResponseOutput
+ firstState: CDSDeleteResponseState
+ - key:
+ name: ReceiveEventPolicy
+ version: 0.0.1
+ value:
+ policyKey:
+ name: ReceiveEventPolicy
+ version: 0.0.1
+ template: Freestyle
+ state:
+ entry:
+ - key: CreateOrDeleteState
+ value:
+ stateKey:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: 'NULL'
+ localName: CreateOrDeleteState
+ trigger:
+ name: PMSubscriptionOutputEvent
+ version: 0.0.1
+ stateOutputs:
+ entry:
+ - key: CreateSubscriptionPayload
+ value:
+ key:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CreateOrDeleteState
+ localName: CreateSubscriptionPayload
+ outgoingEvent:
+ name: CreateSubscriptionPayloadEvent
+ version: 0.0.1
+ nextState:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: 'NULL'
+ localName: CreateSubscription
+ - key: DeleteSubscriptionPayload
+ value:
+ key:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CreateOrDeleteState
+ localName: DeleteSubscriptionPayload
+ outgoingEvent:
+ name: DeleteSubscriptionPayloadEvent
+ version: 0.0.1
+ nextState:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: 'NULL'
+ localName: DeleteSubscription
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskSelectionLogic:
+ key: TaskSelectionLogic
+ logicFlavour: JAVASCRIPT
+ logic: |-
+ /*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix. 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=========================================================
+ */
+
+ executor.logger.info(executor.subject.id);
+
+ var pmSubscriptionInfo = executor.getContextAlbum("PMSubscriptionAlbum").get(executor.inFields.get("albumID").toString())
+ var changeType = pmSubscriptionInfo.get("changeType").toString()
+
+ executor.logger.info("Change Type is " + changeType)
+
+ if ("CREATE".equals(changeType)) {
+ executor.logger.info("Choosing to create a subscription")
+ executor.subject.getTaskKey("CreateSubscriptionPayloadTask").copyTo(executor.selectedTask);
+ }
+ else if ("DELETE".equals(changeType)) {
+ executor.logger.info("Choosing to delete a subscription")
+ executor.subject.getTaskKey("DeleteSubscriptionPayloadTask").copyTo(executor.selectedTask);
+ }
+
+ //var returnValue = executor.isTrue;
+ true;
+ stateFinalizerLogicMap:
+ entry: []
+ defaultTask:
+ name: CreateSubscriptionPayloadTask
+ version: 0.0.1
+ taskReferences:
+ entry:
+ - key:
+ name: CreateSubscriptionPayloadTask
+ version: 0.0.1
+ value:
+ key:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CreateOrDeleteState
+ localName: ReceiveEventPolicy
+ outputType: DIRECT
+ output:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CreateOrDeleteState
+ localName: CreateSubscriptionPayload
+ - key:
+ name: DeleteSubscriptionPayloadTask
+ version: 0.0.1
+ value:
+ key:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CreateOrDeleteState
+ localName: ReceiveEventPolicy
+ outputType: DIRECT
+ output:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CreateOrDeleteState
+ localName: DeleteSubscriptionPayload
+ - key: CreateSubscription
+ value:
+ stateKey:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: 'NULL'
+ localName: CreateSubscription
+ trigger:
+ name: CreateSubscriptionPayloadEvent
+ version: 0.0.1
+ stateOutputs:
+ entry:
+ - key: IssueCreateSubscriptionRequestOutput
+ value:
+ key:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CreateSubscription
+ localName: IssueCreateSubscriptionRequestOutput
+ outgoingEvent:
+ name: CDSCreateSubscriptionRequestEvent
+ version: 0.0.1
+ nextState:
+ parentKeyName: 'NULL'
+ parentKeyVersion: 0.0.0
+ parentLocalName: 'NULL'
+ localName: 'NULL'
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskSelectionLogic:
+ key: 'NULL'
+ logicFlavour: UNDEFINED
+ logic: ''
+ stateFinalizerLogicMap:
+ entry: []
+ defaultTask:
+ name: CreateSubscriptionRequestTask
+ version: 0.0.1
+ taskReferences:
+ entry:
+ - key:
+ name: CreateSubscriptionRequestTask
+ version: 0.0.1
+ value:
+ key:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CreateSubscription
+ localName: ReceiveEventPolicy
+ outputType: DIRECT
+ output:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: CreateSubscription
+ localName: IssueCreateSubscriptionRequestOutput
+ - key: DeleteSubscription
+ value:
+ stateKey:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: 'NULL'
+ localName: DeleteSubscription
+ trigger:
+ name: DeleteSubscriptionPayloadEvent
+ version: 0.0.1
+ stateOutputs:
+ entry:
+ - key: IssueDeleteSubscriptionRequestOutput
+ value:
+ key:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: DeleteSubscription
+ localName: IssueDeleteSubscriptionRequestOutput
+ outgoingEvent:
+ name: CDSDeleteSubscriptionRequestEvent
+ version: 0.0.1
+ nextState:
+ parentKeyName: 'NULL'
+ parentKeyVersion: 0.0.0
+ parentLocalName: 'NULL'
+ localName: 'NULL'
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskSelectionLogic:
+ key: 'NULL'
+ logicFlavour: UNDEFINED
+ logic: ''
+ stateFinalizerLogicMap:
+ entry: []
+ defaultTask:
+ name: DeleteSubscriptionRequestTask
+ version: 0.0.1
+ taskReferences:
+ entry:
+ - key:
+ name: DeleteSubscriptionRequestTask
+ version: 0.0.1
+ value:
+ key:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: DeleteSubscription
+ localName: ReceiveEventPolicy
+ outputType: DIRECT
+ output:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: DeleteSubscription
+ localName: IssueDeleteSubscriptionRequestOutput
+ - key: ReceiveSubscriptionState
+ value:
+ stateKey:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: 'NULL'
+ localName: ReceiveSubscriptionState
+ trigger:
+ name: pmsh-operational-policy
+ version: 0.0.1
+ stateOutputs:
+ entry:
+ - key: ReceivePMSubscriptionOutput
+ value:
+ key:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: ReceiveSubscriptionState
+ localName: ReceivePMSubscriptionOutput
+ outgoingEvent:
+ name: PMSubscriptionOutputEvent
+ version: 0.0.1
+ nextState:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: 'NULL'
+ localName: CreateOrDeleteState
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskSelectionLogic:
+ key: 'NULL'
+ logicFlavour: UNDEFINED
+ logic: ''
+ stateFinalizerLogicMap:
+ entry: []
+ defaultTask:
+ name: ReceiveSubscriptionTask
+ version: 0.0.1
+ taskReferences:
+ entry:
+ - key:
+ name: ReceiveSubscriptionTask
+ version: 0.0.1
+ value:
+ key:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: ReceiveSubscriptionState
+ localName: ReceiveEventPolicy
+ outputType: DIRECT
+ output:
+ parentKeyName: ReceiveEventPolicy
+ parentKeyVersion: 0.0.1
+ parentLocalName: ReceiveSubscriptionState
+ localName: ReceivePMSubscriptionOutput
+ firstState: ReceiveSubscriptionState
+ tasks:
+ key:
+ name: PMControlPolicy_Tasks
+ version: 0.0.1
+ taskMap:
+ entry:
+ - key:
+ name: CDSCreateResponseTask
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateResponseTask
+ version: 0.0.1
+ inputFields:
+ entry:
+ - key: actionIdentifiers
+ value:
+ key: actionIdentifiers
+ fieldSchemaKey:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ optional: false
+ - key: commonHeader
+ value:
+ key: commonHeader
+ fieldSchemaKey:
+ name: CDSResponseCommonHeaderType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSCreateResponsePayloadType
+ version: 0.0.1
+ optional: false
+ - key: status
+ value:
+ key: status
+ fieldSchemaKey:
+ name: CDSResponseStatusType
+ version: 0.0.1
+ optional: false
+ outputFields:
+ entry:
+ - key: status
+ value:
+ key: status
+ fieldSchemaKey:
+ name: SubscriptionStatusType
+ version: 0.0.1
+ optional: false
+ taskParameters:
+ entry: []
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskLogic:
+ key: TaskLogic
+ logicFlavour: JAVASCRIPT
+ logic: |-
+ /*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix. 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=========================================================
+ */
+
+ executor.logger.info(executor.subject.id);
+
+ var commonHeader = executor.inFields.get("commonHeader")
+ var response = executor.inFields.get("payload")
+ var albumID = commonHeader.get("requestId")
+
+ var pmSubscriptionInfo = executor.getContextAlbum("PMSubscriptionAlbum").get(albumID.toString());
+ var responseStatus = executor.subject.getOutFieldSchemaHelper("status").createNewInstance();
+
+ responseStatus.put("subscriptionName", pmSubscriptionInfo.get("subscription").get("subscriptionName"))
+ responseStatus.put("nfName", pmSubscriptionInfo.get("nfName"))
+ responseStatus.put("changeType", pmSubscriptionInfo.get("changeType"))
+
+ var status = response.get(pmSubscriptionInfo.get("changeType").toLowerCase() + "_DasH_subscription_DasH_response").get("odl_DasH_response").get("status")
+
+ executor.logger.info("RESPONSE STATUS = " + status)
+
+ if(status == "success") {
+ responseStatus.put("message", "success")
+ } else {
+ responseStatus.put("message", "failed")
+ }
+
+ executor.outFields.put("status", responseStatus)
+
+ //var returnValue = executor.isTrue;
+ true;
+ - key:
+ name: CDSDeleteResponseTask
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteResponseTask
+ version: 0.0.1
+ inputFields:
+ entry:
+ - key: actionIdentifiers
+ value:
+ key: actionIdentifiers
+ fieldSchemaKey:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ optional: false
+ - key: commonHeader
+ value:
+ key: commonHeader
+ fieldSchemaKey:
+ name: CDSResponseCommonHeaderType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSDeleteResponsePayloadType
+ version: 0.0.1
+ optional: false
+ - key: status
+ value:
+ key: status
+ fieldSchemaKey:
+ name: CDSResponseStatusType
+ version: 0.0.1
+ optional: false
+ outputFields:
+ entry:
+ - key: status
+ value:
+ key: status
+ fieldSchemaKey:
+ name: SubscriptionStatusType
+ version: 0.0.1
+ optional: false
+ taskParameters:
+ entry: []
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskLogic:
+ key: TaskLogic
+ logicFlavour: JAVASCRIPT
+ logic: |-
+ /*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix. 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=========================================================
+ */
+
+ executor.logger.info(executor.subject.id);
+
+ var commonHeader = executor.inFields.get("commonHeader")
+ var response = executor.inFields.get("payload")
+ var albumID = commonHeader.get("requestId")
+
+ var pmSubscriptionInfo = executor.getContextAlbum("PMSubscriptionAlbum").get(albumID.toString());
+ var responseStatus = executor.subject.getOutFieldSchemaHelper("status").createNewInstance();
+
+ responseStatus.put("subscriptionName", pmSubscriptionInfo.get("subscription").get("subscriptionName"))
+ responseStatus.put("nfName", pmSubscriptionInfo.get("nfName"))
+ responseStatus.put("changeType", pmSubscriptionInfo.get("changeType"))
+
+ var status = response.get(pmSubscriptionInfo.get("changeType").toLowerCase() + "_DasH_subscription_DasH_response").get("odl_DasH_response").get("status")
+
+ executor.logger.info("RESPONSE STATUS = " + status)
+
+ if(status == "success") {
+ responseStatus.put("message", "success")
+ } else {
+ responseStatus.put("message", "failed")
+ }
+
+ executor.outFields.put("status", responseStatus)
+
+ //var returnValue = executor.isTrue;
+ true;
+ - key:
+ name: CreateSubscriptionPayloadTask
+ version: 0.0.1
+ value:
+ key:
+ name: CreateSubscriptionPayloadTask
+ version: 0.0.1
+ inputFields:
+ entry:
+ - key: albumID
+ value:
+ key: albumID
+ fieldSchemaKey:
+ name: UUIDType
+ version: 0.0.1
+ optional: false
+ outputFields:
+ entry:
+ - key: albumID
+ value:
+ key: albumID
+ fieldSchemaKey:
+ name: UUIDType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSCreateSubscriptionPayloadType
+ version: 0.0.1
+ optional: false
+ taskParameters:
+ entry: []
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskLogic:
+ key: TaskLogic
+ logicFlavour: JAVASCRIPT
+ logic: |-
+ /*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix. 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=========================================================
+ */
+
+ executor.logger.info(executor.subject.id);
+
+ var pmSubscriptionInfo = executor.getContextAlbum("PMSubscriptionAlbum").get(executor.inFields.get("albumID").toString())
+
+ var changeType = pmSubscriptionInfo.get("changeType").toLowerCase()
+
+ var payloadProperties = executor.subject.getOutFieldSchemaHelper("payload").createNewSubInstance(changeType + "_DasH_subscription_DasH_properties_record");
+
+ payloadProperties.put("nfName", pmSubscriptionInfo.get("nfName"))
+ payloadProperties.put("subscriptionName", pmSubscriptionInfo.get("subscription").get("subscriptionName"))
+ payloadProperties.put("administrativeState", pmSubscriptionInfo.get("subscription").get("administrativeState"))
+ payloadProperties.put("fileBasedGP", pmSubscriptionInfo.get("subscription").get("fileBasedGP").toString())
+ payloadProperties.put("fileLocation", pmSubscriptionInfo.get("subscription").get("fileLocation"))
+ payloadProperties.put("measurementGroups", pmSubscriptionInfo.get("subscription").get("measurementGroups"))
+
+ var payloadEntry = executor.subject.getOutFieldSchemaHelper("payload").createNewSubInstance("CDSRequestPayloadEntry");
+ payloadEntry.put(changeType + "_DasH_subscription_DasH_properties", payloadProperties)
+
+ var payload = executor.subject.getOutFieldSchemaHelper("payload").createNewInstance();
+ payload.put(changeType + "_DasH_subscription_DasH_request", payloadEntry);
+
+ executor.outFields.put("albumID", executor.inFields.get("albumID"))
+ executor.outFields.put("payload", payload);
+
+ //var returnValue = executor.isTrue;
+ true;
+ - key:
+ name: CreateSubscriptionRequestTask
+ version: 0.0.1
+ value:
+ key:
+ name: CreateSubscriptionRequestTask
+ version: 0.0.1
+ inputFields:
+ entry:
+ - key: albumID
+ value:
+ key: albumID
+ fieldSchemaKey:
+ name: UUIDType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSCreateSubscriptionPayloadType
+ version: 0.0.1
+ optional: false
+ outputFields:
+ entry:
+ - key: actionIdentifiers
+ value:
+ key: actionIdentifiers
+ fieldSchemaKey:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ optional: false
+ - key: commonHeader
+ value:
+ key: commonHeader
+ fieldSchemaKey:
+ name: CDSRequestCommonHeaderType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSCreateSubscriptionPayloadType
+ version: 0.0.1
+ optional: false
+ taskParameters:
+ entry: []
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskLogic:
+ key: TaskLogic
+ logicFlavour: JAVASCRIPT
+ logic: |-
+ /*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix. 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=========================================================
+ */
+
+ executor.logger.info(executor.subject.id);
+
+ var pmSubscriptionInfo = executor.getContextAlbum("PMSubscriptionAlbum").get(executor.inFields.get("albumID").toString())
+
+ var changeType = pmSubscriptionInfo.get("changeType").toLowerCase()
+ var blueprintName = pmSubscriptionInfo.get("blueprintName").toLowerCase()
+ var blueprintVersion = pmSubscriptionInfo.get("blueprintVersion").toLowerCase()
+ var payload = executor.inFields.get("payload")
+ var actionName = changeType + "-subscription"
+
+ var commonHeader = executor.subject.getOutFieldSchemaHelper("commonHeader").createNewInstance();
+ commonHeader.put("originatorId", "sdnc");
+ commonHeader.put("requestId", executor.inFields.get("albumID").toString());
+ commonHeader.put("subRequestId", "sub-123456-1000");
+
+ var actionIdentifiers = executor.subject.getOutFieldSchemaHelper("actionIdentifiers").createNewInstance();
+ actionIdentifiers.put("actionName", actionName);
+ actionIdentifiers.put("blueprintName", blueprintName);
+ actionIdentifiers.put("blueprintVersion", blueprintVersion);
+ actionIdentifiers.put("mode", "sync");
+
+ executor.outFields.put("commonHeader", commonHeader);
+ executor.outFields.put("actionIdentifiers", actionIdentifiers);
+ executor.outFields.put("payload", payload);
+
+ //var returnValue = executor.isTrue;
+ true;
+ - key:
+ name: DeleteSubscriptionPayloadTask
+ version: 0.0.1
+ value:
+ key:
+ name: DeleteSubscriptionPayloadTask
+ version: 0.0.1
+ inputFields:
+ entry:
+ - key: albumID
+ value:
+ key: albumID
+ fieldSchemaKey:
+ name: UUIDType
+ version: 0.0.1
+ optional: false
+ outputFields:
+ entry:
+ - key: albumID
+ value:
+ key: albumID
+ fieldSchemaKey:
+ name: UUIDType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSDeleteSubscriptionPayloadType
+ version: 0.0.1
+ optional: false
+ taskParameters:
+ entry: []
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskLogic:
+ key: TaskLogic
+ logicFlavour: JAVASCRIPT
+ logic: |-
+ /*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix. 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=========================================================
+ */
+
+ executor.logger.info(executor.subject.id);
+
+ var pmSubscriptionInfo = executor.getContextAlbum("PMSubscriptionAlbum").get(executor.inFields.get("albumID").toString())
+
+ var changeType = pmSubscriptionInfo.get("changeType").toLowerCase()
+
+ var payloadProperties = executor.subject.getOutFieldSchemaHelper("payload").createNewSubInstance(changeType + "_DasH_subscription_DasH_properties_record");
+
+ payloadProperties.put("nfName", pmSubscriptionInfo.get("nfName"))
+ payloadProperties.put("subscriptionName", pmSubscriptionInfo.get("subscription").get("subscriptionName"))
+ payloadProperties.put("administrativeState", pmSubscriptionInfo.get("subscription").get("administrativeState"))
+ payloadProperties.put("fileBasedGP", pmSubscriptionInfo.get("subscription").get("fileBasedGP").toString())
+ payloadProperties.put("fileLocation", pmSubscriptionInfo.get("subscription").get("fileLocation"))
+ payloadProperties.put("measurementGroups", pmSubscriptionInfo.get("subscription").get("measurementGroups"))
+
+ var payloadEntry = executor.subject.getOutFieldSchemaHelper("payload").createNewSubInstance("CDSRequestPayloadEntry");
+ payloadEntry.put(changeType + "_DasH_subscription_DasH_properties", payloadProperties)
+
+ var payload = executor.subject.getOutFieldSchemaHelper("payload").createNewInstance();
+ payload.put(changeType + "_DasH_subscription_DasH_request", payloadEntry);
+
+ executor.outFields.put("albumID", executor.inFields.get("albumID"))
+ executor.outFields.put("payload", payload);
+
+ //var returnValue = executor.isTrue;
+ true;
+ - key:
+ name: DeleteSubscriptionRequestTask
+ version: 0.0.1
+ value:
+ key:
+ name: DeleteSubscriptionRequestTask
+ version: 0.0.1
+ inputFields:
+ entry:
+ - key: albumID
+ value:
+ key: albumID
+ fieldSchemaKey:
+ name: UUIDType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSDeleteSubscriptionPayloadType
+ version: 0.0.1
+ optional: false
+ outputFields:
+ entry:
+ - key: actionIdentifiers
+ value:
+ key: actionIdentifiers
+ fieldSchemaKey:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ optional: false
+ - key: commonHeader
+ value:
+ key: commonHeader
+ fieldSchemaKey:
+ name: CDSRequestCommonHeaderType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSDeleteSubscriptionPayloadType
+ version: 0.0.1
+ optional: false
+ taskParameters:
+ entry: []
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskLogic:
+ key: TaskLogic
+ logicFlavour: JAVASCRIPT
+ logic: |-
+ /*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix. 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=========================================================
+ */
+
+ executor.logger.info(executor.subject.id);
+
+ var pmSubscriptionInfo = executor.getContextAlbum("PMSubscriptionAlbum").get(executor.inFields.get("albumID").toString())
+
+ var changeType = pmSubscriptionInfo.get("changeType").toLowerCase()
+ var blueprintName = pmSubscriptionInfo.get("blueprintName").toLowerCase()
+ var blueprintVersion = pmSubscriptionInfo.get("blueprintVersion").toLowerCase()
+ var payload = executor.inFields.get("payload")
+ var actionName = changeType + "-subscription"
+
+ var commonHeader = executor.subject.getOutFieldSchemaHelper("commonHeader").createNewInstance();
+ commonHeader.put("originatorId", "sdnc");
+ commonHeader.put("requestId", executor.inFields.get("albumID").toString());
+ commonHeader.put("subRequestId", "sub-123456-1000");
+
+ var actionIdentifiers = executor.subject.getOutFieldSchemaHelper("actionIdentifiers").createNewInstance();
+ actionIdentifiers.put("actionName", actionName);
+ actionIdentifiers.put("blueprintName", blueprintName);
+ actionIdentifiers.put("blueprintVersion", blueprintVersion);
+ actionIdentifiers.put("mode", "sync");
+
+ executor.outFields.put("commonHeader", commonHeader);
+ executor.outFields.put("actionIdentifiers", actionIdentifiers);
+ executor.outFields.put("payload", payload);
+
+ //var returnValue = executor.isTrue;
+ true;
+ - key:
+ name: ReceiveSubscriptionTask
+ version: 0.0.1
+ value:
+ key:
+ name: ReceiveSubscriptionTask
+ version: 0.0.1
+ inputFields:
+ entry:
+ - key: blueprintName
+ value:
+ key: blueprintName
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: blueprintVersion
+ value:
+ key: blueprintVersion
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: changeType
+ value:
+ key: changeType
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: closedLoopControlName
+ value:
+ key: closedLoopControlName
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: nfName
+ value:
+ key: nfName
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: policyName
+ value:
+ key: policyName
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: subscription
+ value:
+ key: subscription
+ fieldSchemaKey:
+ name: SubscriptionType
+ version: 0.0.1
+ optional: false
+ outputFields:
+ entry:
+ - key: albumID
+ value:
+ key: albumID
+ fieldSchemaKey:
+ name: UUIDType
+ version: 0.0.1
+ optional: false
+ taskParameters:
+ entry: []
+ contextAlbumReference:
+ - name: PMSubscriptionAlbum
+ version: 0.0.1
+ taskLogic:
+ key: TaskLogic
+ logicFlavour: JAVASCRIPT
+ logic: |-
+ /*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix. 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=========================================================
+ */
+ var uuidType = java.util.UUID;
+
+ executor.logger.info(executor.subject.id);
+
+ //albumID will be used to fetch info from our album later
+ var albumID = uuidType.randomUUID();
+ var pmSubscriptionInfo = executor.getContextAlbum("PMSubscriptionAlbum").getSchemaHelper().createNewInstance();
+ var returnValue = true;
+
+ if(executor.inFields.get("policyName") != null) {
+ executor.logger.info("nfName in receive sub event " + executor.inFields.get("nfName"));
+
+ var changeType = executor.inFields.get("changeType")
+ var nfName = executor.inFields.get("nfName")
+ var policyName = executor.inFields.get("policyName")
+ var closedLoopControlName = executor.inFields.get("closedLoopControlName")
+ var subscription = executor.inFields.get("subscription")
+ var blueprintName = executor.inFields.get("blueprintName")
+ var blueprintVersion = executor.inFields.get("blueprintVersion")
+
+ pmSubscriptionInfo.put("nfName", executor.inFields.get("nfName"));
+ pmSubscriptionInfo.put("changeType", executor.inFields.get("changeType"))
+ pmSubscriptionInfo.put("policyName", executor.inFields.get("policyName"))
+ pmSubscriptionInfo.put("closedLoopControlName", executor.inFields.get("closedLoopControlName"))
+ pmSubscriptionInfo.put("subscription", subscription)
+ pmSubscriptionInfo.put("blueprintName", blueprintName)
+ pmSubscriptionInfo.put("blueprintVersion", blueprintVersion)
+
+
+ executor.getContextAlbum("PMSubscriptionAlbum").put(albumID.toString(), pmSubscriptionInfo);
+
+ executor.outFields.put("albumID", albumID)
+ } else {
+ executor.message = "Received invalid event"
+ returnValue = false;
+ }
+
+ returnValue;
+ events:
+ key:
+ name: PMControlPolicy_Events
+ version: 0.0.1
+ eventMap:
+ entry:
+ - key:
+ name: CDSCreateResponseEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateResponseEvent
+ version: 0.0.1
+ nameSpace: org.onap.policy.apex.onap.pmcontrol
+ source: CDS
+ target: APEX
+ parameter:
+ entry:
+ - key: actionIdentifiers
+ value:
+ key: actionIdentifiers
+ fieldSchemaKey:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ optional: false
+ - key: commonHeader
+ value:
+ key: commonHeader
+ fieldSchemaKey:
+ name: CDSResponseCommonHeaderType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSCreateResponsePayloadType
+ version: 0.0.1
+ optional: false
+ - key: status
+ value:
+ key: status
+ fieldSchemaKey:
+ name: CDSResponseStatusType
+ version: 0.0.1
+ optional: false
+ - key:
+ name: CDSCreateSubscriptionRequestEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateSubscriptionRequestEvent
+ version: 0.0.1
+ nameSpace: org.onap.policy.apex.onap.pmcontrol
+ source: APEX
+ target: APEX
+ parameter:
+ entry:
+ - key: actionIdentifiers
+ value:
+ key: actionIdentifiers
+ fieldSchemaKey:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ optional: false
+ - key: commonHeader
+ value:
+ key: commonHeader
+ fieldSchemaKey:
+ name: CDSRequestCommonHeaderType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSCreateSubscriptionPayloadType
+ version: 0.0.1
+ optional: false
+ - key:
+ name: CDSDeleteResponseEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteResponseEvent
+ version: 0.0.1
+ nameSpace: org.onap.policy.apex.onap.pmcontrol
+ source: CDS
+ target: APEX
+ parameter:
+ entry:
+ - key: actionIdentifiers
+ value:
+ key: actionIdentifiers
+ fieldSchemaKey:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ optional: false
+ - key: commonHeader
+ value:
+ key: commonHeader
+ fieldSchemaKey:
+ name: CDSResponseCommonHeaderType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSDeleteResponsePayloadType
+ version: 0.0.1
+ optional: false
+ - key: status
+ value:
+ key: status
+ fieldSchemaKey:
+ name: CDSResponseStatusType
+ version: 0.0.1
+ optional: false
+ - key:
+ name: CDSDeleteSubscriptionRequestEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteSubscriptionRequestEvent
+ version: 0.0.1
+ nameSpace: org.onap.policy.apex.onap.pmcontrol
+ source: APEX
+ target: APEX
+ parameter:
+ entry:
+ - key: actionIdentifiers
+ value:
+ key: actionIdentifiers
+ fieldSchemaKey:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ optional: false
+ - key: commonHeader
+ value:
+ key: commonHeader
+ fieldSchemaKey:
+ name: CDSRequestCommonHeaderType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSDeleteSubscriptionPayloadType
+ version: 0.0.1
+ optional: false
+ - key:
+ name: CDSResponseStatusEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CDSResponseStatusEvent
+ version: 0.0.1
+ nameSpace: org.onap.policy.apex.onap.pmcontrol
+ source: APEX
+ target: DCAE
+ parameter:
+ entry:
+ - key: status
+ value:
+ key: status
+ fieldSchemaKey:
+ name: SubscriptionStatusType
+ version: 0.0.1
+ optional: false
+ - key:
+ name: CreateSubscriptionPayloadEvent
+ version: 0.0.1
+ value:
+ key:
+ name: CreateSubscriptionPayloadEvent
+ version: 0.0.1
+ nameSpace: org.onap.policy.apex.onap.pmcontrol
+ source: APEX
+ target: APEX
+ parameter:
+ entry:
+ - key: albumID
+ value:
+ key: albumID
+ fieldSchemaKey:
+ name: UUIDType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSCreateSubscriptionPayloadType
+ version: 0.0.1
+ optional: false
+ - key:
+ name: DeleteSubscriptionPayloadEvent
+ version: 0.0.1
+ value:
+ key:
+ name: DeleteSubscriptionPayloadEvent
+ version: 0.0.1
+ nameSpace: org.onap.policy.apex.onap.pmcontrol
+ source: APEX
+ target: APEX
+ parameter:
+ entry:
+ - key: albumID
+ value:
+ key: albumID
+ fieldSchemaKey:
+ name: UUIDType
+ version: 0.0.1
+ optional: false
+ - key: payload
+ value:
+ key: payload
+ fieldSchemaKey:
+ name: CDSDeleteSubscriptionPayloadType
+ version: 0.0.1
+ optional: false
+ - key:
+ name: MRResponseEvent
+ version: 0.0.1
+ value:
+ key:
+ name: MRResponseEvent
+ version: 0.0.1
+ nameSpace: org.onap.policy.apex.onap.pmcontrol
+ source: DCAE
+ target: APEX
+ parameter:
+ entry:
+ - key: count
+ value:
+ key: count
+ fieldSchemaKey:
+ name: SimpleIntType
+ version: 0.0.1
+ optional: false
+ - key: serverTimeMs
+ value:
+ key: serverTimeMs
+ fieldSchemaKey:
+ name: SimpleIntType
+ version: 0.0.1
+ optional: false
+ - key:
+ name: PMSubscriptionOutputEvent
+ version: 0.0.1
+ value:
+ key:
+ name: PMSubscriptionOutputEvent
+ version: 0.0.1
+ nameSpace: org.onap.policy.apex.onap.pmcontrol
+ source: APEX
+ target: APEX
+ parameter:
+ entry:
+ - key: albumID
+ value:
+ key: albumID
+ fieldSchemaKey:
+ name: UUIDType
+ version: 0.0.1
+ optional: false
+ - key:
+ name: pmsh-operational-policy
+ version: 0.0.1
+ value:
+ key:
+ name: pmsh-operational-policy
+ version: 0.0.1
+ nameSpace: org.onap.policy.apex.onap.pmcontrol
+ source: DCAE
+ target: APEX
+ parameter:
+ entry:
+ - key: blueprintName
+ value:
+ key: blueprintName
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: blueprintVersion
+ value:
+ key: blueprintVersion
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: changeType
+ value:
+ key: changeType
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: closedLoopControlName
+ value:
+ key: closedLoopControlName
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: nfName
+ value:
+ key: nfName
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: policyName
+ value:
+ key: policyName
+ fieldSchemaKey:
+ name: SimpleStringType
+ version: 0.0.1
+ optional: false
+ - key: subscription
+ value:
+ key: subscription
+ fieldSchemaKey:
+ name: SubscriptionType
+ version: 0.0.1
+ optional: false
+ albums:
+ key:
+ name: PMControlPolicy_Albums
+ version: 0.0.1
+ albums:
+ entry:
+ - key:
+ name: PMSubscriptionAlbum
+ version: 0.0.1
+ value:
+ key:
+ name: PMSubscriptionAlbum
+ version: 0.0.1
+ scope: policy
+ isWritable: true
+ itemSchema:
+ name: PMSubscriptionType
+ version: 0.0.1
+ schemas:
+ key:
+ name: PMControlPolicy_Schemas
+ version: 0.0.1
+ schemas:
+ entry:
+ - key:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSActionIdentifiersType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: |-
+ {
+ "type": "record",
+ "name": "ActionIdentifiers_Type",
+ "namespace": "org.onap.policy.apex.onap.helloworld",
+ "fields": [
+ {
+ "name": "actionName",
+ "type": "string"
+ },
+ {
+ "name": "blueprintName",
+ "type": "string"
+ },
+ {
+ "name": "blueprintVersion",
+ "type": "string"
+ },
+ {
+ "name": "mode",
+ "type": "string"
+ }
+ ]
+ }
+ - key:
+ name: CDSCreateResponsePayloadType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateResponsePayloadType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: |-
+ {
+ "name": "CreateResponsePayloadEntry",
+ "type": "record",
+ "namespace": "org.onap.policy.apex.onap.helloworld",
+ "fields": [
+ {
+ "name": "create_DasH_subscription_DasH_response",
+ "type": {
+ "name": "create_DasH_subscription_DasH_response",
+ "type": "record",
+ "fields": [
+ {
+ "name": "odl_DasH_response",
+ "type": {
+ "name": "odl_DasH_response",
+ "type": "record",
+ "fields": [
+ {
+ "name": "status",
+ "type": "string"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ - key:
+ name: CDSCreateSubscriptionPayloadType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSCreateSubscriptionPayloadType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: |-
+ {
+ "type": "map",
+ "values": {
+ "type": "record",
+ "name": "CDSRequestPayloadEntry",
+ "fields": [
+ {
+ "name": "create_DasH_subscription_DasH_properties",
+ "type": {
+ "name": "create_DasH_subscription_DasH_properties_record",
+ "type": "record",
+ "fields": [
+ {
+ "name": "nfName",
+ "type": "string"
+ },
+ {
+ "name": "subscriptionName",
+ "type": "string"
+ },
+ {
+ "name": "administrativeState",
+ "type": "string"
+ },
+ {
+ "name": "fileBasedGP",
+ "type": "string"
+ },
+ {
+ "name": "fileLocation",
+ "type": "string"
+ },
+ {
+ "name": "measurementGroups",
+ "type": {
+ "type": "array",
+ "items": {
+ "name": "measurementGroups_record",
+ "type": "record",
+ "fields": [
+ {
+ "name": "measurementGroup",
+ "type": {
+ "name": "measurementGroup",
+ "type": "record",
+ "fields": [
+ {
+ "name": "measurementTypes",
+ "type": {
+ "type": "array",
+ "items": {
+ "name": "measurementTypes_record",
+ "type": "record",
+ "fields": [
+ {
+ "name": "measurementType",
+ "type": "string"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "managedObjectDNsBasic",
+ "type": {
+ "type": "array",
+ "items": {
+ "name": "managedObjectDNsBasic_record",
+ "type": "record",
+ "fields": [
+ {
+ "name": "DN",
+ "type": "string"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ - key:
+ name: CDSDeleteResponsePayloadType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteResponsePayloadType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: |-
+ {
+ "name": "DeleteResponsePayloadEntry",
+ "type": "record",
+ "namespace": "com.acme.avro",
+ "fields": [
+ {
+ "name": "delete_DasH_subscription_DasH_response",
+ "type": {
+ "name": "delete_DasH_subscription_DasH_response",
+ "type": "record",
+ "fields": [
+ {
+ "name": "odl_DasH_response",
+ "type": {
+ "name": "odl_DasH_response",
+ "type": "record",
+ "fields": [
+ {
+ "name": "status",
+ "type": "string"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ - key:
+ name: CDSDeleteSubscriptionPayloadType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSDeleteSubscriptionPayloadType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: |-
+ {
+ "type": "map",
+ "values": {
+ "type": "record",
+ "name": "CDSRequestPayloadEntry",
+ "fields": [
+ {
+ "name": "delete_DasH_subscription_DasH_properties",
+ "type": {
+ "name": "delete_DasH_subscription_DasH_properties_record",
+ "type": "record",
+ "fields": [
+ {
+ "name": "nfName",
+ "type": "string"
+ },
+ {
+ "name": "subscriptionName",
+ "type": "string"
+ },
+ {
+ "name": "administrativeState",
+ "type": "string"
+ },
+ {
+ "name": "fileBasedGP",
+ "type": "string"
+ },
+ {
+ "name": "fileLocation",
+ "type": "string"
+ },
+ {
+ "name": "measurementGroups",
+ "type": {
+ "type": "array",
+ "items": {
+ "name": "measurementGroups_record",
+ "type": "record",
+ "fields": [
+ {
+ "name": "measurementGroup",
+ "type": {
+ "name": "measurementGroup",
+ "type": "record",
+ "fields": [
+ {
+ "name": "measurementTypes",
+ "type": {
+ "type": "array",
+ "items": {
+ "name": "measurementTypes_record",
+ "type": "record",
+ "fields": [
+ {
+ "name": "measurementType",
+ "type": "string"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "managedObjectDNsBasic",
+ "type": {
+ "type": "array",
+ "items": {
+ "name": "managedObjectDNsBasic_record",
+ "type": "record",
+ "fields": [
+ {
+ "name": "DN",
+ "type": "string"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ - key:
+ name: CDSRequestCommonHeaderType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSRequestCommonHeaderType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: |-
+ {
+ "type": "record",
+ "name": "RequestCommonHeader_Type",
+ "namespace": "org.onap.policy.apex.onap.helloworld",
+ "fields": [
+ {
+ "name": "originatorId",
+ "type": "string"
+ },
+ {
+ "name": "requestId",
+ "type": "string"
+ },
+ {
+ "name": "subRequestId",
+ "type": "string"
+ }
+ ]
+ }
+ - key:
+ name: CDSResponseCommonHeaderType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSResponseCommonHeaderType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: |-
+ {
+ "type": "record",
+ "name": "ResponseCommonHeader_Type",
+ "namespace": "org.onap.policy.apex.onap.helloworld",
+ "fields": [
+ {
+ "name": "originatorId",
+ "type": "string"
+ },
+ {
+ "name": "requestId",
+ "type": "string"
+ },
+ {
+ "name": "subRequestId",
+ "type": "string"
+ },
+ {
+ "name": "timestamp",
+ "type": "string"
+ },
+ {
+ "name": "flags",
+ "type": ["null", "string"]
+ }
+ ]
+ }
+ - key:
+ name: CDSResponseStatusType
+ version: 0.0.1
+ value:
+ key:
+ name: CDSResponseStatusType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: |-
+ {
+ "type": "record",
+ "name": "ResponseStatus_Type",
+ "namespace": "org.onap.policy.apex.onap.helloworld",
+ "fields": [
+ {
+ "name": "code",
+ "type": "int"
+ },
+ {
+ "name": "eventType",
+ "type": "string"
+ },
+ {
+ "name": "timestamp",
+ "type": "string"
+ },
+ {
+ "name": "message",
+ "type": "string"
+ }
+ ]
+ }
+ - key:
+ name: PMSubscriptionType
+ version: 0.0.1
+ value:
+ key:
+ name: PMSubscriptionType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: "{\n\t\"name\": \"PMSubscription\",\n\t\"type\": \"record\",\n\t\"namespace\": \"\
+ org.onap.policy.apex.onap.pmcontrol\",\n\t\"fields\": [\n {\n \"name\": \"nfName\"\
+ ,\n \"type\": \"string\"\n },\n\t {\n\t\t\t\"name\": \"changeType\",\n\t\t\t\"\
+ type\": \"string\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"closedLoopControlName\",\n\t\t\t\"type\": \"\
+ string\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"policyName\",\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\
+ {\n\t\t \"name\": \"blueprintName\",\n\t\t \"type\": \"string\"\n\t\t},\n\t\t{\n\t\t \"name\"\
+ : \"blueprintVersion\",\n\t\t \"type\": \"string\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"subscription\"\
+ ,\n\t\t\t\"type\": {\n\t\t\t\t\"name\": \"subscription\",\n\t\t\t\t\"type\": \"record\",\n\t\t\t\t\
+ \"fields\": [{\n\t\t\t\t\t\t\"name\": \"subscriptionName\",\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\
+ \t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"administrativeState\",\n\t\t\t\t\t\t\"type\": \"string\"\
+ \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"fileBasedGP\",\n\t\t\t\t\t\t\"type\": \"int\"\
+ \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"fileLocation\",\n\t\t\t\t\t\t\"type\": \"string\"\
+ \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"measurementGroups\",\n\t\t\t\t\t\t\"type\": {\n\
+ \t\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\t\"name\": \"Measurement_Groups_Type\"\
+ ,\n\t\t\t\t\t\t\t\t\"type\": \"record\",\n\t\t\t\t\t\t\t\t\"fields\": [{\n\t\t\t\t\t\t\t\t\t\"name\"\
+ : \"measurementGroup\",\n\t\t\t\t\t\t\t\t\t\"type\": {\n\t\t\t\t\t\t\t\t\t\t\"name\": \"Measurement_Group_Type\"\
+ ,\n\t\t\t\t\t\t\t\t\t\t\"type\": \"record\",\n\t\t\t\t\t\t\t\t\t\t\"fields\": [{\n\t\t\t\t\t\t\t\t\
+ \t\t\t\t\"name\": \"measurementTypes\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": {\n\t\t\t\t\t\t\t\t\t\t\
+ \t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"\
+ name\": \"Measurement_Types_Type\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"record\",\n\t\t\t\t\t\
+ \t\t\t\t\t\t\t\t\t\"fields\": [{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": \"measurementType\",\n\t\
+ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t\t\
+ \t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\
+ \t\t\t\t\t\t\t\t\"name\": \"managedObjectDNsBasic\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": {\n\t\t\t\t\
+ \t\t\t\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\t\t\
+ \t\t\t\t\t\"name\": \"Managed_Object_Dns_Basic_Type\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"record\"\
+ ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"fields\": [{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": \"DN\",\n\t\
+ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t\t\
+ \t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\
+ \t\t\t\t}\n\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\
+ \t}\n\t]\n}"
+ - key:
+ name: SimpleIntType
+ version: 0.0.1
+ value:
+ key:
+ name: SimpleIntType
+ version: 0.0.1
+ schemaFlavour: Java
+ schemaDefinition: java.lang.Integer
+ - key:
+ name: SimpleStringType
+ version: 0.0.1
+ value:
+ key:
+ name: SimpleStringType
+ version: 0.0.1
+ schemaFlavour: Java
+ schemaDefinition: java.lang.String
+ - key:
+ name: SubscriptionStatusType
+ version: 0.0.1
+ value:
+ key:
+ name: SubscriptionStatusType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: |-
+ {
+ "type": "record",
+ "name": "ActivateSubscriptionStatus_Type",
+ "namespace": "org.onap.policy.apex.onap.helloworld",
+ "fields": [
+ {
+ "name": "subscriptionName",
+ "type": "string"
+ },
+ {
+ "name": "nfName",
+ "type": "string"
+ },
+ {
+ "name": "changeType",
+ "type": "string"
+ },
+ {
+ "name": "message",
+ "type": "string"
+ }
+ ]
+ }
+ - key:
+ name: SubscriptionType
+ version: 0.0.1
+ value:
+ key:
+ name: SubscriptionType
+ version: 0.0.1
+ schemaFlavour: Avro
+ schemaDefinition: "{\n\t\"name\": \"subscription\",\n\t\"type\": \"record\",\n\t\"fields\": [{\n\t\t\
+ \t\"name\": \"subscriptionName\",\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"administrativeState\"\
+ ,\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"fileBasedGP\",\n\t\t\t\"type\": \"\
+ int\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"fileLocation\",\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\
+ {\n\t\t\t\"name\": \"measurementGroups\",\n\t\t\t\"type\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\
+ \t\"items\": {\n\t\t\t\t\t\"name\": \"Measurement_Groups_Type\",\n\t\t\t\t\t\"type\": \"record\",\n\
+ \t\t\t\t\t\"fields\": [{\n\t\t\t\t\t\t\"name\": \"measurementGroup\",\n\t\t\t\t\t\t\"type\": {\n\t\
+ \t\t\t\t\t\t\"name\": \"Measurement_Group_Type\",\n\t\t\t\t\t\t\t\"type\": \"record\",\n\t\t\t\t\t\
+ \t\t\"fields\": [{\n\t\t\t\t\t\t\t\t\t\"name\": \"measurementTypes\",\n\t\t\t\t\t\t\t\t\t\"type\"\
+ : {\n\t\t\t\t\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\t\t\
+ \t\t\"name\": \"Measurement_Types_Type\",\n\t\t\t\t\t\t\t\t\t\t\t\"type\": \"record\",\n\t\t\t\t\t\
+ \t\t\t\t\t\t\"fields\": [{\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": \"measurementType\",\n\t\t\t\t\t\t\t\
+ \t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\
+ }\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"name\": \"managedObjectDNsBasic\",\n\
+ \t\t\t\t\t\t\t\t\t\"type\": {\n\t\t\t\t\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\t\t\t\t\"items\"\
+ : {\n\t\t\t\t\t\t\t\t\t\t\t\"name\": \"Managed_Object_Dns_Basic_Type\",\n\t\t\t\t\t\t\t\t\t\t\t\"\
+ type\": \"record\",\n\t\t\t\t\t\t\t\t\t\t\t\"fields\": [{\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": \"DN\"\
+ ,\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t\t\t\t}\n\
+ \t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\
+ \t\t}\n\t\t}\n\t]\n}"
+ - key:
+ name: UUIDType
+ version: 0.0.1
+ value:
+ key:
+ name: UUIDType
+ version: 0.0.1
+ schemaFlavour: Java
+ schemaDefinition: java.util.UUID
+ engineParameters:
+ executorParameters:
+ JAVASCRIPT:
+ parameterClassName: org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters
+ contextParameters:
+ parameterClassName: org.onap.policy.apex.context.parameters.ContextParameters
+ schemaParameters:
+ Avro:
+ parameterClassName: org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters
+ Java:
+ parameterClassName: org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters
+ jsonAdapters:
+ Instant:
+ adaptedClass: java.time.Instant
+ adaptorClass: org.onap.policy.controlloop.util.Serialization$GsonInstantAdapter
+ eventInputParameters:
+ DCAEConsumer:
+ carrierTechnologyParameters:
+ carrierTechnology: RESTCLIENT
+ parameterClassName: org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters
+ parameters:
+ consumerPollTime: '50'
+ url: https://message-router:3905/events/unauthenticated.DCAE_CL_OUTPUT/cg1/sg1
+ eventProtocolParameters:
+ eventProtocol: JSON
+ parameters:
+ nameAlias: policyName
+ eventName: pmsh-operational-policy
+ eventNameFilter: pmsh-operational-policy
+ CDSRequestConsumer:
+ carrierTechnologyParameters:
+ carrierTechnology: RESTREQUESTOR
+ parameterClassName: org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters
+ parameters:
+ url: http://10.10.10.184:30254/api/v1/execution-service/process
+ httpMethod: POST
+ restRequestTimeout: 2000
+ httpHeaders:
+ - - Authorization
+ - Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
+ eventProtocolParameters:
+ eventProtocol: JSON
+ eventName: CDSCreateResponseEvent
+ eventNameFilter: CDSCreateResponseEvent
+ requestorMode: true
+ requestorPeer: CDSRequestProducer
+ requestorTimeout: 500
+ CDSDeleteRequestConsumer:
+ carrierTechnologyParameters:
+ carrierTechnology: RESTREQUESTOR
+ parameterClassName: org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters
+ parameters:
+ url: http://10.10.10.184:30254/api/v1/execution-service/process
+ httpMethod: POST
+ restRequestTimeout: 2000
+ httpHeaders:
+ - - Authorization
+ - Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
+ eventProtocolParameters:
+ eventProtocol: JSON
+ eventName: CDSDeleteResponseEvent
+ eventNameFilter: CDSDeleteResponseEvent
+ requestorMode: true
+ requestorPeer: CDSDeleteRequestProducer
+ requestorTimeout: 500
+ CDSReplyConsumer:
+ carrierTechnologyParameters:
+ carrierTechnology: RESTREQUESTOR
+ parameterClassName: org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters
+ parameters:
+ url: https://message-router:3905/events/unauthenticated.PMSH_CL_INPUT
+ httpMethod: POST
+ restRequestTimeout: 2000
+ eventProtocolParameters:
+ eventProtocol: JSON
+ eventName: MRResponseEvent
+ eventNameFilter: MRResponseEvent
+ requestorMode: true
+ requestorPeer: CDSReplyProducer
+ requestorTimeout: 500
+ eventOutputParameters:
+ logOutputter:
+ carrierTechnologyParameters:
+ carrierTechnology: FILE
+ parameters:
+ fileName: /tmp/outputevents.log
+ eventProtocolParameters:
+ eventProtocol: JSON
+ StdOutOutputter:
+ carrierTechnologyParameters:
+ carrierTechnology: FILE
+ parameters:
+ standardIo: true
+ eventProtocolParameters:
+ eventProtocol: JSON
+ CDSRequestProducer:
+ carrierTechnologyParameters:
+ carrierTechnology: RESTREQUESTOR
+ parameterClassName: org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters
+ eventProtocolParameters:
+ eventProtocol: JSON
+ eventNameFilter: CDSCreateSubscriptionRequestEvent
+ requestorMode: true
+ requestorPeer: CDSRequestConsumer
+ requestorTimeout: 500
+ CDSDeleteRequestProducer:
+ carrierTechnologyParameters:
+ carrierTechnology: RESTREQUESTOR
+ parameterClassName: org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters
+ eventProtocolParameters:
+ eventProtocol: JSON
+ eventNameFilter: CDSDeleteSubscriptionRequestEvent
+ requestorMode: true
+ requestorPeer: CDSDeleteRequestConsumer
+ requestorTimeout: 500
+ CDSReplyProducer:
+ carrierTechnologyParameters:
+ carrierTechnology: RESTREQUESTOR
+ parameterClassName: org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters
+ eventProtocolParameters:
+ eventProtocol: JSON
+ eventNameFilter: CDSResponseStatusEvent
+ requestorMode: true
+ requestorPeer: CDSReplyConsumer
+ requestorTimeout: 500
diff --git a/models/src/test/resources/providers/tosca-for-smoke-testing.yaml b/models/src/test/resources/providers/tosca-for-smoke-testing.yaml
new file mode 100644
index 000000000..f69755e2b
--- /dev/null
+++ b/models/src/test/resources/providers/tosca-for-smoke-testing.yaml
@@ -0,0 +1,966 @@
+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
+ onap.datatype.controlloop.Target:
+ derived_from: tosca.datatypes.Root
+ description: Definition for a entity in A&AI to perform a control loop operation on
+ properties:
+ targetType:
+ type: string
+ description: Category for the target type
+ required: true
+ constraints:
+ - valid_values:
+ - VNF
+ - VM
+ - VFMODULE
+ - PNF
+ entityIds:
+ type: map
+ description: |
+ Map of values that identify the resource. If none are provided, it is assumed that the
+ entity that generated the ONSET event will be the target.
+ required: false
+ metadata:
+ clamp_possible_values: ClampExecution:CSAR_RESOURCES
+ entry_schema:
+ type: string
+ onap.datatype.controlloop.Actor:
+ derived_from: tosca.datatypes.Root
+ description: An actor/operation/target definition
+ properties:
+ actor:
+ type: string
+ description: The actor performing the operation.
+ required: true
+ metadata:
+ clamp_possible_values: Dictionary:DefaultActors,ClampExecution:CDS/actor
+ operation:
+ type: string
+ description: The operation the actor is performing.
+ metadata:
+ clamp_possible_values: Dictionary:DefaultOperations,ClampExecution:CDS/operation
+ required: true
+ target:
+ type: onap.datatype.controlloop.Target
+ description: The resource the operation should be performed on.
+ required: true
+ payload:
+ type: map
+ description: Name/value pairs of payload information passed by Policy to the actor
+ required: false
+ metadata:
+ clamp_possible_values: ClampExecution:CDS/payload
+ entry_schema:
+ type: string
+ onap.datatype.controlloop.Operation:
+ derived_from: tosca.datatypes.Root
+ description: An operation supported by an actor
+ properties:
+ id:
+ type: string
+ description: Unique identifier for the operation
+ required: true
+ description:
+ type: string
+ description: A user-friendly description of the intent for the operation
+ required: false
+ operation:
+ type: onap.datatype.controlloop.Actor
+ description: The definition of the operation to be performed.
+ required: true
+ timeout:
+ type: integer
+ description: The amount of time for the actor to perform the operation.
+ required: true
+ retries:
+ type: integer
+ description: The number of retries the actor should attempt to perform the operation.
+ required: true
+ default: 0
+ success:
+ type: string
+ description: Points to the operation to invoke on success. A value of "final_success" indicates and end to the operation.
+ required: false
+ default: final_success
+ failure:
+ type: string
+ description: Points to the operation to invoke on Actor operation failure.
+ required: false
+ default: final_failure
+ failure_timeout:
+ type: string
+ description: Points to the operation to invoke when the time out for the operation occurs.
+ required: false
+ default: final_failure_timeout
+ failure_retries:
+ type: string
+ description: Points to the operation to invoke when the current operation has exceeded its max retries.
+ required: false
+ default: final_failure_retries
+ failure_exception:
+ type: string
+ description: Points to the operation to invoke when the current operation causes an exception.
+ required: false
+ default: final_failure_exception
+ failure_guard:
+ type: string
+ description: Points to the operation to invoke when the current operation is blocked due to guard policy enforcement.
+ required: false
+ default: final_failure_guard
+ onap.datatypes.monitoring.managedObjectDNsBasic:
+ constraints: []
+ properties:
+ DN:
+ name: DN
+ type: string
+ typeVersion: 0.0.0
+ description: Managed object distinguished name
+ required: true
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.managedObjectDNsBasic
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.managedObjectDNsBasics:
+ constraints: []
+ properties:
+ managedObjectDNsBasic:
+ name: managedObjectDNsBasic
+ type: map
+ typeVersion: 0.0.0
+ description: Managed object distinguished name object
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.managedObjectDNsBasic
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.managedObjectDNsBasics
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.measurementGroup:
+ constraints: []
+ properties:
+ measurementTypes:
+ name: measurementTypes
+ type: list
+ typeVersion: 0.0.0
+ description: List of measurement types
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.measurementTypes
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ managedObjectDNsBasic:
+ name: managedObjectDNsBasic
+ type: list
+ typeVersion: 0.0.0
+ description: List of managed object distinguished names
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.managedObjectDNsBasics
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.measurementGroup
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.measurementGroups:
+ constraints: []
+ properties:
+ measurementGroup:
+ name: measurementGroup
+ type: map
+ typeVersion: 0.0.0
+ description: Measurement Group
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.measurementGroup
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.measurementGroups
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.measurementType:
+ constraints: []
+ properties:
+ measurementType:
+ name: measurementType
+ type: string
+ typeVersion: 0.0.0
+ description: Measurement type
+ required: true
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.measurementType
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.measurementTypes:
+ constraints: []
+ properties:
+ measurementType:
+ name: measurementType
+ type: map
+ typeVersion: 0.0.0
+ description: Measurement type object
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.measurementType
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.measurementTypes
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.nfFilter:
+ constraints: []
+ properties:
+ modelNames:
+ name: modelNames
+ type: list
+ typeVersion: 0.0.0
+ description: List of model names
+ required: true
+ constraints: []
+ entry_schema:
+ type: string
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ modelInvariantIDs:
+ name: modelInvariantIDs
+ type: list
+ typeVersion: 0.0.0
+ description: List of model invariant IDs
+ required: true
+ constraints: []
+ entry_schema:
+ type: string
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ modelVersionIDs:
+ name: modelVersionIDs
+ type: list
+ typeVersion: 0.0.0
+ description: List of model version IDs
+ required: true
+ constraints: []
+ entry_schema:
+ type: string
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ nfNames:
+ name: nfNames
+ type: list
+ typeVersion: 0.0.0
+ description: List of network functions
+ required: true
+ constraints: []
+ entry_schema:
+ type: string
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.nfFilter
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ onap.datatypes.monitoring.subscription:
+ constraints: []
+ properties:
+ measurementGroups:
+ name: measurementGroups
+ type: list
+ typeVersion: 0.0.0
+ description: Measurement Groups
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.measurementGroups
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ fileBasedGP:
+ name: fileBasedGP
+ type: integer
+ typeVersion: 0.0.0
+ description: File based granularity period
+ required: true
+ constraints: []
+ metadata: {}
+ fileLocation:
+ name: fileLocation
+ type: string
+ typeVersion: 0.0.0
+ description: ROP file location
+ required: true
+ constraints: []
+ metadata: {}
+ subscriptionName:
+ name: subscriptionName
+ type: string
+ typeVersion: 0.0.0
+ description: Name of the subscription
+ required: true
+ constraints: []
+ metadata: {}
+ administrativeState:
+ name: administrativeState
+ type: string
+ typeVersion: 0.0.0
+ description: State of the subscription
+ required: true
+ constraints:
+ - valid_values:
+ - LOCKED
+ - UNLOCKED
+ metadata: {}
+ nfFilter:
+ name: nfFilter
+ type: map
+ typeVersion: 0.0.0
+ description: Network function filter
+ required: true
+ constraints: []
+ entry_schema:
+ type: onap.datatypes.monitoring.nfFilter
+ typeVersion: 0.0.0
+ constraints: []
+ metadata: {}
+ name: onap.datatypes.monitoring.subscription
+ version: 0.0.0
+ derived_from: tosca.datatypes.Root
+ metadata: {}
+ org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.RestRequest:
+ version: 1.0.0
+ derived_from: tosca.datatypes.Root
+ properties:
+ restRequestId:
+ type: onap.datatypes.ToscaConceptIdentifier
+ typeVersion: 1.0.0
+ required: true
+ description: The name and version of a REST request to be sent to a REST endpoint
+ httpMethod:
+ type: string
+ required: true
+ constraints:
+ - valid_values: [POST, PUT, GET, DELETE]
+ description: The REST method to use
+ path:
+ type: string
+ required: true
+ description: The path of the REST request relative to the base URL
+ body:
+ type: string
+ required: false
+ description: The body of the REST request for PUT and POST requests
+ expectedResponse:
+ type: integer
+ required: true
+ constraints: []
+ description: THe expected HTTP status code for the REST request
+ org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.ConfigurationEntity:
+ version: 1.0.0
+ derived_from: tosca.datatypes.Root
+ properties:
+ configurationEntityId:
+ type: onap.datatypes.ToscaConceptIdentifier
+ typeVersion: 1.0.0
+ required: true
+ description: The name and version of a Configuration Entity to be handled by the HTTP Control Loop Element
+ restSequence:
+ type: list
+ entry_schema:
+ type: org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.RestRequest
+ typeVersion: 1.0.0
+ description: A sequence of REST commands to send to the REST endpoint
+policy_types:
+ onap.policies.Monitoring:
+ derived_from: tosca.policies.Root
+ description: a base policy type for all policies that govern monitoring provisioning
+ version: 1.0.0
+ name: onap.policies.Monitoring
+ onap.policies.Sirisha:
+ derived_from: tosca.policies.Root
+ description: a base policy type for all policies that govern monitoring provisioning
+ version: 1.0.0
+ name: onap.policies.Sirisha
+ onap.policies.monitoring.dcae-pm-subscription-handler:
+ properties:
+ pmsh_policy:
+ name: pmsh_policy
+ type: onap.datatypes.monitoring.subscription
+ typeVersion: 0.0.0
+ description: PMSH Policy JSON
+ required: false
+ constraints: []
+ metadata: {}
+ name: onap.policies.monitoring.dcae-pm-subscription-handler
+ version: 1.0.0
+ derived_from: onap.policies.Monitoring
+ metadata: {}
+ onap.policies.controlloop.operational.Common:
+ derived_from: tosca.policies.Root
+ version: 1.0.0
+ name: onap.policies.controlloop.operational.Common
+ description: |
+ Operational Policy for Control Loop execution. Originated in Frankfurt to support TOSCA Compliant
+ Policy Types. This does NOT support the legacy Policy YAML policy type.
+ properties:
+ id:
+ type: string
+ description: The unique control loop id.
+ required: true
+ timeout:
+ type: integer
+ description: |
+ Overall timeout for executing all the operations. This timeout should equal or exceed the total
+ timeout for each operation listed.
+ required: true
+ abatement:
+ type: boolean
+ description: Whether an abatement event message will be expected for the control loop from DCAE.
+ required: true
+ default: false
+ trigger:
+ type: string
+ description: Initial operation to execute upon receiving an Onset event message for the Control Loop.
+ required: true
+ operations:
+ type: list
+ description: List of operations to be performed when Control Loop is triggered.
+ required: true
+ entry_schema:
+ type: onap.datatype.controlloop.Operation
+ onap.policies.controlloop.operational.common.Apex:
+ derived_from: onap.policies.controlloop.operational.Common
+ type_version: 1.0.0
+ version: 1.0.0
+ name: onap.policies.controlloop.operational.common.Apex
+ description: Operational policies for Apex PDP
+ properties:
+ engineServiceParameters:
+ type: string
+ description: The engine parameters like name, instanceCount, policy implementation, parameters etc.
+ required: true
+ eventInputParameters:
+ type: string
+ description: The event input parameters.
+ required: true
+ eventOutputParameters:
+ type: string
+ description: The event output parameters.
+ required: true
+ javaProperties:
+ type: string
+ description: Name/value pairs of properties to be set for APEX if needed.
+ required: false
+node_types:
+ org.onap.policy.clamp.controlloop.Participant:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ requred: false
+ org.onap.policy.clamp.controlloop.ControlLoopElement:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ required: false
+ metadata:
+ common: true
+ description: Specifies the organization that provides the control loop element
+ participant_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: true
+ metadata:
+ common: true
+ participantType:
+ type: onap.datatypes.ToscaConceptIdentifier
+ required: true
+ metadata:
+ common: true
+ description: The identity of the participant type that hosts this type of Control Loop Element
+ startPhase:
+ type: integer
+ required: false
+ constraints:
+ - greater_or_equal: 0
+ metadata:
+ common: true
+ description: A value indicating the start phase in which this control loop element will be started, the
+ first start phase is zero. Control Loop Elements are started in their start_phase order and stopped
+ in reverse start phase order. Control Loop Elements with the same start phase are started and
+ stopped simultaneously
+ uninitializedToPassiveTimeout:
+ 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 uninitialized to passive
+ 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.controlloop.ControlLoop:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ required: false
+ metadata:
+ common: true
+ description: Specifies the organization that provides the control loop element
+ elements:
+ type: list
+ required: true
+ metadata:
+ common: true
+ entry_schema:
+ type: onap.datatypes.ToscaConceptIdentifier
+ description: Specifies a list of control loop element definitions that make up this control loop definition
+ org.onap.policy.clamp.controlloop.PolicyControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ properties:
+ policy_type_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: true
+ policy_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: false
+ org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
+ properties:
+ policy_type_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: true
+ policy_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: false
+ org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement
+ properties:
+ policy_type_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: true
+ policy_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: false
+ org.onap.policy.clamp.controlloop.CDSControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ properties:
+ cds_blueprint_id:
+ type: onap.datatypes.ToscaConceptIdentifier
+ requred: true
+ org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ properties:
+ chart:
+ type: string
+ required: true
+ configs:
+ type: list
+ required: false
+ requirements:
+ type: string
+ requred: false
+ templates:
+ type: list
+ required: false
+ entry_schema:
+ values:
+ type: string
+ requred: true
+ org.onap.policy.clamp.controlloop.HttpControlLoopElement:
+ version: 1.0.1
+ derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ properties:
+ baseUrl:
+ type: string
+ required: true
+ description: The base URL to be prepended to each path, identifies the host for the REST endpoints.
+ httpHeaders:
+ type: map
+ required: false
+ entry_schema:
+ type: string
+ description: HTTP headers to send on REST requests
+ configurationEntities:
+ type: map
+ required: true
+ entry_schema:
+ type: org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.ConfigurationEntity
+ typeVersion: 1.0.0
+ description: The connfiguration entities the Control Loop Element is managing and their associated REST requests
+
+topology_template:
+ inputs:
+ pmsh_monitoring_policy:
+ type: onap.datatypes.ToscaConceptIdentifier
+ description: The ID of the PMSH monitoring policy to use
+ default:
+ name: MICROSERVICE_vLoadBalancerMS_v1_0_dcae-pm-subscription-handler_1_0_0test
+ version: 1.0.0
+ pmsh_operational_policy:
+ type: onap.datatypes.ToscaConceptIdentifier
+ description: The ID of the PMSH operational policy to use
+ default:
+ name: operational.apex.pmcontrol
+ version: 1.0.0
+ node_templates:
+ org.onap.policy.controlloop.PolicyControlLoopParticipant:
+ version: 2.3.1
+ type: org.onap.policy.clamp.controlloop.Participant
+ type_version: 1.0.1
+ description: Participant for DCAE microservices
+ properties:
+ provider: ONAP
+ org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the monitoring policy for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participant_id:
+ name: org.onap.PM_Policy
+ version: 1.0.0
+ participantType:
+ name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+ version: 2.3.1
+ policy_type_id:
+ name: onap.policies.monitoring.pm-subscription-handler
+ version: 1.0.0
+ policy_id:
+ get_input: pmsh_monitoring_policy
+ org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the operational policy for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participant_id:
+ name: org.onap.PM_Policy
+ version: 1.0.0
+ participantType:
+ name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+ version: 2.3.1
+ policy_type_id:
+ name: onap.policies.operational.pm-subscription-handler
+ version: 1.0.0
+ policy_id:
+ get_input: pmsh_operational_policy
+ org.onap.domain.pmsh.DerivedPolicyControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement
+ type_version: 1.0.0
+ description: Control loop for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participantType:
+ name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+ version: 2.3.1
+ participant_id:
+ name: org.onap.PM_Policy
+ version: 1.0.0
+ org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement
+ type_version: 1.0.0
+ description: Control loop for Performance Management Subscription Handling
+ properties:
+ provider: Ericsson
+ participantType:
+ name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+ version: 2.3.1
+ participant_id:
+ name: org.onap.PM_Policy
+ version: 1.0.0
+ org.onap.k8s.controlloop.K8SControlLoopParticipant:
+ version: 2.3.4
+ type: org.onap.policy.clamp.controlloop.Participant
+ type_version: 1.0.1
+ description: Participant for K8S
+ properties:
+ provider: ONAP
+ org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement:
+ # Chart from new repository
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the K8S microservice for PMSH
+ properties:
+ provider: ONAP
+ participant_id:
+ name: K8sParticipant0
+ version: 1.0.0
+ participantType:
+ name: org.onap.k8s.controlloop.K8SControlLoopParticipant
+ version: 2.3.4
+ chart:
+ chartId:
+ name: dcae-pmsh
+ version: 8.0.0
+ namespace: onap
+ releaseName: pmshms
+ repository:
+ repoName: chartmuseum
+ protocol: http
+ address: 10.152.183.120
+ port: 80
+ userName: onapinitializer
+ password: demo123456!
+ overrideParams:
+ global.masterPassword: test
+
+ org.onap.domain.database.Local_K8SMicroserviceControlLoopElement:
+ # Chart installation without passing repository info
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement
+ type_version: 1.0.0
+ description: Control loop element for the K8S microservice for local chart
+ properties:
+ provider: ONAP
+ participant_id:
+ name: K8sParticipant0
+ version: 1.0.0
+ participantType:
+ name: org.onap.k8s.controlloop.K8SControlLoopParticipant
+ version: 2.3.4
+ chart:
+ chartId:
+ name: nginx-ingress
+ version: 0.9.1
+ releaseName: nginxms
+ namespace: test
+ org.onap.controlloop.HttpControlLoopParticipant:
+ version: 2.3.4
+ type: org.onap.policy.clamp.controlloop.Participant
+ type_version: 1.0.1
+ description: Participant for Http requests
+ properties:
+ provider: ONAP
+ org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement:
+ # Consul http config for PMSH.
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.HttpControlLoopElement
+ type_version: 1.0.1
+ description: Control loop element for the http requests of PMSH microservice
+ properties:
+ provider: ONAP
+ participant_id:
+ name: HttpParticipant0
+ version: 1.0.0
+ participantType:
+ name: org.onap.k8s.controlloop.HttpControlLoopParticipant
+ version: 2.3.4
+ uninitializedToPassiveTimeout: 180
+ startPhase: 1
+ baseUrl: http://10.152.183.51:8500
+ httpHeaders:
+ Content-Type: application/json
+ configurationEntities:
+ - configurationEntityId:
+ name: entity1
+ version: 1.0.1
+ restSequence:
+ - restRequestId:
+ name: request1
+ version: 1.0.1
+ httpMethod: PUT
+ path: v1/kv/dcae-pmsh2
+ body: '{
+ "control_loop_name":"pmsh-control-loop",
+ "operational_policy_name":"pmsh-operational-policy",
+ "aaf_password":"demo123456!",
+ "aaf_identity":"dcae@dcae.onap.org",
+ "cert_path":"/opt/app/pmsh/etc/certs/cert.pem",
+ "key_path":"/opt/app/pmsh/etc/certs/key.pem",
+ "ca_cert_path":"/opt/app/pmsh/etc/certs/cacert.pem",
+ "enable_tls":"true",
+ "pmsh_policy":{
+ "subscription":{
+ "subscriptionName":"ExtraPM-All-gNB-R2B",
+ "administrativeState":"UNLOCKED",
+ "fileBasedGP":15,
+ "fileLocation":"\/pm\/pm.xml",
+ "nfFilter":{
+ "nfNames":[
+ "^pnf.*",
+ "^vnf.*"
+ ],
+ "modelInvariantIDs":[
+ ],
+ "modelVersionIDs":[
+ ],
+ "modelNames":[
+ ]
+ },
+ "measurementGroups":[
+ {
+ "measurementGroup":{
+ "measurementTypes":[
+ {
+ "measurementType":"countera"
+ },
+ {
+ "measurementType":"counterb"
+ }
+ ],
+ "managedObjectDNsBasic":[
+ {
+ "DN":"dna"
+ },
+ {
+ "DN":"dnb"
+ }
+ ]
+ }
+ },
+ {
+ "measurementGroup":{
+ "measurementTypes":[
+ {
+ "measurementType":"counterc"
+ },
+ {
+ "measurementType":"counterd"
+ }
+ ],
+ "managedObjectDNsBasic":[
+ {
+ "DN":"dnc"
+ },
+ {
+ "DN":"dnd"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ "streams_subscribes":{
+ "aai_subscriber":{
+ "type":"message_router",
+ "dmaap_info":{
+ "topic_url":"https://10.152.183.151:3905/events/AAI_EVENT",
+ "client_role":"org.onap.dcae.aaiSub",
+ "location":"san-francisco",
+ "client_id":"1575976809466"
+ }
+ },
+ "policy_pm_subscriber":{
+ "type":"message_router",
+ "dmaap_info":{
+ "topic_url":"https://10.152.183.151:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS",
+ "client_role":"org.onap.dcae.pmSubscriber",
+ "location":"san-francisco",
+ "client_id":"1575876809456"
+ }
+ }
+ },
+ "streams_publishes":{
+ "policy_pm_publisher":{
+ "type":"message_router",
+ "dmaap_info":{
+ "topic_url":"https://10.152.183.151:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS",
+ "client_role":"org.onap.dcae.pmPublisher",
+ "location":"san-francisco",
+ "client_id":"1475976809466"
+ }
+ },
+ "other_publisher":{
+ "type":"message_router",
+ "dmaap_info":{
+ "topic_url":"https://10.152.183.151:3905/events/org.onap.dmaap.mr.SOME_OTHER_TOPIC",
+ "client_role":"org.onap.dcae.pmControlPub",
+ "location":"san-francisco",
+ "client_id":"1875976809466"
+ }
+ }
+ }
+ }'
+ expectedResponse: 200
+ org.onap.domain.sample.GenericK8s_ControlLoopDefinition:
+ version: 1.2.3
+ type: org.onap.policy.clamp.controlloop.ControlLoop
+ type_version: 1.0.0
+ description: Control loop for Hello World
+ properties:
+ provider: ONAP
+ elements:
+ - name: org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.database.Local_K8SMicroserviceControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.DerivedPolicyControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement
+ version: 1.2.3
+ - name: org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement
+ version: 1.2.3
diff --git a/packages/policy-clamp-docker/src/main/docker/ClRuntimeDockerfile b/packages/policy-clamp-docker/src/main/docker/ClRuntimeDockerfile
index 1b9cb251a..9167b226a 100644
--- a/packages/policy-clamp-docker/src/main/docker/ClRuntimeDockerfile
+++ b/packages/policy-clamp-docker/src/main/docker/ClRuntimeDockerfile
@@ -21,7 +21,7 @@
#
# Docker file to build an image that runs CLAMP on Java 11 or better in alpine
#
-FROM onap/policy-jre-alpine:2.3.0
+FROM onap/policy-jre-alpine:2.3.1
LABEL maintainer="Policy Team"
diff --git a/packages/policy-clamp-docker/src/main/docker/HttpParticipantDockerfile b/packages/policy-clamp-docker/src/main/docker/HttpParticipantDockerfile
index fe14f7d7c..88bf34579 100644
--- a/packages/policy-clamp-docker/src/main/docker/HttpParticipantDockerfile
+++ b/packages/policy-clamp-docker/src/main/docker/HttpParticipantDockerfile
@@ -22,7 +22,7 @@
# Docker file to build an image that runs CLAMP on Java 11 or better in alpine
#
-FROM onap/policy-jre-alpine:2.3.0
+FROM onap/policy-jre-alpine:2.3.1
LABEL maintainer="Policy Team"
diff --git a/packages/policy-clamp-docker/src/main/docker/KubernetesParticipantDockerfile b/packages/policy-clamp-docker/src/main/docker/KubernetesParticipantDockerfile
index 26fb66f22..e107b45af 100644
--- a/packages/policy-clamp-docker/src/main/docker/KubernetesParticipantDockerfile
+++ b/packages/policy-clamp-docker/src/main/docker/KubernetesParticipantDockerfile
@@ -21,7 +21,7 @@
#
# Docker file to build an image that runs CLAMP on Java 11 or better in alpine
#
-FROM onap/policy-jre-alpine:2.3.0
+FROM onap/policy-jre-alpine:2.3.1
LABEL maintainer="Policy Team"
diff --git a/packages/policy-clamp-docker/src/main/docker/PolicyParticipantDockerfile b/packages/policy-clamp-docker/src/main/docker/PolicyParticipantDockerfile
index 916ec2328..08a731c0c 100644
--- a/packages/policy-clamp-docker/src/main/docker/PolicyParticipantDockerfile
+++ b/packages/policy-clamp-docker/src/main/docker/PolicyParticipantDockerfile
@@ -21,7 +21,7 @@
#
# Docker file to build an image that runs CLAMP on Java 11 or better in alpine
#
-FROM onap/policy-jre-alpine:2.3.0
+FROM onap/policy-jre-alpine:2.3.1
LABEL maintainer="Policy Team"
diff --git a/pom.xml b/pom.xml
index 020f708f3..f2ac7915e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.onap.policy.parent</groupId>
<artifactId>integration</artifactId>
- <version>3.4.2</version>
+ <version>3.4.3</version>
</parent>
<groupId>org.onap.policy.clamp</groupId>
@@ -37,7 +37,7 @@
This is the root Maven module for the policy-clamp project.
It contains the following modules:
- - policy-clamp-common: Common code for all CLAMP modules
+ - policy-clamp-common: Common code for all Policy/CLAMP modules
- policy-clamp-models: POJOs and other model code for REST and DMaaP messages and for persistence
- policy-clamp-runtime: The runtime server for CLAMP
- policy-clamp-participant: Modules for CLAMP control loop participants
@@ -50,8 +50,8 @@
</description>
<properties>
- <policy.common.version>1.9.0</policy.common.version>
- <policy.models.version>2.5.0</policy.models.version>
+ <policy.common.version>1.9.1</policy.common.version>
+ <policy.models.version>2.5.1</policy.models.version>
</properties>
<modules>
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProvider.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProvider.java
index d2d57ed83..d055ba266 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProvider.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProvider.java
@@ -37,17 +37,16 @@ import org.apache.commons.collections4.MapUtils;
import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant;
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ControlLoopProvider;
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ParticipantProvider;
+import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ServiceTemplateProvider;
import org.onap.policy.clamp.controlloop.models.messages.rest.commissioning.CommissioningResponse;
import org.onap.policy.clamp.controlloop.runtime.supervision.SupervisionHandler;
import org.onap.policy.models.base.PfModelException;
-import org.onap.policy.models.provider.PolicyModelsProvider;
import org.onap.policy.models.tosca.authorative.concepts.ToscaCapabilityType;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaDataType;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeType;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty;
import org.onap.policy.models.tosca.authorative.concepts.ToscaRelationshipType;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplates;
@@ -64,7 +63,7 @@ public class CommissioningProvider {
public static final String CONTROL_LOOP_NODE_TYPE = "org.onap.policy.clamp.controlloop.ControlLoop";
private static final String INSTANCE_TEXT = "_Instance";
- private final PolicyModelsProvider modelsProvider;
+ private final ServiceTemplateProvider serviceTemplateProvider;
private final ControlLoopProvider clProvider;
private final ObjectMapper mapper = new ObjectMapper();
private final ParticipantProvider participantProvider;
@@ -75,14 +74,14 @@ public class CommissioningProvider {
/**
* Create a commissioning provider.
*
- * @param modelsProvider the PolicyModelsProvider
- * @param clProvider the ControlLoopProvider
+ * @param serviceTemplateProvider the ServiceTemplate Provider
+ * @param clProvider the ControlLoop Provider
+ * @param supervisionHandler the Supervision Handler
+ * @param participantProvider the Participant Provider
*/
- public CommissioningProvider(PolicyModelsProvider modelsProvider,
- ControlLoopProvider clProvider,
- SupervisionHandler supervisionHandler,
- ParticipantProvider participantProvider) {
- this.modelsProvider = modelsProvider;
+ public CommissioningProvider(ServiceTemplateProvider serviceTemplateProvider, ControlLoopProvider clProvider,
+ SupervisionHandler supervisionHandler, ParticipantProvider participantProvider) {
+ this.serviceTemplateProvider = serviceTemplateProvider;
this.clProvider = clProvider;
this.supervisionHandler = supervisionHandler;
this.participantProvider = participantProvider;
@@ -97,22 +96,17 @@ public class CommissioningProvider {
* @throws PfModelException on creation errors
*/
public CommissioningResponse createControlLoopDefinitions(ToscaServiceTemplate serviceTemplate)
- throws PfModelException {
+ throws PfModelException {
if (verifyIfInstancePropertiesExists()) {
- throw new PfModelException(Status.BAD_REQUEST,
- "Delete instances, to commission control loop definitions");
+ throw new PfModelException(Status.BAD_REQUEST, "Delete instances, to commission control loop definitions");
}
synchronized (lockit) {
- modelsProvider.createServiceTemplate(serviceTemplate);
- List<Participant> participantList =
- participantProvider.getParticipants(null, null);
+ serviceTemplateProvider.createServiceTemplate(serviceTemplate);
+ List<Participant> participantList = participantProvider.getParticipants(null, null);
if (!participantList.isEmpty()) {
- this.supervisionHandler.handleSendCommissionMessage(
- getCommonOrInstancePropertiesFromNodeTypes(true,
- serviceTemplate.getName(),
- serviceTemplate.getVersion()));
+ supervisionHandler.handleSendCommissionMessage(serviceTemplate.getName(), serviceTemplate.getVersion());
}
}
@@ -136,22 +130,18 @@ public class CommissioningProvider {
* @return the result of the deletion
* @throws PfModelException on deletion errors
*/
- public CommissioningResponse deleteControlLoopDefinition(String name, String version)
- throws PfModelException {
+ public CommissioningResponse deleteControlLoopDefinition(String name, String version) throws PfModelException {
if (verifyIfInstancePropertiesExists()) {
- throw new PfModelException(Status.BAD_REQUEST,
- "Delete instances, to commission control loop definitions");
+ throw new PfModelException(Status.BAD_REQUEST, "Delete instances, to commission control loop definitions");
}
synchronized (lockit) {
- List<Participant> participantList =
- participantProvider.getParticipants(null,
- null);
+ List<Participant> participantList = participantProvider.getParticipants(null, null);
if (!participantList.isEmpty()) {
- this.supervisionHandler.handleSendDeCommissionMessage();
+ supervisionHandler.handleSendDeCommissionMessage();
}
- modelsProvider.deleteServiceTemplate(name, version);
+ serviceTemplateProvider.deleteServiceTemplate(name, version);
}
var response = new CommissioningResponse();
@@ -224,143 +214,6 @@ public class CommissioningProvider {
}
/**
- * Get the initial node types with common or instance properties.
- *
- * @param fullNodeTypes map of all the node types in the specified template
- * @param common boolean to indicate whether common or instance properties are required
- * @return node types map that only has common properties
- * @throws PfModelException on errors getting node type with common properties
- */
- private Map<String, ToscaNodeType> getInitialNodeTypesMap(Map<String, ToscaNodeType> fullNodeTypes,
- boolean common) {
-
- var tempNodeTypesMap = new HashMap<String, ToscaNodeType>();
-
- fullNodeTypes.forEach((key, nodeType) -> {
- var tempToscaNodeType = new ToscaNodeType();
- tempToscaNodeType.setName(key);
-
- var resultantPropertyMap = findCommonOrInstancePropsInNodeTypes(nodeType, common);
-
- if (!resultantPropertyMap.isEmpty()) {
- tempToscaNodeType.setProperties(resultantPropertyMap);
- tempNodeTypesMap.put(key, tempToscaNodeType);
- }
- });
- return tempNodeTypesMap;
- }
-
- private Map<String, ToscaProperty> findCommonOrInstancePropsInNodeTypes(ToscaNodeType nodeType, boolean common) {
-
- var tempCommonPropertyMap = new HashMap<String, ToscaProperty>();
- var tempInstancePropertyMap = new HashMap<String, ToscaProperty>();
-
- nodeType.getProperties().forEach((propKey, prop) -> {
-
- if (prop.getMetadata() != null) {
- prop.getMetadata().forEach((k, v) -> {
- if (k.equals("common") && v.equals("true") && common) {
- tempCommonPropertyMap.put(propKey, prop);
- } else if (k.equals("common") && v.equals("false") && !common) {
- tempInstancePropertyMap.put(propKey, prop);
- }
-
- });
- } else {
- tempInstancePropertyMap.put(propKey, prop);
- }
- });
-
- if (tempCommonPropertyMap.isEmpty() && !common) {
- return tempInstancePropertyMap;
- } else {
- return tempCommonPropertyMap;
- }
- }
-
- /**
- * Get the node types derived from those that have common properties.
- *
- * @param initialNodeTypes map of all the node types in the specified template
- * @param filteredNodeTypes map of all the node types that have common or instance properties
- * @return all node types that have common properties including their children
- * @throws PfModelException on errors getting node type with common properties
- */
- private Map<String, ToscaNodeType> getFinalNodeTypesMap(Map<String, ToscaNodeType> initialNodeTypes,
- Map<String, ToscaNodeType> filteredNodeTypes) {
- for (var i = 0; i < initialNodeTypes.size(); i++) {
- initialNodeTypes.forEach((key, nodeType) -> {
- var tempToscaNodeType = new ToscaNodeType();
- tempToscaNodeType.setName(key);
-
- if (filteredNodeTypes.get(nodeType.getDerivedFrom()) != null) {
- tempToscaNodeType.setName(key);
-
- var finalProps = new HashMap<String, ToscaProperty>(
- filteredNodeTypes.get(nodeType.getDerivedFrom()).getProperties());
-
- tempToscaNodeType.setProperties(finalProps);
- } else {
- return;
- }
- filteredNodeTypes.putIfAbsent(key, tempToscaNodeType);
-
- });
- }
- return filteredNodeTypes;
- }
-
- /**
- * Get the requested node types with common or instance properties.
- *
- * @param common boolean indicating common or instance properties
- * @param name the name of the definition to get, null for all definitions
- * @param version the version of the definition to get, null for all definitions
- * @return the node types with common or instance properties
- * @throws PfModelException on errors getting node type properties
- */
- public Map<String, ToscaNodeType> getCommonOrInstancePropertiesFromNodeTypes(boolean common, String name,
- String version) throws PfModelException {
- var serviceTemplates = new ToscaServiceTemplates();
- serviceTemplates.setServiceTemplates(modelsProvider.getServiceTemplateList(name, version));
- var tempNodeTypesMap =
- this.getInitialNodeTypesMap(serviceTemplates.getServiceTemplates().get(0).getNodeTypes(), common);
-
- return this.getFinalNodeTypesMap(serviceTemplates.getServiceTemplates().get(0).getNodeTypes(),
- tempNodeTypesMap);
-
- }
-
- /**
- * Get node templates with appropriate common or instance properties added.
- *
- * @param initialNodeTemplates map of all the node templates in the specified template
- * @param nodeTypeProps map of all the node types that have common or instance properties including children
- * @return all node templates with appropriate common or instance properties added
- * @throws PfModelException on errors getting map of node templates with common or instance properties added
- */
- private Map<String, ToscaNodeTemplate> getDerivedCommonOrInstanceNodeTemplates(
- Map<String, ToscaNodeTemplate> initialNodeTemplates, Map<String, ToscaNodeType> nodeTypeProps) {
-
- var finalNodeTemplatesMap = new HashMap<String, ToscaNodeTemplate>();
-
- initialNodeTemplates.forEach((templateKey, template) -> {
- if (nodeTypeProps.containsKey(template.getType())) {
- var finalMergedProps = new HashMap<String, Object>();
-
- nodeTypeProps.get(template.getType()).getProperties().forEach(finalMergedProps::putIfAbsent);
-
- template.setProperties(finalMergedProps);
-
- finalNodeTemplatesMap.put(templateKey, template);
- } else {
- return;
- }
- });
- return finalNodeTemplatesMap;
- }
-
- /**
* Get node templates with common properties added.
*
* @param common boolean indicating common or instance properties to be used
@@ -374,17 +227,17 @@ public class CommissioningProvider {
if (common && verifyIfInstancePropertiesExists()) {
throw new PfModelException(Status.BAD_REQUEST,
- "Cannot create or edit common properties, delete all the instantiations first");
+ "Cannot create or edit common properties, delete all the instantiations first");
}
+ var serviceTemplateList = serviceTemplateProvider.getServiceTemplateList(name, version);
var commonOrInstanceNodeTypeProps =
- this.getCommonOrInstancePropertiesFromNodeTypes(common, name, version);
+ serviceTemplateProvider.getCommonOrInstancePropertiesFromNodeTypes(common, serviceTemplateList.get(0));
var serviceTemplates = new ToscaServiceTemplates();
- serviceTemplates.setServiceTemplates(filterToscaNodeTemplateInstance(
- modelsProvider.getServiceTemplateList(name, version)));
+ serviceTemplates.setServiceTemplates(filterToscaNodeTemplateInstance(serviceTemplateList));
- return this.getDerivedCommonOrInstanceNodeTemplates(
+ return serviceTemplateProvider.getDerivedCommonOrInstanceNodeTemplates(
serviceTemplates.getServiceTemplates().get(0).getToscaTopologyTemplate().getNodeTemplates(),
commonOrInstanceNodeTypeProps);
}
@@ -398,9 +251,7 @@ public class CommissioningProvider {
* @throws PfModelException on errors getting control loop definitions
*/
public ToscaServiceTemplate getToscaServiceTemplate(String name, String version) throws PfModelException {
- var serviceTemplates = new ToscaServiceTemplates();
- serviceTemplates.setServiceTemplates(modelsProvider.getServiceTemplateList(name, version));
- return serviceTemplates.getServiceTemplates().get(0);
+ return serviceTemplateProvider.getToscaServiceTemplate(name, version);
}
/**
@@ -414,11 +265,16 @@ public class CommissioningProvider {
public String getToscaServiceTemplateReduced(String name, String version)
throws PfModelException {
- var serviceTemplates = new ToscaServiceTemplates();
- serviceTemplates.setServiceTemplates(modelsProvider.getServiceTemplateList(name, version));
+ var serviceTemplateList = serviceTemplateProvider.getServiceTemplateList(name, version);
+
+ List<ToscaServiceTemplate> filteredServiceTemplateList = filterToscaNodeTemplateInstance(
+ serviceTemplateList);
+
+ if (filteredServiceTemplateList.isEmpty()) {
+ throw new PfModelException(Status.BAD_REQUEST, "Invalid Service Template");
+ }
- ToscaServiceTemplate fullTemplate = filterToscaNodeTemplateInstance(
- serviceTemplates.getServiceTemplates()).get(0);
+ ToscaServiceTemplate fullTemplate = filteredServiceTemplateList.get(0);
var template = new HashMap<String, Object>();
template.put("tosca_definitions_version", fullTemplate.getToscaDefinitionsVersion());
@@ -511,7 +367,7 @@ public class CommissioningProvider {
*/
private boolean verifyIfInstancePropertiesExists() {
return clProvider.getNodeTemplates(null, null).stream()
- .anyMatch(nodeTemplate -> nodeTemplate.getKey().getName().contains(INSTANCE_TEXT));
+ .anyMatch(nodeTemplate -> nodeTemplate.getKey().getName().contains(INSTANCE_TEXT));
}
}
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionAspect.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionAspect.java
index fbb2742a7..d975ec6bc 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionAspect.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionAspect.java
@@ -28,6 +28,7 @@ import java.util.concurrent.TimeUnit;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.aspectj.lang.annotation.After;
+import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantRegister;
@@ -74,10 +75,21 @@ public class SupervisionAspect implements Closeable {
executor.execute(() -> supervisionScanner.handleParticipantStatus(participantStatusMessage.getParticipantId()));
}
- @Before("@annotation(MessageIntercept) && args(participantRegisterMessage,..)")
- public void handleParticipantRegister(ParticipantRegister participantRegisterMessage) {
- executor.execute(() -> supervisionScanner.handleParticipantRegister(new ImmutablePair<>(
- participantRegisterMessage.getParticipantId(), participantRegisterMessage.getParticipantType())));
+ /**
+ * Intercepts participant Register Message
+ * if there is a Commissioning starts an execution of handleParticipantRegister.
+ *
+ * @param participantRegisterMessage the ParticipantRegister message
+ * @param isCommissioning is Commissioning
+ */
+ @AfterReturning(
+ value = "@annotation(MessageIntercept) && args(participantRegisterMessage,..)",
+ returning = "isCommissioning")
+ public void handleParticipantRegister(ParticipantRegister participantRegisterMessage, boolean isCommissioning) {
+ if (isCommissioning) {
+ executor.execute(() -> supervisionScanner.handleParticipantRegister(new ImmutablePair<>(
+ participantRegisterMessage.getParticipantId(), participantRegisterMessage.getParticipantType())));
+ }
}
@Before("@annotation(MessageIntercept) && args(participantUpdateAckMessage,..)")
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java
index a031cfaf6..960cb4304 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java
@@ -21,7 +21,6 @@
package org.onap.policy.clamp.controlloop.runtime.supervision;
-import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -53,7 +52,6 @@ import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantReg
import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantUpdatePublisher;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -144,15 +142,21 @@ public class SupervisionHandler {
*
* @param participantRegisterMessage the ParticipantRegister message received from a participant
*/
- public void handleParticipantMessage(ParticipantRegister participantRegisterMessage) {
+ @MessageIntercept
+ public boolean handleParticipantMessage(ParticipantRegister participantRegisterMessage) {
LOGGER.debug("Participant Register received {}", participantRegisterMessage);
try {
checkParticipant(participantRegisterMessage, ParticipantState.UNKNOWN, ParticipantHealthStatus.UNKNOWN);
} catch (PfModelException | ControlLoopException svExc) {
LOGGER.warn("error saving participant {}", participantRegisterMessage.getParticipantId(), svExc);
}
+
+ var isCommissioning = participantUpdatePublisher.sendCommissioning(null, null,
+ participantRegisterMessage.getParticipantId(), participantRegisterMessage.getParticipantType());
+
participantRegisterAckPublisher.send(participantRegisterMessage.getMessageId(),
participantRegisterMessage.getParticipantId(), participantRegisterMessage.getParticipantType());
+ return isCommissioning;
}
/**
@@ -213,10 +217,13 @@ public class SupervisionHandler {
/**
* Send commissioning update message to dmaap.
*
+ * @param name the ToscaServiceTemplate name
+ * @param version the ToscaServiceTemplate version
*/
- public void handleSendCommissionMessage(Map<String, ToscaNodeType> commonPropertiesMap) {
- LOGGER.debug("Participant update message being sent {}");
- participantUpdatePublisher.send(commonPropertiesMap, true);
+ public void handleSendCommissionMessage(String name, String version) {
+ LOGGER.debug("Participant update message with serviveTemplate {} {} being sent to all participants", name,
+ version);
+ participantUpdatePublisher.sendComissioningBroadcast(name, version);
}
/**
@@ -225,7 +232,7 @@ public class SupervisionHandler {
*/
public void handleSendDeCommissionMessage() {
LOGGER.debug("Participant update message being sent");
- participantUpdatePublisher.send(Collections.emptyMap(), false);
+ participantUpdatePublisher.sendDecomisioning();
}
/**
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionScanner.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionScanner.java
index df7efbe9c..5147aa241 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionScanner.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionScanner.java
@@ -160,7 +160,7 @@ public class SupervisionScanner {
if (participantUpdateCounter.count(id)) {
LOGGER.debug("retry message ParticipantUpdate");
- participantUpdatePublisher.send(null, true);
+ participantUpdatePublisher.sendCommissioning(null, null, id.getLeft(), id.getRight());
} else {
LOGGER.debug("report Participant Update fault");
participantUpdateCounter.setFault(id);
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java
index 0f6cc7cbc..5d879dc56 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java
@@ -30,9 +30,9 @@ import lombok.AllArgsConstructor;
import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElementDefinition;
import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantDefinition;
import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantUtils;
+import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ServiceTemplateProvider;
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdate;
import org.onap.policy.models.base.PfModelException;
-import org.onap.policy.models.provider.PolicyModelsProvider;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeType;
@@ -50,49 +50,67 @@ public class ParticipantUpdatePublisher extends AbstractParticipantPublisher<Par
private static final Logger LOGGER = LoggerFactory.getLogger(ParticipantUpdatePublisher.class);
- private final PolicyModelsProvider modelsProvider;
+ private final ServiceTemplateProvider serviceTemplateProvider;
/**
- * Send ParticipantUpdate to Participant.
+ * Send ParticipantUpdate to all Participants.
*
+ * @param name the ToscaServiceTemplate name
+ * @param version the ToscaServiceTemplate version
*/
- public void send(Map<String, ToscaNodeType> commonPropertiesMap, boolean commissionFlag) {
+ public void sendComissioningBroadcast(String name, String version) {
+ sendCommissioning(name, version, null, null);
+ }
+
+ /**
+ * Send ParticipantUpdate to Participant
+ * if participantType and participantId are null then message is broadcast.
+ *
+ * @param name the ToscaServiceTemplate name
+ * @param version the ToscaServiceTemplate version
+ * @param participantType the ParticipantType
+ * @param participantId the ParticipantId
+ */
+ public boolean sendCommissioning(String name, String version, ToscaConceptIdentifier participantType,
+ ToscaConceptIdentifier participantId) {
var message = new ParticipantUpdate();
+ message.setParticipantType(participantType);
+ message.setParticipantId(participantId);
message.setTimestamp(Instant.now());
ToscaServiceTemplate toscaServiceTemplate = null;
+ Map<String, ToscaNodeType> commonPropertiesMap = null;
try {
- var list = modelsProvider.getServiceTemplateList(null, null);
+ var list = serviceTemplateProvider.getServiceTemplateList(name, version);
if (!list.isEmpty()) {
toscaServiceTemplate = list.get(0);
+ commonPropertiesMap =
+ serviceTemplateProvider.getCommonOrInstancePropertiesFromNodeTypes(true, toscaServiceTemplate);
+ } else {
+ LOGGER.warn("No tosca service template found, cannot send participantupdate {} {}", name, version);
+ return false;
}
} catch (PfModelException pfme) {
LOGGER.warn("Get of tosca service template failed, cannot send participantupdate", pfme);
- return;
+ return false;
}
List<ParticipantDefinition> participantDefinitionUpdates = new ArrayList<>();
- if (toscaServiceTemplate != null) {
- for (var toscaInputEntry : toscaServiceTemplate.getToscaTopologyTemplate().getNodeTemplates().entrySet()) {
- if (ParticipantUtils.checkIfNodeTemplateIsControlLoopElement(toscaInputEntry.getValue(),
- toscaServiceTemplate)) {
- var clParticipantType =
- ParticipantUtils.findParticipantType(toscaInputEntry.getValue().getProperties());
- prepareParticipantDefinitionUpdate(clParticipantType, toscaInputEntry.getKey(),
- toscaInputEntry.getValue(), participantDefinitionUpdates, commonPropertiesMap);
- }
+ for (var toscaInputEntry : toscaServiceTemplate.getToscaTopologyTemplate().getNodeTemplates().entrySet()) {
+ if (ParticipantUtils.checkIfNodeTemplateIsControlLoopElement(toscaInputEntry.getValue(),
+ toscaServiceTemplate)) {
+ var clParticipantType =
+ ParticipantUtils.findParticipantType(toscaInputEntry.getValue().getProperties());
+ prepareParticipantDefinitionUpdate(clParticipantType, toscaInputEntry.getKey(),
+ toscaInputEntry.getValue(), participantDefinitionUpdates, commonPropertiesMap);
}
}
- if (commissionFlag) {
- // Commission the controlloop but sending participantdefinitions to participants
- message.setParticipantDefinitionUpdates(participantDefinitionUpdates);
- } else {
- // DeCommission the controlloop but deleting participantdefinitions on participants
- message.setParticipantDefinitionUpdates(null);
- }
+ // Commission the controlloop but sending participantdefinitions to participants
+ message.setParticipantDefinitionUpdates(participantDefinitionUpdates);
LOGGER.debug("Participant Update sent {}", message);
super.send(message);
+ return true;
}
private void prepareParticipantDefinitionUpdate(ToscaConceptIdentifier clParticipantType, String entryKey,
@@ -136,4 +154,17 @@ public class ParticipantUpdatePublisher extends AbstractParticipantPublisher<Par
participantDefinition.setControlLoopElementDefinitionList(controlLoopElementDefinitionList);
return participantDefinition;
}
+
+ /**
+ * Send ParticipantUpdate to Participant after that commissioning has been removed.
+ */
+ public void sendDecomisioning() {
+ var message = new ParticipantUpdate();
+ message.setTimestamp(Instant.now());
+ // DeCommission the controlloop but deleting participantdefinitions on participants
+ message.setParticipantDefinitionUpdates(null);
+
+ LOGGER.debug("Participant Update sent {}", message);
+ super.send(message);
+ }
}
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProviderTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProviderTest.java
index b0ea00913..3fd74f22e 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProviderTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProviderTest.java
@@ -35,6 +35,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ControlLoopProvider;
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ParticipantProvider;
+import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ServiceTemplateProvider;
import org.onap.policy.clamp.controlloop.runtime.instantiation.InstantiationUtils;
import org.onap.policy.clamp.controlloop.runtime.main.parameters.ClRuntimeParameterGroup;
import org.onap.policy.clamp.controlloop.runtime.util.CommonTestData;
@@ -90,8 +91,8 @@ class CommissioningProviderTest {
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
participantProvider = new ParticipantProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
- CommissioningProvider provider =
- new CommissioningProvider(modelsProvider, clProvider, null, participantProvider);
+ CommissioningProvider provider = new CommissioningProvider(new ServiceTemplateProvider(modelsProvider),
+ clProvider, null, participantProvider);
ToscaServiceTemplate serviceTemplate = InstantiationUtils.getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML);
List<ToscaNodeTemplate> listOfTemplates = provider.getControlLoopDefinitions(null, null);
@@ -128,8 +129,8 @@ class CommissioningProviderTest {
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
participantProvider = new ParticipantProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
- CommissioningProvider provider =
- new CommissioningProvider(modelsProvider, clProvider, null, participantProvider);
+ CommissioningProvider provider = new CommissioningProvider(new ServiceTemplateProvider(modelsProvider),
+ clProvider, null, participantProvider);
// Test Service template is null
assertThatThrownBy(() -> provider.createControlLoopDefinitions(null)).hasMessageMatching(TEMPLATE_IS_NULL);
List<ToscaNodeTemplate> listOfTemplates = provider.getControlLoopDefinitions(null, null);
@@ -158,8 +159,8 @@ class CommissioningProviderTest {
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
participantProvider = new ParticipantProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
- CommissioningProvider provider =
- new CommissioningProvider(modelsProvider, clProvider, null, participantProvider);
+ CommissioningProvider provider = new CommissioningProvider(new ServiceTemplateProvider(modelsProvider),
+ clProvider, null, participantProvider);
ToscaServiceTemplate serviceTemplate =
InstantiationUtils.getToscaServiceTemplate(COMMON_TOSCA_SERVICE_TEMPLATE_YAML);
@@ -187,8 +188,8 @@ class CommissioningProviderTest {
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
participantProvider = new ParticipantProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
- CommissioningProvider provider =
- new CommissioningProvider(modelsProvider, clProvider, null, participantProvider);
+ CommissioningProvider provider = new CommissioningProvider(new ServiceTemplateProvider(modelsProvider),
+ clProvider, null, participantProvider);
ToscaServiceTemplate serviceTemplate =
InstantiationUtils.getToscaServiceTemplate(COMMON_TOSCA_SERVICE_TEMPLATE_YAML);
@@ -216,8 +217,8 @@ class CommissioningProviderTest {
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
participantProvider = new ParticipantProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
- CommissioningProvider provider =
- new CommissioningProvider(modelsProvider, clProvider, null, participantProvider);
+ CommissioningProvider provider = new CommissioningProvider(new ServiceTemplateProvider(modelsProvider),
+ clProvider, null, participantProvider);
ToscaServiceTemplate serviceTemplate =
InstantiationUtils.getToscaServiceTemplate(COMMON_TOSCA_SERVICE_TEMPLATE_YAML);
@@ -262,8 +263,8 @@ class CommissioningProviderTest {
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
participantProvider = new ParticipantProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
- CommissioningProvider provider =
- new CommissioningProvider(modelsProvider, clProvider, null, participantProvider);
+ CommissioningProvider provider = new CommissioningProvider(new ServiceTemplateProvider(modelsProvider),
+ clProvider, null, participantProvider);
ToscaServiceTemplate serviceTemplate = InstantiationUtils.getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML);
List<ToscaNodeTemplate> listOfTemplates = provider.getControlLoopDefinitions(null, null);
@@ -291,8 +292,8 @@ class CommissioningProviderTest {
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
participantProvider = new ParticipantProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
- CommissioningProvider provider =
- new CommissioningProvider(modelsProvider, clProvider, null, participantProvider);
+ CommissioningProvider provider = new CommissioningProvider(new ServiceTemplateProvider(modelsProvider),
+ clProvider, null, participantProvider);
ToscaServiceTemplate serviceTemplate = InstantiationUtils.getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML);
provider.getControlLoopDefinitions(null, null);
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
index abf0cfc3e..82f7e66d5 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
@@ -40,6 +40,7 @@ import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ControlLoopProvider;
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ParticipantProvider;
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ParticipantStatisticsProvider;
+import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ServiceTemplateProvider;
import org.onap.policy.clamp.controlloop.models.messages.rest.instantiation.InstantiationCommand;
import org.onap.policy.clamp.controlloop.models.messages.rest.instantiation.InstantiationResponse;
import org.onap.policy.clamp.controlloop.runtime.commissioning.CommissioningProvider;
@@ -122,7 +123,8 @@ class ControlLoopInstantiationProviderTest {
new ParticipantStatisticsProvider(controlLoopParameters.getDatabaseProviderParameters());
var clElementStatisticsProvider =
new ClElementStatisticsProvider(controlLoopParameters.getDatabaseProviderParameters());
- commissioningProvider = new CommissioningProvider(modelsProvider, clProvider, null, participantProvider);
+ commissioningProvider = new CommissioningProvider(new ServiceTemplateProvider(modelsProvider), clProvider, null,
+ participantProvider);
var monitoringProvider =
new MonitoringProvider(participantStatisticsProvider, clElementStatisticsProvider, clProvider);
var participantProvider = new ParticipantProvider(controlLoopParameters.getDatabaseProviderParameters());
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandlerTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandlerTest.java
index 25ce61122..0ad8aad43 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandlerTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandlerTest.java
@@ -23,7 +23,6 @@ package org.onap.policy.clamp.controlloop.runtime.supervision;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyList;
-import static org.mockito.ArgumentMatchers.anyMap;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -230,9 +229,10 @@ class SupervisionHandlerTest {
mock(MonitoringProvider.class), mock(ParticipantRegisterAckPublisher.class),
mock(ParticipantDeregisterAckPublisher.class), mock(ControlLoopUpdatePublisher.class),
participantUpdatePublisher);
- handler.handleSendCommissionMessage(Map.of());
+ handler.handleSendCommissionMessage(participantId.getName(), participantId.getVersion());
- verify(participantUpdatePublisher).send(anyMap(), eq(true));
+ verify(participantUpdatePublisher).sendComissioningBroadcast(eq(participantId.getName()),
+ eq(participantId.getVersion()));
}
@Test
@@ -244,7 +244,7 @@ class SupervisionHandlerTest {
participantUpdatePublisher);
handler.handleSendDeCommissionMessage();
- verify(participantUpdatePublisher).send(anyMap(), eq(false));
+ verify(participantUpdatePublisher).sendDecomisioning();
}
private SupervisionHandler createSupervisionHandler(ControlLoopProvider controlLoopProvider,
diff --git a/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml
index 55e1f8ad1..e7ba1283f 100644
--- a/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -336,6 +336,9 @@
<to uri="direct:load-loop"/>
<to
uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DCAE UNDEPLOY request','INFO',${exchangeProperty[loopObject]})"/>
+ <setProperty name="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
<to uri="direct:undeploy-loop"/>
<log loggingLevel="INFO"
@@ -549,9 +552,6 @@
<doTry>
<log loggingLevel="INFO"
message="DELETE request for loop: ${header.loopName}"/>
- <setProperty name="raiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">true</simple>
- </setProperty>
<to
uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')"/>
<to
@@ -559,8 +559,17 @@
<to uri="direct:load-loop"/>
<to
uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})"/>
+
+ <setProperty name="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">false</simple>
+ </setProperty>
<to uri="direct:undeploy-loop"/>
+
+ <setProperty name="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">false</simple>
+ </setProperty>
<to uri="direct:remove-all-policy-from-active-pdp-group"/>
+
<log loggingLevel="INFO"
message="Deleting all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}"/>
<split>
@@ -597,6 +606,12 @@
message="DELETE request successfully executed for loop: ${header.loopName}"/>
<to
uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()"/>
+ <setHeader name="CamelHttpResponseCode">
+ <constant>200</constant>
+ </setHeader>
+ <setBody>
+ <simple>DELETE request SUCCESSFUL</simple>
+ </setBody>
<doCatch>
<exception>java.lang.Exception</exception>
<handled>
diff --git a/runtime/src/main/resources/clds/camel/routes/dcae-flows.xml b/runtime/src/main/resources/clds/camel/routes/dcae-flows.xml
index d74bd91bf..55ec70d16 100644
--- a/runtime/src/main/resources/clds/camel/routes/dcae-flows.xml
+++ b/runtime/src/main/resources/clds/camel/routes/dcae-flows.xml
@@ -180,17 +180,11 @@
<when>
<simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true
</simple>
- <setProperty name="raiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">true</simple>
- </setProperty>
<to uri="direct:undeploy-loop-single-blueprint"/>
</when>
<when>
<simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false
</simple>
- <setProperty name="raiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">true</simple>
- </setProperty>
<to uri="direct:undeploy-loop-multi-blueprint"/>
</when>
</choice>
@@ -349,9 +343,9 @@
</when>
<otherwise>
<log loggingLevel="WARN"
- message="Cannot Undeploy for the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !"/>
+ message="Cannot Undeploy the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !"/>
<to
- uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('Cannot Undeploy for the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !','WARNING',${exchangeProperty[loopObject]})"/>
+ uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('Cannot Undeploy the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !','WARNING','DCAE',${exchangeProperty[loopObject]})"/>
</otherwise>
</choice>
</route>
@@ -404,7 +398,7 @@
<log loggingLevel="ERROR"
message="GET DCAE deployment request FAILED for loop: ${header.loopName}, ${exception.stacktrace}"/>
<to
- uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('GET DCAE deployment request failed, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})"/>
+ uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('GET DCAE deployment request failed, Error reported: ${exception.message}','ERROR','DCAE',${exchangeProperty[loopObject]})"/>
</doCatch>
<doFinally>
<to uri="direct:reset-raise-http-exception-flag"/>
diff --git a/runtime/src/main/resources/logback-default.xml b/runtime/src/main/resources/logback-default.xml
index 443bc0eb1..cfa280c45 100644
--- a/runtime/src/main/resources/logback-default.xml
+++ b/runtime/src/main/resources/logback-default.xml
@@ -214,5 +214,6 @@
<appender-ref ref="asyncAudit" />
<appender-ref ref="asyncMetric" />
<appender-ref ref="asyncSecurity" />
+ <appender-ref ref="STDOUT" />
</root>
</included>
diff --git a/runtime/src/test/java/org/onap/policy/clamp/loop/DeployFlowItTestCase.java b/runtime/src/test/java/org/onap/policy/clamp/loop/DeployFlowItTestCase.java
index bfd5b0377..899b6206b 100644
--- a/runtime/src/test/java/org/onap/policy/clamp/loop/DeployFlowItTestCase.java
+++ b/runtime/src/test/java/org/onap/policy/clamp/loop/DeployFlowItTestCase.java
@@ -154,7 +154,7 @@ public class DeployFlowItTestCase {
loopTest.addMicroServicePolicy(microServicePolicy);
loopService.saveOrUpdateLoop(loopTest);
Exchange myCamelExchange = ExchangeBuilder.anExchange(camelContext).withProperty("loopObject", loopTest)
- .build();
+ .withProperty("raiseHttpExceptionFlag", true).build();
camelContext.createProducerTemplate().send("direct:undeploy-loop", myCamelExchange);
@@ -189,7 +189,7 @@ public class DeployFlowItTestCase {
loopTest2.addMicroServicePolicy(microServicePolicy2);
loopsRepository.saveAndFlush(loopTest2);
Exchange myCamelExchange = ExchangeBuilder.anExchange(camelContext).withProperty("loopObject", loopTest2)
- .build();
+ .withProperty("raiseHttpExceptionFlag", true).build();
camelContext.createProducerTemplate().send("direct:undeploy-loop", myCamelExchange);
diff --git a/runtime/ui-react/src/api/LoopActionService.js b/runtime/ui-react/src/api/LoopActionService.js
index bff812a2f..18ae90eff 100644
--- a/runtime/ui-react/src/api/LoopActionService.js
+++ b/runtime/ui-react/src/api/LoopActionService.js
@@ -32,7 +32,7 @@ export default class LoopActionService{
})
.then(function (response) {
if (response.ok) {
- return response.json();
+ return response;
} else {
return Promise.reject("Perform action failed with code:" + response.status);
}