summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/pom.xml18
-rw-r--r--common/src/main/resources/examples/controlloop/PMSH/consul_url.txt1
-rw-r--r--common/src/test/resources/examples/controlloop/KubernetesHelm.yaml (renamed from common/src/main/resources/examples/controlloop/KubernetesHelm.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/PMSH/consul_call_body.json (renamed from common/src/main/resources/examples/controlloop/PMSH/consul_call_body.json)0
-rw-r--r--common/src/test/resources/examples/controlloop/PMSH/consul_url.txt1
-rw-r--r--common/src/test/resources/examples/controlloop/PMSH/pmsh_cloudify_blueprint.yaml (renamed from common/src/main/resources/examples/controlloop/PMSH/pmsh_cloudify_blueprint.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.json (renamed from common/src/main/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.json)0
-rw-r--r--common/src/test/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.yaml (renamed from common/src/main/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/PMSH/pmsh_monitoring_policy_type.yaml (renamed from common/src/main/resources/examples/controlloop/PMSH/pmsh_monitoring_policy_type.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/PMSH/pmsh_operational_policy.json (renamed from common/src/main/resources/examples/controlloop/PMSH/pmsh_operational_policy.json)0
-rw-r--r--common/src/test/resources/examples/controlloop/PMSH/pmsh_operational_policy.yaml (renamed from common/src/main/resources/examples/controlloop/PMSH/pmsh_operational_policy.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/PMSubscriptionHandling.yaml (renamed from common/src/main/resources/examples/controlloop/PMSubscriptionHandling.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/PMSubscriptionHandling_GuilinFormat.yaml (renamed from common/src/main/resources/examples/controlloop/PMSubscriptionHandling_GuilinFormat.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/original/cloop_DCAE_VES_TCA_substitution.yaml (renamed from common/src/main/resources/examples/controlloop/original/cloop_DCAE_VES_TCA_substitution.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/original/cloop_base_types.yaml (renamed from common/src/main/resources/examples/controlloop/original/cloop_base_types.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/original/cloop_dcae_example.yaml (renamed from common/src/main/resources/examples/controlloop/original/cloop_dcae_example.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/original/cloop_dcae_types.yaml (renamed from common/src/main/resources/examples/controlloop/original/cloop_dcae_types.yaml)0
-rw-r--r--common/src/test/resources/examples/controlloop/original/cloop_other_types.yaml (renamed from common/src/main/resources/examples/controlloop/original/cloop_other_types.yaml)0
-rw-r--r--participant/participant-impl/pom.xml8
-rw-r--r--runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml33
-rw-r--r--runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml25
21 files changed, 85 insertions, 1 deletions
diff --git a/common/pom.xml b/common/pom.xml
index d962fc74a..78789a2e7 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -33,4 +33,22 @@
<artifactId>policy-clamp-common</artifactId>
<name>${project.artifactId}</name>
<description>Common utilities and code for the TOSCA Control Loop system</description>
+
+ <build>
+ <plugins>
+ <!-- Builds examples jar -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.2.0</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/common/src/main/resources/examples/controlloop/PMSH/consul_url.txt b/common/src/main/resources/examples/controlloop/PMSH/consul_url.txt
deleted file mode 100644
index e90ded1c6..000000000
--- a/common/src/main/resources/examples/controlloop/PMSH/consul_url.txt
+++ /dev/null
@@ -1 +0,0 @@
-http://consul:31321/v1/kv/dcae-pmsh:policy \ No newline at end of file
diff --git a/common/src/main/resources/examples/controlloop/KubernetesHelm.yaml b/common/src/test/resources/examples/controlloop/KubernetesHelm.yaml
index 2a5f76082..2a5f76082 100644
--- a/common/src/main/resources/examples/controlloop/KubernetesHelm.yaml
+++ b/common/src/test/resources/examples/controlloop/KubernetesHelm.yaml
diff --git a/common/src/main/resources/examples/controlloop/PMSH/consul_call_body.json b/common/src/test/resources/examples/controlloop/PMSH/consul_call_body.json
index 9118e9a6f..9118e9a6f 100644
--- a/common/src/main/resources/examples/controlloop/PMSH/consul_call_body.json
+++ b/common/src/test/resources/examples/controlloop/PMSH/consul_call_body.json
diff --git a/common/src/test/resources/examples/controlloop/PMSH/consul_url.txt b/common/src/test/resources/examples/controlloop/PMSH/consul_url.txt
new file mode 100644
index 000000000..2a2e77e86
--- /dev/null
+++ b/common/src/test/resources/examples/controlloop/PMSH/consul_url.txt
@@ -0,0 +1 @@
+http://consul:31321/v1/kv/dcae-pmsh:policy
diff --git a/common/src/main/resources/examples/controlloop/PMSH/pmsh_cloudify_blueprint.yaml b/common/src/test/resources/examples/controlloop/PMSH/pmsh_cloudify_blueprint.yaml
index 7cdc6d5b9..7cdc6d5b9 100644
--- a/common/src/main/resources/examples/controlloop/PMSH/pmsh_cloudify_blueprint.yaml
+++ b/common/src/test/resources/examples/controlloop/PMSH/pmsh_cloudify_blueprint.yaml
diff --git a/common/src/main/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.json b/common/src/test/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.json
index 5b64b5b6f..5b64b5b6f 100644
--- a/common/src/main/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.json
+++ b/common/src/test/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.json
diff --git a/common/src/main/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.yaml b/common/src/test/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.yaml
index 6021f36bc..6021f36bc 100644
--- a/common/src/main/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.yaml
+++ b/common/src/test/resources/examples/controlloop/PMSH/pmsh_monitoring_policy.yaml
diff --git a/common/src/main/resources/examples/controlloop/PMSH/pmsh_monitoring_policy_type.yaml b/common/src/test/resources/examples/controlloop/PMSH/pmsh_monitoring_policy_type.yaml
index e282bf5ba..e282bf5ba 100644
--- a/common/src/main/resources/examples/controlloop/PMSH/pmsh_monitoring_policy_type.yaml
+++ b/common/src/test/resources/examples/controlloop/PMSH/pmsh_monitoring_policy_type.yaml
diff --git a/common/src/main/resources/examples/controlloop/PMSH/pmsh_operational_policy.json b/common/src/test/resources/examples/controlloop/PMSH/pmsh_operational_policy.json
index 6bd681d71..6bd681d71 100644
--- a/common/src/main/resources/examples/controlloop/PMSH/pmsh_operational_policy.json
+++ b/common/src/test/resources/examples/controlloop/PMSH/pmsh_operational_policy.json
diff --git a/common/src/main/resources/examples/controlloop/PMSH/pmsh_operational_policy.yaml b/common/src/test/resources/examples/controlloop/PMSH/pmsh_operational_policy.yaml
index faf579012..faf579012 100644
--- a/common/src/main/resources/examples/controlloop/PMSH/pmsh_operational_policy.yaml
+++ b/common/src/test/resources/examples/controlloop/PMSH/pmsh_operational_policy.yaml
diff --git a/common/src/main/resources/examples/controlloop/PMSubscriptionHandling.yaml b/common/src/test/resources/examples/controlloop/PMSubscriptionHandling.yaml
index f9f97420a..f9f97420a 100644
--- a/common/src/main/resources/examples/controlloop/PMSubscriptionHandling.yaml
+++ b/common/src/test/resources/examples/controlloop/PMSubscriptionHandling.yaml
diff --git a/common/src/main/resources/examples/controlloop/PMSubscriptionHandling_GuilinFormat.yaml b/common/src/test/resources/examples/controlloop/PMSubscriptionHandling_GuilinFormat.yaml
index 51e369696..51e369696 100644
--- a/common/src/main/resources/examples/controlloop/PMSubscriptionHandling_GuilinFormat.yaml
+++ b/common/src/test/resources/examples/controlloop/PMSubscriptionHandling_GuilinFormat.yaml
diff --git a/common/src/main/resources/examples/controlloop/original/cloop_DCAE_VES_TCA_substitution.yaml b/common/src/test/resources/examples/controlloop/original/cloop_DCAE_VES_TCA_substitution.yaml
index 96ea133c2..96ea133c2 100644
--- a/common/src/main/resources/examples/controlloop/original/cloop_DCAE_VES_TCA_substitution.yaml
+++ b/common/src/test/resources/examples/controlloop/original/cloop_DCAE_VES_TCA_substitution.yaml
diff --git a/common/src/main/resources/examples/controlloop/original/cloop_base_types.yaml b/common/src/test/resources/examples/controlloop/original/cloop_base_types.yaml
index 4f29e5635..4f29e5635 100644
--- a/common/src/main/resources/examples/controlloop/original/cloop_base_types.yaml
+++ b/common/src/test/resources/examples/controlloop/original/cloop_base_types.yaml
diff --git a/common/src/main/resources/examples/controlloop/original/cloop_dcae_example.yaml b/common/src/test/resources/examples/controlloop/original/cloop_dcae_example.yaml
index 4629f6f75..4629f6f75 100644
--- a/common/src/main/resources/examples/controlloop/original/cloop_dcae_example.yaml
+++ b/common/src/test/resources/examples/controlloop/original/cloop_dcae_example.yaml
diff --git a/common/src/main/resources/examples/controlloop/original/cloop_dcae_types.yaml b/common/src/test/resources/examples/controlloop/original/cloop_dcae_types.yaml
index 5f96cd5df..5f96cd5df 100644
--- a/common/src/main/resources/examples/controlloop/original/cloop_dcae_types.yaml
+++ b/common/src/test/resources/examples/controlloop/original/cloop_dcae_types.yaml
diff --git a/common/src/main/resources/examples/controlloop/original/cloop_other_types.yaml b/common/src/test/resources/examples/controlloop/original/cloop_other_types.yaml
index d743f499f..d743f499f 100644
--- a/common/src/main/resources/examples/controlloop/original/cloop_other_types.yaml
+++ b/common/src/test/resources/examples/controlloop/original/cloop_other_types.yaml
diff --git a/participant/participant-impl/pom.xml b/participant/participant-impl/pom.xml
index ecc16e633..3d099e747 100644
--- a/participant/participant-impl/pom.xml
+++ b/participant/participant-impl/pom.xml
@@ -78,5 +78,13 @@
<artifactId>policy-clamp-participant-intermediary</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.clamp</groupId>
+ <artifactId>policy-clamp-common</artifactId>
+ <classifier>tests</classifier>
+ <type>test-jar</type>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
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 5fd242282..b3c4edbe6 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
@@ -1543,6 +1543,39 @@
</route>
</post>
+ <get uri="/v2/toscaControlLoop/getToscaInstantiation" outType="java.lang.String" bindingMode="off" produces="application/json">
+ <route>
+ <doTry>
+ <to uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Instantiation ')"/>
+ <to uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')"/>
+ <setHeader name="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <setProperty name="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
+ <to uri="direct:get-tosca-instantiation"/>
+ <to uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()"/>
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/>
+ <log loggingLevel="ERROR"
+ message="GET Tosca Instantiation JSON request failed: ${exception.stacktrace}"/>
+ <setHeader name="CamelHttpResponseCode">
+ <constant>500</constant>
+ </setHeader>
+ <setBody>
+ <simple>GET Tosca Instantiation JSON FAILED</simple>
+ </setBody>
+ </doCatch>
+ </doTry>
+ </route>
+ </get>
+
<get uri="/v2/clampInformation" outType="org.onap.policy.clamp.clds.model.ClampInformation"
produces="application/json">
<route>
diff --git a/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml b/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml
index 0641b326e..009e00fca 100644
--- a/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml
+++ b/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml
@@ -52,4 +52,29 @@
</doFinally>
</doTry>
</route>
+ <route id="get-tosca-instantiation">
+ <from uri="direct:get-tosca-instantiation"/>
+ <doTry>
+ <log loggingLevel="INFO"
+ message="Getting the Tosca instantiation"/>
+ <to
+ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('ControlLoop', 'Getting the Tosca instantiation')"/>
+ <setHeader name="CamelHttpMethod">
+ <constant>GET</constant>
+ </setHeader>
+ <setHeader name="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <log loggingLevel="INFO"
+ message="Endpoint to get Tosca Instantiation: {{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/instantiation"></log>
+ <toD
+ uri="{{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/instantiation?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.controlloop.runtime.userName}}&amp;authPassword={{clamp.config.controlloop.runtime.password}}&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
+ <convertBodyTo type="java.lang.String"/>
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag"/>
+ <to
+ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
+ </doFinally>
+ </doTry>
+ </route>
</routes>