summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/docker/Dockerfile9
-rw-r--r--src/main/docker/kibana/conf/keystore/org.onap.clamp.crt.pem30
-rw-r--r--src/main/docker/kibana/conf/keystore/org.onap.clamp.key.pem32
-rw-r--r--src/main/docker/kibana/conf/kibana.yml9
-rw-r--r--src/main/java/org/onap/clamp/clds/ClampServlet.java53
-rw-r--r--src/main/java/org/onap/clamp/clds/camel/CamelProxy.java55
-rw-r--r--src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java432
-rw-r--r--src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java54
-rw-r--r--src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java83
-rw-r--r--src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java11
-rw-r--r--src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java16
-rw-r--r--src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java22
-rw-r--r--src/main/java/org/onap/clamp/clds/dao/CldsDao.java19
-rw-r--r--src/main/java/org/onap/clamp/clds/model/properties/Holmes.java16
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java61
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstaller.java1
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/MicroService.java18
-rw-r--r--src/main/java/org/onap/clamp/clds/service/CldsService.java35
-rw-r--r--src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java12
-rw-r--r--src/main/java/org/onap/clamp/clds/service/CldsToscaService.java13
-rw-r--r--src/main/java/org/onap/clamp/clds/tosca/ToscaSchemaConstants.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/util/CryptoUtils.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/util/LoggingUtils.java786
-rw-r--r--src/main/java/org/onap/clamp/clds/util/ONAPLogConstants.java3
-rw-r--r--src/main/java/org/onap/clamp/clds/util/XmlTools.java8
-rwxr-xr-xsrc/main/java/org/onap/clamp/clds/util/drawing/Painter.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/util/drawing/SvgFacade.java2
-rw-r--r--src/main/java/org/onap/clamp/flow/log/FlowLogOperation.java102
-rw-r--r--src/main/java/org/onap/clamp/loop/Loop.java12
-rw-r--r--src/main/java/org/onap/clamp/loop/LoopCsarInstaller.java (renamed from src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java)57
-rw-r--r--src/main/java/org/onap/clamp/loop/LoopOperation.java312
-rw-r--r--src/main/java/org/onap/clamp/loop/log/LoopLog.java2
-rw-r--r--src/main/java/org/onap/clamp/policy/Policy.java4
-rw-r--r--src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java10
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/LegacyOperationalPolicy.java150
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java42
-rw-r--r--src/main/java/org/onap/clamp/util/PrincipalUtils.java6
-rw-r--r--src/main/resources/META-INF/resources/designer/modeler/dist/index.html19
-rw-r--r--src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html79
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js35
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js255
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/app.js15
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/authcontroller.js1
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/propertyController.js15
-rw-r--r--src/main/resources/META-INF/resources/swagger.html2008
-rw-r--r--src/main/resources/application-noaaf.properties16
-rw-r--r--src/main/resources/application.properties21
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml720
-rw-r--r--src/main/resources/clds/camel/routes/flexible-flow.xml765
-rw-r--r--src/main/resources/logback-default.xml279
-rw-r--r--src/test/java/org/onap/clamp/clds/client/GuardPolicyDeleteDelegateTest.java117
-rw-r--r--src/test/java/org/onap/clamp/clds/client/HolmesPolicyDelegateTest.java183
-rw-r--r--src/test/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegateTest.java104
-rw-r--r--src/test/java/org/onap/clamp/clds/client/ModelDeleteDelegateTest.java63
-rw-r--r--src/test/java/org/onap/clamp/clds/client/OperationalPolicyDelegateTest.java125
-rw-r--r--src/test/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegateTest.java108
-rw-r--r--src/test/java/org/onap/clamp/clds/client/TcaPolicyDeleteDelegateTest.java103
-rw-r--r--src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java13
-rw-r--r--src/test/java/org/onap/clamp/clds/it/CldsHealthcheckServiceItCase.java2
-rw-r--r--src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java1
-rw-r--r--src/test/java/org/onap/clamp/clds/it/CldsToscaServiceItCase.java2
-rw-r--r--src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java13
-rw-r--r--src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java16
-rw-r--r--src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java24
-rw-r--r--src/test/java/org/onap/clamp/clds/sdc/controller/installer/LoopCsarInstallerTest.java (renamed from src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImplTest.java)2
-rw-r--r--src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java48
-rw-r--r--src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java7
-rw-r--r--src/test/java/org/onap/clamp/clds/util/drawing/ClampGraphBuilderTest.java14
-rw-r--r--src/test/java/org/onap/clamp/clds/util/drawing/DocumentBuilderTest.java3
-rw-r--r--src/test/java/org/onap/clamp/flow/FlowLogOperationTest.java99
-rw-r--r--src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java45
-rw-r--r--src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java244
-rw-r--r--src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java2
-rw-r--r--src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java15
-rw-r--r--src/test/resources/application.properties429
-rw-r--r--src/test/resources/clds/blueprint-with-microservice-chain.yaml6
-rw-r--r--src/test/resources/clds/clds-parse-exception.json1
-rw-r--r--src/test/resources/clds/single-microservice-fragment-valid.yaml2
-rw-r--r--src/test/resources/example/sdc/blueprint-dcae/prop-text-for-tca-2.json25
-rw-r--r--src/test/resources/example/sdc/blueprint-dcae/prop-text-for-tca-3.json48
-rw-r--r--src/test/resources/example/sdc/blueprint-dcae/tca.yaml2
-rw-r--r--src/test/resources/example/sdc/blueprint-dcae/tca_2.yaml160
-rw-r--r--src/test/resources/example/sdc/blueprint-dcae/tca_3.yaml240
-rw-r--r--src/test/resources/example/sdc/expected-result/policy-data.yaml1035
-rwxr-xr-xsrc/test/resources/example/sdc/service-Vloadbalancerms-csar.csarbin110668 -> 0 bytes
-rw-r--r--src/test/resources/example/sdc/service_Vloadbalancerms_csar.csarbin0 -> 115690 bytes
-rwxr-xr-xsrc/test/resources/http-cache/third_party_proxy.py12
-rw-r--r--src/test/resources/tosca/guard1-policy-payload.json14
-rw-r--r--src/test/resources/tosca/guard2-policy-payload.json14
-rw-r--r--src/test/resources/tosca/micro-service-policy-payload.json2
-rw-r--r--src/test/resources/tosca/model-properties.json123
-rw-r--r--src/test/resources/tosca/operational-policy-no-guard-properties.json2
-rw-r--r--src/test/resources/tosca/operational-policy-payload-legacy.yaml39
-rw-r--r--src/test/resources/tosca/operational-policy-payload.json4
-rw-r--r--src/test/resources/tosca/operational-policy-payload.yaml25
-rw-r--r--src/test/resources/tosca/operational-policy-properties.json28
-rw-r--r--src/test/resources/tosca/tosca_example.yaml2
99 files changed, 7887 insertions, 2394 deletions
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile
index f2c7edd8e..c47d6229e 100644
--- a/src/main/docker/Dockerfile
+++ b/src/main/docker/Dockerfile
@@ -20,6 +20,15 @@ RUN chmod 700 /opt/clamp/app.jar
RUN chown -R clamp:onap /opt/clamp
+RUN apk add fontconfig
+RUN apk add ttf-dejavu
+
+RUN ln -s /usr/lib/libfontconfig.so.1 /usr/lib/libfontconfig.so && \
+ ln -s /lib/libuuid.so.1 /usr/lib/libuuid.so.1 && \
+ ln -s /lib/libc.musl-x86_64.so.1 /usr/lib/libc.musl-x86_64.so.1
+
+ENV LD_LIBRARY_PATH /usr/lib
+
USER clamp
WORKDIR /opt/clamp/
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Xms256m", "-Xmx1g", "-jar" ,"./app.jar"]
diff --git a/src/main/docker/kibana/conf/keystore/org.onap.clamp.crt.pem b/src/main/docker/kibana/conf/keystore/org.onap.clamp.crt.pem
new file mode 100644
index 000000000..ce630d435
--- /dev/null
+++ b/src/main/docker/kibana/conf/keystore/org.onap.clamp.crt.pem
@@ -0,0 +1,30 @@
+Bag Attributes
+ friendlyName: clamp@clamp.onap.org
+ localKeyID: 54 69 6D 65 20 31 35 35 33 37 38 37 35 31 38 33 30 33
+subject=/CN=clamp/emailAddress=/OU=clamp@clamp.onap.org/OU=OSAAF/O=ONAP/C=US
+issuer=/C=US/O=ONAP/OU=OSAAF/CN=intermediateCA_9
+-----BEGIN CERTIFICATE-----
+MIIEKDCCAxCgAwIBAgIIWY+5kgf/UG4wDQYJKoZIhvcNAQELBQAwRzELMAkGA1UE
+BhMCVVMxDTALBgNVBAoMBE9OQVAxDjAMBgNVBAsMBU9TQUFGMRkwFwYDVQQDDBBp
+bnRlcm1lZGlhdGVDQV85MB4XDTE5MDMyMTE2MTY1OFoXDTIwMDMyMTE2MTY1OFow
+bDEOMAwGA1UEAwwFY2xhbXAxDzANBgkqhkiG9w0BCQEWADEdMBsGA1UECwwUY2xh
+bXBAY2xhbXAub25hcC5vcmcxDjAMBgNVBAsMBU9TQUFGMQ0wCwYDVQQKDARPTkFQ
+MQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALic
+uDccBjOAlOsL1Z1nKnDPRTNxBwIVfARRQDxK3C0zDHQ5qEmIQlF0Vjp+bJ2rgzMW
+BnodC38zt1jSXymEsekZNV2sUyBbzJl6vxvA1xJKI9VHLyPSzyUEd1H4qh8b7IDX
+3GDqUJgNfvzJ94DaNnnYWFVZq/IYdLjCFaXDxPUQZtlmpdkIWBzvMeNRe4bWajau
+immkmSi5/2BYQfZXHXpiKiyBnN+1FbU3consmjNwS1L+PjD+k3JLsc5ANZYZMOTp
+Szhu3xmDiB3UV4gPQWacQQZEo/5exywY3Ax3TowGwIA660eSkW1L5RPdyvzEgp7A
+vu4+rbhfeR5bXjy2iAUCAwEAAaOB8jCB7zAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
+AwIF4DAgBgNVHSUBAf8EFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwVAYDVR0jBE0w
+S4AUgfeZWxC5yIze81Je6k5poEM+rN2hMKQuMCwxDjAMBgNVBAsMBU9TQUFGMQ0w
+CwYDVQQKDARPTkFQMQswCQYDVQQGEwJVU4IBBzAdBgNVHQ4EFgQU+GZ6wmWDPrmq
+Wd1/NtMYiCQ8Dg4wOwYDVR0RBDQwMoIFY2xhbXCCHWNsYW1wLmFwaS5zaW1wbGVk
+ZW1vLm9uYXAub3JnggpjbGFtcC5vbmFwMA0GCSqGSIb3DQEBCwUAA4IBAQCFZdhB
+U6xm6l0vj4q89onLx4opTPvwGNRc0n402lifkPYXseFtphZSHIf2Sg0mFTH4KHb4
+FdMyBzq1+f5WLU+xRC1nT4eGJ0FvRR6204/fGVrzJTS67phnRnxr2WZzLPW0wPJe
+K8SzN6tkUgE7/a/s0T/htE/blDxWh75+tA2jQlgj1Ri0y9A1J8wx++REKjGlHjFN
+53aiipsB+wC/oEMzYL4qEPiYPI0Lr3Lsay1F7f6cvDT4+EYzBLMFuwCvpcnHgSMS
+4fFj2ROmUG2+CC23B88Q0WNxjLPq/CrmHZZBsqwruPJ0cSuCQxfshTQ6uZhcjtu8
+6TRYkIcL0x9r/AHP
+-----END CERTIFICATE-----
diff --git a/src/main/docker/kibana/conf/keystore/org.onap.clamp.key.pem b/src/main/docker/kibana/conf/keystore/org.onap.clamp.key.pem
new file mode 100644
index 000000000..fcf68bfa2
--- /dev/null
+++ b/src/main/docker/kibana/conf/keystore/org.onap.clamp.key.pem
@@ -0,0 +1,32 @@
+Bag Attributes
+ friendlyName: clamp@clamp.onap.org
+ localKeyID: 54 69 6D 65 20 31 35 35 33 37 38 37 35 31 38 33 30 33
+Key Attributes: <No Attributes>
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4nLg3HAYzgJTr
+C9WdZypwz0UzcQcCFXwEUUA8StwtMwx0OahJiEJRdFY6fmydq4MzFgZ6HQt/M7dY
+0l8phLHpGTVdrFMgW8yZer8bwNcSSiPVRy8j0s8lBHdR+KofG+yA19xg6lCYDX78
+yfeA2jZ52FhVWavyGHS4whWlw8T1EGbZZqXZCFgc7zHjUXuG1mo2ropppJkouf9g
+WEH2Vx16YiosgZzftRW1N3KJ7JozcEtS/j4w/pNyS7HOQDWWGTDk6Us4bt8Zg4gd
+1FeID0FmnEEGRKP+XscsGNwMd06MBsCAOutHkpFtS+UT3cr8xIKewL7uPq24X3ke
+W148togFAgMBAAECggEATncV+R5pKFS7dteV2IvzxvTh1cZxkxoslu0t3zJ2OKPc
+5D1pYK+QeGx5Be2cHru6TOlMoXRc4ZjKke8AUXY74/Y573GB91vtL0KznYkuIHDw
+oALcb153eqVWTbniHMzSjcSxv2N4E9iQo8L39oVI6CrjCIvPgFuSqMCdUNJPkVTI
+4nsarTfLK4fzi7IbWzi9JdE1QRNIxcCMcYJRnLZMdneMLBleR0UL82Xc2KOy5SEt
+zyKYCQ8zS247FKolnOrDkhKxXI5fzdDpRK5AQSsAykUPWlYq7pzKjY/dU9rMRohx
+YSltFjPZ3sQ3UKqqIqhZS+GoVuZoc925WyhViPsqtQKBgQDsL4LFfPWN8nnsusQp
+VR3T7HvvwXuEVAydlaJMwZU0cRYN+L7RHHjDoXZZrNJDIDzNoWnBLKRGx3mtLmgJ
+9Pa6SxN6Oc8oo6jzv2D59g1PVjNOMOYTCTb/2Xum4LMLaeeF57HkWxzeA3Ws47++
+gXwzQpbE90tp1Ys4uXD3JoivvwKBgQDIGZTwLGhLSegdAjG83WEgmdtzT1kjvx0Q
+A8IR2jkgkTJHdKiuslJ8Z3/XufHEwWMWwfs1XLwxYluoo1y9eNvNeHZXjLqjL62c
+I3034F9IvvTUqFcxam2WdoklXbAiSvLUo/9exPgOuVxok6Zv1imRgGb/vYV9vyG7
+86MRuQu5OwKBgQC9E3fcA6JMpY3H3uhEsngzfMDm+fyYvfRvfyezzNFWbyWZv8V6
+gBGJg0vMlFarGDa044BW/hbw9qXI5zqwpeOS1aFdGsRlo0cRAuduk/Spy7c85FZ7
+bMgT4BZmTMHo5DpNb2NxDSO59AkThCuvJde47ZjnS5WavzI6EfKGWNnZ3wKBgQCF
+QiwjCp/mS/DtqLFxAsmVSYGROG231aXILYiIFRloa+ndFn7j4NP4D4FfLHErRFL2
+K/ddIUYfaU57b1fqwts26ht90LXWyYDH9AaHOMCcFLe+C+INgcA7rPNG1C7hl6JC
+JHmEJo7AV4eICZSU9D44rRdrB08oYCpaHjYiLmb1UwKBgQCWCDJ4p2DrNL9hzj3K
+kzvM5saXrfI4aVBXVt9rw9s1d/WG8JOpnmHcnLPb6Tj59rDktrLCLv0sVstMwNVJ
+sOO+qsgn1VoZalcVhhjdONm5YvhJQgz0F7Y2xkr6g/AuMPz2YigGfm7fe/z7rc+L
+q9Ua2HmUS8DDBy7W89MNZJNkDQ==
+-----END PRIVATE KEY-----
diff --git a/src/main/docker/kibana/conf/kibana.yml b/src/main/docker/kibana/conf/kibana.yml
new file mode 100644
index 000000000..0c4eda9a1
--- /dev/null
+++ b/src/main/docker/kibana/conf/kibana.yml
@@ -0,0 +1,9 @@
+---
+# Default Kibana configuration from kibana-docker.
+
+server.name: kibana
+server.host: "0"
+elasticsearch.hosts: http://elasticsearch:9200
+server.ssl.enabled: true
+server.ssl.key: /usr/share/kibana/config/keystore/org.onap.clamp.key.pem
+server.ssl.certificate: /usr/share/kibana/config/keystore/org.onap.clamp.crt.pem \ No newline at end of file
diff --git a/src/main/java/org/onap/clamp/clds/ClampServlet.java b/src/main/java/org/onap/clamp/clds/ClampServlet.java
index e8fd83e2e..86524d1c6 100644
--- a/src/main/java/org/onap/clamp/clds/ClampServlet.java
+++ b/src/main/java/org/onap/clamp/clds/ClampServlet.java
@@ -5,6 +5,8 @@
* Copyright (C) 2018 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -30,7 +32,6 @@ import java.io.IOException;
import java.security.Principal;
import java.util.ArrayList;
import java.util.List;
-
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -54,24 +55,27 @@ public class ClampServlet extends CamelHttpTransportServlet {
*/
private static final long serialVersionUID = -4198841134910211542L;
- protected static final EELFLogger logger = EELFManager.getInstance().getLogger(ClampServlet.class);
- public static final String PERM_INSTANCE = "clamp.config.security.permission.instance";
- public static final String PERM_CL = "clamp.config.security.permission.type.cl";
- public static final String PERM_TEMPLATE = "clamp.config.security.permission.type.template";
- public static final String PERM_VF = "clamp.config.security.permission.type.filter.vf";
- public static final String PERM_MANAGE = "clamp.config.security.permission.type.cl.manage";
- public static final String PERM_TOSCA = "clamp.config.security.permission.type.tosca";
- public static final String AUTHENTICATION_CLASS = "clamp.config.security.authentication.class";
+ private static final EELFLogger logger = EELFManager.getInstance().getLogger(ClampServlet.class);
+ private static final String PERM_INSTANCE = "clamp.config.security.permission.instance";
+ private static final String PERM_CL = "clamp.config.security.permission.type.cl";
+ private static final String PERM_TEMPLATE = "clamp.config.security.permission.type.template";
+ private static final String PERM_VF = "clamp.config.security.permission.type.filter.vf";
+ private static final String PERM_MANAGE = "clamp.config.security.permission.type.cl.manage";
+ private static final String PERM_TOSCA = "clamp.config.security.permission.type.tosca";
+ private static final String AUTHENTICATION_CLASS = "clamp.config.security.authentication.class";
+ private static final String READ = "read";
+ private static final String UPDATE = "update";
+
private static List<SecureServicePermission> permissionList;
private synchronized Class loadDynamicAuthenticationClass() {
try {
String authenticationObject = WebApplicationContextUtils.getWebApplicationContext(getServletContext())
- .getEnvironment().getProperty(AUTHENTICATION_CLASS);
+ .getEnvironment().getProperty(AUTHENTICATION_CLASS);
return Class.forName(authenticationObject);
} catch (ClassNotFoundException e) {
logger.error(
- "Exception caught when attempting to create associated class of config:" + AUTHENTICATION_CLASS, e);
+ "Exception caught when attempting to create associated class of config:" + AUTHENTICATION_CLASS, e);
return Object.class;
}
}
@@ -80,24 +84,25 @@ public class ClampServlet extends CamelHttpTransportServlet {
if (permissionList == null) {
permissionList = new ArrayList<>();
ApplicationContext applicationContext = WebApplicationContextUtils
- .getWebApplicationContext(getServletContext());
+ .getWebApplicationContext(getServletContext());
String cldsPermissionInstance = applicationContext.getEnvironment().getProperty(PERM_INSTANCE);
permissionList.add(SecureServicePermission.create(applicationContext.getEnvironment().getProperty(PERM_CL),
- cldsPermissionInstance, "read"));
+ cldsPermissionInstance, READ));
permissionList.add(SecureServicePermission.create(applicationContext.getEnvironment().getProperty(PERM_CL),
- cldsPermissionInstance, "update"));
+ cldsPermissionInstance, UPDATE));
permissionList.add(SecureServicePermission.create(
- applicationContext.getEnvironment().getProperty(PERM_TEMPLATE), cldsPermissionInstance, "read"));
+ applicationContext.getEnvironment().getProperty(PERM_TEMPLATE), cldsPermissionInstance, READ));
permissionList.add(SecureServicePermission.create(
- applicationContext.getEnvironment().getProperty(PERM_TEMPLATE), cldsPermissionInstance, "update"));
+ applicationContext.getEnvironment().getProperty(PERM_TEMPLATE), cldsPermissionInstance, UPDATE));
permissionList.add(SecureServicePermission.create(applicationContext.getEnvironment().getProperty(PERM_VF),
- cldsPermissionInstance, "*"));
+ cldsPermissionInstance, "*"));
permissionList.add(SecureServicePermission
- .create(applicationContext.getEnvironment().getProperty(PERM_MANAGE), cldsPermissionInstance, "*"));
+ .create(applicationContext.getEnvironment().getProperty(PERM_MANAGE), cldsPermissionInstance, "*"));
permissionList.add(SecureServicePermission
- .create(applicationContext.getEnvironment().getProperty(PERM_TOSCA), cldsPermissionInstance, "read"));
+ .create(applicationContext.getEnvironment().getProperty(PERM_TOSCA), cldsPermissionInstance, READ));
permissionList.add(SecureServicePermission
- .create(applicationContext.getEnvironment().getProperty(PERM_TOSCA), cldsPermissionInstance, "update"));
+ .create(applicationContext.getEnvironment().getProperty(PERM_TOSCA), cldsPermissionInstance,
+ UPDATE));
}
return permissionList;
}
@@ -107,8 +112,7 @@ public class ClampServlet extends CamelHttpTransportServlet {
* to isUserInRole will invoke a http call to AAF server.
*/
@Override
- protected void doService(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
+ protected void doService(HttpServletRequest request, HttpServletResponse response) {
Principal principal = request.getUserPrincipal();
if (loadDynamicAuthenticationClass().isInstance(principal)) {
// When AAF is enabled, there is a need to provision the permissions to Spring
@@ -120,8 +124,8 @@ public class ClampServlet extends CamelHttpTransportServlet {
grantedAuths.add(new SimpleGrantedAuthority(permString));
}
}
- Authentication auth = new UsernamePasswordAuthenticationToken(new User(principal.getName(), "", grantedAuths), "",
- grantedAuths);
+ Authentication auth = new UsernamePasswordAuthenticationToken(new User(principal.getName(), "",
+ grantedAuths), "", grantedAuths);
SecurityContextHolder.getContext().setAuthentication(auth);
}
try {
@@ -134,6 +138,5 @@ public class ClampServlet extends CamelHttpTransportServlet {
logger.error("Exception caught when executing HTTP sendError in servlet", e);
}
}
-
}
} \ No newline at end of file
diff --git a/src/main/java/org/onap/clamp/clds/camel/CamelProxy.java b/src/main/java/org/onap/clamp/clds/camel/CamelProxy.java
index a74f4c702..f6265982b 100644
--- a/src/main/java/org/onap/clamp/clds/camel/CamelProxy.java
+++ b/src/main/java/org/onap/clamp/clds/camel/CamelProxy.java
@@ -5,6 +5,8 @@
* Copyright (C) 2018 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -18,7 +20,7 @@
* limitations under the License.
* ============LICENSE_END============================================
* ===================================================================
- *
+ *
*/
package org.onap.clamp.clds.camel;
@@ -29,41 +31,32 @@ import org.apache.camel.ExchangeProperty;
* This interface describes the CamelProxy parameters that must be passed to the
* Camel flow.
*/
+@FunctionalInterface
public interface CamelProxy {
/**
* This method is called when invoking a camel flow.
- *
- * @param actionCommand
- * The action coming from the Clamp UI (like SUBMIT, UPDATE,
- * DELETE, ...)
- * @param modelProperties
- * The Model properties created based on the BPMN Json and
- * Properties Json
- * @param modelBpmnProperties
- * The Json with all the properties describing the flow
- * @param modelName
- * The model name
- * @param controlName
- * The control loop name
- * @param docText
- * The Global properties JSON containing YAML (coming from CLamp
- * template)
- * @param isTest
- * Is a test or not (flag coming from the UI)
- * @param userId
- * The user ID coming from the UI
- * @param isInsertTestEvent
- * Is a test or not (flag coming from the UI)
- * @param eventAction
- * The latest event action in database (like CREATE, SUBMIT, ...)
+ *
+ * @param actionCommand The action coming from the Clamp UI (like SUBMIT, UPDATE,
+ * DELETE, ...)
+ * @param modelProperties The Model properties created based on the BPMN Json and
+ * Properties Json
+ * @param modelBpmnProperties The Json with all the properties describing the flow
+ * @param modelName The model name
+ * @param controlName The control loop name
+ * @param docText The Global properties JSON containing YAML (coming from CLamp
+ * template)
+ * @param isTest Is a test or not (flag coming from the UI)
+ * @param userId The user ID coming from the UI
+ * @param isInsertTestEvent Is a test or not (flag coming from the UI)
+ * @param eventAction The latest event action in database (like CREATE, SUBMIT, ...)
* @return A string containing the result of the Camel flow execution
*/
String executeAction(@ExchangeProperty("actionCd") String actionCommand,
- @ExchangeProperty("modelProp") String modelProperties,
- @ExchangeProperty("modelBpmnProp") String modelBpmnProperties,
- @ExchangeProperty("modelName") String modelName, @ExchangeProperty("controlName") String controlName,
- @ExchangeProperty("docText") String docText, @ExchangeProperty("isTest") boolean isTest,
- @ExchangeProperty("userid") String userId, @ExchangeProperty("isInsertTestEvent") boolean isInsertTestEvent,
- @ExchangeProperty("eventAction") String eventAction);
+ @ExchangeProperty("modelProp") String modelProperties,
+ @ExchangeProperty("modelBpmnProp") String modelBpmnProperties,
+ @ExchangeProperty("modelName") String modelName, @ExchangeProperty("controlName") String controlName,
+ @ExchangeProperty("docText") String docText, @ExchangeProperty("isTest") boolean isTest,
+ @ExchangeProperty("userid") String userId, @ExchangeProperty("isInsertTestEvent") boolean isInsertTestEvent,
+ @ExchangeProperty("eventAction") String eventAction);
}
diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
index f7aff0eff..83401a3c4 100644
--- a/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
@@ -1,218 +1,216 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
- * reserved.
- * ================================================================================
- * Modifications Copyright (c) 2019 Samsung
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END============================================
- * ===================================================================
- *
- */
-
-package org.onap.clamp.clds.client;
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-import com.google.gson.JsonObject;
-import java.io.IOException;
-import java.util.Date;
-
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-import org.json.simple.parser.ParseException;
-import org.onap.clamp.clds.config.ClampProperties;
-import org.onap.clamp.clds.exception.dcae.DcaeDeploymentException;
-import org.onap.clamp.clds.util.LoggingUtils;
-import org.onap.clamp.util.HttpConnectionManager;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * This class implements the communication with DCAE for the service
- * deployments.
- */
-@Component
-public class DcaeDispatcherServices {
-
- protected static final EELFLogger logger = EELFManager.getInstance().getLogger(DcaeDispatcherServices.class);
- protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
- private final ClampProperties refProp;
- private final HttpConnectionManager dcaeHttpConnectionManager;
- private static final String STATUS_URL_LOG = "Status URL extracted: ";
- private static final String DCAE_URL_PREFIX = "/dcae-deployments/";
- private static final String DCAE_URL_PROPERTY_NAME = "dcae.dispatcher.url";
- private static final String DCAE_LINK_FIELD = "links";
- private static final String DCAE_STATUS_FIELD = "status";
-
- @Autowired
- public DcaeDispatcherServices(ClampProperties refProp, HttpConnectionManager dcaeHttpConnectionManager) {
- this.refProp = refProp;
- this.dcaeHttpConnectionManager = dcaeHttpConnectionManager;
- }
-
- /**
- * Get the Operation Status from a specified URL with retry.
- * @param operationStatusUrl
- * The URL of the DCAE
- * @return The status
- * @throws InterruptedException Exception during the retry
- */
- public String getOperationStatusWithRetry(String operationStatusUrl) throws InterruptedException {
- String operationStatus = "";
- for (int i = 0; i < Integer.valueOf(refProp.getStringValue("dcae.dispatcher.retry.limit")); i++) {
- logger.info("Trying to get Operation status on DCAE for url:" + operationStatusUrl);
- operationStatus = getOperationStatus(operationStatusUrl);
- logger.info("Current Status is:" + operationStatus);
- if (!"processing".equalsIgnoreCase(operationStatus)) {
- return operationStatus;
- } else {
- Thread.sleep(Integer.valueOf(refProp.getStringValue("dcae.dispatcher.retry.interval")));
- }
- }
- logger.warn("Number of attempts on DCAE is over, stopping the getOperationStatus method");
- return operationStatus;
- }
-
- /**
- * Get the Operation Status from a specified URL.
- * @param statusUrl
- * The URL provided by a previous DCAE Query
- * @return The status
- */
- public String getOperationStatus(String statusUrl) {
- // Assigning processing status to monitor operation status further
- String opStatus = "processing";
- Date startTime = new Date();
- LoggingUtils.setTargetContext("DCAE", "getOperationStatus");
- try {
- String responseStr = dcaeHttpConnectionManager.doHttpRequest(statusUrl, "GET", null,
- null, "DCAE", null,
- null);
- JSONObject jsonObj = parseResponse(responseStr);
- String operationType = (String) jsonObj.get("operationType");
- String status = (String) jsonObj.get(DCAE_STATUS_FIELD);
- logger.info("Operation Type - " + operationType + ", Status " + status);
- LoggingUtils.setResponseContext("0", "Get operation status success", this.getClass().getName());
- opStatus = status;
- } catch (Exception e) {
- LoggingUtils.setResponseContext("900", "Get operation status failed", this.getClass().getName());
- LoggingUtils.setErrorContext("900", "Get operation status error");
- logger.error("Exception occurred during getOperationStatus Operation with DCAE", e);
- } finally {
- LoggingUtils.setTimeContext(startTime, new Date());
- metricsLogger.info("getOperationStatus complete");
- }
- return opStatus;
- }
-
- /**
- * Returns status URL for createNewDeployment operation.
- * @param deploymentId
- * The deployment ID
- * @param serviceTypeId
- * Service type ID
- * @param blueprintInputJson
- * The value for each blueprint parameters in a flat JSON
- * @return The status URL
- */
- public String createNewDeployment(String deploymentId, String serviceTypeId, JsonObject blueprintInputJson) {
- Date startTime = new Date();
- LoggingUtils.setTargetContext("DCAE", "createNewDeployment");
- try {
- JsonObject rootObject = refProp.getJsonTemplate("dcae.deployment.template").getAsJsonObject();
- rootObject.addProperty("serviceTypeId", serviceTypeId);
- if (blueprintInputJson != null) {
- rootObject.add("inputs", blueprintInputJson);
- }
- String apiBodyString = rootObject.toString();
- logger.info("Dcae api Body String - " + apiBodyString);
- String url = refProp.getStringValue(DCAE_URL_PROPERTY_NAME) + DCAE_URL_PREFIX + deploymentId;
- String statusUrl = getDcaeResponse(url, "PUT", apiBodyString, "application/json", DCAE_LINK_FIELD,
- DCAE_STATUS_FIELD);
- LoggingUtils.setResponseContext("0", "Create new deployment failed", this.getClass().getName());
- return statusUrl;
- } catch (Exception e) {
- LoggingUtils.setResponseContext("900", "Create new deployment failed", this.getClass().getName());
- LoggingUtils.setErrorContext("900", "Create new deployment error");
- logger.error("Exception occurred during createNewDeployment Operation with DCAE", e);
- throw new DcaeDeploymentException("Exception occurred during createNewDeployment Operation with DCAE", e);
- } finally {
- LoggingUtils.setTimeContext(startTime, new Date());
- metricsLogger.info("createNewDeployment complete");
- }
- }
-
- /***
- * Returns status URL for deleteExistingDeployment operation.
- *
- * @param deploymentId
- * The deployment ID
- * @param serviceTypeId
- * The service Type ID
- * @return The status URL
- */
- public String deleteExistingDeployment(String deploymentId, String serviceTypeId) {
- Date startTime = new Date();
- LoggingUtils.setTargetContext("DCAE", "deleteExistingDeployment");
- try {
- String apiBodyString = "{\"serviceTypeId\": \"" + serviceTypeId + "\"}";
- logger.info("Dcae api Body String - " + apiBodyString);
- String url = refProp.getStringValue(DCAE_URL_PROPERTY_NAME) + DCAE_URL_PREFIX + deploymentId;
- String statusUrl = getDcaeResponse(url, "DELETE", apiBodyString, "application/json", DCAE_LINK_FIELD,
- DCAE_STATUS_FIELD);
- LoggingUtils.setResponseContext("0", "Delete existing deployment success", this.getClass().getName());
- return statusUrl;
-
- } catch (Exception e) {
- LoggingUtils.setResponseContext("900", "Delete existing deployment failed", this.getClass().getName());
- LoggingUtils.setErrorContext("900", "Delete existing deployment error");
- logger.error("Exception occurred during deleteExistingDeployment Operation with DCAE", e);
- throw new DcaeDeploymentException("Exception occurred during deleteExistingDeployment Operation with DCAE",
- e);
- } finally {
- LoggingUtils.setTimeContext(startTime, new Date());
- metricsLogger.info("deleteExistingDeployment complete");
- }
- }
-
- private String getDcaeResponse(String url, String requestMethod, String payload, String contentType, String node,
- String nodeAttr) throws IOException, ParseException {
- Date startTime = new Date();
- try {
- String responseStr = dcaeHttpConnectionManager.doHttpRequest(url, requestMethod, payload, contentType, "DCAE", null, null);
- JSONObject jsonObj = parseResponse(responseStr);
- JSONObject linksObj = (JSONObject) jsonObj.get(node);
- String statusUrl = (String) linksObj.get(nodeAttr);
- logger.info(STATUS_URL_LOG + statusUrl);
- return statusUrl;
- } catch (IOException | ParseException e) {
- logger.error("Exception occurred getting response from DCAE", e);
- throw e;
- } finally {
- LoggingUtils.setTimeContext(startTime, new Date());
- metricsLogger.info("getDcaeResponse complete");
- }
- }
-
- private JSONObject parseResponse(String responseStr) throws ParseException {
- JSONParser parser = new JSONParser();
- Object obj0 = parser.parse(responseStr);
- JSONObject jsonObj = (JSONObject) obj0;
- return jsonObj;
- }
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.client;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import com.google.gson.JsonObject;
+import java.io.IOException;
+import java.util.Date;
+
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+import org.onap.clamp.clds.config.ClampProperties;
+import org.onap.clamp.clds.exception.dcae.DcaeDeploymentException;
+import org.onap.clamp.clds.util.LoggingUtils;
+import org.onap.clamp.util.HttpConnectionManager;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * This class implements the communication with DCAE for the service
+ * deployments.
+ */
+@Component
+public class DcaeDispatcherServices {
+
+ protected static final EELFLogger logger = EELFManager.getInstance().getLogger(DcaeDispatcherServices.class);
+ protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
+ private final ClampProperties refProp;
+ private final HttpConnectionManager dcaeHttpConnectionManager;
+ private static final String STATUS_URL_LOG = "Status URL extracted: ";
+ private static final String DCAE_URL_PREFIX = "/dcae-deployments/";
+ private static final String DCAE_URL_PROPERTY_NAME = "dcae.dispatcher.url";
+ private static final String DCAE_LINK_FIELD = "links";
+ private static final String DCAE_STATUS_FIELD = "status";
+
+ @Autowired
+ public DcaeDispatcherServices(ClampProperties refProp, HttpConnectionManager dcaeHttpConnectionManager) {
+ this.refProp = refProp;
+ this.dcaeHttpConnectionManager = dcaeHttpConnectionManager;
+ }
+
+ /**
+ * Get the Operation Status from a specified URL with retry.
+ * @param operationStatusUrl
+ * The URL of the DCAE
+ * @return The status
+ * @throws InterruptedException Exception during the retry
+ */
+ public String getOperationStatusWithRetry(String operationStatusUrl) throws InterruptedException {
+ String operationStatus = "";
+ for (int i = 0; i < Integer.valueOf(refProp.getStringValue("dcae.dispatcher.retry.limit")); i++) {
+ logger.info("Trying to get Operation status on DCAE for url:" + operationStatusUrl);
+ operationStatus = getOperationStatus(operationStatusUrl);
+ logger.info("Current Status is:" + operationStatus);
+ if (!"processing".equalsIgnoreCase(operationStatus)) {
+ return operationStatus;
+ } else {
+ Thread.sleep(Integer.valueOf(refProp.getStringValue("dcae.dispatcher.retry.interval")));
+ }
+ }
+ logger.warn("Number of attempts on DCAE is over, stopping the getOperationStatus method");
+ return operationStatus;
+ }
+
+ /**
+ * Get the Operation Status from a specified URL.
+ * @param statusUrl
+ * The URL provided by a previous DCAE Query
+ * @return The status
+ */
+ public String getOperationStatus(String statusUrl) {
+ // Assigning processing status to monitor operation status further
+ String opStatus = "processing";
+ Date startTime = new Date();
+ LoggingUtils.setTargetContext("DCAE", "getOperationStatus");
+ try {
+ String responseStr = dcaeHttpConnectionManager.doHttpRequest(statusUrl, "GET", null,
+ null, "DCAE", null,
+ null);
+ JSONObject jsonObj = parseResponse(responseStr);
+ String operationType = (String) jsonObj.get("operationType");
+ String status = (String) jsonObj.get(DCAE_STATUS_FIELD);
+ logger.info("Operation Type - " + operationType + ", Status " + status);
+ LoggingUtils.setResponseContext("0", "Get operation status success", this.getClass().getName());
+ opStatus = status;
+ } catch (Exception e) {
+ LoggingUtils.setResponseContext("900", "Get operation status failed", this.getClass().getName());
+ LoggingUtils.setErrorContext("900", "Get operation status error");
+ logger.error("Exception occurred during getOperationStatus Operation with DCAE", e);
+ } finally {
+ LoggingUtils.setTimeContext(startTime, new Date());
+ metricsLogger.info("getOperationStatus complete");
+ }
+ return opStatus;
+ }
+
+ /**
+ * Returns status URL for createNewDeployment operation.
+ * @param deploymentId
+ * The deployment ID
+ * @param serviceTypeId
+ * Service type ID
+ * @param blueprintInputJson
+ * The value for each blueprint parameters in a flat JSON
+ * @return The status URL
+ */
+ public String createNewDeployment(String deploymentId, String serviceTypeId, JsonObject blueprintInputJson) {
+ Date startTime = new Date();
+ LoggingUtils.setTargetContext("DCAE", "createNewDeployment");
+ try {
+ JsonObject rootObject = refProp.getJsonTemplate("dcae.deployment.template").getAsJsonObject();
+ rootObject.addProperty("serviceTypeId", serviceTypeId);
+ if (blueprintInputJson != null) {
+ rootObject.add("inputs", blueprintInputJson);
+ }
+ String apiBodyString = rootObject.toString();
+ logger.info("Dcae api Body String - " + apiBodyString);
+ String url = refProp.getStringValue(DCAE_URL_PROPERTY_NAME) + DCAE_URL_PREFIX + deploymentId;
+ String statusUrl = getDcaeResponse(url, "PUT", apiBodyString, "application/json", DCAE_LINK_FIELD,
+ DCAE_STATUS_FIELD);
+ LoggingUtils.setResponseContext("0", "Create new deployment failed", this.getClass().getName());
+ return statusUrl;
+ } catch (Exception e) {
+ LoggingUtils.setResponseContext("900", "Create new deployment failed", this.getClass().getName());
+ LoggingUtils.setErrorContext("900", "Create new deployment error");
+ logger.error("Exception occurred during createNewDeployment Operation with DCAE", e);
+ throw new DcaeDeploymentException("Exception occurred during createNewDeployment Operation with DCAE", e);
+ } finally {
+ LoggingUtils.setTimeContext(startTime, new Date());
+ metricsLogger.info("createNewDeployment complete");
+ }
+ }
+
+ /***
+ * Returns status URL for deleteExistingDeployment operation.
+ *
+ * @param deploymentId
+ * The deployment ID
+ * @param serviceTypeId
+ * The service Type ID
+ * @return The status URL
+ */
+ public String deleteExistingDeployment(String deploymentId, String serviceTypeId) {
+ Date startTime = new Date();
+ LoggingUtils.setTargetContext("DCAE", "deleteExistingDeployment");
+ try {
+ String apiBodyString = "{\"serviceTypeId\": \"" + serviceTypeId + "\"}";
+ logger.info("Dcae api Body String - " + apiBodyString);
+ String url = refProp.getStringValue(DCAE_URL_PROPERTY_NAME) + DCAE_URL_PREFIX + deploymentId;
+ String statusUrl = getDcaeResponse(url, "DELETE", apiBodyString, "application/json", DCAE_LINK_FIELD,
+ DCAE_STATUS_FIELD);
+ LoggingUtils.setResponseContext("0", "Delete existing deployment success", this.getClass().getName());
+ return statusUrl;
+
+ } catch (Exception e) {
+ LoggingUtils.setResponseContext("900", "Delete existing deployment failed", this.getClass().getName());
+ LoggingUtils.setErrorContext("900", "Delete existing deployment error");
+ logger.error("Exception occurred during deleteExistingDeployment Operation with DCAE", e);
+ throw new DcaeDeploymentException("Exception occurred during deleteExistingDeployment Operation with DCAE",
+ e);
+ } finally {
+ LoggingUtils.setTimeContext(startTime, new Date());
+ metricsLogger.info("deleteExistingDeployment complete");
+ }
+ }
+
+ private String getDcaeResponse(String url, String requestMethod, String payload, String contentType, String node,
+ String nodeAttr) throws IOException, ParseException {
+ Date startTime = new Date();
+ try {
+ String responseStr = dcaeHttpConnectionManager.doHttpRequest(url, requestMethod, payload, contentType, "DCAE", null, null);
+ JSONObject jsonObj = parseResponse(responseStr);
+ JSONObject linksObj = (JSONObject) jsonObj.get(node);
+ String statusUrl = (String) linksObj.get(nodeAttr);
+ logger.info(STATUS_URL_LOG + statusUrl);
+ return statusUrl;
+ } catch (IOException | ParseException e) {
+ logger.error("Exception occurred getting response from DCAE", e);
+ throw e;
+ } finally {
+ LoggingUtils.setTimeContext(startTime, new Date());
+ metricsLogger.info("getDcaeResponse complete");
+ }
+ }
+
+ private JSONObject parseResponse(String responseStr) throws ParseException {
+ JSONParser parser = new JSONParser();
+ return (JSONObject) parser.parse(responseStr);
+ }
} \ No newline at end of file
diff --git a/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java b/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
index 43209b299..68d8529ce 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
@@ -65,7 +65,6 @@ import org.onap.policy.api.PolicyType;
import org.onap.policy.api.PushPolicyParameters;
import org.onap.policy.api.RuleProvider;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
@@ -76,22 +75,23 @@ import org.springframework.stereotype.Component;
@Primary
public class PolicyClient {
- protected PolicyEngine policyEngine;
- protected static final String LOG_POLICY_PREFIX = "Response is ";
- protected static final EELFLogger logger = EELFManager.getInstance().getLogger(PolicyClient.class);
- protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
- public static final String POLICY_MSTYPE_PROPERTY_NAME = "policy.ms.type";
- public static final String POLICY_ONAPNAME_PROPERTY_NAME = "policy.onap.name";
- public static final String POLICY_BASENAME_PREFIX_PROPERTY_NAME = "policy.base.policyNamePrefix";
- public static final String POLICY_OP_NAME_PREFIX_PROPERTY_NAME = "policy.op.policyNamePrefix";
+ private PolicyEngine policyEngine;
+ private static final String LOG_POLICY_PREFIX = "Response is ";
+ private static final EELFLogger logger = EELFManager.getInstance().getLogger(PolicyClient.class);
+ private static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
+ private static final String POLICY_MSTYPE_PROPERTY_NAME = "policy.ms.type";
+ private static final String POLICY_ONAPNAME_PROPERTY_NAME = "policy.onap.name";
+ private static final String POLICY_BASENAME_PREFIX_PROPERTY_NAME = "policy.base.policyNamePrefix";
+ private static final String POLICY_OP_NAME_PREFIX_PROPERTY_NAME = "policy.op.policyNamePrefix";
public static final String POLICY_MS_NAME_PREFIX_PROPERTY_NAME = "policy.ms.policyNamePrefix";
- public static final String POLICY_OP_TYPE_PROPERTY_NAME = "policy.op.type";
- public static final String TOSCA_FILE_TEMP_PATH = "tosca.filePath";
+ private static final String POLICY_OP_TYPE_PROPERTY_NAME = "policy.op.type";
+ private static final String TOSCA_FILE_TEMP_PATH = "tosca.filePath";
+ private static final String POLICY_COMMUNICATION_LOG_MESSAGE = "Exception occurred during policy communication";
+ private static final String POLICY_COMMUNICATION_EXC_MESSAGE = "Exception while communicating with Policy";
+ private static final String POLICY = "Policy";
@Autowired
- protected ApplicationContext appContext;
- @Autowired
- protected ClampProperties refProp;
+ private ClampProperties refProp;
@Autowired
private PolicyConfiguration policyConfiguration;
@@ -274,12 +274,12 @@ public class PolicyClient {
if ((PolicyClass.Decision.equals(policyParameters.getPolicyClass()) && !checkDecisionPolicyExists(prop))
|| (PolicyClass.Config.equals(policyParameters.getPolicyClass())
&& !checkPolicyExists(prop, policyPrefix, policyNameWithPrefix))) {
- LoggingUtils.setTargetContext("Policy", "createPolicy");
+ LoggingUtils.setTargetContext(POLICY, "createPolicy");
logger.info("Attempting to create policy for action=" + prop.getActionCd());
response = getPolicyEngine().createPolicy(policyParameters);
responseMessage = response.getResponseMessage();
} else {
- LoggingUtils.setTargetContext("Policy", "updatePolicy");
+ LoggingUtils.setTargetContext(POLICY, "updatePolicy");
logger.info("Attempting to update policy for action=" + prop.getActionCd());
response = getPolicyEngine().updatePolicy(policyParameters);
responseMessage = response.getResponseMessage();
@@ -287,8 +287,8 @@ public class PolicyClient {
} catch (Exception e) {
LoggingUtils.setResponseContext("900", "Policy send failed", this.getClass().getName());
LoggingUtils.setErrorContext("900", "Policy send error");
- logger.error("Exception occurred during policy communication", e);
- throw new PolicyClientException("Exception while communicating with Policy", e);
+ logger.error(POLICY_COMMUNICATION_LOG_MESSAGE, e);
+ throw new PolicyClientException(POLICY_COMMUNICATION_EXC_MESSAGE, e);
}
logger.info(LOG_POLICY_PREFIX + responseMessage);
LoggingUtils.setTimeContext(startTime, new Date());
@@ -329,7 +329,7 @@ public class PolicyClient {
PolicyChangeResponse response;
String responseMessage = "";
try {
- LoggingUtils.setTargetContext("Policy", "pushPolicy");
+ LoggingUtils.setTargetContext(POLICY, "pushPolicy");
logger.info("Attempting to push policy...");
response = getPolicyEngine().pushPolicy(pushPolicyParameters);
if (response != null) {
@@ -338,8 +338,8 @@ public class PolicyClient {
} catch (Exception e) {
LoggingUtils.setResponseContext("900", "Policy push failed", this.getClass().getName());
LoggingUtils.setErrorContext("900", "Policy push error");
- logger.error("Exception occurred during policy communication", e);
- throw new PolicyClientException("Exception while communicating with Policy", e);
+ logger.error(POLICY_COMMUNICATION_LOG_MESSAGE, e);
+ throw new PolicyClientException(POLICY_COMMUNICATION_EXC_MESSAGE, e);
}
logger.info(LOG_POLICY_PREFIX + responseMessage);
if (response != null && (response.getResponseCode() == 200 || response.getResponseCode() == 204)) {
@@ -466,8 +466,8 @@ public class PolicyClient {
deletePolicyResponse = deletePolicy(prop, DictionaryType.Decision.toString(), null);
}
} catch (Exception e) {
- logger.error("Exception occurred during policy communication", e);
- throw new PolicyClientException("Exception while communicating with Policy", e);
+ logger.error(POLICY_COMMUNICATION_LOG_MESSAGE, e);
+ throw new PolicyClientException(POLICY_COMMUNICATION_EXC_MESSAGE, e);
}
return deletePolicyResponse;
}
@@ -492,8 +492,8 @@ public class PolicyClient {
deletePolicyResponse = deletePolicy(prop, policyType, null);
}
} catch (Exception e) {
- logger.error("Exception occurred during policy communication", e);
- throw new PolicyClientException("Exception while communicating with Policy", e);
+ logger.error(POLICY_COMMUNICATION_LOG_MESSAGE, e);
+ throw new PolicyClientException(POLICY_COMMUNICATION_EXC_MESSAGE, e);
}
return deletePolicyResponse;
}
@@ -650,8 +650,8 @@ public class PolicyClient {
} catch (Exception e) {
LoggingUtils.setResponseContext("900", "Policy Model import failed", this.getClass().getName());
LoggingUtils.setErrorContext("900", "Policy Model import error");
- logger.error("Exception occurred during policy communication", e);
- throw new PolicyClientException("Exception while communicating with Policy", e);
+ logger.error(POLICY_COMMUNICATION_LOG_MESSAGE, e);
+ throw new PolicyClientException(POLICY_COMMUNICATION_EXC_MESSAGE, e);
}
logger.info(LOG_POLICY_PREFIX + responseMessage);
if (response != null && (response.getResponseCode() == 200 || response.getResponseCode() == 204)) {
diff --git a/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java b/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java
index 3a98788f5..3dc807388 100644
--- a/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java
@@ -22,11 +22,34 @@
package org.onap.clamp.clds.config;
+import java.io.IOException;
+import java.net.URL;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
+
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.http4.HttpClientConfigurer;
+import org.apache.camel.component.http4.HttpComponent;
import org.apache.camel.model.rest.RestBindingMode;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.scheme.Scheme;
+import org.apache.http.conn.scheme.SchemeRegistry;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLSocketFactory;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
import org.onap.clamp.clds.util.ClampVersioning;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
@@ -35,15 +58,69 @@ public class CamelConfiguration extends RouteBuilder {
@Autowired
CamelContext camelContext;
+ @Autowired
+ private Environment env;
+
+ private void configureDefaultSslProperties() {
+ if (env.getProperty("server.ssl.trust-store") != null) {
+ URL storeResource = CamelConfiguration.class
+ .getResource(env.getProperty("server.ssl.trust-store").replaceAll("classpath:", ""));
+ System.setProperty("javax.net.ssl.trustStore", storeResource.getPath());
+ System.setProperty("javax.net.ssl.trustStorePassword", env.getProperty("server.ssl.trust-store-password"));
+ System.setProperty("javax.net.ssl.trustStoreType", "jks");
+ System.setProperty("ssl.TrustManagerFactory.algorithm", "PKIX");
+ storeResource = CamelConfiguration.class
+ .getResource(env.getProperty("server.ssl.key-store").replaceAll("classpath:", ""));
+ System.setProperty("javax.net.ssl.keyStore", storeResource.getPath());
+ System.setProperty("javax.net.ssl.keyStorePassword", env.getProperty("server.ssl.key-store-password"));
+ System.setProperty("javax.net.ssl.keyStoreType", env.getProperty("server.ssl.key-store-type"));
+ }
+ }
+
+ private void registerTrustStore()
+ throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException, CertificateException, IOException {
+ if (env.getProperty("server.ssl.trust-store") != null) {
+ KeyStore truststore = KeyStore.getInstance("JKS");
+ truststore.load(
+ getClass().getClassLoader()
+ .getResourceAsStream(env.getProperty("server.ssl.trust-store").replaceAll("classpath:", "")),
+ env.getProperty("server.ssl.trust-store-password").toCharArray());
+
+ TrustManagerFactory trustFactory = TrustManagerFactory.getInstance("PKIX");
+ trustFactory.init(truststore);
+ SSLContext sslcontext = SSLContext.getInstance("TLS");
+ sslcontext.init(null, trustFactory.getTrustManagers(), null);
+ SSLSocketFactory factory = new SSLSocketFactory(sslcontext, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
+ SchemeRegistry registry = new SchemeRegistry();
+ final Scheme scheme = new Scheme("https4", 443, factory);
+ registry.register(scheme);
+ ConnectionSocketFactory plainsf = PlainConnectionSocketFactory.getSocketFactory();
+ HttpComponent http4 = camelContext.getComponent("https4", HttpComponent.class);
+ http4.setHttpClientConfigurer(new HttpClientConfigurer() {
+
+ @Override
+ public void configureHttpClient(HttpClientBuilder builder) {
+ builder.setSSLSocketFactory(factory);
+ Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
+ .register("https", factory).register("http", plainsf).build();
+ builder.setConnectionManager(new BasicHttpClientConnectionManager(registry));
+ }
+ });
+ }
+ }
+
@Override
- public void configure() {
+ public void configure()
+ throws KeyManagementException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {
restConfiguration().component("servlet").bindingMode(RestBindingMode.json).jsonDataFormat("clamp-gson")
.dataFormatProperty("prettyPrint", "true")// .enableCORS(true)
// turn on swagger api-doc
.apiContextPath("api-doc").apiVendorExtension(true).apiProperty("api.title", "Clamp Rest API")
.apiProperty("api.version", ClampVersioning.getCldsVersionFromProps())
.apiProperty("base.path", "/restservices/clds/");
- // .apiProperty("cors", "true");
- camelContext.setTracing(true);
+ // camelContext.setTracing(true);
+
+ configureDefaultSslProperties();
+ registerTrustStore();
}
}
diff --git a/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java b/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java
index 6ec2221d4..a8ff12067 100644
--- a/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -54,6 +56,7 @@ public class DefaultUserConfiguration extends WebSecurityConfigurerAdapter {
protected static final EELFLogger logger = EELFManager.getInstance().getLogger(DefaultUserConfiguration.class);
protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
+ private static final String SETUP_WEB_USERS_EXCEPTION_MSG = "Exception occurred during the setup of the Web users in memory";
@Autowired
private ClampProperties refProp;
@Value("${clamp.config.security.permission.type.cl:permission-type-cl}")
@@ -76,8 +79,8 @@ public class DefaultUserConfiguration extends WebSecurityConfigurerAdapter {
.and().invalidSessionUrl("/designer/timeout.html");
} catch (Exception e) {
- logger.error("Exception occurred during the setup of the Web users in memory", e);
- throw new CldsUsersException("Exception occurred during the setup of the Web users in memory", e);
+ logger.error(SETUP_WEB_USERS_EXCEPTION_MSG, e);
+ throw new CldsUsersException(SETUP_WEB_USERS_EXCEPTION_MSG, e);
}
}
@@ -105,8 +108,8 @@ public class DefaultUserConfiguration extends WebSecurityConfigurerAdapter {
.authorities(user.getPermissionsString()).and().passwordEncoder(passwordEncoder);
}
} catch (Exception e) {
- logger.error("Exception occurred during the setup of the Web users in memory", e);
- throw new CldsUsersException("Exception occurred during the setup of the Web users in memory", e);
+ logger.error(SETUP_WEB_USERS_EXCEPTION_MSG, e);
+ throw new CldsUsersException(SETUP_WEB_USERS_EXCEPTION_MSG, e);
}
}
diff --git a/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java b/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java
index 92b0272a9..bee0d4c05 100644
--- a/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java
@@ -39,23 +39,27 @@ import org.onap.clamp.clds.exception.sdc.controller.SdcControllerException;
import org.onap.clamp.clds.sdc.controller.SdcSingleController;
import org.onap.clamp.clds.sdc.controller.SdcSingleControllerStatus;
import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
-import org.onap.clamp.clds.sdc.controller.installer.CsarInstallerImpl;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
@Configuration
+@ComponentScan(basePackages = "org.onap.clamp.clds")
@Profile("clamp-sdc-controller")
public class CldsSdcControllerConfiguration {
private static final EELFLogger logger = EELFManager.getInstance().getLogger(CldsSdcControllerConfiguration.class);
private List<SdcSingleController> sdcControllersList = new ArrayList<>();
- @Autowired
- private ClampProperties clampProp;
- @Autowired
- protected CsarInstaller csarInstaller;
+ private final ClampProperties clampProp;
+ private final CsarInstaller csarInstaller;
+
+ public CldsSdcControllerConfiguration(ClampProperties clampProp, @Qualifier("oldModelInstaller") CsarInstaller csarInstaller) {
+ this.clampProp = clampProp;
+ this.csarInstaller = csarInstaller;
+ }
/**
* Loads SDC controllers configuration.
diff --git a/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java b/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
index 55b90cc52..8b8ee932b 100644
--- a/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
@@ -25,36 +25,39 @@ package org.onap.clamp.clds.config.spring;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import java.util.ArrayList;
import java.util.List;
-
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
-
import org.onap.clamp.clds.config.ClampProperties;
import org.onap.clamp.clds.config.sdc.SdcControllersConfiguration;
import org.onap.clamp.clds.exception.sdc.controller.SdcControllerException;
import org.onap.clamp.clds.sdc.controller.SdcSingleController;
import org.onap.clamp.clds.sdc.controller.SdcSingleControllerStatus;
import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
-import org.onap.clamp.loop.CsarInstallerImpl;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
@Configuration
+@ComponentScan(basePackages = {"org.onap.clamp.loop", "org.onap.clamp.clds.config"})
@Profile("clamp-sdc-controller-new")
public class SdcControllerConfiguration {
private static final EELFLogger logger = EELFManager.getInstance().getLogger(SdcControllerConfiguration.class);
private List<SdcSingleController> sdcControllersList = new ArrayList<>();
+ private final ClampProperties clampProp;
+ private final CsarInstaller csarInstaller;
+
@Autowired
- private ClampProperties clampProp;
- @Autowired
- protected CsarInstaller csarInstaller;
+ public SdcControllerConfiguration(ClampProperties clampProp, @Qualifier("loopInstaller") CsarInstaller csarInstaller) {
+ this.clampProp = clampProp;
+ this.csarInstaller = csarInstaller;
+ }
/**
* Loads SDC controller configuration.
@@ -101,11 +104,6 @@ public class SdcControllerConfiguration {
});
}
- @Bean(name = "csarInstaller")
- public CsarInstaller getCsarInstaller() {
- return new CsarInstallerImpl();
- }
-
@Bean(name = "sdcControllersConfiguration")
public SdcControllersConfiguration getSdcControllersConfiguration() {
return new SdcControllersConfiguration();
diff --git a/src/main/java/org/onap/clamp/clds/dao/CldsDao.java b/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
index 44228b226..16a6a748c 100644
--- a/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
+++ b/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
@@ -352,7 +352,7 @@ public class CldsDao {
}
/**
- * Helper method to setup the base template properties
+ * Helper method to setup the base template properties.
*
* @param template
* the template
@@ -474,7 +474,7 @@ public class CldsDao {
}
/**
- * Helper method to setup the event prop to the CldsEvent class
+ * Helper method to setup the event prop to the CldsEvent class.
*
* @param event
* the clds event
@@ -742,12 +742,13 @@ public class CldsDao {
String dictElementShortName) {
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
List<CldsDictionaryItem> dictionaryItems = new ArrayList<>();
- String dictionarySql = new StringBuilder("SELECT de.dict_element_id, de.dictionary_id, de.dict_element_name, " +
- "de.dict_element_short_name, de.dict_element_description, de.dict_element_type, de.created_by, " +
- "de.modified_by, de.timestamp FROM dictionary_elements de, " +
- "dictionary d WHERE de.dictionary_id = d.dictionary_id")
+ String dictionarySql = new StringBuilder("SELECT de.dict_element_id, de.dictionary_id, de.dict_element_name, "
+ + "de.dict_element_short_name, de.dict_element_description, de.dict_element_type, de.created_by, "
+ + "de.modified_by, de.timestamp FROM dictionary_elements de, "
+ + "dictionary d WHERE de.dictionary_id = d.dictionary_id")
.append((dictionaryId != null) ? (" AND d.dictionary_id = '" + dictionaryId + "'") : "")
- .append((dictElementShortName != null) ? (" AND de.dict_element_short_name = '" + dictElementShortName + "'") : "")
+ .append((dictElementShortName != null) ? (" AND de.dict_element_short_name = '" + dictElementShortName
+ + "'") : "")
.append((dictionaryName != null) ? (" AND dictionary_name = '" + dictionaryName + "'") : "").toString();
List<Map<String, Object>> rows = jdbcTemplateObject.queryForList(dictionarySql);
@@ -780,8 +781,8 @@ public class CldsDao {
*/
public Map<String, String> getDictionaryElementsByType(String dictionaryElementType) {
Map<String, String> dictionaryItems = new HashMap<>();
- String dictionarySql = new StringBuilder("SELECT dict_element_name, dict_element_short_name " +
- "FROM dictionary_elements WHERE dict_element_type = '")
+ String dictionarySql = new StringBuilder("SELECT dict_element_name, dict_element_short_name "
+ + "FROM dictionary_elements WHERE dict_element_type = '")
.append(dictionaryElementType).append("'").toString();
List<Map<String, Object>> rows = jdbcTemplateObject.queryForList(dictionarySql);
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/Holmes.java b/src/main/java/org/onap/clamp/clds/model/properties/Holmes.java
index a93b09cfa..a56c57d19 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/Holmes.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/Holmes.java
@@ -26,11 +26,11 @@
package org.onap.clamp.clds.model.properties;
import com.google.gson.JsonObject;
+
import org.onap.clamp.clds.util.JsonUtils;
/**
- * Parse Holmes bpmn parameters json properties.
- * Example json:
+ * Parse Holmes bpmn parameters json properties. Example json:
* [{"name":"correlationalLogic","value":"vcwx"},{"name":"configPolicyName","value":"cccc"}]
*/
public class Holmes extends AbstractModelElement {
@@ -43,14 +43,18 @@ public class Holmes extends AbstractModelElement {
/**
* Default constructor for Holmes Element.
*
- * @param modelBpmn The model bpmn
- * @param modelJson The model json
+ * @param modelBpmn
+ * The model bpmn
+ * @param modelJson
+ * The model json
*/
public Holmes(ModelBpmn modelBpmn, JsonObject modelJson) {
super(TYPE_HOLMES, modelBpmn, modelJson);
- correlationLogic = JsonUtils.getStringValueByName(modelElementJsonNode, "correlationalLogic");
- configPolicyName = JsonUtils.getStringValueByName(modelElementJsonNode, "configPolicyName");
+ if (modelElementJsonNode != null) {
+ correlationLogic = JsonUtils.getStringValueByName(modelElementJsonNode, "correlationalLogic");
+ configPolicyName = JsonUtils.getStringValueByName(modelElementJsonNode, "configPolicyName");
+ }
}
public static final String getType() {
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
index 5dcffd61c..3792c1720 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
@@ -29,6 +29,7 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
+import java.util.AbstractMap;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -52,21 +53,23 @@ public class BlueprintParser {
private static final String TYPE = "type";
private static final String PROPERTIES = "properties";
private static final String NAME = "name";
- private static final String POLICYID = "policy_id";
- private static final String POLICY_TYPEID = "policy_type_id";
+ private static final String INPUT = "inputs";
+ private static final String GET_INPUT = "get_input";
+ private static final String POLICY_MODELID = "policy_model_id";
private static final String RELATIONSHIPS = "relationships";
private static final String CLAMP_NODE_RELATIONSHIPS_GETS_INPUT_FROM = "clamp_node.relationships.gets_input_from";
private static final String TARGET = "target";
public Set<MicroService> getMicroServices(String blueprintString) {
Set<MicroService> microServices = new HashSet<>();
- JsonObject jsonObject = BlueprintParser.convertToJson(blueprintString);
- JsonObject results = jsonObject.get(NODE_TEMPLATES).getAsJsonObject();
+ JsonObject blueprintJson = BlueprintParser.convertToJson(blueprintString);
+ JsonObject nodeTemplateList = blueprintJson.get(NODE_TEMPLATES).getAsJsonObject();
+ JsonObject inputList = blueprintJson.get(INPUT).getAsJsonObject();
- for (Entry<String, JsonElement> entry : results.entrySet()) {
+ for (Entry<String, JsonElement> entry : nodeTemplateList.entrySet()) {
JsonObject nodeTemplate = entry.getValue().getAsJsonObject();
if (nodeTemplate.get(TYPE).getAsString().contains(DCAE_NODES)) {
- MicroService microService = getNodeRepresentation(entry);
+ MicroService microService = getNodeRepresentation(entry, nodeTemplateList, inputList);
microServices.add(microService);
}
}
@@ -89,7 +92,7 @@ public class BlueprintParser {
}
String msName = theBiggestMicroServiceKey.toLowerCase().contains(HOLMES_PREFIX) ? HOLMES : TCA;
return Collections
- .singletonList(new MicroService(msName, "onap.policy.monitoring.cdap.tca.hi.lo.app", "", "", ""));
+ .singletonList(new MicroService(msName, "onap.policies.monitoring.cdap.tca.hi.lo.app", "", ""));
}
String getName(Entry<String, JsonElement> entry) {
@@ -118,30 +121,48 @@ public class BlueprintParser {
return "";
}
- String getModelType(Entry<String, JsonElement> entry) {
+ String findModelTypeInTargetArray(JsonArray jsonArray, JsonObject nodeTemplateList, JsonObject inputList) {
+ for (JsonElement elem : jsonArray) {
+ String modelType = getModelType(
+ new AbstractMap.SimpleEntry<String, JsonElement>(elem.getAsJsonObject().get(TARGET).getAsString(),
+ nodeTemplateList.get(elem.getAsJsonObject().get(TARGET).getAsString()).getAsJsonObject()),
+ nodeTemplateList, inputList);
+ if (!modelType.isEmpty()) {
+ return modelType;
+ }
+ }
+ return "";
+ }
+
+ String getModelType(Entry<String, JsonElement> entry, JsonObject nodeTemplateList, JsonObject inputList) {
JsonObject ob = entry.getValue().getAsJsonObject();
+ // Search first in this node template
if (ob.has(PROPERTIES)) {
JsonObject properties = ob.get(PROPERTIES).getAsJsonObject();
- if (properties.has(POLICYID)) {
- JsonObject policyIdObj = properties.get(POLICYID).getAsJsonObject();
- if (policyIdObj.has(POLICY_TYPEID)) {
- return policyIdObj.get(POLICY_TYPEID).getAsString();
+ if (properties.has(POLICY_MODELID)) {
+ if (properties.get(POLICY_MODELID).isJsonObject()) {
+ // it's a blueprint parameter
+ return inputList.get(properties.get(POLICY_MODELID).getAsJsonObject().get(GET_INPUT).getAsString())
+ .getAsJsonObject().get("default").getAsString();
+ } else {
+ // It's a direct value
+ return properties.get(POLICY_MODELID).getAsString();
}
}
}
+ // Or it's may be defined in a relationship
+ if (ob.has(RELATIONSHIPS)) {
+ return findModelTypeInTargetArray(ob.get(RELATIONSHIPS).getAsJsonArray(), nodeTemplateList, inputList);
+ }
return "";
}
- String getBlueprintName(Entry<String, JsonElement> entry) {
- return entry.getKey();
- }
-
- MicroService getNodeRepresentation(Entry<String, JsonElement> entry) {
+ MicroService getNodeRepresentation(Entry<String, JsonElement> entry, JsonObject nodeTemplateList,
+ JsonObject inputList) {
String name = getName(entry);
String getInputFrom = getInput(entry);
- String modelType = getModelType(entry);
- String blueprintName = getBlueprintName(entry);
- return new MicroService(name, modelType, getInputFrom, "", blueprintName);
+ String modelType = getModelType(entry, nodeTemplateList, inputList);
+ return new MicroService(name, modelType, getInputFrom, "");
}
private String getTarget(JsonObject elementObject) {
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
index 5a21a1f8d..7ef217b4e 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
@@ -132,7 +132,7 @@ public class CsarHandler {
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
- if (entry.getName().contains(BLUEPRINT_TYPE)) {
+ if (!entry.isDirectory() && entry.getName().contains(BLUEPRINT_TYPE)) {
BlueprintArtifact blueprintArtifact = new BlueprintArtifact();
blueprintArtifact.setBlueprintArtifactName(
entry.getName().substring(entry.getName().lastIndexOf('/') + 1, entry.getName().length()));
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstaller.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstaller.java
index 12a761dbf..a1f8897fb 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstaller.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstaller.java
@@ -27,6 +27,7 @@ import org.onap.clamp.clds.exception.policy.PolicyModelException;
import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException;
public interface CsarInstaller {
+ String TEMPLATE_NAME_PREFIX = "DCAE-Designer-Template-";
boolean isCsarAlreadyDeployed(CsarHandler csar) throws SdcArtifactInstallerException;
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
index 6dc418340..6c41e9c66 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
@@ -56,6 +56,7 @@ import org.onap.clamp.clds.transform.XslTransformer;
import org.onap.clamp.clds.util.JsonUtils;
import org.onap.clamp.clds.util.drawing.SvgFacade;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
@@ -68,6 +69,7 @@ import org.yaml.snakeyaml.Yaml;
* received from SDC in DB.
*/
@Component
+@Qualifier("oldModelInstaller")
public class CsarInstallerImpl implements CsarInstaller {
private static final EELFLogger logger = EELFManager.getInstance().getLogger(CsarInstallerImpl.class);
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/MicroService.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/MicroService.java
index ac4daeffb..9bc7a022a 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/MicroService.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/MicroService.java
@@ -29,16 +29,14 @@ import java.util.Objects;
public class MicroService {
private final String name;
private final String modelType;
- private final String blueprintName;
private final String inputFrom;
private String mappedNameJpa;
- public MicroService(String name, String modelType, String inputFrom, String mappedNameJpa, String blueprintName) {
+ public MicroService(String name, String modelType, String inputFrom, String mappedNameJpa) {
this.name = name;
this.inputFrom = inputFrom;
this.mappedNameJpa = mappedNameJpa;
- this.modelType = modelType;
- this.blueprintName = blueprintName;
+ this.modelType = modelType;
}
public String getName() {
@@ -53,15 +51,10 @@ public class MicroService {
return inputFrom;
}
- public String getBlueprintName() {
- return blueprintName;
- }
-
@Override
public String toString() {
return "MicroService{" + "name='" + name + '\'' + ", modelType='" + modelType + '\'' + ", inputFrom='"
- + inputFrom + '\'' + ", mappedNameJpa='" + mappedNameJpa + '\'' + ", blueprintName='"
- + blueprintName + '\'' + '}';
+ + inputFrom + '\'' + ", mappedNameJpa='" + mappedNameJpa + '\'' + '}';
}
public String getMappedNameJpa() {
@@ -81,11 +74,12 @@ public class MicroService {
return false;
}
MicroService that = (MicroService) o;
- return name.equals(that.name) && modelType.equals(that.modelType) && inputFrom.equals(that.inputFrom) && mappedNameJpa.equals(that.mappedNameJpa) && blueprintName.equals(that.blueprintName);
+ return name.equals(that.name) && modelType.equals(that.modelType) && inputFrom.equals(that.inputFrom)
+ && mappedNameJpa.equals(that.mappedNameJpa);
}
@Override
public int hashCode() {
- return Objects.hash(name, modelType, inputFrom, mappedNameJpa, blueprintName);
+ return Objects.hash(name, modelType, inputFrom, mappedNameJpa);
}
}
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java
index bf7c502a1..63a913314 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017-2019 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -26,7 +28,6 @@ package org.onap.clamp.clds.service;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
@@ -35,11 +36,9 @@ import java.lang.reflect.Type;
import java.util.Date;
import java.util.List;
import java.util.UUID;
-
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.BadRequestException;
import javax.xml.transform.TransformerException;
-
import org.apache.camel.Produce;
import org.json.simple.parser.ParseException;
import org.onap.clamp.clds.camel.CamelProxy;
@@ -59,7 +58,7 @@ import org.onap.clamp.clds.model.DcaeEvent;
import org.onap.clamp.clds.model.ValueItem;
import org.onap.clamp.clds.model.properties.ModelProperties;
import org.onap.clamp.clds.model.sdc.SdcServiceInfo;
-import org.onap.clamp.clds.sdc.controller.installer.CsarInstallerImpl;
+import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
import org.onap.clamp.clds.transform.XslTransformer;
import org.onap.clamp.clds.util.JsonUtils;
import org.onap.clamp.clds.util.LoggingUtils;
@@ -206,7 +205,7 @@ public class CldsService extends SecureServiceBase {
public List<CldsMonitoringDetails> getCldsDetails() {
util.entering(request, "CldsService: GET model details");
Date startTime = new Date();
- List<CldsMonitoringDetails> cldsMonitoringDetailsList = cldsDao.getCldsMonitoringDetails();
+ final List<CldsMonitoringDetails> cldsMonitoringDetailsList = cldsDao.getCldsMonitoringDetails();
// audit log
LoggingUtils.setTimeContext(startTime, new Date());
auditLogger.info("GET cldsDetails completed");
@@ -226,7 +225,7 @@ public class CldsService extends SecureServiceBase {
LoggingUtils.setTimeContext(startTime, new Date());
CldsInfoProvider cldsInfoProvider = new CldsInfoProvider(this);
- CldsInfo cldsInfo = cldsInfoProvider.getCldsInfo();
+ final CldsInfo cldsInfo = cldsInfoProvider.getCldsInfo();
// audit log
LoggingUtils.setTimeContext(startTime, new Date());
@@ -248,7 +247,7 @@ public class CldsService extends SecureServiceBase {
Date startTime = new Date();
isAuthorized(permissionReadCl);
logger.info("GET bpmnText for modelName={}", modelName);
- CldsModel model = CldsModel.retrieve(cldsDao, modelName, false);
+ final CldsModel model = CldsModel.retrieve(cldsDao, modelName, false);
// audit log
LoggingUtils.setTimeContext(startTime, new Date());
auditLogger.info("GET model bpmn completed");
@@ -269,7 +268,7 @@ public class CldsService extends SecureServiceBase {
Date startTime = new Date();
isAuthorized(permissionReadCl);
logger.info("GET imageText for modelName={}", modelName);
- CldsModel model = CldsModel.retrieve(cldsDao, modelName, false);
+ final CldsModel model = CldsModel.retrieve(cldsDao, modelName, false);
// audit log
LoggingUtils.setTimeContext(startTime, new Date());
auditLogger.info("GET model image completed");
@@ -285,7 +284,7 @@ public class CldsService extends SecureServiceBase {
*/
public CldsModel getModel(String modelName) {
util.entering(request, "CldsService: GET model");
- Date startTime = new Date();
+ final Date startTime = new Date();
isAuthorized(permissionReadCl);
logger.debug("GET model for modelName={}", modelName);
CldsModel cldsModel = CldsModel.retrieve(cldsDao, modelName, false);
@@ -295,7 +294,7 @@ public class CldsService extends SecureServiceBase {
try {
// Method to call dcae inventory and invoke insert event method
if (cldsModel.canDcaeInventoryCall()
- && !cldsModel.getTemplateName().startsWith(CsarInstallerImpl.TEMPLATE_NAME_PREFIX)) {
+ && !cldsModel.getTemplateName().startsWith(CsarInstaller.TEMPLATE_NAME_PREFIX)) {
dcaeInventoryServices.setEventInventory(cldsModel, getUserId());
}
// This is a blocking call
@@ -326,7 +325,7 @@ public class CldsService extends SecureServiceBase {
*/
public CldsModel putModel(String modelName, CldsModel cldsModel) {
util.entering(request, "CldsService: PUT model");
- Date startTime = new Date();
+ final Date startTime = new Date();
isAuthorized(permissionUpdateCl);
isAuthorizedForVf(cldsModel);
logger.info("PUT model for modelName={}", modelName);
@@ -353,7 +352,7 @@ public class CldsService extends SecureServiceBase {
Date startTime = new Date();
isAuthorized(permissionReadCl);
logger.info("GET list of model names");
- List<ValueItem> names = cldsDao.getModelNames();
+ final List<ValueItem> names = cldsDao.getModelNames();
// audit log
LoggingUtils.setTimeContext(startTime, new Date());
auditLogger.info("GET model names completed");
@@ -412,11 +411,11 @@ public class CldsService extends SecureServiceBase {
model.save(cldsDao, getUserId());
// get vars and format if necessary
- String prop = model.getPropText();
- String bpmn = model.getBpmnText();
- String docText = model.getDocText();
- String controlName = model.getControlName();
- String bpmnJson = cldsBpmnTransformer.doXslTransformToString(bpmn);
+ final String prop = model.getPropText();
+ final String bpmn = model.getBpmnText();
+ final String docText = model.getDocText();
+ final String controlName = model.getControlName();
+ final String bpmnJson = cldsBpmnTransformer.doXslTransformToString(bpmn);
logger.info("PUT bpmnJson={}", bpmnJson);
// Test flag coming from UI or from Clamp config
boolean isTest = Boolean.parseBoolean(test)
@@ -474,7 +473,7 @@ public class CldsService extends SecureServiceBase {
*/
public String postDcaeEvent(String test, DcaeEvent dcaeEvent) {
util.entering(request, "CldsService: Post dcae event");
- Date startTime = new Date();
+ final Date startTime = new Date();
String userid = null;
// TODO: allow auth checking to be turned off by removing the permission
// type property
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java b/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java
index f60c63830..d107731b0 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -79,7 +81,7 @@ public class CldsTemplateService extends SecureServiceBase {
Date startTime = new Date();
isAuthorized(permissionReadTemplate);
logger.info("GET bpmnText for templateName=" + templateName);
- CldsTemplate template = CldsTemplate.retrieve(cldsDao, templateName, false);
+ final CldsTemplate template = CldsTemplate.retrieve(cldsDao, templateName, false);
// audit log
LoggingUtils.setTimeContext(startTime, new Date());
auditLogger.info("GET template bpmn completed");
@@ -100,7 +102,7 @@ public class CldsTemplateService extends SecureServiceBase {
Date startTime = new Date();
isAuthorized(permissionReadTemplate);
logger.info("GET imageText for templateName=" + templateName);
- CldsTemplate template = CldsTemplate.retrieve(cldsDao, templateName, false);
+ final CldsTemplate template = CldsTemplate.retrieve(cldsDao, templateName, false);
// audit log
LoggingUtils.setTimeContext(startTime, new Date());
auditLogger.info("GET template image completed");
@@ -116,7 +118,7 @@ public class CldsTemplateService extends SecureServiceBase {
*/
public CldsTemplate getTemplate(String templateName) {
util.entering(request, "CldsTemplateService: GET template");
- Date startTime = new Date();
+ final Date startTime = new Date();
isAuthorized(permissionReadTemplate);
logger.info("GET model for templateName=" + templateName);
CldsTemplate template = CldsTemplate.retrieve(cldsDao, templateName, false);
@@ -137,7 +139,7 @@ public class CldsTemplateService extends SecureServiceBase {
*/
public CldsTemplate putTemplate(String templateName, CldsTemplate cldsTemplate) {
util.entering(request, "CldsTemplateService: PUT template");
- Date startTime = new Date();
+ final Date startTime = new Date();
isAuthorized(permissionUpdateTemplate);
logger.info("PUT Template for templateName=" + templateName);
logger.info("PUT bpmnText=" + cldsTemplate.getBpmnText());
@@ -162,7 +164,7 @@ public class CldsTemplateService extends SecureServiceBase {
Date startTime = new Date();
isAuthorized(permissionReadTemplate);
logger.info("GET list of template names");
- List<ValueItem> names = cldsDao.getTemplateNames();
+ final List<ValueItem> names = cldsDao.getTemplateNames();
// audit log
LoggingUtils.setTimeContext(startTime, new Date());
auditLogger.info("GET template names completed");
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java b/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java
index f2c75ead1..81bafef47 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java
@@ -5,6 +5,8 @@
* Copyright (C) 2018 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -84,7 +86,7 @@ public class CldsToscaService extends SecureServiceBase {
* type
*/
public ResponseEntity<?> parseToscaModelAndSave(String toscaModelName, CldsToscaModel cldsToscaModel) {
- Date startTime = new Date();
+ final Date startTime = new Date();
LoggingUtils.setRequestContext("CldsToscaService: Parse Tosca model and save", getPrincipalName());
// TODO revisit based on new permissions
isAuthorized(permissionUpdateTosca);
@@ -107,7 +109,7 @@ public class CldsToscaService extends SecureServiceBase {
LoggingUtils.setRequestContext("CldsToscaService: Get All tosca models", getPrincipalName());
// TODO revisit based on new permissions
isAuthorized(permissionReadTosca);
- List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getAllToscaModels()).get();
+ final List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getAllToscaModels()).get();
LoggingUtils.setTimeContext(startTime, new Date());
LoggingUtils.setResponseContext("0", "Get All tosca models success", this.getClass().getName());
auditLogger.info("Get All tosca models");
@@ -128,7 +130,8 @@ public class CldsToscaService extends SecureServiceBase {
LoggingUtils.setRequestContext("CldsToscaService: Get tosca models by model name", getPrincipalName());
// TODO revisit based on new permissions
isAuthorized(permissionReadTosca);
- List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getToscaModelByName(toscaModelName)).get();
+ final List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getToscaModelByName(toscaModelName))
+ .get();
LoggingUtils.setTimeContext(startTime, new Date());
LoggingUtils.setResponseContext("0", "Get tosca models by model name success", this.getClass().getName());
auditLogger.info("GET tosca models by model name completed");
@@ -140,6 +143,7 @@ public class CldsToscaService extends SecureServiceBase {
* from the database.
*
* @param policyType
+ * The type of the policy
* @return clds tosca model - CLDS tosca model for a given policy type
*/
public CldsToscaModel getToscaModelsByPolicyType(String policyType) {
@@ -147,7 +151,8 @@ public class CldsToscaService extends SecureServiceBase {
LoggingUtils.setRequestContext("CldsToscaService: Get tosca models by policyType", getPrincipalName());
// TODO revisit based on new permissions
isAuthorized(permissionReadTosca);
- List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getToscaModelByPolicyType(policyType)).get();
+ final List<CldsToscaModel> cldsToscaModels = Optional.ofNullable(cldsDao.getToscaModelByPolicyType(policyType))
+ .get();
LoggingUtils.setTimeContext(startTime, new Date());
LoggingUtils.setResponseContext("0", "Get tosca models by policyType success", this.getClass().getName());
auditLogger.info("GET tosca models by policyType completed");
diff --git a/src/main/java/org/onap/clamp/clds/tosca/ToscaSchemaConstants.java b/src/main/java/org/onap/clamp/clds/tosca/ToscaSchemaConstants.java
index f1344723e..595b1805e 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/ToscaSchemaConstants.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/ToscaSchemaConstants.java
@@ -58,7 +58,7 @@ public class ToscaSchemaConstants {
public static final String PATTERN = "pattern";
// Prefix for policy nodes
- public static final String POLICY_NODE = "onap.policy.";
+ public static final String POLICY_NODE = "onap.policies.";
// Prefix for data nodes
public static final String POLICY_DATA = "onap.datatypes.";
diff --git a/src/main/java/org/onap/clamp/clds/util/CryptoUtils.java b/src/main/java/org/onap/clamp/clds/util/CryptoUtils.java
index f08bf7b28..85aae0a5d 100644
--- a/src/main/java/org/onap/clamp/clds/util/CryptoUtils.java
+++ b/src/main/java/org/onap/clamp/clds/util/CryptoUtils.java
@@ -162,7 +162,7 @@ public final class CryptoUtils {
private static SecretKeySpec readSecretKeySpec(String propertiesFileName) {
Properties props = new Properties();
try {
- //Workaround fix to make encryption key configurable
+ // Workaround fix to make encryption key configurable
// System environment variable takes precedence for over clds/key.properties
String encryptionKey = System.getenv(AES_ENCRYPTION_KEY);
if(encryptionKey != null && encryptionKey.trim().length() > 0) {
diff --git a/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java b/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java
index 08bb97608..cbe7eba96 100644
--- a/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java
+++ b/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java
@@ -1,373 +1,413 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
- * reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END============================================
- * ===================================================================
- *
- */
-
-package org.onap.clamp.clds.util;
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-import java.net.HttpURLConnection;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.time.ZoneOffset;
-import java.time.ZonedDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.Date;
-import java.util.TimeZone;
-import java.util.UUID;
-
-import javax.net.ssl.HttpsURLConnection;
-import javax.servlet.http.HttpServletRequest;
-import javax.validation.constraints.NotNull;
-
-import org.onap.clamp.clds.service.DefaultUserNameHandler;
-import org.slf4j.MDC;
-import org.slf4j.event.Level;
-import org.springframework.security.core.context.SecurityContextHolder;
-
-/**
- * This class handles the special info that appear in the log, like RequestID,
- * time context, ...
- */
-public class LoggingUtils {
- protected static final EELFLogger logger = EELFManager.getInstance().getLogger(LoggingUtils.class);
-
- private static final DateFormat DATE_FORMAT = createDateFormat();
-
- /** String constant for messages <tt>ENTERING</tt>, <tt>EXITING</tt>, etc. */
- private static final String EMPTY_MESSAGE = "";
-
- /** Logger delegate. */
- private EELFLogger mlogger;
- /** Automatic UUID, overrideable per adapter or per invocation. */
- private static UUID sInstanceUUID = UUID.randomUUID();
-
- /**
- * Constructor.
- */
- public LoggingUtils(final EELFLogger loggerP) {
- this.mlogger = checkNotNull(loggerP);
- }
-
- /**
- * Set request related logging variables in thread local data via MDC
- *
- * @param service Service Name of API (ex. "PUT template")
- * @param partner Partner name (client or user invoking API)
- */
- public static void setRequestContext(String service, String partner) {
- MDC.put("RequestId", UUID.randomUUID().toString());
- MDC.put("ServiceName", service);
- MDC.put("PartnerName", partner);
- //Defaulting to HTTP/1.1 protocol
- MDC.put("Protocol", "HTTP/1.1");
- try {
- MDC.put("ServerFQDN", InetAddress.getLocalHost().getCanonicalHostName());
- MDC.put("ServerIPAddress", InetAddress.getLocalHost().getHostAddress());
- } catch (UnknownHostException e) {
- logger.error("Failed to initiate setRequestContext", e);
- }
- }
-
- /**
- * Set time related logging variables in thread local data via MDC.
- *
- * @param beginTimeStamp Start time
- * @param endTimeStamp End time
- */
- public static void setTimeContext(@NotNull Date beginTimeStamp, @NotNull Date endTimeStamp) {
- MDC.put("BeginTimestamp", generateTimestampStr(beginTimeStamp));
- MDC.put("EndTimestamp", generateTimestampStr(endTimeStamp));
- MDC.put("ElapsedTime", String.valueOf(endTimeStamp.getTime() - beginTimeStamp.getTime()));
- }
-
- /**
- * Set response related logging variables in thread local data via MDC.
- *
- * @param code Response code ("0" indicates success)
- * @param description Response description
- * @param className class name of invoking class
- */
- public static void setResponseContext(String code, String description, String className) {
- MDC.put("ResponseCode", code);
- MDC.put("StatusCode", code.equals("0") ? "COMPLETE" : "ERROR");
- MDC.put("ResponseDescription", description != null ? description : "");
- MDC.put("ClassName", className != null ? className : "");
- }
-
- /**
- * Set target related logging variables in thread local data via MDC
- *
- * @param targetEntity Target entity (an external/sub component, for ex. "sdc")
- * @param targetServiceName Target service name (name of API invoked on target)
- */
- public static void setTargetContext(String targetEntity, String targetServiceName) {
- MDC.put("TargetEntity", targetEntity != null ? targetEntity : "");
- MDC.put("TargetServiceName", targetServiceName != null ? targetServiceName : "");
- }
-
- /**
- * Set error related logging variables in thread local data via MDC.
- *
- * @param code Error code
- * @param description Error description
- */
- public static void setErrorContext(String code, String description) {
- MDC.put("ErrorCode", code);
- MDC.put("ErrorDescription", description != null ? description : "");
- }
-
- private static String generateTimestampStr(Date timeStamp) {
- return DATE_FORMAT.format(timeStamp);
- }
-
- /**
- * Get a previously stored RequestID for the thread local data via MDC. If
- * one was not previously stored, generate one, store it, and return that
- * one.
- *
- * @return A string with the request ID
- */
- public static String getRequestId() {
- String requestId = MDC.get(ONAPLogConstants.MDCs.REQUEST_ID);
- if (requestId == null || requestId.isEmpty()) {
- requestId = UUID.randomUUID().toString();
- MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
- }
- return requestId;
- }
-
- private static DateFormat createDateFormat() {
- DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
- dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
- return dateFormat;
- }
-
-
-
- /*********************************************************************************************
- * Method for ONAP Application Logging Specification v1.2
- ********************************************************************************************/
-
- /**
- * Report <tt>ENTERING</tt> marker.
- *
- * @param request non-null incoming request (wrapper)
- * @param serviceName service name
- */
- public void entering(HttpServletRequest request, String serviceName) {
- MDC.clear();
- checkNotNull(request);
- // Extract MDC values from standard HTTP headers.
- final String requestId = defaultToUUID(request.getHeader(ONAPLogConstants.Headers.REQUEST_ID));
- final String invocationId = defaultToUUID(request.getHeader(ONAPLogConstants.Headers.INVOCATION_ID));
- final String partnerName = defaultToEmpty(request.getHeader(ONAPLogConstants.Headers.PARTNER_NAME));
-
- // Default the partner name to the user name used to login to clamp
- if (partnerName.equalsIgnoreCase(EMPTY_MESSAGE)) {
- MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME, new DefaultUserNameHandler()
- .retrieveUserName(SecurityContextHolder.getContext()));
- }
-
- // Set standard MDCs. Override this entire method if you want to set
- // others, OR set them BEFORE or AFTER the invocation of #entering,
- // depending on where you need them to appear, OR extend the
- // ServiceDescriptor to add them.
- MDC.put(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP,
- ZonedDateTime.now(ZoneOffset.UTC)
- .format(DateTimeFormatter.ISO_INSTANT));
- MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
- MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
- MDC.put(ONAPLogConstants.MDCs.CLIENT_IP_ADDRESS, defaultToEmpty(request.getRemoteAddr()));
- MDC.put(ONAPLogConstants.MDCs.SERVER_FQDN, defaultToEmpty(request.getServerName()));
- MDC.put(ONAPLogConstants.MDCs.INSTANCE_UUID, defaultToEmpty(sInstanceUUID));
-
- // Default the service name to the requestURI, in the event that
- // no value has been provided.
- if (serviceName == null
- || serviceName.equalsIgnoreCase(EMPTY_MESSAGE)) {
- MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, request.getRequestURI());
- } else {
- MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, serviceName);
- }
-
- this.mlogger.info(ONAPLogConstants.Markers.ENTRY);
- }
-
- /**
- * Report <tt>EXITING</tt> marker.
- *
- * @param code response code
- * @param descrption response description
- * @param severity response severity
- * @param status response status code
- */
- public void exiting(String code, String descrption, Level severity, ONAPLogConstants.ResponseStatus status) {
- try {
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, defaultToEmpty(code));
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION, defaultToEmpty(descrption));
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_SEVERITY, defaultToEmpty(severity));
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, defaultToEmpty(status));
- this.mlogger.info(ONAPLogConstants.Markers.EXIT);
- }
- finally {
- MDC.clear();
- }
- }
-
- /**
- * Report pending invocation with <tt>INVOKE</tt> marker,
- * setting standard ONAP logging headers automatically.
- *
- * @param con http URL connection
- * @param targetEntity target entity
- * @param targetServiceName target service name
- * @return invocation ID to be passed with invocation
- */
- public HttpURLConnection invoke(final HttpURLConnection con, String targetEntity, String targetServiceName) {
- final String invocationId = UUID.randomUUID().toString();
-
- // Set standard HTTP headers on (southbound request) builder.
- con.setRequestProperty(ONAPLogConstants.Headers.REQUEST_ID,
- defaultToEmpty(MDC.get(ONAPLogConstants.MDCs.REQUEST_ID)));
- con.setRequestProperty(ONAPLogConstants.Headers.INVOCATION_ID,
- invocationId);
- con.setRequestProperty(ONAPLogConstants.Headers.PARTNER_NAME,
- defaultToEmpty(MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME)));
-
- invokeContext(targetEntity, targetServiceName, invocationId);
-
- // Log INVOKE*, with the invocationID as the message body.
- // (We didn't really want this kind of behavior in the standard,
- // but is it worse than new, single-message MDC?)
- this.mlogger.info(ONAPLogConstants.Markers.INVOKE);
- this.mlogger.info(ONAPLogConstants.Markers.INVOKE_SYNC + "{" + invocationId + "}");
- return con;
- }
-
- /**
- * Report pending invocation with <tt>INVOKE</tt> marker,
- * setting standard ONAP logging headers automatically.
- *
- * @param con http URL connection
- * @param targetEntity target entity
- * @param targetServiceName target service name
- * @return invocation ID to be passed with invocation
- */
- public HttpsURLConnection invokeHttps(final HttpsURLConnection con, String targetEntity, String targetServiceName) {
- final String invocationId = UUID.randomUUID().toString();
-
- // Set standard HTTP headers on (southbound request) builder.
- con.setRequestProperty(ONAPLogConstants.Headers.REQUEST_ID,
- defaultToEmpty(MDC.get(ONAPLogConstants.MDCs.REQUEST_ID)));
- con.setRequestProperty(ONAPLogConstants.Headers.INVOCATION_ID,
- invocationId);
- con.setRequestProperty(ONAPLogConstants.Headers.PARTNER_NAME,
- defaultToEmpty(MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME)));
-
- invokeContext(targetEntity, targetServiceName, invocationId);
-
- // Log INVOKE*, with the invocationID as the message body.
- // (We didn't really want this kind of behavior in the standard,
- // but is it worse than new, single-message MDC?)
- this.mlogger.info(ONAPLogConstants.Markers.INVOKE);
- this.mlogger.info(ONAPLogConstants.Markers.INVOKE_SYNC + "{" + invocationId + "}");
- return con;
- }
-
- /**
- * Invokes return context.
- */
- public void invokeReturn() {
- // Add the Invoke-return marker and clear the needed MDC
- this.mlogger.info(ONAPLogConstants.Markers.INVOKE_RETURN);
- invokeReturnContext();
- }
-
- /**
- * Dependency-free nullcheck.
- *
- * @param in to be checked
- * @param <T> argument (and return) type
- * @return input arg
- */
- private static <T> T checkNotNull(final T in) {
- if (in == null) {
- throw new NullPointerException();
- }
- return in;
- }
-
- /**
- * Dependency-free string default.
- *
- * @param in to be filtered
- * @return input string or null
- */
- private static String defaultToEmpty(final Object in) {
- if (in == null) {
- return "";
- }
- return in.toString();
- }
-
- /**
- * Dependency-free string default.
- *
- * @param in to be filtered
- * @return input string or null
- */
- private static String defaultToUUID(final String in) {
- if (in == null) {
- return UUID.randomUUID().toString();
- }
- return in;
- }
-
- /**
- * Set target related logging variables in thread local data via MDC.
- *
- * @param targetEntity Target entity (an external/sub component, for ex. "sdc")
- * @param targetServiceName Target service name (name of API invoked on target)
- * @param invocationID The invocation ID
- */
- private void invokeContext(String targetEntity, String targetServiceName, String invocationID) {
- MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY, defaultToEmpty(targetEntity));
- MDC.put(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME, defaultToEmpty(targetServiceName));
- MDC.put(ONAPLogConstants.MDCs.INVOCATIONID_OUT, invocationID);
- MDC.put(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP,
- ZonedDateTime.now(ZoneOffset.UTC)
- .format(DateTimeFormatter.ISO_INSTANT));
- }
-
- /**
- * Clear target related logging variables in thread local data via MDC.
- */
- private void invokeReturnContext() {
- MDC.remove(ONAPLogConstants.MDCs.TARGET_ENTITY);
- MDC.remove(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME);
- MDC.remove(ONAPLogConstants.MDCs.INVOCATIONID_OUT);
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.util;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.net.HttpURLConnection;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.util.Date;
+import java.util.TimeZone;
+import java.util.UUID;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.constraints.NotNull;
+
+import org.onap.clamp.clds.service.DefaultUserNameHandler;
+import org.slf4j.MDC;
+import org.slf4j.event.Level;
+import org.springframework.security.core.context.SecurityContextHolder;
+
+/**
+ * This class handles the special info that appear in the log, like RequestID,
+ * time context, ...
+ */
+public class LoggingUtils {
+ protected static final EELFLogger logger = EELFManager.getInstance().getLogger(LoggingUtils.class);
+
+ private static final DateFormat DATE_FORMAT = createDateFormat();
+
+ /** String constant for messages <tt>ENTERING</tt>, <tt>EXITING</tt>, etc. */
+ private static final String EMPTY_MESSAGE = "";
+
+ /** Logger delegate. */
+ private EELFLogger mlogger;
+
+ /** Automatic UUID, overrideable per adapter or per invocation. */
+ private static UUID sInstanceUUID = UUID.randomUUID();
+
+ /**
+ * Constructor.
+ */
+ public LoggingUtils(final EELFLogger loggerP) {
+ this.mlogger = checkNotNull(loggerP);
+ }
+
+ /**
+ * Set request related logging variables in thread local data via MDC.
+ *
+ * @param service Service Name of API (ex. "PUT template")
+ * @param partner Partner name (client or user invoking API)
+ */
+ public static void setRequestContext(String service, String partner) {
+ MDC.put("RequestId", UUID.randomUUID().toString());
+ MDC.put("ServiceName", service);
+ MDC.put("PartnerName", partner);
+ //Defaulting to HTTP/1.1 protocol
+ MDC.put("Protocol", "HTTP/1.1");
+ try {
+ MDC.put("ServerFQDN", InetAddress.getLocalHost().getCanonicalHostName());
+ MDC.put("ServerIPAddress", InetAddress.getLocalHost().getHostAddress());
+ } catch (UnknownHostException e) {
+ logger.error("Failed to initiate setRequestContext", e);
+ }
+ }
+
+ /**
+ * Set time related logging variables in thread local data via MDC.
+ *
+ * @param beginTimeStamp Start time
+ * @param endTimeStamp End time
+ */
+ public static void setTimeContext(@NotNull Date beginTimeStamp, @NotNull Date endTimeStamp) {
+ MDC.put("EntryTimestamp", generateTimestampStr(beginTimeStamp));
+ MDC.put("EndTimestamp", generateTimestampStr(endTimeStamp));
+ MDC.put("ElapsedTime", String.valueOf(endTimeStamp.getTime() - beginTimeStamp.getTime()));
+ }
+
+ /**
+ * Set response related logging variables in thread local data via MDC.
+ *
+ * @param code Response code ("0" indicates success)
+ * @param description Response description
+ * @param className class name of invoking class
+ */
+ public static void setResponseContext(String code, String description, String className) {
+ MDC.put("ResponseCode", code);
+ MDC.put("StatusCode", code.equals("0") ? "COMPLETE" : "ERROR");
+ MDC.put("ResponseDescription", description != null ? description : "");
+ MDC.put("ClassName", className != null ? className : "");
+ }
+
+ /**
+ * Set target related logging variables in thread local data via MDC.
+ *
+ * @param targetEntity Target entity (an external/sub component, for ex. "sdc")
+ * @param targetServiceName Target service name (name of API invoked on target)
+ */
+ public static void setTargetContext(String targetEntity, String targetServiceName) {
+ MDC.put("TargetEntity", targetEntity != null ? targetEntity : "");
+ MDC.put("TargetServiceName", targetServiceName != null ? targetServiceName : "");
+ }
+
+ /**
+ * Set error related logging variables in thread local data via MDC.
+ *
+ * @param code Error code
+ * @param description Error description
+ */
+ public static void setErrorContext(String code, String description) {
+ MDC.put("ErrorCode", code);
+ MDC.put("ErrorDescription", description != null ? description : "");
+ }
+
+ private static String generateTimestampStr(Date timeStamp) {
+ return DATE_FORMAT.format(timeStamp);
+ }
+
+ /**
+ * Get a previously stored RequestID for the thread local data via MDC. If
+ * one was not previously stored, generate one, store it, and return that
+ * one.
+ *
+ * @return A string with the request ID
+ */
+ public static String getRequestId() {
+ String requestId = MDC.get(ONAPLogConstants.MDCs.REQUEST_ID);
+ if (requestId == null || requestId.isEmpty()) {
+ requestId = UUID.randomUUID().toString();
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
+ }
+ return requestId;
+ }
+
+ private static DateFormat createDateFormat() {
+ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+ return dateFormat;
+ }
+
+
+
+ /*********************************************************************************************
+ * Method for ONAP Application Logging Specification v1.2
+ ********************************************************************************************/
+
+ /**
+ * Report <tt>ENTERING</tt> marker.
+ *
+ * @param request non-null incoming request (wrapper)
+ * @param serviceName service name
+ */
+ public void entering(HttpServletRequest request, String serviceName) {
+ MDC.clear();
+ checkNotNull(request);
+ // Extract MDC values from standard HTTP headers.
+ final String requestId = defaultToUUID(request.getHeader(ONAPLogConstants.Headers.REQUEST_ID));
+ final String invocationId = defaultToUUID(request.getHeader(ONAPLogConstants.Headers.INVOCATION_ID));
+ final String partnerName = defaultToEmpty(request.getHeader(ONAPLogConstants.Headers.PARTNER_NAME));
+
+ // Default the partner name to the user name used to login to clamp
+ if (partnerName.equalsIgnoreCase(EMPTY_MESSAGE)) {
+ MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME, new DefaultUserNameHandler()
+ .retrieveUserName(SecurityContextHolder.getContext()));
+ }
+
+ // Set standard MDCs. Override this entire method if you want to set
+ // others, OR set them BEFORE or AFTER the invocation of #entering,
+ // depending on where you need them to appear, OR extend the
+ // ServiceDescriptor to add them.
+ MDC.put(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP,
+ ZonedDateTime.now(ZoneOffset.UTC)
+ .format(DateTimeFormatter.ISO_INSTANT));
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
+ MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
+ MDC.put(ONAPLogConstants.MDCs.CLIENT_IP_ADDRESS, defaultToEmpty(request.getRemoteAddr()));
+ MDC.put(ONAPLogConstants.MDCs.SERVER_FQDN, defaultToEmpty(request.getServerName()));
+ MDC.put(ONAPLogConstants.MDCs.INSTANCE_UUID, defaultToEmpty(sInstanceUUID));
+
+ // Default the service name to the requestURI, in the event that
+ // no value has been provided.
+ if (serviceName == null
+ || serviceName.equalsIgnoreCase(EMPTY_MESSAGE)) {
+ MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, request.getRequestURI());
+ } else {
+ MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, serviceName);
+ }
+
+ this.mlogger.info(ONAPLogConstants.Markers.ENTRY);
+ }
+
+ /**
+ * Report <tt>EXITING</tt> marker.
+ *
+
+ * @param code response code
+ * @param descrption response description
+ * @param severity response severity
+ * @param status response status code
+ */
+ public void exiting(String code, String descrption, Level severity, ONAPLogConstants.ResponseStatus status) {
+ try {
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, defaultToEmpty(code));
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION, defaultToEmpty(descrption));
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_SEVERITY, defaultToEmpty(severity));
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, defaultToEmpty(status));
+
+ ZonedDateTime startTime = ZonedDateTime.parse(MDC.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP),
+ DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC));
+ ZonedDateTime endTime = ZonedDateTime.now(ZoneOffset.UTC);
+ MDC.put(ONAPLogConstants.MDCs.END_TIMESTAMP, endTime.format(DateTimeFormatter.ISO_INSTANT));
+ long duration = ChronoUnit.MILLIS.between(startTime, endTime);
+ MDC.put(ONAPLogConstants.MDCs.ELAPSED_TIMESTAMP, String.valueOf(duration));
+ this.mlogger.info(ONAPLogConstants.Markers.EXIT);
+ }
+ finally {
+ MDC.clear();
+ }
+ }
+
+ /**
+ * Get the property value.
+ *
+ * @param name The name of the property
+ * @return The value of the property
+ */
+ public String getProperties(String name) {
+ return MDC.get(name);
+ }
+
+ /**
+ * Report pending invocation with <tt>INVOKE</tt> marker,
+ * setting standard ONAP logging headers automatically.
+ *
+ * @param con The HTTP url connection
+ * @param targetEntity The target entity
+ * @param targetServiceName The target service name
+ * @return The HTTP url connection
+ */
+ public HttpURLConnection invoke(final HttpURLConnection con, String targetEntity, String targetServiceName) {
+ final String invocationId = UUID.randomUUID().toString();
+
+ // Set standard HTTP headers on (southbound request) builder.
+ con.setRequestProperty(ONAPLogConstants.Headers.REQUEST_ID,
+ defaultToEmpty(MDC.get(ONAPLogConstants.MDCs.REQUEST_ID)));
+ con.setRequestProperty(ONAPLogConstants.Headers.INVOCATION_ID,
+ invocationId);
+ con.setRequestProperty(ONAPLogConstants.Headers.PARTNER_NAME,
+ defaultToEmpty(MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME)));
+
+ invokeContext(targetEntity, targetServiceName, invocationId);
+
+ // Log INVOKE*, with the invocationID as the message body.
+ // (We didn't really want this kind of behavior in the standard,
+ // but is it worse than new, single-message MDC?)
+ this.mlogger.info(ONAPLogConstants.Markers.INVOKE);
+ this.mlogger.info(ONAPLogConstants.Markers.INVOKE_SYNC + "{" + invocationId + "}");
+ return con;
+ }
+
+ /**
+ * Report pending invocation with <tt>INVOKE</tt> marker,
+ * setting standard ONAP logging headers automatically.
+ *
+ * @param targetEntity The target entity
+ * @param targetServiceName The target service name
+ */
+ public void invoke(String targetEntity, String targetServiceName) {
+ final String invocationId = UUID.randomUUID().toString();
+
+ invokeContext(targetEntity, targetServiceName, invocationId);
+
+ // Log INVOKE*, with the invocationID as the message body.
+ // (We didn't really want this kind of behavior in the standard,
+ // but is it worse than new, single-message MDC?)
+ this.mlogger.info(ONAPLogConstants.Markers.INVOKE);
+ this.mlogger.info(ONAPLogConstants.Markers.INVOKE_SYNC + "{" + invocationId + "}");
+ }
+
+ /**
+ * Report pending invocation with <tt>INVOKE</tt> marker,
+ * setting standard ONAP logging headers automatically.
+ *
+ * @param con The HTTPS url connection
+ * @param targetEntity The target entity
+ * @param targetServiceName The target service name
+ * @return The HTTPS url connection
+ */
+ public HttpsURLConnection invokeHttps(final HttpsURLConnection con, String targetEntity, String targetServiceName) {
+ final String invocationId = UUID.randomUUID().toString();
+
+ // Set standard HTTP headers on (southbound request) builder.
+ con.setRequestProperty(ONAPLogConstants.Headers.REQUEST_ID,
+ defaultToEmpty(MDC.get(ONAPLogConstants.MDCs.REQUEST_ID)));
+ con.setRequestProperty(ONAPLogConstants.Headers.INVOCATION_ID,
+ invocationId);
+ con.setRequestProperty(ONAPLogConstants.Headers.PARTNER_NAME,
+ defaultToEmpty(MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME)));
+
+ invokeContext(targetEntity, targetServiceName, invocationId);
+
+ // Log INVOKE*, with the invocationID as the message body.
+ // (We didn't really want this kind of behavior in the standard,
+ // but is it worse than new, single-message MDC?)
+ this.mlogger.info(ONAPLogConstants.Markers.INVOKE);
+ this.mlogger.info(ONAPLogConstants.Markers.INVOKE_SYNC + "{" + invocationId + "}");
+ return con;
+ }
+
+ /**
+ * Report pending invocation with <tt>INVOKE-RETURN</tt> marker.
+ */
+ public void invokeReturn() {
+ // Add the Invoke-return marker and clear the needed MDC
+ this.mlogger.info(ONAPLogConstants.Markers.INVOKE_RETURN);
+ invokeReturnContext();
+ }
+
+ /**
+ * Dependency-free nullcheck.
+ *
+ * @param in to be checked
+ * @param <T> argument (and return) type
+ * @return input arg
+ */
+ private static <T> T checkNotNull(final T in) {
+ if (in == null) {
+ throw new NullPointerException();
+ }
+ return in;
+ }
+
+ /**
+ * Dependency-free string default.
+ *
+ * @param in to be filtered
+ * @return input string or null
+ */
+ private static String defaultToEmpty(final Object in) {
+ if (in == null) {
+ return "";
+ }
+ return in.toString();
+ }
+
+ /**
+ * Dependency-free string default.
+ *
+ * @param in to be filtered
+ * @return input string or null
+ */
+ private static String defaultToUUID(final String in) {
+ if (in == null) {
+ return UUID.randomUUID().toString();
+ }
+ return in;
+ }
+
+ /**
+ * Set target related logging variables in thread local data via MDC.
+ *
+ * @param targetEntity Target entity (an external/sub component, for ex. "sdc")
+ * @param targetServiceName Target service name (name of API invoked on target)
+ * @param invocationID The invocation ID
+ */
+ private void invokeContext(String targetEntity, String targetServiceName, String invocationID) {
+ MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY, defaultToEmpty(targetEntity));
+ MDC.put(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME, defaultToEmpty(targetServiceName));
+ MDC.put(ONAPLogConstants.MDCs.INVOCATIONID_OUT, invocationID);
+ MDC.put(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP,
+ ZonedDateTime.now(ZoneOffset.UTC)
+ .format(DateTimeFormatter.ISO_INSTANT));
+ }
+
+ /**
+ * Clear target related logging variables in thread local data via MDC.
+ */
+ private void invokeReturnContext() {
+ MDC.remove(ONAPLogConstants.MDCs.TARGET_ENTITY);
+ MDC.remove(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME);
+ MDC.remove(ONAPLogConstants.MDCs.INVOCATIONID_OUT);
+ MDC.remove(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP);
+ }
+}
diff --git a/src/main/java/org/onap/clamp/clds/util/ONAPLogConstants.java b/src/main/java/org/onap/clamp/clds/util/ONAPLogConstants.java
index eea01a39a..906f8e033 100644
--- a/src/main/java/org/onap/clamp/clds/util/ONAPLogConstants.java
+++ b/src/main/java/org/onap/clamp/clds/util/ONAPLogConstants.java
@@ -122,7 +122,8 @@ public final class ONAPLogConstants {
* </p>
* */
public static final String ENTRY_TIMESTAMP = "EntryTimestamp";
-
+ public static final String END_TIMESTAMP = "EndTimestamp";
+ public static final String ELAPSED_TIMESTAMP = "ElapsedTime";
/** MDC recording timestamp at the start of the current invocation. */
public static final String INVOKE_TIMESTAMP = "InvokeTimestamp";
diff --git a/src/main/java/org/onap/clamp/clds/util/XmlTools.java b/src/main/java/org/onap/clamp/clds/util/XmlTools.java
index a812fa127..a7d4ed9fb 100644
--- a/src/main/java/org/onap/clamp/clds/util/XmlTools.java
+++ b/src/main/java/org/onap/clamp/clds/util/XmlTools.java
@@ -24,6 +24,7 @@
package org.onap.clamp.clds.util;
import java.io.StringWriter;
+import javax.xml.XMLConstants;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
@@ -39,6 +40,12 @@ import org.w3c.dom.Document;
public class XmlTools {
/**
+ * Private constructor to avoid creating instances of util class.
+ */
+ private XmlTools(){
+ }
+
+ /**
* Transforms document to XML string.
*
* @param doc XML document
@@ -47,6 +54,7 @@ public class XmlTools {
public static String exportXmlDocumentAsString(Document doc) {
try {
TransformerFactory tf = TransformerFactory.newInstance();
+ tf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
Transformer transformer = tf.newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
StringWriter writer = new StringWriter();
diff --git a/src/main/java/org/onap/clamp/clds/util/drawing/Painter.java b/src/main/java/org/onap/clamp/clds/util/drawing/Painter.java
index fe2d5cb34..d88a17e86 100755
--- a/src/main/java/org/onap/clamp/clds/util/drawing/Painter.java
+++ b/src/main/java/org/onap/clamp/clds/util/drawing/Painter.java
@@ -64,7 +64,7 @@ public class Painter {
adjustGraphics2DProperties();
- Point origin = new Point(0, rectHeight / 2);
+ Point origin = new Point(1, rectHeight / 2);
ImageBuilder ib = new ImageBuilder(g2d, documentBuilder, origin, baseLength, rectHeight);
doTheActualDrawing(collector, microServices, policy, ib);
diff --git a/src/main/java/org/onap/clamp/clds/util/drawing/SvgFacade.java b/src/main/java/org/onap/clamp/clds/util/drawing/SvgFacade.java
index f5bd6e79d..f7bf92bfd 100644
--- a/src/main/java/org/onap/clamp/clds/util/drawing/SvgFacade.java
+++ b/src/main/java/org/onap/clamp/clds/util/drawing/SvgFacade.java
@@ -41,7 +41,7 @@ public class SvgFacade {
Painter p = new Painter(svgGraphics2D, dp);
ClampGraphBuilder cgp = new ClampGraphBuilder(p).collector("VES");
cgp.addAllMicroServices(microServicesChain);
- ClampGraph cg = cgp.policy("Policy").build();
+ ClampGraph cg = cgp.policy("OperationalPolicy").build();
return cg.getAsSVG();
}
diff --git a/src/main/java/org/onap/clamp/flow/log/FlowLogOperation.java b/src/main/java/org/onap/clamp/flow/log/FlowLogOperation.java
new file mode 100644
index 000000000..3da93b26a
--- /dev/null
+++ b/src/main/java/org/onap/clamp/flow/log/FlowLogOperation.java
@@ -0,0 +1,102 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.flow.log;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.camel.Exchange;
+import org.onap.clamp.clds.util.LoggingUtils;
+import org.onap.clamp.clds.util.ONAPLogConstants;
+import org.slf4j.event.Level;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Component;
+
+/**
+ * The Flow log operations.
+ */
+@Component
+public class FlowLogOperation {
+
+ protected static final EELFLogger logger = EELFManager.getInstance().getLogger(FlowLogOperation.class);
+ protected static final EELFLogger auditLogger = EELFManager.getInstance().getMetricsLogger();
+ private LoggingUtils util = new LoggingUtils(logger);
+
+ @Autowired
+ private HttpServletRequest request;
+
+ /**
+ * Generate the entry log.
+ *
+ * @param serviceDesc
+ * The service description the loop name
+ */
+ public void startLog(Exchange exchange, String serviceDesc) {
+ util.entering(request, serviceDesc);
+ exchange.setProperty(ONAPLogConstants.Headers.REQUEST_ID, util.getProperties(ONAPLogConstants.MDCs.REQUEST_ID));
+ exchange.setProperty(ONAPLogConstants.Headers.INVOCATION_ID,
+ util.getProperties(ONAPLogConstants.MDCs.INVOCATION_ID));
+ exchange.setProperty(ONAPLogConstants.Headers.PARTNER_NAME,
+ util.getProperties(ONAPLogConstants.MDCs.PARTNER_NAME));
+ }
+
+ /**
+ * Generate the exiting log.
+ */
+ public void endLog() {
+ util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
+ }
+
+ /**
+ * Generate the error exiting log.
+ */
+ public void errorLog() {
+ util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "Failed", Level.INFO,
+ ONAPLogConstants.ResponseStatus.ERROR);
+ }
+
+ /**
+ * Generate the error exiting log.
+ */
+ public void httpErrorLog() {
+
+ }
+
+ /**
+ * Generate the invoke log.
+ */
+ public void invokeLog(String targetEntity, String targetServiceName) {
+ util.invoke(targetEntity, targetServiceName);
+ }
+
+ /**
+ * Generate the invoke return marker.
+ */
+ public void invokeReturnLog() {
+ util.invokeReturn();
+ }
+}
diff --git a/src/main/java/org/onap/clamp/loop/Loop.java b/src/main/java/org/onap/clamp/loop/Loop.java
index 0041c589e..6de2863ea 100644
--- a/src/main/java/org/onap/clamp/loop/Loop.java
+++ b/src/main/java/org/onap/clamp/loop/Loop.java
@@ -23,6 +23,8 @@
package org.onap.clamp.loop;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
@@ -45,7 +47,9 @@ import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
import javax.persistence.Table;
+import javax.persistence.Transient;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
@@ -65,6 +69,9 @@ public class Loop implements Serializable {
*/
private static final long serialVersionUID = -286522707701388642L;
+ @Transient
+ private static final EELFLogger logger = EELFManager.getInstance().getLogger(Loop.class);
+
@Id
@Expose
@Column(nullable = false, name = "name", unique = true)
@@ -114,6 +121,7 @@ public class Loop implements Serializable {
@Expose
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "loop")
+ @OrderBy("id DESC")
private Set<LoopLog> loopLogs = new HashSet<>();
public Loop() {
@@ -277,7 +285,9 @@ public class Loop implements Serializable {
jsonArray.add(policyNode);
policyNode.addProperty("policy-id", policyName);
}
- return new GsonBuilder().setPrettyPrinting().create().toJson(jsonObject);
+ String payload = new GsonBuilder().setPrettyPrinting().create().toJson(jsonObject);
+ logger.info("PdpGroup policy payload: " + payload);
+ return payload;
}
/**
diff --git a/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java b/src/main/java/org/onap/clamp/loop/LoopCsarInstaller.java
index f407aa944..ad13ad34d 100644
--- a/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java
+++ b/src/main/java/org/onap/clamp/loop/LoopCsarInstaller.java
@@ -25,7 +25,6 @@ package org.onap.clamp.loop;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-import com.google.gson.Gson;
import com.google.gson.JsonObject;
import java.io.IOException;
@@ -51,9 +50,16 @@ import org.onap.clamp.clds.util.drawing.SvgFacade;
import org.onap.clamp.policy.Policy;
import org.onap.clamp.policy.microservice.MicroServicePolicy;
import org.onap.clamp.policy.operational.OperationalPolicy;
+import org.onap.sdc.tosca.parser.api.IEntityDetails;
+import org.onap.sdc.tosca.parser.elements.queries.EntityQuery;
+import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery;
+import org.onap.sdc.tosca.parser.enums.EntityTemplateType;
import org.onap.sdc.tosca.parser.enums.SdcTypes;
import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.Property;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.yaml.snakeyaml.Yaml;
@@ -63,10 +69,11 @@ import org.yaml.snakeyaml.Yaml;
* There is no state kept by the bean. It's used to deploy the csar/notification
* received from SDC in DB.
*/
-public class CsarInstallerImpl implements CsarInstaller {
+@Component
+@Qualifier("loopInstaller")
+public class LoopCsarInstaller implements CsarInstaller {
- private static final EELFLogger logger = EELFManager.getInstance().getLogger(CsarInstallerImpl.class);
- public static final String TEMPLATE_NAME_PREFIX = "DCAE-Designer-Template-";
+ private static final EELFLogger logger = EELFManager.getInstance().getLogger(LoopCsarInstaller.class);
public static final String CONTROL_NAME_PREFIX = "ClosedLoop-";
public static final String GET_INPUT_BLUEPRINT_PARAM = "get_input";
// This will be used later as the policy scope
@@ -179,21 +186,49 @@ public class CsarInstallerImpl implements CsarInstaller {
return globalProperties;
}
- private JsonObject createModelPropertiesJson(CsarHandler csar) {
- JsonObject modelProperties = new JsonObject();
- Gson gson = new Gson();
- modelProperties.add("serviceDetails",
- gson.fromJson(gson.toJson(csar.getSdcCsarHelper().getServiceMetadataAllProperties()), JsonObject.class));
+ private static JsonObject createVfModuleProperties(CsarHandler csar) {
+ JsonObject vfModuleProps = new JsonObject();
+ // Loop on all Groups defined in the service (VFModule entries type:
+ // org.openecomp.groups.VfModule)
+ for (IEntityDetails entity : csar.getSdcCsarHelper().getEntity(
+ EntityQuery.newBuilder(EntityTemplateType.GROUP).build(),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE).build(), false)) {
+ // Get all metadata info
+ JsonObject allVfProps = (JsonObject) JsonUtils.GSON.toJsonTree(entity.getMetadata().getAllProperties());
+ vfModuleProps.add(entity.getMetadata().getAllProperties().get("vfModuleModelName"), allVfProps);
+ // now append the properties section so that we can also have isBase,
+ // volume_group, etc ... fields under the VFmodule name
+ for (Entry<String, Property> additionalProp : entity.getProperties().entrySet()) {
+ allVfProps.add(additionalProp.getValue().getName(),
+ JsonUtils.GSON.toJsonTree(additionalProp.getValue().getValue()));
+ }
+ }
+ return vfModuleProps;
+ }
+ private static JsonObject createServicePropertiesByType(CsarHandler csar) {
JsonObject resourcesProp = new JsonObject();
+ // Iterate on all types defined in the tosca lib
for (SdcTypes type : SdcTypes.values()) {
JsonObject resourcesPropByType = new JsonObject();
+ // For each type, get the metadata of each nodetemplate
for (NodeTemplate nodeTemplate : csar.getSdcCsarHelper().getServiceNodeTemplateBySdcType(type)) {
- resourcesPropByType.add(nodeTemplate.getName(), JsonUtils.GSON_JPA_MODEL
- .fromJson(new Gson().toJson(nodeTemplate.getMetaData().getAllProperties()), JsonObject.class));
+ resourcesPropByType.add(nodeTemplate.getName(),
+ JsonUtils.GSON.toJsonTree(nodeTemplate.getMetaData().getAllProperties()));
}
resourcesProp.add(type.getValue(), resourcesPropByType);
}
+ return resourcesProp;
+ }
+
+ private static JsonObject createModelPropertiesJson(CsarHandler csar) {
+ JsonObject modelProperties = new JsonObject();
+ // Add service details
+ modelProperties.add("serviceDetails", JsonUtils.GSON.fromJson(
+ JsonUtils.GSON.toJson(csar.getSdcCsarHelper().getServiceMetadataAllProperties()), JsonObject.class));
+ // Add properties details for each type, VfModule, VF, VFC, ....
+ JsonObject resourcesProp = createServicePropertiesByType(csar);
+ resourcesProp.add("VFModule", createVfModuleProperties(csar));
modelProperties.add("resourceDetails", resourcesProp);
return modelProperties;
}
diff --git a/src/main/java/org/onap/clamp/loop/LoopOperation.java b/src/main/java/org/onap/clamp/loop/LoopOperation.java
index d9ea24871..87effa5fd 100644
--- a/src/main/java/org/onap/clamp/loop/LoopOperation.java
+++ b/src/main/java/org/onap/clamp/loop/LoopOperation.java
@@ -25,191 +25,241 @@ package org.onap.clamp.loop;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonNull;
import com.google.gson.JsonObject;
-import com.google.gson.JsonPrimitive;
-import java.lang.reflect.Array;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.UUID;
import org.apache.camel.Exchange;
-import org.onap.clamp.clds.client.DcaeDispatcherServices;
-import org.onap.clamp.clds.config.ClampProperties;
-import org.onap.clamp.clds.util.LoggingUtils;
-import org.onap.clamp.clds.util.ONAPLogConstants;
-import org.onap.clamp.exception.OperationException;
-import org.onap.clamp.util.HttpConnectionManager;
-import org.slf4j.event.Level;
+import org.apache.camel.Message;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+import org.onap.clamp.policy.operational.OperationalPolicy;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
-import org.yaml.snakeyaml.Yaml;
/**
- * Closed loop operations
+ * Closed loop operations.
*/
@Component
public class LoopOperation {
protected static final EELFLogger logger = EELFManager.getInstance().getLogger(LoopOperation.class);
protected static final EELFLogger auditLogger = EELFManager.getInstance().getMetricsLogger();
- private final DcaeDispatcherServices dcaeDispatcherServices;
+ private static final String DCAE_LINK_FIELD = "links";
+ private static final String DCAE_STATUS_FIELD = "status";
+ private static final String DCAE_SERVICETYPE_ID = "serviceTypeId";
+ private static final String DCAE_INPUTS = "inputs";
+ private static final String DCAE_DEPLOYMENT_PREFIX = "CLAMP_";
+ private static final String DEPLOYMENT_PARA = "dcaeDeployParameters";
private final LoopService loopService;
- private LoggingUtils util = new LoggingUtils(logger);
- @Autowired
- private HttpServletRequest request;
+ public enum TempLoopState {
+ NOT_SUBMITTED, SUBMITTED, DEPLOYED, NOT_DEPLOYED, PROCESSING, IN_ERROR;
+ }
+ /**
+ * The constructor.
+ *
+ * @param loopService
+ * The loop service
+ * @param refProp
+ * The clamp properties
+ */
@Autowired
- public LoopOperation(LoopService loopService, DcaeDispatcherServices dcaeDispatcherServices,
- ClampProperties refProp, HttpConnectionManager httpConnectionManager) {
+ public LoopOperation(LoopService loopService) {
this.loopService = loopService;
- this.dcaeDispatcherServices = dcaeDispatcherServices;
}
/**
- * Deploy the closed loop.
+ * Get the payload used to send the deploy closed loop request.
*
- * @param loopName
- * the loop name
- * @return the updated loop
- * @throws Exceptions
- * during the operation
+ * @param loop
+ * The loop
+ * @return The payload used to send deploy closed loop request
+ * @throws IOException
+ * IOException
*/
- public Loop deployLoop(Exchange camelExchange, String loopName) throws OperationException {
- util.entering(request, "CldsService: Deploy model");
- Date startTime = new Date();
- Loop loop = loopService.getLoop(loopName);
-
- if (loop == null) {
- String msg = "Deploy loop exception: Not able to find closed loop:" + loopName;
- util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), msg, Level.INFO,
- ONAPLogConstants.ResponseStatus.ERROR);
- throw new OperationException(msg);
- }
+ public String getDeployPayload(Loop loop) throws IOException {
+ JsonObject globalProp = loop.getGlobalPropertiesJson();
+ JsonObject deploymentProp = globalProp.getAsJsonObject(DEPLOYMENT_PARA);
+
+ String serviceTypeId = loop.getDcaeBlueprintId();
- // verify the current closed loop state
- if (loop.getLastComputedState() != LoopState.SUBMITTED) {
- String msg = "Deploy loop exception: This closed loop is in state:" + loop.getLastComputedState()
- + ". It could be deployed only when it is in SUBMITTED state.";
- util.exiting(HttpStatus.CONFLICT.toString(), msg, Level.INFO, ONAPLogConstants.ResponseStatus.ERROR);
- throw new OperationException(msg);
+ JsonObject rootObject = new JsonObject();
+ rootObject.addProperty(DCAE_SERVICETYPE_ID, serviceTypeId);
+ if (deploymentProp != null) {
+ rootObject.add(DCAE_INPUTS, deploymentProp);
}
+ String apiBodyString = rootObject.toString();
+ logger.info("Dcae api Body String - " + apiBodyString);
+ return apiBodyString;
+ }
+
+ /**
+ * Get the deployment id.
+ *
+ * @param loop
+ * The loop
+ * @return The deployment id
+ * @throws IOException
+ * IOException
+ */
+ public String getDeploymentId(Loop loop) {
// Set the deploymentId if not present yet
String deploymentId = "";
// If model is already deployed then pass same deployment id
if (loop.getDcaeDeploymentId() != null && !loop.getDcaeDeploymentId().isEmpty()) {
deploymentId = loop.getDcaeDeploymentId();
} else {
- loop.setDcaeDeploymentId(deploymentId = "closedLoop_" + loopName + "_deploymentId");
+ deploymentId = DCAE_DEPLOYMENT_PREFIX + UUID.randomUUID();
}
-
- Yaml yaml = new Yaml();
- Map<String, Object> yamlMap = yaml.load(loop.getBlueprint());
- JsonObject bluePrint = wrapSnakeObject(yamlMap).getAsJsonObject();
-
- loop.setDcaeDeploymentStatusUrl(
- dcaeDispatcherServices.createNewDeployment(deploymentId, loop.getDcaeBlueprintId(), bluePrint));
- loop.setLastComputedState(LoopState.DEPLOYED);
- // save the updated loop
- loopService.saveOrUpdateLoop(loop);
-
- // audit log
- LoggingUtils.setTimeContext(startTime, new Date());
- auditLogger.info("Deploy model completed");
- util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
- return loop;
+ return deploymentId;
}
/**
- * Un deploy closed loop.
+ * Update the loop info.
*
- * @param loopName
- * the loop name
- * @return the updated loop
+ * @param camelExchange
+ * The camel exchange
+ * @param loop
+ * The loop
+ * @param deploymentId
+ * The deployment id
+ * @throws ParseException
+ * The parse exception
*/
- public Loop unDeployLoop(String loopName) throws OperationException {
- util.entering(request, "LoopOperation: Undeploy the closed loop");
- Date startTime = new Date();
- Loop loop = loopService.getLoop(loopName);
-
- if (loop == null) {
- String msg = "Undeploy loop exception: Not able to find closed loop:" + loopName;
- util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), msg, Level.INFO,
- ONAPLogConstants.ResponseStatus.ERROR);
- throw new OperationException(msg);
- }
-
- // verify the current closed loop state
- if (loop.getLastComputedState() != LoopState.DEPLOYED) {
- String msg = "Unploy loop exception: This closed loop is in state:" + loop.getLastComputedState()
- + ". It could be undeployed only when it is in DEPLOYED state.";
- util.exiting(HttpStatus.CONFLICT.toString(), msg, Level.INFO, ONAPLogConstants.ResponseStatus.ERROR);
- throw new OperationException(msg);
- }
+ public void updateLoopInfo(Exchange camelExchange, Loop loop, String deploymentId) throws ParseException {
+ Message in = camelExchange.getIn();
+ String msg = in.getBody(String.class);
- loop.setDcaeDeploymentStatusUrl(
- dcaeDispatcherServices.deleteExistingDeployment(loop.getDcaeDeploymentId(), loop.getDcaeBlueprintId()));
+ JSONParser parser = new JSONParser();
+ Object obj0 = parser.parse(msg);
+ JSONObject jsonObj = (JSONObject) obj0;
- // clean the deployment ID
- loop.setDcaeDeploymentId(null);
- loop.setLastComputedState(LoopState.SUBMITTED);
+ JSONObject linksObj = (JSONObject) jsonObj.get(DCAE_LINK_FIELD);
+ String statusUrl = (String) linksObj.get(DCAE_STATUS_FIELD);
- // save the updated loop
+ if (deploymentId == null) {
+ loop.setDcaeDeploymentId(null);
+ loop.setDcaeDeploymentStatusUrl(null);
+ } else {
+ loop.setDcaeDeploymentId(deploymentId);
+ loop.setDcaeDeploymentStatusUrl(statusUrl.replaceAll("http:", "http4:").replaceAll("https:", "https4:"));
+ }
loopService.saveOrUpdateLoop(loop);
-
- // audit log
- LoggingUtils.setTimeContext(startTime, new Date());
- auditLogger.info("Undeploy model completed");
- util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
- return loop;
}
- private JsonElement wrapSnakeObject(Object o) {
- // NULL => JsonNull
- if (o == null)
- return JsonNull.INSTANCE;
-
- // Collection => JsonArray
- if (o instanceof Collection) {
- JsonArray array = new JsonArray();
- for (Object childObj : (Collection<?>) o)
- array.add(wrapSnakeObject(childObj));
- return array;
+ /**
+ * Get the Closed Loop status based on the reply from Policy.
+ *
+ * @param statusCode
+ * The status code
+ * @return The state based on policy response
+ * @throws ParseException
+ * The parse exception
+ */
+ public String analysePolicyResponse(int statusCode) {
+ if (statusCode == 200) {
+ return TempLoopState.SUBMITTED.toString();
+ } else if (statusCode == 404) {
+ return TempLoopState.NOT_SUBMITTED.toString();
}
+ return TempLoopState.IN_ERROR.toString();
+ }
- // Array => JsonArray
- if (o.getClass().isArray()) {
- JsonArray array = new JsonArray();
+ /**
+ * Get the name of the first Operational policy.
+ *
+ * @param loop
+ * The closed loop
+ * @return The name of the first operational policy
+ */
+ public String getOperationalPolicyName(Loop loop) {
+ Set<OperationalPolicy> opSet = loop.getOperationalPolicies();
+ Iterator<OperationalPolicy> iterator = opSet.iterator();
+ while (iterator.hasNext()) {
+ OperationalPolicy policy = iterator.next();
+ return policy.getName();
+ }
+ return null;
+ }
- int length = Array.getLength(array);
- for (int i = 0; i < length; i++)
- array.add(wrapSnakeObject(Array.get(array, i)));
- return array;
+ /**
+ * Get the Closed Loop status based on the reply from DCAE.
+ *
+ * @param camelExchange
+ * The camel exchange
+ * @return The state based on DCAE response
+ * @throws ParseException
+ * The parse exception
+ */
+ public String analyseDcaeResponse(Exchange camelExchange, Integer statusCode) throws ParseException {
+ if (statusCode == null) {
+ return TempLoopState.NOT_DEPLOYED.toString();
}
+ if (statusCode == 200) {
+ Message in = camelExchange.getIn();
+ String msg = in.getBody(String.class);
+
+ JSONParser parser = new JSONParser();
+ Object obj0 = parser.parse(msg);
+ JSONObject jsonObj = (JSONObject) obj0;
- // Map => JsonObject
- if (o instanceof Map) {
- Map<?, ?> map = (Map<?, ?>) o;
+ String opType = (String) jsonObj.get("operationType");
+ String status = (String) jsonObj.get("status");
- JsonObject jsonObject = new JsonObject();
- for (final Map.Entry<?, ?> entry : map.entrySet()) {
- final String name = String.valueOf(entry.getKey());
- final Object value = entry.getValue();
- jsonObject.add(name, wrapSnakeObject(value));
+ // status = processing/successded/failed
+ if (status.equals("succeeded")) {
+ if (opType.equals("install")) {
+ return TempLoopState.DEPLOYED.toString();
+ } else if (opType.equals("uninstall")) {
+ return TempLoopState.NOT_DEPLOYED.toString();
+ }
+ } else if (status.equals("processing")) {
+ return TempLoopState.PROCESSING.toString();
}
- return jsonObject;
+ } else if (statusCode == 404) {
+ return TempLoopState.NOT_DEPLOYED.toString();
}
+ return TempLoopState.IN_ERROR.toString();
+ }
- // otherwise take it as a string
- return new JsonPrimitive(String.valueOf(o));
+ /**
+ * Update the status of the closed loop based on the response from Policy and
+ * DCAE.
+ *
+ * @param loop
+ * The closed loop
+ * @param policyState
+ * The state get from Policy
+ * @param dcaeState
+ * The state get from DCAE
+ * @throws ParseException
+ * The parse exception
+ */
+ public LoopState updateLoopStatus(Loop loop, TempLoopState policyState, TempLoopState dcaeState) {
+ LoopState clState = LoopState.IN_ERROR;
+ if (policyState == TempLoopState.SUBMITTED) {
+ if (dcaeState == TempLoopState.DEPLOYED) {
+ clState = LoopState.DEPLOYED;
+ } else if (dcaeState == TempLoopState.PROCESSING) {
+ clState = LoopState.WAITING;
+ } else if (dcaeState == TempLoopState.NOT_DEPLOYED) {
+ clState = LoopState.SUBMITTED;
+ }
+ } else if (policyState == TempLoopState.NOT_SUBMITTED) {
+ if (dcaeState == TempLoopState.NOT_DEPLOYED) {
+ clState = LoopState.DESIGN;
+ }
+ }
+ loop.setLastComputedState(clState);
+ loopService.saveOrUpdateLoop(loop);
+ return clState;
}
}
diff --git a/src/main/java/org/onap/clamp/loop/log/LoopLog.java b/src/main/java/org/onap/clamp/loop/log/LoopLog.java
index 3edb2ee59..cea495712 100644
--- a/src/main/java/org/onap/clamp/loop/log/LoopLog.java
+++ b/src/main/java/org/onap/clamp/loop/log/LoopLog.java
@@ -69,7 +69,7 @@ public class LoopLog implements Serializable {
private LogType logType;
@Expose
- @Column(name = "message", nullable = false)
+ @Column(name = "message", columnDefinition = "MEDIUMTEXT", nullable = false)
private String message;
@ManyToOne(fetch = FetchType.LAZY)
diff --git a/src/main/java/org/onap/clamp/policy/Policy.java b/src/main/java/org/onap/clamp/policy/Policy.java
index f4efab0d7..fc097bd60 100644
--- a/src/main/java/org/onap/clamp/policy/Policy.java
+++ b/src/main/java/org/onap/clamp/policy/Policy.java
@@ -25,13 +25,15 @@ package org.onap.clamp.policy;
import com.google.gson.JsonObject;
+import java.io.UnsupportedEncodingException;
+
public interface Policy {
String getName();
JsonObject getJsonRepresentation();
- String createPolicyPayload();
+ String createPolicyPayload() throws UnsupportedEncodingException;
/**
* Generate the policy name.
diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
index 2bbb91183..d8d15a5b2 100644
--- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
+++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
@@ -23,6 +23,8 @@
package org.onap.clamp.policy.microservice;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
@@ -40,6 +42,7 @@ import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
+import javax.persistence.Transient;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
@@ -61,6 +64,9 @@ public class MicroServicePolicy implements Serializable, Policy {
*/
private static final long serialVersionUID = 6271238288583332616L;
+ @Transient
+ private static final EELFLogger logger = EELFManager.getInstance().getLogger(MicroServicePolicy.class);
+
@Expose
@Id
@Column(nullable = false, name = "name", unique = true)
@@ -271,7 +277,9 @@ public class MicroServicePolicy implements Serializable, Policy {
JsonObject policyProperties = new JsonObject();
policyDetails.add("properties", policyProperties);
policyProperties.add(this.getMicroServicePropertyNameFromTosca(toscaJson), this.getProperties());
- return new GsonBuilder().setPrettyPrinting().create().toJson(policyPayloadResult);
+ String policyPayload = new GsonBuilder().setPrettyPrinting().create().toJson(policyPayloadResult);
+ logger.info("Micro service policy payload: " + policyPayload);
+ return policyPayload;
}
}
diff --git a/src/main/java/org/onap/clamp/policy/operational/LegacyOperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/LegacyOperationalPolicy.java
new file mode 100644
index 000000000..33148f0b6
--- /dev/null
+++ b/src/main/java/org/onap/clamp/policy/operational/LegacyOperationalPolicy.java
@@ -0,0 +1,150 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.policy.operational;
+
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonElement;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TreeMap;
+
+import org.apache.commons.lang3.math.NumberUtils;
+import org.yaml.snakeyaml.DumperOptions;
+import org.yaml.snakeyaml.DumperOptions.ScalarStyle;
+import org.yaml.snakeyaml.Yaml;
+
+/**
+ *
+ * This class contains the code required to support the sending of Legacy
+ * operational payload to policy engine. This will probably disappear in El
+ * Alto.
+ *
+ */
+public class LegacyOperationalPolicy {
+
+ private LegacyOperationalPolicy() {
+
+ }
+
+ private static void translateStringValues(String jsonKey, String stringValue, JsonElement parentJsonElement) {
+ if (stringValue.equalsIgnoreCase("true") || stringValue.equalsIgnoreCase("false")) {
+ parentJsonElement.getAsJsonObject().addProperty(jsonKey, Boolean.valueOf(stringValue));
+
+ } else if (NumberUtils.isParsable(stringValue)) {
+ parentJsonElement.getAsJsonObject().addProperty(jsonKey, Long.parseLong(stringValue));
+ }
+ }
+
+ private static JsonElement removeAllQuotes(JsonElement jsonElement) {
+ if (jsonElement.isJsonArray()) {
+ for (JsonElement element : jsonElement.getAsJsonArray()) {
+ removeAllQuotes(element);
+ }
+ } else if (jsonElement.isJsonObject()) {
+ for (Entry<String, JsonElement> entry : jsonElement.getAsJsonObject().entrySet()) {
+ if (entry.getValue().isJsonPrimitive() && entry.getValue().getAsJsonPrimitive().isString()) {
+ translateStringValues(entry.getKey(), entry.getValue().getAsString(), jsonElement);
+ } else {
+ removeAllQuotes(entry.getValue());
+ }
+ }
+ }
+ return jsonElement;
+ }
+
+ public static JsonElement reworkPayloadAttributes(JsonElement policyJson) {
+ for (JsonElement policy : policyJson.getAsJsonObject().get("policies").getAsJsonArray()) {
+ JsonElement payloadElem = policy.getAsJsonObject().get("payload");
+ String payloadString = payloadElem != null ? payloadElem.getAsString() : "";
+ if (!payloadString.isEmpty()) {
+ Map<String, String> testMap = new Yaml().load(payloadString);
+ String json = new GsonBuilder().create().toJson(testMap);
+ policy.getAsJsonObject().add("payload", new GsonBuilder().create().fromJson(json, JsonElement.class));
+ }
+ }
+ return policyJson;
+ }
+
+ private static void replacePropertiesIfEmpty(JsonElement policy, String key, String valueIfEmpty) {
+ JsonElement payloadElem = policy.getAsJsonObject().get(key);
+ String payloadString = payloadElem != null ? payloadElem.getAsString() : "";
+ if (payloadString.isEmpty()) {
+ policy.getAsJsonObject().addProperty(key, valueIfEmpty);
+ }
+ }
+
+ private static JsonElement fulfillPoliciesTreeField(JsonElement policyJson) {
+ for (JsonElement policy : policyJson.getAsJsonObject().get("policies").getAsJsonArray()) {
+ replacePropertiesIfEmpty(policy, "success", "final_success");
+ replacePropertiesIfEmpty(policy, "failure", "final_failure");
+ replacePropertiesIfEmpty(policy, "failure_timeout", "final_failure_timeout");
+ replacePropertiesIfEmpty(policy, "failure_retries", "final_failure_retries");
+ replacePropertiesIfEmpty(policy, "failure_exception", "final_failure_exception");
+ replacePropertiesIfEmpty(policy, "failure_guard", "final_failure_guard");
+ }
+ return policyJson;
+ }
+
+ private static Map<String, Object> createMap(JsonElement jsonElement) {
+ Map<String, Object> mapResult = new TreeMap<>();
+
+ if (jsonElement.isJsonObject()) {
+ for (Entry<String, JsonElement> entry : jsonElement.getAsJsonObject().entrySet()) {
+ if (entry.getValue().isJsonPrimitive() && entry.getValue().getAsJsonPrimitive().isString()) {
+ mapResult.put(entry.getKey(), entry.getValue().getAsString());
+ } else if (entry.getValue().isJsonPrimitive() && entry.getValue().getAsJsonPrimitive().isBoolean()) {
+ mapResult.put(entry.getKey(), entry.getValue().getAsBoolean());
+ } else if (entry.getValue().isJsonPrimitive() && entry.getValue().getAsJsonPrimitive().isNumber()) {
+ // Only int ro long normally, we don't need float here
+ mapResult.put(entry.getKey(), entry.getValue().getAsLong());
+ } else if (entry.getValue().isJsonArray()) {
+ List<Map<String, Object>> newArray = new ArrayList<>();
+ mapResult.put(entry.getKey(), newArray);
+ for (JsonElement element : entry.getValue().getAsJsonArray()) {
+ newArray.add(createMap(element));
+ }
+ } else if (entry.getValue().isJsonObject()) {
+ mapResult.put(entry.getKey(), createMap(entry.getValue()));
+ }
+ }
+ }
+ return mapResult;
+ }
+
+ public static String createPolicyPayloadYamlLegacy(JsonElement operationalPolicyJsonElement) {
+ JsonElement opPolicy = fulfillPoliciesTreeField(
+ removeAllQuotes(reworkPayloadAttributes(operationalPolicyJsonElement.getAsJsonObject().deepCopy())));
+ Map<?, ?> jsonMap = createMap(opPolicy);
+ DumperOptions options = new DumperOptions();
+ options.setDefaultScalarStyle(ScalarStyle.PLAIN);
+ options.setIndent(2);
+ options.setPrettyFlow(true);
+ // Policy can't support { } in the yaml
+ options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
+ return (new Yaml(options)).dump(jsonMap);
+ }
+}
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
index 1e35ad6c4..62c5a1e9f 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
@@ -23,6 +23,8 @@
package org.onap.clamp.policy.operational;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
@@ -31,6 +33,9 @@ import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
@@ -42,6 +47,7 @@ import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
+import javax.persistence.Transient;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
@@ -49,6 +55,7 @@ import org.hibernate.annotations.TypeDefs;
import org.onap.clamp.dao.model.jsontype.StringJsonUserType;
import org.onap.clamp.loop.Loop;
import org.onap.clamp.policy.Policy;
+import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
@Entity
@@ -60,6 +67,9 @@ public class OperationalPolicy implements Serializable, Policy {
*/
private static final long serialVersionUID = 6117076450841538255L;
+ @Transient
+ private static final EELFLogger logger = EELFManager.getInstance().getLogger(OperationalPolicy.class);
+
@Id
@Expose
@Column(nullable = false, name = "name", unique = true)
@@ -150,8 +160,7 @@ public class OperationalPolicy implements Serializable, Policy {
return true;
}
- @Override
- public String createPolicyPayload() {
+ public String createPolicyPayloadYaml() {
JsonObject policyPayloadResult = new JsonObject();
policyPayloadResult.addProperty("tosca_definitions_version", "tosca_simple_yaml_1_0_0");
@@ -174,11 +183,33 @@ public class OperationalPolicy implements Serializable, Policy {
operationalPolicyDetails.add("metadata", metadata);
metadata.addProperty("policy-id", this.name);
- operationalPolicyDetails.add("properties", this.configurationsJson.get("operational_policy"));
+ operationalPolicyDetails.add("properties", LegacyOperationalPolicy
+ .reworkPayloadAttributes(this.configurationsJson.get("operational_policy").deepCopy()));
Gson gson = new GsonBuilder().create();
+
Map<?, ?> jsonMap = gson.fromJson(gson.toJson(policyPayloadResult), Map.class);
- return (new Yaml()).dump(jsonMap);
+
+ DumperOptions options = new DumperOptions();
+ options.setIndent(2);
+ options.setPrettyFlow(true);
+ options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
+
+ return (new Yaml(options)).dump(jsonMap);
+ }
+
+ @Override
+ public String createPolicyPayload() throws UnsupportedEncodingException {
+
+ // Now using the legacy payload fo Dublin
+ JsonObject payload = new JsonObject();
+ payload.addProperty("policy-id", this.getName());
+ payload.addProperty("content", URLEncoder.encode(
+ LegacyOperationalPolicy.createPolicyPayloadYamlLegacy(this.configurationsJson.get("operational_policy")),
+ StandardCharsets.UTF_8.toString()));
+ String opPayload = new GsonBuilder().setPrettyPrinting().create().toJson(payload);
+ logger.info("Operational policy payload: " + opPayload);
+ return opPayload;
}
/**
@@ -194,10 +225,11 @@ public class OperationalPolicy implements Serializable, Policy {
for (Entry<String, JsonElement> guardElem : guardsList.getAsJsonObject().entrySet()) {
JsonObject guard = new JsonObject();
guard.addProperty("policy-id", guardElem.getKey());
- guard.add("contents", guardElem.getValue());
+ guard.add("content", guardElem.getValue());
result.put(guardElem.getKey(), new GsonBuilder().create().toJson(guard));
}
}
+ logger.info("Guard policy payload: " + result);
return result;
}
diff --git a/src/main/java/org/onap/clamp/util/PrincipalUtils.java b/src/main/java/org/onap/clamp/util/PrincipalUtils.java
index d6b20f30b..d6dfacbdb 100644
--- a/src/main/java/org/onap/clamp/util/PrincipalUtils.java
+++ b/src/main/java/org/onap/clamp/util/PrincipalUtils.java
@@ -38,6 +38,12 @@ public class PrincipalUtils {
private static SecurityContext securityContext = SecurityContextHolder.getContext();
/**
+ * Private constructor to avoid creating instances of util class.
+ */
+ private PrincipalUtils(){
+ }
+
+ /**
* Get the Full name.
*
* @return The user name
diff --git a/src/main/resources/META-INF/resources/designer/modeler/dist/index.html b/src/main/resources/META-INF/resources/designer/modeler/dist/index.html
index ead478a4e..ab337de8f 100644
--- a/src/main/resources/META-INF/resources/designer/modeler/dist/index.html
+++ b/src/main/resources/META-INF/resources/designer/modeler/dist/index.html
@@ -20,6 +20,11 @@
===================================================================
-->
+<style>
+.ERROR{color: red;}
+.WARNING{color: orange;}
+.INFO{color: green;}
+</style>
<html>
<head>
@@ -43,9 +48,12 @@
</div>
</div>
- <div class="canvas" id="js-canvas" style="margin-top: 100px">
+ <div class="canvas" id="js-canvas" style="margin-top: 100px; margin-left: 20px;">
+ <div id="loop-content">
+ </div>
+
<label for="loop-log-div" class="col-sm-4 control-label">Loop Logs</label>
- <div id="loop-log-div" style="border: 2px solid gray;height: 20vh">
+ <div id="loop-log-div" style="border: 2px solid gray;height: 20vh; margin-right: 40px;">
<div id="loop-log-table-scroll" style="width: 100%;height: 87%;overflow: auto;margin-top: 20px;">
<table id="loop-log-table" style="width: 100%">
<thead>
@@ -57,9 +65,9 @@
</thead>
<tbody>
<tr ng-repeat="log in loop_logs" ng-class="{reverse: reverse}">
- <td>{{log.logInstant}}</td>
- <td>{{log.logType}}</td>
- <td>{{log.message}}</td>
+ <td width="20%">{{log.logInstant}}</td>
+ <td width="10%" ng-class="log.logType">{{log.logType}}</td>
+ <td width="70">{{log.message}}</td>
</tr>
</tbody>
</table>
@@ -67,6 +75,7 @@
</div>
</div>
+
</div>
</body>
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html
index b7864eca9..db127f7d2 100644
--- a/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html
+++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html
@@ -2,7 +2,7 @@
============LICENSE_START=======================================================
ONAP CLAMP
================================================================================
- Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
+ Copyright (C) 2017-2019 AT&T Intellectual Property. All rights
reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
@@ -58,6 +58,16 @@ label {
margin-bottom: 0px;
}
+.withnote {
+ margin-bottom: 0px;
+}
+
+.note {
+ font-size:10px;
+ margin-left: 250px;
+ font-weight: normal;
+}
+
#policyTable {
cursor: pointer;
width: 100%;
@@ -101,10 +111,9 @@ label {
<div class="modal-body">
<div attribute-test="policywindowpropertiesb" class="modal-body row">
- <div class="panel panel-default col-sm-9 policyPanel">
+ <div class="panel panel-default col-sm-10 policyPanel">
<form id="operationalPolicyHeaderForm" class="form-horizontal">
- <div>
- <div class="form-group clearfix row">
+ <div class="form-group clearfix">
<label class="col-sm-2">Parent policy</label>
<div class="col-sm-3" style="padding: 0px;">
<select type="text" id="trigger_policy" name="trigger_policy"
@@ -124,9 +133,11 @@ label {
</div>
<label for="abatement" class="col-sm-2">Abatement</label>
- <div class="col-sm-3" style="padding: 0px;">
- <input type="checkbox" id="abatement" name="abatement"
- checked="true" class="form-control">
+ <div class="col-sm-2" style="padding-left: 0px;">
+ <select class="form-control" id="abatement" name="abatement">
+ <option value="false" selected>False</option>
+ <option value="true">True</option>
+ </select>
</div>
</div>
<div class="form-group clearfix row">
@@ -136,7 +147,6 @@ label {
readonly="readonly" id="clname" ng-model="clname"/>
</div>
</div>
- </div>
</form>
<div class="panel-heading" style="background-color: white;">
<ul id="nav_Tabs" class="nav nav-tabs">
@@ -291,23 +301,22 @@ label {
Type</label>
<div class="col-sm-8">
<select class="form-control" name="type" id="type"
- ng-click="initTargetResourceId()" ng-model="type">
+ ng-click="initTargetResourceId($event)" ng-model="type">
<option value="">-- choose an option --</option>
- <option value="VFModule">VFModule</option>
+ <option value="VFMODULE">VFMODULE</option>
<option value="VM">VM</option>
<option value="VNF">VNF</option>
</select>
</div>
</div>
<div class="form-group clearfix">
- <label for="resourceId" class="col-sm-4 control-label">
+ <label for="resourceID" class="col-sm-4 control-label">
Target ResourceId</label>
<div class="col-sm-8">
- <select class="form-control" name="resourceId" id="resourceId"
- enableFilter="true" ng-click="changeTargetResourceId()"
+ <select class="form-control" name="resourceID" id="resourceID"
+ enableFilter="true" ng-click="changeTargetResourceId($event)"
ng-model="resourceId">
<option value="">-- choose an option --</option>
- <option value="Other:">Other:</option>
</select>
</div>
</div>
@@ -366,7 +375,7 @@ label {
<label for="guardPolicyType" class="col-sm-4 control-label">
Guard Policy Type</label> <select class="form-control"
name="guardPolicyType" id="guardPolicyType"
- ng-change="changeGuardPolicyType()" ng-model="guardType">
+ ng-click="changeGuardPolicyType()" ng-model="guardType">
<option value="GUARD_MIN_MAX">MinMax</option>
<option value="GUARD_YAML">FrequencyLimiter</option>
</select>
@@ -375,12 +384,15 @@ label {
<form class="guardProperties" class="form-horizontal"
title="Guard policy associated" style="border: 2px dotted gray;">
- <div class="form-group clearfix">
+ <div class="form-group clearfix withnote">
<label class="col-sm-4 control-label" for="id">Guard Policy ID</label>
<div class="col-sm-8">
- <input type="text" class="form-control" name="id" id="id" />
+ <input type="text" class="form-control" name="id" id="id" ng-blur="changeGuardId()" ng-model="id"/>
</div>
</div>
+ <div>
+ <label class="form-group note">Note: Prefix will be added to Guard Policy ID automatically based on Guard Policy Type</label>
+ </div>
<div class="form-group clearfix">
<label class="col-sm-4 control-label" for="recipe">Recipe</label>
<div class="col-sm-8">
@@ -404,34 +416,35 @@ label {
</div>
<div class="form-group clearfix">
- <label for="guardTargets" class="col-sm-4 control-label">Guard
+ <label for="targets" class="col-sm-4 control-label">Guard
targets</label>
<div class="col-sm-8">
- <input class="form-control" name="guardTargets" id="guardTargets" />
+ <input class="form-control" name="targets" id="targets" />
</div>
</div>
<div class="form-group clearfix" id="minMaxGuardPolicyDiv">
- <label for="minGuard" class="col-sm-4 control-label"> Min
+ <label for="min" class="col-sm-4 control-label"> Min
Guard</label>
<div class="col-sm-8">
- <input class="form-control" name="minGuard" id="minGuard" />
+ <input class="form-control" name="min" id="min" />
</div>
- <label for="maxGuard" class="col-sm-4 control-label"> Max
+ <label for="max" class="col-sm-4 control-label"> Max
Guard</label>
<div class="col-sm-8">
- <input class="form-control" name="maxGuard" id="maxGuard" />
+ <input class="form-control" name="max" id="max" />
</div>
</div>
<div class="form-group clearfix"
id="frequencyLimiterGuardPolicyDiv" style="display: none">
- <label for="limitGuard" class="col-sm-4 control-label">Limit</label>
+ <label for="limit" class="col-sm-4 control-label">Limit</label>
<div class="col-sm-8">
- <input class="form-control" name="limitGuard" id="limitGuard" />
+ <input class="form-control" name="limit" id="limit" />
</div>
+ <label for="timeUnits" class="col-sm-4 control-label">Time Units</label>
<div class="col-sm-8">
- <select class="form-control" name="timeUnitsGuard"
- id="timeUnitsGuard">
+ <select class="form-control" name="timeUnits"
+ id="timeUnits">
<option value=""></option>
<option value="minute">minute</option>
<option value="hour">hour</option>
@@ -439,13 +452,11 @@ label {
<option value="week">week</option>
<option value="month">month</option>
<option value="year">year</option>
-
- </select> <label for="timeWindowGuard" class="col-sm-4 control-label">Time
- Window</label>
+ </select>
</div>
+ <label for="timeWindow" class="col-sm-4 control-label">Time Window</label>
<div class="col-sm-8">
- <input class="form-control" name="timeWindowGuard"
- id="timeWindowGuard" />
+ <input class="form-control" name="timeWindow" id="timeWindow" />
</div>
</div>
<div class="form-group clearfix">
@@ -453,13 +464,13 @@ label {
Guard Active Start</label>
<div class="col-sm-8">
<input class="form-control" name="guardActiveStart"
- id="guardActiveStart" />
+ id="guardActiveStart" value="00:00:00Z"/>
</div>
<label for="guardActiveEnd" class="col-sm-4 control-label">
Guard Active End</label>
<div class="col-sm-8">
<input class="form-control" name="guardActiveEnd"
- id="guardActiveEnd" />
+ id="guardActiveEnd" value="00:00:01Z"/>
</div>
</div>
diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js
index 34e90e632..0cc5c38f3 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js
@@ -34,7 +34,7 @@ app
//This will open the methods located in the app.js
if (undefined == name) {
return;
- }else if (name.toLowerCase().indexOf("policy") >= 0){
+ }else if (name === "OperationalPolicy"){
PolicyWindow();
} else {
$rootScope.selectedBoxName = name;
@@ -51,10 +51,10 @@ app
def.resolve(data);
alertService.alertMessage("Action Successful: " + svcAction, 1)
// update deploymentID, lastUpdatedStatus
- setLastUpdatedStatus(data.lastUpdatedStatus);
+ setLastComputedState(data.lastComputedState);
setDeploymentStatusURL(data.dcaeDeploymentStatusUrl);
setDeploymentID(data.dcaeDeploymentId);
- setStatus();
+ setStatus(data.lastComputedState);
enableDisableMenuOptions();
}).error(
function(data) {
@@ -70,6 +70,7 @@ app
var svcUrl = "/restservices/clds/v2/loop/" + modelName;
$http.get(svcUrl).success(function(data) {
cl_props = data;
+ setStatus(data.lastComputedState);
def.resolve(data);
}).error(function(data) {
def.reject("Open Model not successful");
@@ -100,11 +101,9 @@ app
def.resolve(data);
alertService.alertMessage("Action Successful: " + svcAction, 1)
// update deploymentID, lastUpdatedStatus
- setLastUpdatedStatus(data.lastUpdatedStatus);
+ setLastComputedState(data.lastComputedState);
setDeploymentStatusURL(data.dcaeDeploymentStatusUrl);
setDeploymentID(data.dcaeDeploymentId);
- setStatus();
- enableDisableMenuOptions();
}).error(
function(data) {
def.resolve(data);
@@ -139,23 +138,30 @@ app
this.processActionResponse = function(modelName) {
// populate control name (prefix and uuid here)
$("#loop_name").text(getLoopName());
- setStatus();
manageCLImage(modelName);
enableDisableMenuOptions();
};
- this.processRefresh = function() {
- setStatus();
+ this.refreshStatus = function(modelName) {
+ var def = $q.defer();
+ var sets = [];
+ var svcUrl = "/restservices/clds/v2/loop/getstatus/" + modelName;
+ $http.get(svcUrl).success(function(data) {
+ setStatus(data.lastComputedState);
+ def.resolve(data);
+ }).error(function(data) {
+ def.reject("Refresh Status not successful");
+ });
+ return def.promise;
enableDisableMenuOptions();
}
- function setStatus() {
- var status = getLastUpdatedStatus();
+ function setStatus(status) {
// apply color to status
var statusColor = 'white';
if (status.trim() === "DESIGN") {
statusColor = 'gray'
} else if (status.trim() === "DISTRIBUTED") {
statusColor = 'blue'
- } else if (status.trim() === "ACTIVE") {
+ } else if (status.trim() === "SUBMITTED") {
statusColor = 'green'
} else if (status.trim() === "STOPPED") {
statusColor = 'red'
@@ -180,13 +186,12 @@ app
'<span id="status_clds" style="position: absolute; left: 61%;top: 151px; font-size:20px;">Status: '
+ statusMsg + '</span>');
}
-
function manageCLImage(modelName) {
getModelImage(modelName).then(function(pars) {
var svg = pars;
if ($("#svgContainer").length > 0)
$("#svgContainer").remove();
- $("#js-canvas").append(
+ $("#loop-content").append(
"<span id=\"svgContainer\">" + svg + "</span>");
$("#svgContainer svg").attr('width', '100%');
$("#svgContainer svg").attr('height', '100%');
@@ -200,8 +205,6 @@ app
}
enableDisableMenuOptions = function() {
enableDefaultMenu();
- //var status = getStatus();
- //enableActionMenu(status);
enableAllActionMenu();
}
getModelImage = function(modelName) {
diff --git a/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js
index 2c3f83e41..0f9b62ffe 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP CLAMP
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -55,7 +55,6 @@ app
}
console.log("No active formId found !");
}
-
function add_one_more() {
console.log("add one more");
@@ -154,10 +153,9 @@ app
policiesArray.push(policyProperties);
// Now get the Guard
if ($("#" + this.id + " #enableGuardPolicy").is(':checked')) {
- var guardPolicyBody = serializeElement($("#" + this.id + " .guardProperties"));
- var guardPolicyId = guardPolicyBody['id'];
- delete guardPolicyBody['id'];
-
+ var guardPolicyBody = serializeElement($("#" + this.id + " .guardProperties"));
+ var guardPolicyId = guardPolicyBody['id'];
+ delete guardPolicyBody['id'];
allPolicies['guard_policies'][guardPolicyId] = guardPolicyBody;
$scope.guard_ids.push(guardPolicyId);
}
@@ -181,7 +179,6 @@ app
console.log("load properties to op policy");
// Set the header
$.each($('#operationalPolicyHeaderForm').find('.form-control'), function() {
-
$(this).val(allPolicies['operational_policy']['controlLoop'][this.id]);
});
// Set the sub-policies
@@ -190,9 +187,18 @@ app
var formNum = add_one_more();
$.each($('.policyProperties').find('.form-control'), function(opPolicyPropIndex, opPolicyPropValue) {
- $("#formId"+formNum+" .policyProperties").find("#"+opPolicyPropValue.id).val(
+ $("#formId" + formNum + " .policyProperties").find("#" + opPolicyPropValue.id).val(
allPolicies['operational_policy']['policies'][opPolicyElemIndex][opPolicyPropValue.id]);
});
+
+ // Initial TargetResourceId options
+ initTargetResourceIdOptions(allPolicies['operational_policy']['policies'][opPolicyElemIndex]['target']['type'], formNum);
+ $.each($('.policyTarget').find('.form-control'), function(opPolicyTargetPropIndex, opPolicyTargetPropValue) {
+
+ $("#formId" + formNum + " .policyTarget").find("#" + opPolicyTargetPropValue.id).val(
+ allPolicies['operational_policy']['policies'][opPolicyElemIndex]['target'][opPolicyTargetPropValue.id]);
+ });
+
// update the current tab label
$("#go_properties_tab" + formNum).text(
allPolicies['operational_policy']['policies'][opPolicyElemIndex]['id']);
@@ -201,119 +207,121 @@ app
if (guardElemValue.recipe === $($("#formId" + formNum + " #recipe")[0]).val()) {
// Found one, set all guard prop
- $.each($('.guardProperties').find('.form-control'), function(guardPropElemIndex,guardPropElemValue) {
- guardElemValue['id'] = guardElemId;
- $("#formId"+formNum+" .guardProperties").find("#"+guardPropElemValue.id).val(
+ $.each($('.guardProperties').find('.form-control'), function(guardPropElemIndex,
+ guardPropElemValue) {
+
+ guardElemValue['id'] = guardElemId;
+ $("#formId" + formNum + " .guardProperties").find("#" + guardPropElemValue.id).val(
guardElemValue[guardPropElemValue.id]);
});
+ iniGuardPolicyType(guardElemId, formNum);
// And finally enable the flag
$("#formId" + formNum + " #enableGuardPolicy").prop("checked", true);
}
});
});
}
-
- $scope.initTargetResourceId = function() {
-
- var recipe = $(event.target).val();
-
- var type = $(event.target).val();
-
- $("#modelName").val("");
- $("#modelInvariantId").val("");
- $("#modelVersionId").val("");
- $("#modelVersion").val("");
- $("#modelCustomizationId").val("");
- $('#resourceId').empty();
- $("#resourceId")
- .append(
- $('<option></option>').val("")
- .html("-- choose an option --"));
- $("#resourceId").append(
- $('<option></option>').val("Other:")
- .html("Other:"));
- if (type == "VM" || type == "" || type == "VNF" ) {
- $("#metadata *").prop('disabled',true);
- }
-
- var resourceVnf = getResourceDetailsProperty();
- if (type == "VNF"
- && (null !== resourceVnf || undefined !== resourceVnf)) {
- for ( var prop in resourceVnf) {
- var name = resourceVnf[prop]["name"];
- $("#resourceId").append(
- $('<option></option>')
- .val(name).html(name));
- }
-
- }
- var resourceVFModule = getResourceDetailsVfModuleProperty();
- if (type == "VFModule"
- && (null !== resourceVFModule || undefined !== resourceVFModule)) {
- if (recipe == 'VF Module Create'
- || recipe == 'VF Module Delete') {
- for ( var prop in resourceVFModule) {
- if (resourceVFModule[prop]["isBase"] == false) {
- var name = resourceVFModule[prop]["name"];
- $("#resourceId").append(
- $('<option></option>')
- .val(name)
- .html(name));
- }
- }
- }
- else
- {
- for ( var prop in resourceVFModule) {
- var name = resourceVFModule[prop]["name"];
- $("#resourceId").append(
- $('<option></option>')
- .val(name).html(name));
- }
- }
- }
- }
-
- $scope.changeTargetResourceId = function() {
- $("#modelName").val("");
- $("#modelInvariantId").val("");
- $("#modelVersionId").val("");
- $("#modelVersion").val("");
- $("#modelCustomizationId").val("");
- var resourceVFModule = getResourceDetailsVfModuleProperty();
- var type = $("#type").val();
- var recipe = $("#recipe").val();
- vfBaseName = $(event.target).val();
- if (type == "VFModule"
- && (null !== resourceVFModule || undefined !== resourceVFModule)
- && (recipe == 'VF Module Create' || recipe == 'VF Module Delete')) {
- for ( var prop in resourceVFModule) {
- var name = resourceVFModule[prop]["name"];
- if (name == vfBaseName) {
- var vfModuleModelName = resourceVFModule[prop]["name"];
- $("#modelName").val(
- vfModuleModelName);
- var vfModuleModelInvariantUUID = resourceVFModule[prop]["invariantUUID"];
- $("#modelInvariantId").val(
- vfModuleModelInvariantUUID);
- var vfModuleModelUUID = resourceVFModule[prop]["UUID"];
- $("#modelVersionId").val(
- vfModuleModelUUID);
- var vfModuleModelVersion = resourceVFModule[prop]["version"];
- $("#modelVersion").val(
- vfModuleModelVersion);
- var vfModuleModelCustomizationUUID = resourceVFModule[prop]["customizationUUID"];
- $("#modelCustomizationId")
- .val(
- vfModuleModelCustomizationUUID);
- }
- }
- }
- else {
- $("#metadata *").prop('disabled',true);
- }
- }
+ function iniGuardPolicyType (guardPolicyId, formNum) {
+ if(guardPolicyId.indexOf('guard.minmax.') !== -1) {
+ $("#formId" + formNum + " #minMaxGuardPolicyDiv").show();
+ $("#formId" + formNum + " #frequencyLimiterGuardPolicyDiv").hide();
+ $("#formId" + formNum + " #guardPolicyType").val("GUARD_MIN_MAX");
+ } else if (guardPolicyId.indexOf('guard.frequency.') !== -1) {
+ $("#formId" + formNum + " #minMaxGuardPolicyDiv").hide();
+ $("#formId" + formNum + " #frequencyLimiterGuardPolicyDiv").show();
+ $("#formId" + formNum + " #guardPolicyType").val("GUARD_YAML");
+ }
+ }
+ function initTargetResourceIdOptions (targetType, formNum) {
+ var recipe = $("#formId" + formNum + "#recipe").val();
+ $("#formId" + formNum + " #resourceID").empty();
+ $("#formId" + formNum + " #resourceID").append($('<option></option>').val("").html("-- choose an option --"));
+
+ var resourceVnf = getResourceDetailsVfProperty();
+ if (targetType == "VNF" && (null !== resourceVnf || undefined !== resourceVnf)) {
+ for ( var prop in resourceVnf) {
+ var name = resourceVnf[prop]["name"];
+ $("#formId" + formNum + " #resourceID").append($('<option></option>').val(name).html(name));
+ }
+ }
+ var resourceVFModule = getResourceDetailsVfModuleProperty();
+ if (targetType == "VFMODULE" && (null !== resourceVFModule || undefined !== resourceVFModule)) {
+ if (recipe == 'VF Module Create' || recipe == 'VF Module Delete') {
+ for ( var prop in resourceVFModule) {
+ if (resourceVFModule[prop]["isBase"] == false) {
+ $("#formId" + formNum + " #resourceID").append($('<option></option>').val(resourceVFModule[prop]["vfModuleModelName"]).html(resourceVFModule[prop]["vfModuleModelName"]));
+ }
+ }
+ } else {
+ for ( var prop in resourceVFModule) {
+ $("#formId" + formNum + " #resourceID").append($('<option></option>').val(resourceVFModule[prop]["vfModuleModelName"]).html(resourceVFModule[prop]["vfModuleModelName"]));
+ }
+ }
+ }
+ }
+
+ function initTargetModelAttributes (formNum) {
+ $("#formId" + formNum + " #modelName").val("");
+ $("#formId" + formNum + " #modelInvariantId").val("");
+ $("#formId" + formNum + " #modelVersionId").val("");
+ $("#formId" + formNum + " #modelVersion").val("");
+ $("#formId" + formNum + " #modelCustomizationId").val("");
+ }
+ $scope.initTargetResourceId = function(event) {
+ var formNum = $(event.target).closest('.formId').attr('id').substring(6);
+ initTargetModelAttributes(formNum);
+ var type = $(event.target).val();
+ initTargetResourceIdOptions(type, formNum);
+ }
+
+ $scope.changeGuardId = function(formItemActive) {
+ if (formItemActive === undefined) {
+ formItemActive = searchActiveFormId();
+ if (formItemActive === undefined) {
+ return;
+ }
+ }
+ var oldValue = $("#" + formItemActive.id + " .guardProperties #id").val();
+ // remove old prefix
+ if(oldValue.indexOf('guard.minmax.') !== -1) {
+ oldValue = oldValue.substr(oldValue.indexOf('guard.minmax.') + 13);
+ } else if (oldValue.indexOf('guard.frequency.') !== -1) {
+ oldValue = oldValue.substr(oldValue.indexOf('guard.frequency.') + 16);
+ }
+
+ var prefix = "guard.";
+ if ($("#" + formItemActive.id + " #guardPolicyType").val() === "GUARD_MIN_MAX") {
+ prefix = prefix + "minmax.";
+ } else if ($("#" + formItemActive.id + " #guardPolicyType").val() === "GUARD_YAML") {
+ prefix = prefix + "frequency.";
+ }
+ $("#" + formItemActive.id + " .guardProperties #id").val(prefix+oldValue);
+ }
+
+ $scope.changeTargetResourceId = function(event) {
+ var formNum = $(event.target).closest('.formId').attr('id').substring(6);
+ initTargetModelAttributes(formNum);
+
+ var resourceVFModule = getResourceDetailsVfModuleProperty();
+ var type = $("#formId" + formNum +" #type").val();
+ var recipe = $("#formId" + formNum +" #recipe").val();
+ if (type == "VFMODULE" && (null !== resourceVFModule || undefined !== resourceVFModule)
+ && (recipe == 'VF Module Create' || recipe == 'VF Module Delete')) {
+ for ( var prop in resourceVFModule) {
+ if (prop == $(event.target).val()) {
+ $("#formId" + formNum +" #modelName").val(resourceVFModule[prop]["vfModuleModelName"]);
+ $("#formId" + formNum +" #modelInvariantId").val(resourceVFModule[prop]["vfModuleModelInvariantUUID"]);
+ $("#formId" + formNum +" #modelVersionId").val(resourceVFModule[prop]["vfModuleModelUUID"]);
+ $("#formId" + formNum +" #modelVersion").val(resourceVFModule[prop]["vfModuleModelVersion"]);
+ $("#formId" + formNum +" #modelCustomizationId").val(resourceVFModule[prop]["vfModuleModelCustomizationUUID"]);
+ $("#formId" + formNum +" #metadata *").prop('disabled', false);
+ }
+ }
+ } else {
+ $("#formId" + formNum +" #metadata *").prop('disabled', true);
+ }
+ }
$scope.changeGuardPolicyType = function() {
var formItemActive = searchActiveFormId();
@@ -326,6 +334,7 @@ app
$("#" + formItemActive.id + " #minMaxGuardPolicyDiv").hide();
$("#" + formItemActive.id + " #frequencyLimiterGuardPolicyDiv").show();
}
+ $scope.changeGuardId(formItemActive);
}
$scope.initPolicySelect = function() {
@@ -343,7 +352,8 @@ app
$scope.init = function() {
$(function() {
- $scope.clname=getLoopName();
+
+ $scope.clname = getLoopName();
$("#add_one_more").click(function(event) {
console.log("add one more");
@@ -359,17 +369,18 @@ app
add_new_policy();
}
$("#savePropsBtn").click(function(event) {
+
console.log("save properties triggered");
savePolicyLocally();
- for(var i = 0; i <= $scope.guard_ids.length; i++) {
- for(var j = i; j <= $scope.guard_ids.length; j++) {
- if(i != j && $scope.guard_ids[i] == $scope.guard_ids[j]) {
- // duplacated guard policy id exist
- alert("The guard policy ID should be unique.");
- return;
- }
- }
- }
+ for (var i = 0; i <= $scope.guard_ids.length; i++) {
+ for (var j = i; j <= $scope.guard_ids.length; j++) {
+ if (i != j && $scope.guard_ids[i] == $scope.guard_ids[j]) {
+ // duplacated guard policy id exist
+ alert("The guard policy ID should be unique.");
+ return;
+ }
+ }
+ }
angular.element(document.getElementById('formSpan')).scope().submitForm(allPolicies);
$("#close_button").click();
});
diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js
index 323cffc1e..5597bd992 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/app.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/app.js
@@ -505,17 +505,18 @@ function($scope, $rootScope, $timeout, dialogs) {
cldsModelService.processAction(uiAction, modelName).then(function(pars) {
console.log("cldsPerformAction: pars=" + pars);
- $rootScope.refreshLoopLog();
+ cldsModelService.getModel(modelName).then(function(pars) {
+ $rootScope.refreshLoopLog();
+ }, function(data) {
+ });
}, function(data) {
-
});
};
$scope.refreshStatus = function() {
var modelName = selected_model;
console.log("refreStatus modelName=" + modelName);
- cldsModelService.getModel(modelName).then(function(pars) {
+ cldsModelService.refreshStatus(modelName).then(function(pars) {
console.log("refreStatus: pars=" + pars);
- cldsModelService.processRefresh();
}, function(data) {
});
@@ -566,9 +567,13 @@ function($scope, $rootScope, $timeout, dialogs) {
+ selected_model);
cldsModelService.toggleDeploy(uiAction, selected_model).then(
function(pars) {
+ cldsModelService.getModel(selected_model).then(function(pars) {
+ $rootScope.refreshLoopLog();
+ }, function(data) {
+ });
}, function(data) {
-
});
+
}
$scope.ToscaModelWindow = function (tosca_model) {
diff --git a/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js b/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
index d6387c863..92bd24fdf 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
@@ -34,7 +34,6 @@ angular.module('clds-app').controller(
function($scope, $rootScope, $window, $resource, $http, $location, $cookies) {
console.log("//////////AuthenticateCtrl");
$scope.getInclude = function() {
- console.log("getInclude011111111");
var invalidUser = $window.localStorage.getItem("invalidUser");
var isAuth = $window.localStorage.getItem("isAuth");
if (invalidUser == 'true')
diff --git a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js
index 3902cf413..a8aa83c06 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js
@@ -22,10 +22,11 @@
*/
function updateMsProperties(type, newMsProperties) {
- var newMsProperties = JSON.parse(JSON.stringify(cl_props["microServicePolicies"]));
- for (p in newMsProperties) {
- if (newMsProperties[p]["name"] == type) {
- cl_props["microServicePolicies"][p] = newMsProperties;
+ if (newMsProperties["name"] == type) {
+ for (p in cl_props["microServicePolicies"]) {
+ if (cl_props["microServicePolicies"][p]["name"] == type) {
+ cl_props["microServicePolicies"][p] = newMsProperties;
+ }
}
}
}
@@ -94,7 +95,7 @@ function getLastUpdatedStatus() {
return cl_props["lastComputedState"];
}
-function setLastUpdatedStatus(status) {
+function setLastComputedState(status) {
cl_props["lastComputedState"] = status;
}
@@ -114,7 +115,7 @@ function setDeploymentStatusURL(deploymentStatusURL) {
cl_props["dcaeDeploymentStatusUrl"] = deploymentStatusURL;
}
-function getResourceDetailsProperty() {
+function getResourceDetailsVfProperty() {
return cl_props["modelPropertiesJson"]["resourceDetails"]["VF"];
}
@@ -126,4 +127,4 @@ function getLoopLogsArray() {
return cl_props.loopLogs;
}
-module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getLastUpdatedStatus,getDeploymentID,getDeploymentStatusURL,getResourceDetailsProperty,getResourceDetailsVfModuleProperty }; \ No newline at end of file
+module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getLastUpdatedStatus,getDeploymentID,getDeploymentStatusURL,getResourceDetailsVfProperty,getResourceDetailsVfModuleProperty };
diff --git a/src/main/resources/META-INF/resources/swagger.html b/src/main/resources/META-INF/resources/swagger.html
index e2bc77a20..4809ffabb 100644
--- a/src/main/resources/META-INF/resources/swagger.html
+++ b/src/main/resources/META-INF/resources/swagger.html
@@ -4,17 +4,16 @@
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<meta name="generator" content="Asciidoctor 1.5.6.1">
+<meta name="generator" content="Asciidoctor 1.5.7.1">
<title>Clamp Rest API</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
<style>
/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
-/* Remove comment around @import statement below when using as a custom stylesheet */
+/* Uncomment @import statement below to use as custom stylesheet */
/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";*/
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}
audio,canvas,video{display:inline-block}
audio:not([controls]){display:none;height:0}
-[hidden],template{display:none}
script{display:none!important}
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
a{background:transparent}
@@ -44,12 +43,10 @@ button,select{text-transform:none}
button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}
button[disabled],html input[disabled]{cursor:default}
input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}
-input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
-input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
textarea{overflow:auto;vertical-align:top}
table{border-collapse:collapse;border-spacing:0}
-*,*:before,*:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
+*,*::before,*::after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
html,body{font-size:100%}
body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto;tab-size:4;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
a:hover{cursor:pointer}
@@ -67,8 +64,7 @@ img,object,svg{display:inline-block;vertical-align:middle}
textarea{height:auto;min-height:50px}
select{width:100%}
.center{margin-left:auto;margin-right:auto}
-.spread{width:100%}
-p.lead,.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{font-size:1.21875em;line-height:1.6}
+.stretch{width:100%}
.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr}
a{color:#2156a5;text-decoration:underline;line-height:inherit}
@@ -102,24 +98,24 @@ abbr,acronym{text-transform:uppercase;font-size:90%;color:rgba(0,0,0,.8);border-
abbr{text-transform:none}
blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
blockquote cite{display:block;font-size:.9375em;color:rgba(0,0,0,.6)}
-blockquote cite:before{content:"\2014 \0020"}
+blockquote cite::before{content:"\2014 \0020"}
blockquote cite a,blockquote cite a:visited{color:rgba(0,0,0,.6)}
blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
-@media only screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
+@media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
h1{font-size:2.75em}
h2{font-size:2.3125em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
h4{font-size:1.4375em}}
table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
-table thead,table tfoot{background:#f7f8f7;font-weight:bold}
+table thead,table tfoot{background:#f7f8f7}
table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
table tr.even,table tr.alt,table tr:nth-of-type(even){background:#f8f8f7}
table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6}
h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
-.clearfix:before,.clearfix:after,.float-group:before,.float-group:after{content:" ";display:table}
-.clearfix:after,.float-group:after{clear:both}
+.clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table}
+.clearfix::after,.float-group::after{clear:both}
*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed;word-wrap:break-word}
*:not(pre)>code.nobreak{word-wrap:normal}
*:not(pre)>code.nowrap{white-space:nowrap}
@@ -135,15 +131,15 @@ kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-bl
.menuseq{word-spacing:-.02em}
.menuseq b.caret{font-size:1.25em;line-height:.8}
.menuseq i.caret{font-weight:bold;text-align:center;width:.45em}
-b.button:before,b.button:after{position:relative;top:-1px;font-weight:400}
-b.button:before{content:"[";padding:0 3px 0 2px}
-b.button:after{content:"]";padding:0 2px 0 3px}
+b.button::before,b.button::after{position:relative;top:-1px;font-weight:400}
+b.button::before{content:"[";padding:0 3px 0 2px}
+b.button::after{content:"]";padding:0 2px 0 3px}
p a>code:hover{color:rgba(0,0,0,.9)}
#header,#content,#footnotes,#footer{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
-#header:before,#header:after,#content:before,#content:after,#footnotes:before,#footnotes:after,#footer:before,#footer:after{content:" ";display:table}
-#header:after,#content:after,#footnotes:after,#footer:after{clear:both}
+#header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table}
+#header::after,#content::after,#footnotes::after,#footer::after{clear:both}
#content{margin-top:1.25em}
-#content:before{content:none}
+#content::before{content:none}
#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #ddddd8}
#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #ddddd8;padding-bottom:8px}
@@ -151,11 +147,11 @@ p a>code:hover{color:rgba(0,0,0,.9)}
#header .details span:first-child{margin-left:-.125em}
#header .details span.email a{color:rgba(0,0,0,.85)}
#header .details br{display:none}
-#header .details br+span:before{content:"\00a0\2013\00a0"}
-#header .details br+span.author:before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
-#header .details br+span#revremark:before{content:"\00a0|\00a0"}
+#header .details br+span::before{content:"\00a0\2013\00a0"}
+#header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
+#header .details br+span#revremark::before{content:"\00a0|\00a0"}
#header #revnumber{text-transform:capitalize}
-#header #revnumber:after{content:"\00a0"}
+#header #revnumber::after{content:"\00a0"}
#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #ddddd8;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
#toc{border-bottom:1px solid #efefed;padding-bottom:.5em}
#toc>ul{margin-left:.125em}
@@ -166,7 +162,7 @@ p a>code:hover{color:rgba(0,0,0,.9)}
#toc a{text-decoration:none}
#toc a:active{text-decoration:underline}
#toctitle{color:#7a2518;font-size:1.2em}
-@media only screen and (min-width:768px){#toctitle{font-size:1.375em}
+@media screen and (min-width:768px){#toctitle{font-size:1.375em}
body.toc2{padding-left:15em;padding-right:0}
#toc.toc2{margin-top:0!important;background-color:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #efefed;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
@@ -175,7 +171,7 @@ body.toc2{padding-left:15em;padding-right:0}
#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
body.toc2.toc-right{padding-left:0;padding-right:15em}
body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}}
-@media only screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
+@media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
#toc.toc2{width:20em}
#toc.toc2 #toctitle{font-size:1.375em}
#toc.toc2>ul{font-size:.95em}
@@ -186,22 +182,25 @@ body.toc2.toc-right{padding-left:0;padding-right:20em}}
#content #toc>:last-child{margin-bottom:0}
#footer{max-width:100%;background-color:rgba(0,0,0,.8);padding:1.25em}
#footer-text{color:rgba(255,255,255,.8);line-height:1.44}
+#content{margin-bottom:.625em}
.sect1{padding-bottom:.625em}
-@media only screen and (min-width:768px){.sect1{padding-bottom:1.25em}}
+@media screen and (min-width:768px){#content{margin-bottom:1.25em}
+.sect1{padding-bottom:1.25em}}
+.sect1:last-child{padding-bottom:0}
.sect1+.sect1{border-top:1px solid #efefed}
#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
-#content h1>a.anchor:before,h2>a.anchor:before,h3>a.anchor:before,#toctitle>a.anchor:before,.sidebarblock>.content>.title>a.anchor:before,h4>a.anchor:before,h5>a.anchor:before,h6>a.anchor:before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
+#content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
-table.tableblock>caption.title{white-space:nowrap;overflow:visible;max-width:0}
-.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{color:rgba(0,0,0,.85)}
-table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inherit}
+table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
+.paragraph.lead>p,#preamble>.sectionbody>[class="paragraph"]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)}
+table.tableblock #preamble>.sectionbody>[class="paragraph"]:first-of-type p{font-size:inherit}
.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
.admonitionblock>table td.icon{text-align:center;width:80px}
-.admonitionblock>table td.icon img{max-width:initial}
+.admonitionblock>table td.icon img{max-width:none}
.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #ddddd8;color:rgba(0,0,0,.6)}
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
@@ -217,17 +216,17 @@ table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inh
.sidebarblock .literalblock pre,.sidebarblock .listingblock pre:not(.highlight),.sidebarblock .listingblock pre[class="highlight"],.sidebarblock .listingblock pre[class^="highlight "],.sidebarblock .listingblock pre.CodeRay,.sidebarblock .listingblock pre.prettyprint{background:#f2f1f1}
.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;padding:1em;font-size:.8125em}
.literalblock pre.nowrap,.literalblock pre[class].nowrap,.listingblock pre.nowrap,.listingblock pre[class].nowrap{overflow-x:auto;white-space:pre;word-wrap:normal}
-@media only screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}
-@media only screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}
+@media screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}
+@media screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}
.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}
.listingblock pre.highlightjs{padding:0}
.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px}
.listingblock pre.prettyprint{border-width:0}
.listingblock>.content{position:relative}
-.listingblock code[data-lang]:before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:#999}
-.listingblock:hover code[data-lang]:before{display:block}
-.listingblock.terminal pre .command:before{content:attr(data-prompt);padding-right:.5em;color:#999}
-.listingblock.terminal pre .command:not([data-prompt]):before{content:"$"}
+.listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:#999}
+.listingblock:hover code[data-lang]::before{display:block}
+.listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:#999}
+.listingblock.terminal pre .command:not([data-prompt])::before{content:"$"}
table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:none}
table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0;line-height:1.45}
table.pyhltable td.code{padding-left:.75em;padding-right:0}
@@ -238,35 +237,39 @@ table.pyhltable .linenodiv{background:none!important;padding-right:0!important}
.quoteblock>.title{margin-left:-1.5em;margin-bottom:.75em}
.quoteblock blockquote,.quoteblock blockquote p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
.quoteblock blockquote{margin:0;padding:0;border:0}
-.quoteblock blockquote:before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
+.quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
.quoteblock .attribution{margin-top:.5em;margin-right:.5ex;text-align:right}
.quoteblock .quoteblock{margin-left:0;margin-right:0;padding:.5em 0;border-left:3px solid rgba(0,0,0,.6)}
.quoteblock .quoteblock blockquote{padding:0 0 0 .75em}
-.quoteblock .quoteblock blockquote:before{display:none}
-.verseblock{margin:0 1em 1.25em 1em}
+.quoteblock .quoteblock blockquote::before{display:none}
+.verseblock{margin:0 1em 1.25em}
.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
.verseblock pre strong{font-weight:400}
.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
.quoteblock .attribution br,.verseblock .attribution br{display:none}
.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
-.quoteblock.abstract{margin:0 0 1.25em 0;display:block}
-.quoteblock.abstract blockquote,.quoteblock.abstract blockquote p{text-align:left;word-spacing:0}
-.quoteblock.abstract blockquote:before,.quoteblock.abstract blockquote p:first-of-type:before{display:none}
+.quoteblock.abstract{margin:0 1em 1.25em;display:block}
+.quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center}
+.quoteblock.abstract blockquote,.quoteblock.abstract blockquote p{word-spacing:0;line-height:1.6}
+.quoteblock.abstract blockquote::before,.quoteblock.abstract p::before{display:none}
table.tableblock{max-width:100%;border-collapse:separate}
-table.tableblock td>.paragraph:last-child p>p:last-child,table.tableblock th>p:last-child,table.tableblock td>p:last-child{margin-bottom:0}
+p.tableblock:last-child{margin-bottom:0}
+td.tableblock>.content{margin-bottom:-1.25em}
table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
table.grid-all>thead>tr>.tableblock,table.grid-all>tbody>tr>.tableblock{border-width:0 1px 1px 0}
table.grid-all>tfoot>tr>.tableblock{border-width:1px 1px 0 0}
table.grid-cols>*>tr>.tableblock{border-width:0 1px 0 0}
-table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px 0}
-table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0 0}
+table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px}
+table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0}
table.grid-all>*>tr>.tableblock:last-child,table.grid-cols>*>tr>.tableblock:last-child{border-right-width:0}
table.grid-all>tbody>tr:last-child>.tableblock,table.grid-all>thead:last-child>tr>.tableblock,table.grid-rows>tbody>tr:last-child>.tableblock,table.grid-rows>thead:last-child>tr>.tableblock{border-bottom-width:0}
table.frame-all{border-width:1px}
table.frame-sides{border-width:0 1px}
-table.frame-topbot{border-width:1px 0}
+table.frame-topbot,table.frame-ends{border-width:1px 0}
+table.stripes-all tr,table.stripes-odd tr:nth-of-type(odd){background:#f8f8f7}
+table.stripes-none tr,table.stripes-odd tr:nth-of-type(even){background:none}
th.halign-left,td.halign-left{text-align:left}
th.halign-right,td.halign-right{text-align:right}
th.halign-center,td.halign-center{text-align:center}
@@ -290,9 +293,8 @@ ul.unstyled,ol.unstyled{margin-left:0}
ul.checklist{margin-left:.625em}
ul.checklist li>p:first-child>.fa-square-o:first-child,ul.checklist li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}
ul.checklist li>p:first-child>input[type="checkbox"]:first-child{margin-right:.25em}
-ul.inline{margin:0 auto .625em auto;margin-left:-1.375em;margin-right:0;padding:0;list-style:none;overflow:hidden}
-ul.inline>li{list-style:none;float:left;margin-left:1.375em;display:block}
-ul.inline>li>*{display:block}
+ul.inline{display:-ms-flexbox;display:-webkit-box;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em}
+ul.inline>li{margin-left:1.25em}
.unstyled dl dt{font-weight:400;font-style:normal}
ol.arabic{list-style-type:decimal}
ol.decimal{list-style-type:decimal-leading-zero}
@@ -306,9 +308,9 @@ ol.lowergreek{list-style-type:lower-greek}
td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
td.hdlist1{font-weight:bold;padding-bottom:1.25em}
.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
-.colist>table tr>td:first-of-type{padding:.4em .75em 0 .75em;line-height:1;vertical-align:top}
-.colist>table tr>td:first-of-type img{max-width:initial}
-.colist>table tr>td:last-of-type{padding:.25em 0}
+.colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
+.colist td:not([class]):first-child img{max-width:none}
+.colist td:not([class]):last-child{padding:.25em 0}
.thumb,.th{line-height:0;display:inline-block;border:solid 4px #fff;-webkit-box-shadow:0 0 0 1px #ddd;box-shadow:0 0 0 1px #ddd}
.imageblock.left,.imageblock[style*="float: left"]{margin:.25em .625em 1.25em 0}
.imageblock.right,.imageblock[style*="float: right"]{margin:.25em 0 1.25em .625em}
@@ -324,9 +326,9 @@ sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:sup
sup.footnote a,sup.footnoteref a{text-decoration:none}
sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
-#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em 0;border-width:1px 0 0 0}
-#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;text-indent:-1.05em;margin-bottom:.2em}
-#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none}
+#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
+#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
+#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em}
#footnotes .footnote:last-of-type{margin-bottom:0}
#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
.gist .file-data>table{border:0;background:#fff;width:100%;margin-bottom:0}
@@ -372,15 +374,15 @@ div.unbreakable{page-break-inside:avoid}
span.icon>.fa{cursor:default}
a span.icon>.fa{cursor:inherit}
.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
-.admonitionblock td.icon .icon-note:before{content:"\f05a";color:#19407c}
-.admonitionblock td.icon .icon-tip:before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
-.admonitionblock td.icon .icon-warning:before{content:"\f071";color:#bf6900}
-.admonitionblock td.icon .icon-caution:before{content:"\f06d";color:#bf3400}
-.admonitionblock td.icon .icon-important:before{content:"\f06a";color:#bf0000}
+.admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
+.admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
+.admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
+.admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
+.admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
.conum[data-value]{display:inline-block;color:#fff!important;background-color:rgba(0,0,0,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
.conum[data-value] *{color:#fff!important}
.conum[data-value]+b{display:none}
-.conum[data-value]:after{content:attr(data-value)}
+.conum[data-value]::after{content:attr(data-value)}
pre .conum[data-value]{position:relative;top:-.125em}
b.conum *{color:inherit!important}
.conum:not([data-value]):empty{display:none}
@@ -392,12 +394,13 @@ p{margin-bottom:1.25rem}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
.exampleblock>.content{background-color:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc}
.print-only{display:none!important}
-@media print{@page{margin:1.25cm .75cm}
-*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}
+@page{margin:1.25cm .75cm}
+@media print{*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}
+html{font-size:80%}
a{color:inherit!important;text-decoration:underline!important}
a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
-a[href^="http:"]:not(.bare):after,a[href^="https:"]:not(.bare):after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
-abbr[title]:after{content:" (" attr(title) ")"}
+a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
+abbr[title]::after{content:" (" attr(title) ")"}
pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
thead{display:table-header-group}
svg{max-width:100%}
@@ -405,24 +408,26 @@ p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
#toc,.sidebarblock,.exampleblock>.content{background:none!important}
#toc{border-bottom:1px solid #ddddd8!important;padding-bottom:0!important}
-.sect1{padding-bottom:0!important}
-.sect1+.sect1{border:0!important}
-#header>h1:first-child{margin-top:1.25rem}
body.book #header{text-align:center}
-body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em 0}
+body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em}
body.book #header .details{border:0!important;display:block;padding:0!important}
body.book #header .details span:first-child{margin-left:0!important}
body.book #header .details br{display:block}
-body.book #header .details br+span:before{content:none!important}
+body.book #header .details br+span::before{content:none!important}
body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
-.listingblock code[data-lang]:before{display:block}
-#footer{background:none!important;padding:0 .9375em}
-#footer-text{color:rgba(0,0,0,.6)!important;font-size:.9em}
+.listingblock code[data-lang]::before{display:block}
+#footer{padding:0 .9375em}
.hide-on-print{display:none!important}
.print-only{display:block!important}
.hide-for-print{display:none!important}
.show-for-print{display:inherit!important}}
+@media print,amzn-kf8{#header>h1:first-child{margin-top:1.25rem}
+.sect1{padding:0!important}
+.sect1+.sect1{border:0}
+#footer{background:none}
+#footer-text{color:rgba(0,0,0,.6);font-size:.9em}}
+@media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}}
</style>
</head>
<body class="book toc2 toc-left">
@@ -439,7 +444,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</li>
<li><a href="#_paths">2. Paths</a>
<ul class="sectlevel2">
-<li><a href="#_route66">2.1. PUT /clds/action/{action}/{modelName}?test={test}</a>
+<li><a href="#_route23">2.1. PUT /v1/clds/action/{action}/{modelName}?test={test}</a>
<ul class="sectlevel3">
<li><a href="#_parameters">2.1.1. Parameters</a></li>
<li><a href="#_responses">2.1.2. Responses</a></li>
@@ -447,19 +452,19 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_produces">2.1.4. Produces</a></li>
</ul>
</li>
-<li><a href="#_route58">2.2. GET /clds/cldsDetails</a>
+<li><a href="#_route15">2.2. GET /v1/clds/cldsDetails</a>
<ul class="sectlevel3">
<li><a href="#_responses_2">2.2.1. Responses</a></li>
<li><a href="#_produces_2">2.2.2. Produces</a></li>
</ul>
</li>
-<li><a href="#_route59">2.3. GET /clds/cldsInfo</a>
+<li><a href="#_route16">2.3. GET /v1/clds/cldsInfo</a>
<ul class="sectlevel3">
<li><a href="#_responses_3">2.3.1. Responses</a></li>
<li><a href="#_produces_3">2.3.2. Produces</a></li>
</ul>
</li>
-<li><a href="#_route67">2.4. POST /clds/dcae/event?test={test}</a>
+<li><a href="#_route24">2.4. POST /v1/clds/dcae/event?test={test}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_2">2.4.1. Parameters</a></li>
<li><a href="#_responses_4">2.4.2. Responses</a></li>
@@ -467,7 +472,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_produces_4">2.4.4. Produces</a></li>
</ul>
</li>
-<li><a href="#_route69">2.5. PUT /clds/deploy/{modelName}</a>
+<li><a href="#_route26">2.5. PUT /v1/clds/deploy/{modelName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_3">2.5.1. Parameters</a></li>
<li><a href="#_responses_5">2.5.2. Responses</a></li>
@@ -475,34 +480,34 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_produces_5">2.5.4. Produces</a></li>
</ul>
</li>
-<li><a href="#_route65">2.6. GET /clds/model-names</a>
+<li><a href="#_route22">2.6. GET /v1/clds/model-names</a>
<ul class="sectlevel3">
<li><a href="#_responses_6">2.6.1. Responses</a></li>
<li><a href="#_produces_6">2.6.2. Produces</a></li>
</ul>
</li>
-<li><a href="#_route61">2.7. GET /clds/model/bpmn/{modelName}</a>
+<li><a href="#_route18">2.7. GET /v1/clds/model/bpmn/{modelName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_4">2.7.1. Parameters</a></li>
<li><a href="#_responses_7">2.7.2. Responses</a></li>
<li><a href="#_produces_7">2.7.3. Produces</a></li>
</ul>
</li>
-<li><a href="#_route62">2.8. GET /clds/model/image/{modelName}</a>
+<li><a href="#_route19">2.8. GET /v1/clds/model/image/{modelName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_5">2.8.1. Parameters</a></li>
<li><a href="#_responses_8">2.8.2. Responses</a></li>
<li><a href="#_produces_8">2.8.3. Produces</a></li>
</ul>
</li>
-<li><a href="#_route63">2.9. GET /clds/model/{modelName}</a>
+<li><a href="#_route20">2.9. GET /v1/clds/model/{modelName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_6">2.9.1. Parameters</a></li>
<li><a href="#_responses_9">2.9.2. Responses</a></li>
<li><a href="#_produces_9">2.9.3. Produces</a></li>
</ul>
</li>
-<li><a href="#_route64">2.10. PUT /clds/model/{modelName}</a>
+<li><a href="#_route21">2.10. PUT /v1/clds/model/{modelName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_7">2.10.1. Parameters</a></li>
<li><a href="#_responses_10">2.10.2. Responses</a></li>
@@ -510,13 +515,13 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_produces_10">2.10.4. Produces</a></li>
</ul>
</li>
-<li><a href="#_route68">2.11. GET /clds/properties</a>
+<li><a href="#_route25">2.11. GET /v1/clds/properties</a>
<ul class="sectlevel3">
<li><a href="#_responses_11">2.11.1. Responses</a></li>
<li><a href="#_produces_11">2.11.2. Produces</a></li>
</ul>
</li>
-<li><a href="#_route70">2.12. PUT /clds/undeploy/{modelName}</a>
+<li><a href="#_route27">2.12. PUT /v1/clds/undeploy/{modelName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_8">2.12.1. Parameters</a></li>
<li><a href="#_responses_12">2.12.2. Responses</a></li>
@@ -524,34 +529,34 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_produces_12">2.12.4. Produces</a></li>
</ul>
</li>
-<li><a href="#_route75">2.13. GET /cldsTempate/template-names</a>
+<li><a href="#_route32">2.13. GET /v1/cldsTempate/template-names</a>
<ul class="sectlevel3">
<li><a href="#_responses_13">2.13.1. Responses</a></li>
<li><a href="#_produces_13">2.13.2. Produces</a></li>
</ul>
</li>
-<li><a href="#_route71">2.14. GET /cldsTempate/template/bpmn/{templateName}</a>
+<li><a href="#_route28">2.14. GET /v1/cldsTempate/template/bpmn/{templateName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_9">2.14.1. Parameters</a></li>
<li><a href="#_responses_14">2.14.2. Responses</a></li>
<li><a href="#_produces_14">2.14.3. Produces</a></li>
</ul>
</li>
-<li><a href="#_route72">2.15. GET /cldsTempate/template/image/{templateName}</a>
+<li><a href="#_route29">2.15. GET /v1/cldsTempate/template/image/{templateName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_10">2.15.1. Parameters</a></li>
<li><a href="#_responses_15">2.15.2. Responses</a></li>
<li><a href="#_produces_15">2.15.3. Produces</a></li>
</ul>
</li>
-<li><a href="#_route73">2.16. GET /cldsTempate/template/{templateName}</a>
+<li><a href="#_route30">2.16. GET /v1/cldsTempate/template/{templateName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_11">2.16.1. Parameters</a></li>
<li><a href="#_responses_16">2.16.2. Responses</a></li>
<li><a href="#_produces_16">2.16.3. Produces</a></li>
</ul>
</li>
-<li><a href="#_route74">2.17. PUT /cldsTempate/template/{templateName}</a>
+<li><a href="#_route31">2.17. PUT /v1/cldsTempate/template/{templateName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_12">2.17.1. Parameters</a></li>
<li><a href="#_responses_17">2.17.2. Responses</a></li>
@@ -559,13 +564,13 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_produces_17">2.17.4. Produces</a></li>
</ul>
</li>
-<li><a href="#_route81">2.18. GET /dictionary</a>
+<li><a href="#_route40">2.18. GET /v1/dictionary</a>
<ul class="sectlevel3">
<li><a href="#_responses_18">2.18.1. Responses</a></li>
<li><a href="#_produces_18">2.18.2. Produces</a></li>
</ul>
</li>
-<li><a href="#_route80">2.19. PUT /dictionary/{dictionaryName}</a>
+<li><a href="#_route39">2.19. PUT /v1/dictionary/{dictionaryName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_13">2.19.1. Parameters</a></li>
<li><a href="#_responses_19">2.19.2. Responses</a></li>
@@ -573,14 +578,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_produces_19">2.19.4. Produces</a></li>
</ul>
</li>
-<li><a href="#_route83">2.20. GET /dictionary/{dictionaryName}/items</a>
+<li><a href="#_v1_dictionary_dictionaryname_items_get">2.20. GET /v1/dictionary/{dictionaryName}/items</a>
<ul class="sectlevel3">
<li><a href="#_parameters_14">2.20.1. Parameters</a></li>
<li><a href="#_responses_20">2.20.2. Responses</a></li>
<li><a href="#_produces_20">2.20.3. Produces</a></li>
</ul>
</li>
-<li><a href="#_route82">2.21. PUT /dictionary/{dictionaryName}/items</a>
+<li><a href="#_v1_dictionary_dictionaryname_items_put">2.21. PUT /v1/dictionary/{dictionaryName}/items</a>
<ul class="sectlevel3">
<li><a href="#_parameters_15">2.21.1. Parameters</a></li>
<li><a href="#_responses_21">2.21.2. Responses</a></li>
@@ -588,33 +593,33 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_produces_21">2.21.4. Produces</a></li>
</ul>
</li>
-<li><a href="#_route60">2.22. GET /healthcheck</a>
+<li><a href="#_route17">2.22. GET /v1/healthcheck</a>
<ul class="sectlevel3">
<li><a href="#_responses_22">2.22.1. Responses</a></li>
<li><a href="#_produces_22">2.22.2. Produces</a></li>
</ul>
</li>
-<li><a href="#_route78">2.23. GET /tosca/models</a>
+<li><a href="#_route36">2.23. GET /v1/tosca/models</a>
<ul class="sectlevel3">
<li><a href="#_responses_23">2.23.1. Responses</a></li>
<li><a href="#_produces_23">2.23.2. Produces</a></li>
</ul>
</li>
-<li><a href="#_route77">2.24. GET /tosca/models/policyType/{policyType}</a>
+<li><a href="#_route34">2.24. GET /v1/tosca/models/policyType/{policyType}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_16">2.24.1. Parameters</a></li>
<li><a href="#_responses_24">2.24.2. Responses</a></li>
<li><a href="#_produces_24">2.24.3. Produces</a></li>
</ul>
</li>
-<li><a href="#_route79">2.25. GET /tosca/models/{toscaModelName}</a>
+<li><a href="#_v1_tosca_models_toscamodelname_get">2.25. GET /v1/tosca/models/{toscaModelName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_17">2.25.1. Parameters</a></li>
<li><a href="#_responses_25">2.25.2. Responses</a></li>
<li><a href="#_produces_25">2.25.3. Produces</a></li>
</ul>
</li>
-<li><a href="#_route76">2.26. PUT /tosca/models/{toscaModelName}</a>
+<li><a href="#_route33">2.26. PUT /v1/tosca/models/{toscaModelName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_18">2.26.1. Parameters</a></li>
<li><a href="#_responses_26">2.26.2. Responses</a></li>
@@ -622,12 +627,104 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_produces_26">2.26.4. Produces</a></li>
</ul>
</li>
-<li><a href="#_route84">2.27. GET /user/getUser</a>
+<li><a href="#_route41">2.27. GET /v1/user/getUser</a>
<ul class="sectlevel3">
<li><a href="#_responses_27">2.27.1. Responses</a></li>
<li><a href="#_produces_27">2.27.2. Produces</a></li>
</ul>
</li>
+<li><a href="#_route13">2.28. PUT /v2/loop/delete/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_19">2.28.1. Parameters</a></li>
+<li><a href="#_responses_28">2.28.2. Responses</a></li>
+</ul>
+</li>
+<li><a href="#_route8">2.29. PUT /v2/loop/deployLoop/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_20">2.29.1. Parameters</a></li>
+<li><a href="#_responses_29">2.29.2. Responses</a></li>
+<li><a href="#_produces_28">2.29.3. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route2">2.30. GET /v2/loop/getAllNames</a>
+<ul class="sectlevel3">
+<li><a href="#_responses_30">2.30.1. Responses</a></li>
+<li><a href="#_produces_29">2.30.2. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route14">2.31. GET /v2/loop/getstatus/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_21">2.31.1. Parameters</a></li>
+<li><a href="#_responses_31">2.31.2. Responses</a></li>
+<li><a href="#_produces_30">2.31.3. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route11">2.32. PUT /v2/loop/restart/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_22">2.32.1. Parameters</a></li>
+<li><a href="#_responses_32">2.32.2. Responses</a></li>
+<li><a href="#_produces_31">2.32.3. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route10">2.33. PUT /v2/loop/stop/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_23">2.33.1. Parameters</a></li>
+<li><a href="#_responses_33">2.33.2. Responses</a></li>
+<li><a href="#_produces_32">2.33.3. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route12">2.34. PUT /v2/loop/submit/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_24">2.34.1. Parameters</a></li>
+<li><a href="#_responses_34">2.34.2. Responses</a></li>
+<li><a href="#_produces_33">2.34.3. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route4">2.35. GET /v2/loop/svgRepresentation/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_25">2.35.1. Parameters</a></li>
+<li><a href="#_responses_35">2.35.2. Responses</a></li>
+<li><a href="#_produces_34">2.35.3. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route9">2.36. PUT /v2/loop/undeployLoop/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_26">2.36.1. Parameters</a></li>
+<li><a href="#_responses_36">2.36.2. Responses</a></li>
+<li><a href="#_produces_35">2.36.3. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route5">2.37. POST /v2/loop/updateGlobalProperties/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_27">2.37.1. Parameters</a></li>
+<li><a href="#_responses_37">2.37.2. Responses</a></li>
+<li><a href="#_consumes_10">2.37.3. Consumes</a></li>
+<li><a href="#_produces_36">2.37.4. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route7">2.38. POST /v2/loop/updateMicroservicePolicy/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_28">2.38.1. Parameters</a></li>
+<li><a href="#_responses_38">2.38.2. Responses</a></li>
+<li><a href="#_consumes_11">2.38.3. Consumes</a></li>
+<li><a href="#_produces_37">2.38.4. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route6">2.39. POST /v2/loop/updateOperationalPolicies/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_29">2.39.1. Parameters</a></li>
+<li><a href="#_responses_39">2.39.2. Responses</a></li>
+<li><a href="#_consumes_12">2.39.3. Consumes</a></li>
+<li><a href="#_produces_38">2.39.4. Produces</a></li>
+</ul>
+</li>
+<li><a href="#_route3">2.40. GET /v2/loop/{loopName}</a>
+<ul class="sectlevel3">
+<li><a href="#_parameters_30">2.40.1. Parameters</a></li>
+<li><a href="#_responses_40">2.40.2. Responses</a></li>
+<li><a href="#_produces_39">2.40.3. Produces</a></li>
+</ul>
+</li>
</ul>
</li>
<li><a href="#_definitions">3. Definitions</a>
@@ -642,7 +739,16 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_cldstemplate">3.8. CldsTemplate</a></li>
<li><a href="#_cldstoscamodel">3.9. CldsToscaModel</a></li>
<li><a href="#_dcaeevent">3.10. DcaeEvent</a></li>
-<li><a href="#_valueitem">3.11. ValueItem</a></li>
+<li><a href="#_jsonarray">3.11. JsonArray</a></li>
+<li><a href="#_jsonnull">3.12. JsonNull</a></li>
+<li><a href="#_jsonobject">3.13. JsonObject</a></li>
+<li><a href="#_jsonprimitive">3.14. JsonPrimitive</a></li>
+<li><a href="#_loop">3.15. Loop</a></li>
+<li><a href="#_looplog">3.16. LoopLog</a></li>
+<li><a href="#_microservicepolicy">3.17. MicroServicePolicy</a></li>
+<li><a href="#_number">3.18. Number</a></li>
+<li><a href="#_operationalpolicy">3.19. OperationalPolicy</a></li>
+<li><a href="#_valueitem">3.20. ValueItem</a></li>
</ul>
</li>
</ul>
@@ -655,14 +761,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<div class="sect2">
<h3 id="_version_information"><a class="anchor" href="#_version_information"></a><a class="link" href="#_version_information">1.1. Version information</a></h3>
<div class="paragraph">
-<p><em>Version</em> : 4.0.0-SNAPSHOT</p>
+<p><em>Version</em> : 4.0.3-SNAPSHOT</p>
</div>
</div>
<div class="sect2">
<h3 id="_uri_scheme"><a class="anchor" href="#_uri_scheme"></a><a class="link" href="#_uri_scheme">1.2. URI scheme</a></h3>
<div class="paragraph">
-<p><em>Host</em> : 0.0.0.0<br>
-<em>BasePath</em> : /restservices/clds/v1/<br>
+<p><em>Host</em> : localhost:46235<br>
+<em>BasePath</em> : /restservices/clds/<br>
<em>Schemes</em> : HTTP</p>
</div>
</div>
@@ -672,10 +778,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<h2 id="_paths"><a class="anchor" href="#_paths"></a><a class="link" href="#_paths">2. Paths</a></h2>
<div class="sectionbody">
<div class="sect2">
-<h3 id="_route66"><a class="anchor" href="#_route66"></a><a class="link" href="#_route66">2.1. PUT /clds/action/{action}/{modelName}?test={test}</a></h3>
+<h3 id="_route23"><a class="anchor" href="#_route23"></a><a class="link" href="#_route23">2.1. PUT /v1/clds/action/{action}/{modelName}?test={test}</a></h3>
<div class="sect3">
<h4 id="_parameters"><a class="anchor" href="#_parameters"></a><a class="link" href="#_parameters">2.1.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -712,7 +818,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses"><a class="anchor" href="#_responses"></a><a class="link" href="#_responses">2.1.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -753,10 +859,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route58"><a class="anchor" href="#_route58"></a><a class="link" href="#_route58">2.2. GET /clds/cldsDetails</a></h3>
+<h3 id="_route15"><a class="anchor" href="#_route15"></a><a class="link" href="#_route15">2.2. GET /v1/clds/cldsDetails</a></h3>
<div class="sect3">
<h4 id="_responses_2"><a class="anchor" href="#_responses_2"></a><a class="link" href="#_responses_2">2.2.1. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -790,10 +896,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route59"><a class="anchor" href="#_route59"></a><a class="link" href="#_route59">2.3. GET /clds/cldsInfo</a></h3>
+<h3 id="_route16"><a class="anchor" href="#_route16"></a><a class="link" href="#_route16">2.3. GET /v1/clds/cldsInfo</a></h3>
<div class="sect3">
<h4 id="_responses_3"><a class="anchor" href="#_responses_3"></a><a class="link" href="#_responses_3">2.3.1. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -827,10 +933,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route67"><a class="anchor" href="#_route67"></a><a class="link" href="#_route67">2.4. POST /clds/dcae/event?test={test}</a></h3>
+<h3 id="_route24"><a class="anchor" href="#_route24"></a><a class="link" href="#_route24">2.4. POST /v1/clds/dcae/event?test={test}</a></h3>
<div class="sect3">
<h4 id="_parameters_2"><a class="anchor" href="#_parameters_2"></a><a class="link" href="#_parameters_2">2.4.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -855,7 +961,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_4"><a class="anchor" href="#_responses_4"></a><a class="link" href="#_responses_4">2.4.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -896,10 +1002,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route69"><a class="anchor" href="#_route69"></a><a class="link" href="#_route69">2.5. PUT /clds/deploy/{modelName}</a></h3>
+<h3 id="_route26"><a class="anchor" href="#_route26"></a><a class="link" href="#_route26">2.5. PUT /v1/clds/deploy/{modelName}</a></h3>
<div class="sect3">
<h4 id="_parameters_3"><a class="anchor" href="#_parameters_3"></a><a class="link" href="#_parameters_3">2.5.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -930,7 +1036,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_5"><a class="anchor" href="#_responses_5"></a><a class="link" href="#_responses_5">2.5.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -971,10 +1077,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route65"><a class="anchor" href="#_route65"></a><a class="link" href="#_route65">2.6. GET /clds/model-names</a></h3>
+<h3 id="_route22"><a class="anchor" href="#_route22"></a><a class="link" href="#_route22">2.6. GET /v1/clds/model-names</a></h3>
<div class="sect3">
<h4 id="_responses_6"><a class="anchor" href="#_responses_6"></a><a class="link" href="#_responses_6">2.6.1. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1008,10 +1114,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route61"><a class="anchor" href="#_route61"></a><a class="link" href="#_route61">2.7. GET /clds/model/bpmn/{modelName}</a></h3>
+<h3 id="_route18"><a class="anchor" href="#_route18"></a><a class="link" href="#_route18">2.7. GET /v1/clds/model/bpmn/{modelName}</a></h3>
<div class="sect3">
<h4 id="_parameters_4"><a class="anchor" href="#_parameters_4"></a><a class="link" href="#_parameters_4">2.7.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1036,7 +1142,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_7"><a class="anchor" href="#_responses_7"></a><a class="link" href="#_responses_7">2.7.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -1067,10 +1173,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route62"><a class="anchor" href="#_route62"></a><a class="link" href="#_route62">2.8. GET /clds/model/image/{modelName}</a></h3>
+<h3 id="_route19"><a class="anchor" href="#_route19"></a><a class="link" href="#_route19">2.8. GET /v1/clds/model/image/{modelName}</a></h3>
<div class="sect3">
<h4 id="_parameters_5"><a class="anchor" href="#_parameters_5"></a><a class="link" href="#_parameters_5">2.8.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1095,7 +1201,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_8"><a class="anchor" href="#_responses_8"></a><a class="link" href="#_responses_8">2.8.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -1126,10 +1232,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route63"><a class="anchor" href="#_route63"></a><a class="link" href="#_route63">2.9. GET /clds/model/{modelName}</a></h3>
+<h3 id="_route20"><a class="anchor" href="#_route20"></a><a class="link" href="#_route20">2.9. GET /v1/clds/model/{modelName}</a></h3>
<div class="sect3">
<h4 id="_parameters_6"><a class="anchor" href="#_parameters_6"></a><a class="link" href="#_parameters_6">2.9.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1154,7 +1260,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_9"><a class="anchor" href="#_responses_9"></a><a class="link" href="#_responses_9">2.9.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1188,10 +1294,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route64"><a class="anchor" href="#_route64"></a><a class="link" href="#_route64">2.10. PUT /clds/model/{modelName}</a></h3>
+<h3 id="_route21"><a class="anchor" href="#_route21"></a><a class="link" href="#_route21">2.10. PUT /v1/clds/model/{modelName}</a></h3>
<div class="sect3">
<h4 id="_parameters_7"><a class="anchor" href="#_parameters_7"></a><a class="link" href="#_parameters_7">2.10.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1222,7 +1328,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_10"><a class="anchor" href="#_responses_10"></a><a class="link" href="#_responses_10">2.10.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1266,10 +1372,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route68"><a class="anchor" href="#_route68"></a><a class="link" href="#_route68">2.11. GET /clds/properties</a></h3>
+<h3 id="_route25"><a class="anchor" href="#_route25"></a><a class="link" href="#_route25">2.11. GET /v1/clds/properties</a></h3>
<div class="sect3">
<h4 id="_responses_11"><a class="anchor" href="#_responses_11"></a><a class="link" href="#_responses_11">2.11.1. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -1300,10 +1406,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route70"><a class="anchor" href="#_route70"></a><a class="link" href="#_route70">2.12. PUT /clds/undeploy/{modelName}</a></h3>
+<h3 id="_route27"><a class="anchor" href="#_route27"></a><a class="link" href="#_route27">2.12. PUT /v1/clds/undeploy/{modelName}</a></h3>
<div class="sect3">
<h4 id="_parameters_8"><a class="anchor" href="#_parameters_8"></a><a class="link" href="#_parameters_8">2.12.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1334,7 +1440,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_12"><a class="anchor" href="#_responses_12"></a><a class="link" href="#_responses_12">2.12.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -1375,10 +1481,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route75"><a class="anchor" href="#_route75"></a><a class="link" href="#_route75">2.13. GET /cldsTempate/template-names</a></h3>
+<h3 id="_route32"><a class="anchor" href="#_route32"></a><a class="link" href="#_route32">2.13. GET /v1/cldsTempate/template-names</a></h3>
<div class="sect3">
<h4 id="_responses_13"><a class="anchor" href="#_responses_13"></a><a class="link" href="#_responses_13">2.13.1. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1412,10 +1518,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route71"><a class="anchor" href="#_route71"></a><a class="link" href="#_route71">2.14. GET /cldsTempate/template/bpmn/{templateName}</a></h3>
+<h3 id="_route28"><a class="anchor" href="#_route28"></a><a class="link" href="#_route28">2.14. GET /v1/cldsTempate/template/bpmn/{templateName}</a></h3>
<div class="sect3">
<h4 id="_parameters_9"><a class="anchor" href="#_parameters_9"></a><a class="link" href="#_parameters_9">2.14.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1440,7 +1546,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_14"><a class="anchor" href="#_responses_14"></a><a class="link" href="#_responses_14">2.14.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -1471,10 +1577,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route72"><a class="anchor" href="#_route72"></a><a class="link" href="#_route72">2.15. GET /cldsTempate/template/image/{templateName}</a></h3>
+<h3 id="_route29"><a class="anchor" href="#_route29"></a><a class="link" href="#_route29">2.15. GET /v1/cldsTempate/template/image/{templateName}</a></h3>
<div class="sect3">
<h4 id="_parameters_10"><a class="anchor" href="#_parameters_10"></a><a class="link" href="#_parameters_10">2.15.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1499,7 +1605,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_15"><a class="anchor" href="#_responses_15"></a><a class="link" href="#_responses_15">2.15.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -1530,10 +1636,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route73"><a class="anchor" href="#_route73"></a><a class="link" href="#_route73">2.16. GET /cldsTempate/template/{templateName}</a></h3>
+<h3 id="_route30"><a class="anchor" href="#_route30"></a><a class="link" href="#_route30">2.16. GET /v1/cldsTempate/template/{templateName}</a></h3>
<div class="sect3">
<h4 id="_parameters_11"><a class="anchor" href="#_parameters_11"></a><a class="link" href="#_parameters_11">2.16.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1558,7 +1664,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_16"><a class="anchor" href="#_responses_16"></a><a class="link" href="#_responses_16">2.16.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1592,10 +1698,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route74"><a class="anchor" href="#_route74"></a><a class="link" href="#_route74">2.17. PUT /cldsTempate/template/{templateName}</a></h3>
+<h3 id="_route31"><a class="anchor" href="#_route31"></a><a class="link" href="#_route31">2.17. PUT /v1/cldsTempate/template/{templateName}</a></h3>
<div class="sect3">
<h4 id="_parameters_12"><a class="anchor" href="#_parameters_12"></a><a class="link" href="#_parameters_12">2.17.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1626,7 +1732,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_17"><a class="anchor" href="#_responses_17"></a><a class="link" href="#_responses_17">2.17.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1670,10 +1776,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route81"><a class="anchor" href="#_route81"></a><a class="link" href="#_route81">2.18. GET /dictionary</a></h3>
+<h3 id="_route40"><a class="anchor" href="#_route40"></a><a class="link" href="#_route40">2.18. GET /v1/dictionary</a></h3>
<div class="sect3">
<h4 id="_responses_18"><a class="anchor" href="#_responses_18"></a><a class="link" href="#_responses_18">2.18.1. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1707,10 +1813,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route80"><a class="anchor" href="#_route80"></a><a class="link" href="#_route80">2.19. PUT /dictionary/{dictionaryName}</a></h3>
+<h3 id="_route39"><a class="anchor" href="#_route39"></a><a class="link" href="#_route39">2.19. PUT /v1/dictionary/{dictionaryName}</a></h3>
<div class="sect3">
<h4 id="_parameters_13"><a class="anchor" href="#_parameters_13"></a><a class="link" href="#_parameters_13">2.19.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1741,7 +1847,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_19"><a class="anchor" href="#_responses_19"></a><a class="link" href="#_responses_19">2.19.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1785,10 +1891,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route83"><a class="anchor" href="#_route83"></a><a class="link" href="#_route83">2.20. GET /dictionary/{dictionaryName}/items</a></h3>
+<h3 id="_v1_dictionary_dictionaryname_items_get"><a class="anchor" href="#_v1_dictionary_dictionaryname_items_get"></a><a class="link" href="#_v1_dictionary_dictionaryname_items_get">2.20. GET /v1/dictionary/{dictionaryName}/items</a></h3>
<div class="sect3">
<h4 id="_parameters_14"><a class="anchor" href="#_parameters_14"></a><a class="link" href="#_parameters_14">2.20.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1813,7 +1919,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_20"><a class="anchor" href="#_responses_20"></a><a class="link" href="#_responses_20">2.20.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1847,10 +1953,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route82"><a class="anchor" href="#_route82"></a><a class="link" href="#_route82">2.21. PUT /dictionary/{dictionaryName}/items</a></h3>
+<h3 id="_v1_dictionary_dictionaryname_items_put"><a class="anchor" href="#_v1_dictionary_dictionaryname_items_put"></a><a class="link" href="#_v1_dictionary_dictionaryname_items_put">2.21. PUT /v1/dictionary/{dictionaryName}/items</a></h3>
<div class="sect3">
<h4 id="_parameters_15"><a class="anchor" href="#_parameters_15"></a><a class="link" href="#_parameters_15">2.21.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -1881,7 +1987,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_21"><a class="anchor" href="#_responses_21"></a><a class="link" href="#_responses_21">2.21.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1925,10 +2031,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route60"><a class="anchor" href="#_route60"></a><a class="link" href="#_route60">2.22. GET /healthcheck</a></h3>
+<h3 id="_route17"><a class="anchor" href="#_route17"></a><a class="link" href="#_route17">2.22. GET /v1/healthcheck</a></h3>
<div class="sect3">
<h4 id="_responses_22"><a class="anchor" href="#_responses_22"></a><a class="link" href="#_responses_22">2.22.1. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -1959,10 +2065,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route78"><a class="anchor" href="#_route78"></a><a class="link" href="#_route78">2.23. GET /tosca/models</a></h3>
+<h3 id="_route36"><a class="anchor" href="#_route36"></a><a class="link" href="#_route36">2.23. GET /v1/tosca/models</a></h3>
<div class="sect3">
<h4 id="_responses_23"><a class="anchor" href="#_responses_23"></a><a class="link" href="#_responses_23">2.23.1. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -1996,10 +2102,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route77"><a class="anchor" href="#_route77"></a><a class="link" href="#_route77">2.24. GET /tosca/models/policyType/{policyType}</a></h3>
+<h3 id="_route34"><a class="anchor" href="#_route34"></a><a class="link" href="#_route34">2.24. GET /v1/tosca/models/policyType/{policyType}</a></h3>
<div class="sect3">
<h4 id="_parameters_16"><a class="anchor" href="#_parameters_16"></a><a class="link" href="#_parameters_16">2.24.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -2024,21 +2130,24 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_24"><a class="anchor" href="#_responses_24"></a><a class="link" href="#_responses_24">2.24.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
-<col style="width: 33.3333%;">
-<col style="width: 66.6667%;">
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
<th class="tableblock halign-left valign-middle">Schema</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
-<td class="tableblock halign-left valign-middle"><p class="tableblock">No Content</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_cldstoscamodel">CldsToscaModel</a></p></td>
</tr>
</tbody>
</table>
@@ -2055,10 +2164,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route79"><a class="anchor" href="#_route79"></a><a class="link" href="#_route79">2.25. GET /tosca/models/{toscaModelName}</a></h3>
+<h3 id="_v1_tosca_models_toscamodelname_get"><a class="anchor" href="#_v1_tosca_models_toscamodelname_get"></a><a class="link" href="#_v1_tosca_models_toscamodelname_get">2.25. GET /v1/tosca/models/{toscaModelName}</a></h3>
<div class="sect3">
<h4 id="_parameters_17"><a class="anchor" href="#_parameters_17"></a><a class="link" href="#_parameters_17">2.25.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -2083,7 +2192,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_25"><a class="anchor" href="#_responses_25"></a><a class="link" href="#_responses_25">2.25.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 10%;">
<col style="width: 70%;">
@@ -2117,10 +2226,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route76"><a class="anchor" href="#_route76"></a><a class="link" href="#_route76">2.26. PUT /tosca/models/{toscaModelName}</a></h3>
+<h3 id="_route33"><a class="anchor" href="#_route33"></a><a class="link" href="#_route33">2.26. PUT /v1/tosca/models/{toscaModelName}</a></h3>
<div class="sect3">
<h4 id="_parameters_18"><a class="anchor" href="#_parameters_18"></a><a class="link" href="#_parameters_18">2.26.1. Parameters</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 22.2222%;">
<col style="width: 33.3333%;">
@@ -2151,7 +2260,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect3">
<h4 id="_responses_26"><a class="anchor" href="#_responses_26"></a><a class="link" href="#_responses_26">2.26.2. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -2192,10 +2301,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route84"><a class="anchor" href="#_route84"></a><a class="link" href="#_route84">2.27. GET /user/getUser</a></h3>
+<h3 id="_route41"><a class="anchor" href="#_route41"></a><a class="link" href="#_route41">2.27. GET /v1/user/getUser</a></h3>
<div class="sect3">
<h4 id="_responses_27"><a class="anchor" href="#_responses_27"></a><a class="link" href="#_responses_27">2.27.1. Responses</a></h4>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 66.6667%;">
@@ -2225,6 +2334,822 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
</div>
+<div class="sect2">
+<h3 id="_route13"><a class="anchor" href="#_route13"></a><a class="link" href="#_route13">2.28. PUT /v2/loop/delete/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_19"><a class="anchor" href="#_parameters_19"></a><a class="link" href="#_parameters_19">2.28.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_28"><a class="anchor" href="#_responses_28"></a><a class="link" href="#_responses_28">2.28.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 33.3333%;">
+<col style="width: 66.6667%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">No Content</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route8"><a class="anchor" href="#_route8"></a><a class="link" href="#_route8">2.29. PUT /v2/loop/deployLoop/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_20"><a class="anchor" href="#_parameters_20"></a><a class="link" href="#_parameters_20">2.29.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_29"><a class="anchor" href="#_responses_29"></a><a class="link" href="#_responses_29">2.29.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_produces_28"><a class="anchor" href="#_produces_28"></a><a class="link" href="#_produces_28">2.29.3. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route2"><a class="anchor" href="#_route2"></a><a class="link" href="#_route2">2.30. GET /v2/loop/getAllNames</a></h3>
+<div class="sect3">
+<h4 id="_responses_30"><a class="anchor" href="#_responses_30"></a><a class="link" href="#_responses_30">2.30.1. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">&lt; string &gt; array</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_produces_29"><a class="anchor" href="#_produces_29"></a><a class="link" href="#_produces_29">2.30.2. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route14"><a class="anchor" href="#_route14"></a><a class="link" href="#_route14">2.31. GET /v2/loop/getstatus/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_21"><a class="anchor" href="#_parameters_21"></a><a class="link" href="#_parameters_21">2.31.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_31"><a class="anchor" href="#_responses_31"></a><a class="link" href="#_responses_31">2.31.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_produces_30"><a class="anchor" href="#_produces_30"></a><a class="link" href="#_produces_30">2.31.3. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route11"><a class="anchor" href="#_route11"></a><a class="link" href="#_route11">2.32. PUT /v2/loop/restart/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_22"><a class="anchor" href="#_parameters_22"></a><a class="link" href="#_parameters_22">2.32.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_32"><a class="anchor" href="#_responses_32"></a><a class="link" href="#_responses_32">2.32.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_produces_31"><a class="anchor" href="#_produces_31"></a><a class="link" href="#_produces_31">2.32.3. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route10"><a class="anchor" href="#_route10"></a><a class="link" href="#_route10">2.33. PUT /v2/loop/stop/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_23"><a class="anchor" href="#_parameters_23"></a><a class="link" href="#_parameters_23">2.33.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_33"><a class="anchor" href="#_responses_33"></a><a class="link" href="#_responses_33">2.33.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_produces_32"><a class="anchor" href="#_produces_32"></a><a class="link" href="#_produces_32">2.33.3. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route12"><a class="anchor" href="#_route12"></a><a class="link" href="#_route12">2.34. PUT /v2/loop/submit/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_24"><a class="anchor" href="#_parameters_24"></a><a class="link" href="#_parameters_24">2.34.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_34"><a class="anchor" href="#_responses_34"></a><a class="link" href="#_responses_34">2.34.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_produces_33"><a class="anchor" href="#_produces_33"></a><a class="link" href="#_produces_33">2.34.3. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route4"><a class="anchor" href="#_route4"></a><a class="link" href="#_route4">2.35. GET /v2/loop/svgRepresentation/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_25"><a class="anchor" href="#_parameters_25"></a><a class="link" href="#_parameters_25">2.35.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_35"><a class="anchor" href="#_responses_35"></a><a class="link" href="#_responses_35">2.35.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_produces_34"><a class="anchor" href="#_produces_34"></a><a class="link" href="#_produces_34">2.35.3. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/xml</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route9"><a class="anchor" href="#_route9"></a><a class="link" href="#_route9">2.36. PUT /v2/loop/undeployLoop/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_26"><a class="anchor" href="#_parameters_26"></a><a class="link" href="#_parameters_26">2.36.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_36"><a class="anchor" href="#_responses_36"></a><a class="link" href="#_responses_36">2.36.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_produces_35"><a class="anchor" href="#_produces_35"></a><a class="link" href="#_produces_35">2.36.3. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route5"><a class="anchor" href="#_route5"></a><a class="link" href="#_route5">2.37. POST /v2/loop/updateGlobalProperties/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_27"><a class="anchor" href="#_parameters_27"></a><a class="link" href="#_parameters_27">2.37.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Body</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>body</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_37"><a class="anchor" href="#_responses_37"></a><a class="link" href="#_responses_37">2.37.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_consumes_10"><a class="anchor" href="#_consumes_10"></a><a class="link" href="#_consumes_10">2.37.3. Consumes</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_produces_36"><a class="anchor" href="#_produces_36"></a><a class="link" href="#_produces_36">2.37.4. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route7"><a class="anchor" href="#_route7"></a><a class="link" href="#_route7">2.38. POST /v2/loop/updateMicroservicePolicy/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_28"><a class="anchor" href="#_parameters_28"></a><a class="link" href="#_parameters_28">2.38.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Body</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>body</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_microservicepolicy">MicroServicePolicy</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_38"><a class="anchor" href="#_responses_38"></a><a class="link" href="#_responses_38">2.38.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_microservicepolicy">MicroServicePolicy</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_consumes_11"><a class="anchor" href="#_consumes_11"></a><a class="link" href="#_consumes_11">2.38.3. Consumes</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_produces_37"><a class="anchor" href="#_produces_37"></a><a class="link" href="#_produces_37">2.38.4. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route6"><a class="anchor" href="#_route6"></a><a class="link" href="#_route6">2.39. POST /v2/loop/updateOperationalPolicies/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_29"><a class="anchor" href="#_parameters_29"></a><a class="link" href="#_parameters_29">2.39.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Body</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>body</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonarray">JsonArray</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_39"><a class="anchor" href="#_responses_39"></a><a class="link" href="#_responses_39">2.39.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_consumes_12"><a class="anchor" href="#_consumes_12"></a><a class="link" href="#_consumes_12">2.39.3. Consumes</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_produces_38"><a class="anchor" href="#_produces_38"></a><a class="link" href="#_produces_38">2.39.4. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_route3"><a class="anchor" href="#_route3"></a><a class="link" href="#_route3">2.40. GET /v2/loop/{loopName}</a></h3>
+<div class="sect3">
+<h4 id="_parameters_30"><a class="anchor" href="#_parameters_30"></a><a class="link" href="#_parameters_30">2.40.1. Parameters</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 22.2222%;">
+<col style="width: 33.3333%;">
+<col style="width: 44.4445%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Type</th>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_responses_40"><a class="anchor" href="#_responses_40"></a><a class="link" href="#_responses_40">2.40.2. Responses</a></h4>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 10%;">
+<col style="width: 70%;">
+<col style="width: 20%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">HTTP Code</th>
+<th class="tableblock halign-left valign-middle">Description</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect3">
+<h4 id="_produces_39"><a class="anchor" href="#_produces_39"></a><a class="link" href="#_produces_39">2.40.3. Produces</a></h4>
+<div class="ulist">
+<ul>
+<li>
+<p><code>application/json</code></p>
+</li>
+</ul>
+</div>
+</div>
+</div>
</div>
</div>
<div class="sect1">
@@ -2232,7 +3157,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<div class="sectionbody">
<div class="sect2">
<h3 id="_cldsdictionary"><a class="anchor" href="#_cldsdictionary"></a><a class="link" href="#_cldsdictionary">3.1. CldsDictionary</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2279,7 +3204,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect2">
<h3 id="_cldsdictionaryitem"><a class="anchor" href="#_cldsdictionaryitem"></a><a class="link" href="#_cldsdictionaryitem">3.2. CldsDictionaryItem</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2341,7 +3266,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect2">
<h3 id="_cldsevent"><a class="anchor" href="#_cldsevent"></a><a class="link" href="#_cldsevent">3.3. CldsEvent</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2383,7 +3308,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect2">
<h3 id="_cldsinfo"><a class="anchor" href="#_cldsinfo"></a><a class="link" href="#_cldsinfo">3.4. CldsInfo</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2440,7 +3365,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect2">
<h3 id="_cldsmodel"><a class="anchor" href="#_cldsmodel"></a><a class="link" href="#_cldsmodel">3.5. CldsModel</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2562,7 +3487,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect2">
<h3 id="_cldsmodelinstance"><a class="anchor" href="#_cldsmodelinstance"></a><a class="link" href="#_cldsmodelinstance">3.6. CldsModelInstance</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2594,7 +3519,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect2">
<h3 id="_cldsmonitoringdetails"><a class="anchor" href="#_cldsmonitoringdetails"></a><a class="link" href="#_cldsmonitoringdetails">3.7. CldsMonitoringDetails</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2656,7 +3581,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect2">
<h3 id="_cldstemplate"><a class="anchor" href="#_cldstemplate"></a><a class="link" href="#_cldstemplate">3.8. CldsTemplate</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2743,7 +3668,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect2">
<h3 id="_cldstoscamodel"><a class="anchor" href="#_cldstoscamodel"></a><a class="link" href="#_cldstoscamodel">3.9. CldsToscaModel</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2810,7 +3735,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div class="sect2">
<h3 id="_dcaeevent"><a class="anchor" href="#_dcaeevent"></a><a class="link" href="#_dcaeevent">3.10. DcaeEvent</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2861,8 +3786,705 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</table>
</div>
<div class="sect2">
-<h3 id="_valueitem"><a class="anchor" href="#_valueitem"></a><a class="link" href="#_valueitem">3.11. ValueItem</a></h3>
-<table class="tableblock frame-all grid-all spread">
+<h3 id="_jsonarray"><a class="anchor" href="#_jsonarray"></a><a class="link" href="#_jsonarray">3.11. JsonArray</a></h3>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 42.8571%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBigDecimal</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBigInteger</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBoolean</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asByte</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string (byte)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asCharacter</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asDouble</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number (double)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asFloat</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number (float)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asInt</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int32)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonArray</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonarray">JsonArray</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonNull</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonnull">JsonNull</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonObject</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonPrimitive</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonprimitive">JsonPrimitive</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asLong</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int64)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asNumber</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_number">Number</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asShort</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int32)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asString</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonArray</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonNull</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonObject</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonPrimitive</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect2">
+<h3 id="_jsonnull"><a class="anchor" href="#_jsonnull"></a><a class="link" href="#_jsonnull">3.12. JsonNull</a></h3>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 42.8571%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBigDecimal</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBigInteger</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBoolean</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asByte</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string (byte)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asCharacter</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asDouble</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number (double)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asFloat</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number (float)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asInt</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int32)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonArray</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonarray">JsonArray</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonNull</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonnull">JsonNull</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonObject</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonPrimitive</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonprimitive">JsonPrimitive</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asLong</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int64)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asNumber</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_number">Number</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asShort</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int32)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asString</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonArray</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonNull</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonObject</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonPrimitive</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect2">
+<h3 id="_jsonobject"><a class="anchor" href="#_jsonobject"></a><a class="link" href="#_jsonobject">3.13. JsonObject</a></h3>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 42.8571%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBigDecimal</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBigInteger</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBoolean</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asByte</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string (byte)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asCharacter</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asDouble</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number (double)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asFloat</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number (float)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asInt</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int32)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonArray</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonarray">JsonArray</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonNull</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonnull">JsonNull</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonObject</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonPrimitive</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonprimitive">JsonPrimitive</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asLong</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int64)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asNumber</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_number">Number</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asShort</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int32)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asString</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonArray</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonNull</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonObject</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonPrimitive</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect2">
+<h3 id="_jsonprimitive"><a class="anchor" href="#_jsonprimitive"></a><a class="link" href="#_jsonprimitive">3.14. JsonPrimitive</a></h3>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 42.8571%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBigDecimal</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBigInteger</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asBoolean</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asByte</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string (byte)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asCharacter</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asDouble</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number (double)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asFloat</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">number (float)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asInt</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int32)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonArray</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonarray">JsonArray</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonNull</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonnull">JsonNull</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonObject</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asJsonPrimitive</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonprimitive">JsonPrimitive</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asLong</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int64)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asNumber</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_number">Number</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asShort</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int32)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>asString</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>boolean</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonArray</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonNull</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonObject</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonPrimitive</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>number</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>string</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect2">
+<h3 id="_loop"><a class="anchor" href="#_loop"></a><a class="link" href="#_loop">3.15. Loop</a></h3>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 42.8571%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>blueprint</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>dcaeBlueprintId</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>dcaeDeploymentId</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>dcaeDeploymentStatusUrl</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>globalPropertiesJson</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>lastComputedState</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">enum (DESIGN, SUBMITTED, DEPLOYED, RUNNING, STOPPED, IN_ERROR, WAITING)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopLogs</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">&lt; <a href="#_looplog">LoopLog</a> &gt; array</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>microServicePolicies</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">&lt; <a href="#_microservicepolicy">MicroServicePolicy</a> &gt; array</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>modelPropertiesJson</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>name</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>operationalPolicies</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">&lt; <a href="#_operationalpolicy">OperationalPolicy</a> &gt; array</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>svgRepresentation</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect2">
+<h3 id="_looplog"><a class="anchor" href="#_looplog"></a><a class="link" href="#_looplog">3.16. LoopLog</a></h3>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 42.8571%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>id</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int64)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>logInstant</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">integer (int64)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>logType</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">enum (INFO, WARNING, ERROR)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loop</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>message</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect2">
+<h3 id="_microservicepolicy"><a class="anchor" href="#_microservicepolicy"></a><a class="link" href="#_microservicepolicy">3.17. MicroServicePolicy</a></h3>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 42.8571%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonRepresentation</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>modelType</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>name</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>policyTosca</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>properties</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>shared</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>usedByLoops</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">&lt; <a href="#_loop">Loop</a> &gt; array</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect2">
+<h3 id="_number"><a class="anchor" href="#_number"></a><a class="link" href="#_number">3.18. Number</a></h3>
+<div class="paragraph">
+<p><em>Type</em> : object</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_operationalpolicy"><a class="anchor" href="#_operationalpolicy"></a><a class="link" href="#_operationalpolicy">3.19. OperationalPolicy</a></h3>
+<table class="tableblock frame-all grid-all stretch">
+<colgroup>
+<col style="width: 42.8571%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-middle">Name</th>
+<th class="tableblock halign-left valign-middle">Schema</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>configurationsJson</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>jsonRepresentation</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loop</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>name</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="sect2">
+<h3 id="_valueitem"><a class="anchor" href="#_valueitem"></a><a class="link" href="#_valueitem">3.20. ValueItem</a></h3>
+<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 42.8571%;">
<col style="width: 57.1429%;">
@@ -2887,7 +4509,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div id="footer">
<div id="footer-text">
-Last updated 2018-07-05 16:29:36 +02:00
+Last updated 2018-07-06 11:58:45 CEST
</div>
</div>
</body>
diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties
index 56ad7e846..52f79bef4 100644
--- a/src/main/resources/application-noaaf.properties
+++ b/src/main/resources/application-noaaf.properties
@@ -55,7 +55,7 @@ server.port=8080
server.servlet.context-path=/
#Modified engine-rest applicationpath
-spring.profiles.active=clamp-default,clamp-default-user,clamp-sdc-controller
+spring.profiles.active=clamp-default,clamp-default-user,clamp-sdc-controller-new
spring.http.converters.preferred-json-mapper=gson
#The max number of active threads in this pool
@@ -135,9 +135,12 @@ clamp.config.dcae.deployment.template=classpath:/clds/templates/dcae-deployment-
#
#
# Configuration Settings for Policy Engine Components
-clamp.config.policy.url=http://policy.api.simpledemo.onap.org:8081
-clamp.config.policy.userName=test
-clamp.config.policy.password=test
+clamp.config.policy.api.url=http4://policy.api.simpledemo.onap.org:6969
+clamp.config.policy.api.userName=healthcheck
+clamp.config.policy.api.password=zb!XztG34
+clamp.config.policy.pap.url=http4://policy.api.simpledemo.onap.org:6969
+clamp.config.policy.pap.userName=healthcheck
+clamp.config.policy.pap.password=zb!XztG34
clamp.config.policy.pdpUrl1=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
clamp.config.policy.pdpUrl2=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
clamp.config.policy.papUrl=http://policy.api.simpledemo.onap.org:8081/pap/ , testpap, alpha123
@@ -207,6 +210,11 @@ clamp.config.dcae.dispatcher.url=http://dcae.api.simpledemo.onap.org:8188
clamp.config.dcae.dispatcher.retry.interval=20000
clamp.config.dcae.dispatcher.retry.limit=30
+#DCAE Deployment Url Properties
+clamp.config.dcae.deployment.url=http4://dcae.api.simpledemo.onap.org:8188
+clamp.config.dcae.deployment.userName=test
+clamp.config.dcae.deployment.password=test
+
#Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case !
clamp.config.security.permission.type.cl=org.onap.clamp.clds.cl
clamp.config.security.permission.type.cl.manage=org.onap.clamp.clds.cl.manage
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 640120230..534dc4818 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -5,6 +5,8 @@
# Copyright (C) 2017-2019 AT&T Intellectual Property. All rights
# reserved.
# ================================================================================
+# Modifications copyright (c) 2019 Nokia
+# ================================================================================\
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -68,11 +70,11 @@ server.ssl.client-auth=want
server.ssl.trust-store=classpath:/clds/aaf/truststoreONAPall.jks
server.ssl.trust-store-password=changeit
-server.http-to-https-redirection.port=8080
+#server.http-to-https-redirection.port=8080
server.servlet.context-path=/
#Modified engine-rest applicationpath
-spring.profiles.active=clamp-default,clamp-aaf-authentication,clamp-sdc-controller
+spring.profiles.active=clamp-default,clamp-aaf-authentication,clamp-sdc-controller-new
spring.http.converters.preferred-json-mapper=gson
#The max number of active threads in this pool
@@ -150,9 +152,13 @@ clamp.config.dcae.deployment.template=classpath:/clds/templates/dcae-deployment-
#
#
# Configuration Settings for Policy Engine Components
-clamp.config.policy.url=http://policy.api.simpledemo.onap.org:8081
-clamp.config.policy.userName=test
-clamp.config.policy.password=test
+clamp.config.policy.api.url=http4://policy.api.simpledemo.onap.org:6969
+clamp.config.policy.api.userName=healthcheck
+clamp.config.policy.api.password=zb!XztG34
+clamp.config.policy.pap.url=http4://policy.api.simpledemo.onap.org:6969
+clamp.config.policy.pap.userName=healthcheck
+clamp.config.policy.pap.password=zb!XztG34
+
clamp.config.policy.pdpUrl1=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
clamp.config.policy.pdpUrl2=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
clamp.config.policy.papUrl=http://policy.api.simpledemo.onap.org:8081/pap/ , testpap, alpha123
@@ -222,6 +228,11 @@ clamp.config.dcae.dispatcher.url=http://dcae.api.simpledemo.onap.org:8188
clamp.config.dcae.dispatcher.retry.interval=20000
clamp.config.dcae.dispatcher.retry.limit=30
+#DCAE Deployment Url Properties
+clamp.config.dcae.deployment.url=http4://dcae.api.simpledemo.onap.org:8188
+clamp.config.dcae.deployment.userName=test
+clamp.config.dcae.deployment.password=test
+
#Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case !
clamp.config.security.permission.type.cl=org.onap.clamp.clds.cl
clamp.config.security.permission.type.cl.manage=org.onap.clamp.clds.cl.manage
diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
index a823c09da..da856e947 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -5,10 +5,25 @@
outType="java.lang.String[]"
produces="application/json">
<route>
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
- <to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoopNames()" />
+ <removeHeaders pattern="*" />
+ <doTry>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopController?method=getLoopNames()" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ </doCatch>
+ </doTry>
</route>
</get>
<get
@@ -16,10 +31,27 @@
outType="org.onap.clamp.loop.Loop"
produces="application/json">
<route>
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
- <to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Loop')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ </doCatch>
+ </doTry>
</route>
</get>
<get
@@ -27,10 +59,27 @@
outType="java.lang.String"
produces="application/xml">
<route>
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
- <to
- uri="bean:org.onap.clamp.loop.LoopController?method=getSVGRepresentation(${header.loopName})" />
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get SVG Representation')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopController?method=getSVGRepresentation(${header.loopName})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ </doCatch>
+ </doTry>
</route>
</get>
@@ -41,16 +90,33 @@
outType="org.onap.clamp.loop.Loop"
produces="application/json">
<route>
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <setHeader headerName="GlobalPropertiesJson">
- <simple>${body}</simple>
- </setHeader>
- <to uri="direct:load-loop" />
- <to
- uri="bean:org.onap.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${header.GlobalPropertiesJson})" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${header.LoopObject})" />
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update the global properties')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <setHeader headerName="GlobalPropertiesJson">
+ <simple>${body}</simple>
+ </setHeader>
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${header.GlobalPropertiesJson})" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ </doCatch>
+ </doTry>
</route>
</post>
<post
@@ -60,16 +126,33 @@
outType="org.onap.clamp.loop.Loop"
produces="application/json">
<route>
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <setHeader headerName="OperationalPoliciesArray">
- <simple>${body}</simple>
- </setHeader>
- <to uri="direct:load-loop" />
- <to
- uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${header.OperationalPoliciesArray})" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational and Guard policies UPDATED','INFO',${header.LoopObject})" />
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update operational policies')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <setHeader headerName="OperationalPoliciesArray">
+ <simple>${body}</simple>
+ </setHeader>
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${header.OperationalPoliciesArray})" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational and Guard policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ </doCatch>
+ </doTry>
</route>
</post>
<post
@@ -79,17 +162,34 @@
outType="org.onap.clamp.policy.microservice.MicroServicePolicy"
produces="application/json">
<route>
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <setHeader headerName="MicroServicePolicyObject">
- <simple>${body}</simple>
- </setHeader>
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update Microservice policies')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <setProperty propertyName="MicroServicePolicyObject">
+ <simple>${body}</simple>
+ </setProperty>
- <to uri="direct:load-loop" />
- <to
- uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${header.MicroServicePolicyObject})" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Micro Service policies UPDATED','INFO',${header.LoopObject})" />
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${exchangeProperty[MicroServicePolicyObject]})" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Micro Service policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ </doCatch>
+ </doTry>
</route>
</post>
<put
@@ -97,10 +197,63 @@
outType="org.onap.clamp.loop.Loop"
produces="application/json">
<route>
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <to
- uri="bean:org.onap.clamp.operation.LoopOperation?method=deployLoop(*,${header.loopName})" />
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="DCAE DEPLOY request for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE DEPLOY request')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE DEPLOY request','INFO',${exchangeProperty[loopObject]})" />
+
+ <to uri="direct:get-status-from-policy" />
+ <to uri="direct:get-status-from-dcae" />
+ <log
+ loggingLevel="INFO"
+ message="Policy deployment status: ${exchangeProperty[policyStatus]}"></log>
+ <choice>
+ <when>
+ <simple> ${exchangeProperty[policyStatus]} == 'SUBMITTED' and
+ ${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED'
+ </simple>
+ <to uri="direct:deploy-loop" />
+ </when>
+ <otherwise>
+ <log
+ loggingLevel="INFO"
+ message="POLICY status ${exchangeProperty[policyStatus]}/DCAE status ${exchangeProperty[dcaeStatus]}, DCAE deployment will be started anyway" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('POLICY status ${exchangeProperty[policyStatus]}/DCAE status ${exchangeProperty[dcaeStatus]}, DCAE deployment will be started anyway','ERROR',${exchangeProperty[loopObject]})" />
+ <to uri="direct:deploy-loop" />
+ </otherwise>
+ </choice>
+ <log
+ loggingLevel="INFO"
+ message="DEPLOY request successfully executed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ <log
+ loggingLevel="ERROR"
+ message="DEPLOY request failed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+ </doCatch>
+ </doTry>
</route>
</put>
<put
@@ -108,10 +261,56 @@
outType="org.onap.clamp.loop.Loop"
produces="application/json">
<route>
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <to
- uri="bean:org.onap.clamp.operation.LoopOperation?method=unDeployLoop(${header.loopName})" />
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="DCAE UNDEPLOY request for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE UNDEPLOY request')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE UNDEPLOY request','INFO',${exchangeProperty[loopObject]})" />
+ <to uri="direct:get-status-from-dcae" />
+ <choice>
+ <when>
+ <simple> ${exchangeProperty[dcaeStatus]} == 'DEPLOYED' or ${exchangeProperty[dcaeStatus]} == 'IN_ERROR' or ${exchangeProperty[dcaeStatus]} == 'PROCESSING'
+ </simple>
+ <to uri="direct:undeploy-loop" />
+ </when>
+ <otherwise>
+ <log
+ loggingLevel="INFO"
+ message="Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be undeployed when in state DEPLOYED/IN_ERROR/PROCESSING" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be deployed when in state DEPLOYED','ERROR',${exchangeProperty[loopObject]})" />
+ </otherwise>
+ </choice>
+ <log
+ loggingLevel="INFO"
+ message="UNDEPLOY request successfully executed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ <log
+ loggingLevel="ERROR"
+ message="UNDEPLOY request failed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+ </doCatch>
+ </doTry>
</route>
</put>
<put
@@ -119,193 +318,330 @@
outType="org.onap.clamp.loop.Loop"
produces="application/json">
<route>
- <log
- loggingLevel="INFO"
- message="Receive STOP request for loop: ${header.loopName}" />
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="STOP request for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'STOP request')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request','INFO',${exchangeProperty[loopObject]})" />
+
+ <to uri="direct:remove-all-policy-from-active-pdp-group" />
+ <log
+ loggingLevel="INFO"
+ message="STOP request successfully executed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ <log
+ loggingLevel="ERROR"
+ message="STOP request failed for loop: $${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+ </doCatch>
+ </doTry>
</route>
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <to uri="direct:load-loop" />
- <to uri="direct:remove-all-policy-from-active-pdp-group" />
- <log
- loggingLevel="INFO"
- message="STOP request successfully executed for loop: ${body}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${header.LoopObject})" />
- <to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
</put>
<put
- uri="/v2/loop/start/{loopName}"
+ uri="/v2/loop/restart/{loopName}"
outType="org.onap.clamp.loop.Loop"
produces="application/json">
<route>
- <log
- loggingLevel="INFO"
- message="Receive START request for loop: ${header.loopName}" />
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="RESTART request for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'RESTART request')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <to uri="direct:load-loop" />
+
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request','INFO',${exchangeProperty[loopObject]})" />
+
+ <to uri="direct:add-all-to-active-pdp-group" />
+ <log
+ loggingLevel="INFO"
+ message="RESTART request successfully executed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ <log
+ loggingLevel="ERROR"
+ message="RESTART request failed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception}','INFO',${exchangeProperty[loopObject]})" />
+ </doCatch>
+ </doTry>
</route>
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <to uri="direct:load-loop" />
- <to uri="direct:add-all-to-active-pdp-group" />
- <log
- loggingLevel="INFO"
- message="START request successfully executed for loop: ${body}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${header.LoopObject})" />
- <to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
</put>
<put
uri="/v2/loop/submit/{loopName}"
outType="org.onap.clamp.loop.Loop"
produces="application/json">
<route>
- <log
- loggingLevel="INFO"
- message="Receive SUBMIT request for loop: ${header.loopName}" />
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <to uri="direct:load-loop" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive SUBMIT request','INFO',${header.LoopObject})" />
- <setHeader headerName="RaiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">false</simple>
- </setHeader>
- <to uri="direct:remove-all-policy-from-active-pdp-group" />
- <log
- loggingLevel="INFO"
- message="Processing all MICRO-SERVICES policies defined in loop ${header.LoopObject.getName()}" />
- <split>
- <simple>${header.LoopObject.getMicroServicePolicies()}
- </simple>
- <setHeader headerName="microServicePolicy">
- <simple>${body}</simple>
- </setHeader>
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
<log
loggingLevel="INFO"
- message="Processing Micro Service Policy: ${header.microServicePolicy.getName()}" />
- <setHeader headerName="RaiseHttpExceptionFlag">
+ message="POLICY SUBMIT request for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'POLICY SUBMIT request')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('POLICY SUBMIT request','INFO',${exchangeProperty[loopObject]})" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
<simple resultType="java.lang.Boolean">false</simple>
- </setHeader>
- <to uri="direct:delete-micro-service-policy" />
-
- <to uri="direct:create-micro-service-policy" />
- </split>
-
- <log
- loggingLevel="INFO"
- message="Processing all OPERATIONAL policies defined in loop ${header.LoopObject.getName()}" />
- <split>
- <simple>${header.LoopObject.getOperationalPolicies()}
- </simple>
- <setHeader headerName="operationalPolicy">
- <simple>${body}</simple>
- </setHeader>
+ </setProperty>
+ <to uri="direct:remove-all-policy-from-active-pdp-group" />
<log
loggingLevel="INFO"
- message="Processing Operational Policy: ${header.operationalPolicy.getName()}" />
- <setHeader headerName="RaiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">false</simple>
- </setHeader>
- <to uri="direct:delete-operational-policy" />
-
- <to uri="direct:create-operational-policy" />
+ message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
+ <split>
+ <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
+ </simple>
+ <setProperty propertyName="microServicePolicy">
+ <simple>${body}</simple>
+ </setProperty>
+ <log
+ loggingLevel="INFO"
+ message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">false</simple>
+ </setProperty>
+ <to uri="direct:delete-micro-service-policy" />
+ <to uri="direct:create-micro-service-policy" />
+ </split>
<log
loggingLevel="INFO"
- message="Processing all GUARD policies defined in loop ${header.LoopObject.getName()}" />
+ message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
<split>
- <simple>${header.operationalPolicy.createGuardPolicyPayloads().entrySet()}
+ <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
</simple>
- <setHeader headerName="guardPolicy">
+ <setProperty propertyName="operationalPolicy">
<simple>${body}</simple>
- </setHeader>
+ </setProperty>
<log
loggingLevel="INFO"
- message="Processing Guard Policy: ${header.guardPolicy.getKey()}" />
-
- <setHeader headerName="RaiseHttpExceptionFlag">
+ message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
<simple resultType="java.lang.Boolean">false</simple>
- </setHeader>
- <to uri="direct:delete-guard-policy" />
+ </setProperty>
- <to uri="direct:create-guard-policy" />
+ <to uri="direct:delete-operational-policy" />
+ <to uri="direct:create-operational-policy" />
+
+ <log
+ loggingLevel="INFO"
+ message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
+ <split>
+ <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
+ </simple>
+ <setProperty propertyName="guardPolicy">
+ <simple>${body}</simple>
+ </setProperty>
+ <log
+ loggingLevel="INFO"
+ message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
+
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">false</simple>
+ </setProperty>
+ <to uri="direct:delete-guard-policy" />
+ <to uri="direct:create-guard-policy" />
+ </split>
</split>
- </split>
- <to uri="direct:add-all-to-active-pdp-group" />
- <log
- loggingLevel="INFO"
- message="SUBMIT request successfully executed for loop: ${body}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${header.LoopObject})" />
- <to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
+ <to uri="direct:add-all-to-active-pdp-group" />
+
+ <log
+ loggingLevel="INFO"
+ message="SUBMIT request successfully executed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ <log
+ loggingLevel="ERROR"
+ message="SUBMIT request failed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+ </doCatch>
+ </doTry>
</route>
</put>
<put uri="/v2/loop/delete/{loopName}">
<route>
- <log
- loggingLevel="INFO"
- message="Receive DELETE request for loop: ${header.loopName}" />
- <to
- uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <to uri="direct:load-loop" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive DELETE request','INFO',${header.LoopObject})" />
- <to uri="direct:remove-all-policy-from-active-pdp-group" />
- <split>
- <simple>${header.LoopObject.getMicroServicePolicies()}
- </simple>
- <setHeader headerName="microServicePolicy">
- <simple>${body}</simple>
- </setHeader>
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
<log
loggingLevel="INFO"
- message="Processing Micro Service Policy: ${header.microServicePolicy.getName()}" />
-
- <to uri="direct:delete-micro-service-policy" />
- </split>
-
- <log
- loggingLevel="INFO"
- message="Processing all OPERATIONAL policies defined in loop ${header.LoopObject.getName()}" />
- <split>
- <simple>${header.LoopObject.getOperationalPolicies()}
- </simple>
- <setHeader headerName="operationalPolicy">
- <simple>${body}</simple>
- </setHeader>
- <log
- loggingLevel="INFO"
- message="Processing Operational Policy: ${header.operationalPolicy.getName()}" />
+ message="DELETE request for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})" />
+ <to uri="direct:remove-all-policy-from-active-pdp-group" />
+ <split>
+ <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
+ </simple>
+ <setProperty propertyName="microServicePolicy">
+ <simple>${body}</simple>
+ </setProperty>
+ <log
+ loggingLevel="INFO"
+ message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
+ <to uri="direct:delete-micro-service-policy" />
+ </split>
- <to uri="direct:delete-operational-policy" />
<log
loggingLevel="INFO"
- message="Processing all GUARD policies defined in loop ${header.LoopObject.getName()}" />
+ message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
<split>
- <simple>${header.operationalPolicy.createGuardPolicyPayloads().entrySet()}
+ <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
</simple>
- <setHeader headerName="guardPolicy">
+ <setProperty propertyName="operationalPolicy">
<simple>${body}</simple>
- </setHeader>
+ </setProperty>
<log
loggingLevel="INFO"
- message="Processing Guard Policy: ${header.guardPolicy.getKey()}" />
-
- <to uri="direct:delete-guard-policy" />
+ message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
+ <to uri="direct:delete-operational-policy" />
+ <log
+ loggingLevel="INFO"
+ message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
+ <split>
+ <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
+ </simple>
+ <setProperty propertyName="guardPolicy">
+ <simple>${body}</simple>
+ </setProperty>
+ <log
+ loggingLevel="INFO"
+ message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
+ <to uri="direct:delete-guard-policy" />
+ </split>
</split>
- </split>
- <to
- uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" />
- <log
- loggingLevel="INFO"
- message="DELETE request successfully executed for loop: ${body}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${header.LoopObject})" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" />
+ <log
+ loggingLevel="INFO"
+ message="DELETE request successfully executed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ <log
+ loggingLevel="ERROR"
+ message="DELETE request failed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+ </doCatch>
+ </doTry>
</route>
</put>
+ <get
+ uri="/v2/loop/getstatus/{loopName}"
+ outType="org.onap.clamp.loop.Loop"
+ produces="application/json">
+ <route>
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="GET STATUS request for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET STATUS request')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request','INFO',${exchangeProperty[loopObject]})" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">false</simple>
+ </setProperty>
+ <to uri="direct:get-status-from-policy" />
+ <to uri="direct:get-status-from-dcae" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopStatus(${exchangeProperty[loopObject]},${exchangeProperty[policyStatus]}, ${exchangeProperty[dcaeStatus]})" />
+ <log
+ loggingLevel="INFO"
+ message="Get Status request successfully executed. The new state is: ${body}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ <log
+ loggingLevel="ERROR"
+ message="Get Status request failed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+ </doCatch>
+ <doFinally>
+ <to
+ uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
+ </doFinally>
+ </doTry>
+ </route>
+ </get>
</rest>
</rests>
-
diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml
index 683737af3..1bad5fbbe 100644
--- a/src/main/resources/clds/camel/routes/flexible-flow.xml
+++ b/src/main/resources/clds/camel/routes/flexible-flow.xml
@@ -81,14 +81,14 @@
<setBody>
<simple>${header.loopName}</simple>
</setBody>
- <setHeader headerName="LoopObject">
+ <setProperty propertyName="loopObject">
<method
ref="org.onap.clamp.loop.LoopService"
method="getLoop" />
- </setHeader>
+ </setProperty>
<when>
- <simple>${header.LoopObject} == null</simple>
+ <simple>${exchangeProperty[loopObject]} == null</simple>
<setHeader headerName="CamelHttpResponseCode">
<constant>404</constant>
</setHeader>
@@ -101,233 +101,616 @@
<route id="create-micro-service-policy">
<from uri="direct:create-micro-service-policy" />
-
- <log
- loggingLevel="INFO"
- message="Creating Micro Service Policy: ${header.microServicePolicy.getName()}" />
- <setBody>
- <simple>${header.microServicePolicy.createPolicyPayload()}
- </simple>
- </setBody>
- <setHeader headerName="CamelHttpMethod">
- <constant>POST</constant>
- </setHeader>
- <setHeader headerName="Content-Type">
- <constant>application/json</constant>
- </setHeader>
- <setHeader headerName="CamelHttpUri">
- <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies
- </simple>
- </setHeader>
- <log
- loggingLevel="INFO"
- message="Endpoint to create microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
- <toD
- uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy created successfully','INFO',${header.LoopObject})" />
- <to uri="direct:reset-raise-http-exception-flag" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Creating Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Micro Service Policy')" />
+ <setBody>
+ <simple>${exchangeProperty[microServicePolicy].createPolicyPayload()}
+ </simple>
+ </setBody>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>POST</constant>
+ </setHeader>
+ <setHeader headerName="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to create microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies"></log>
+ <toD
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>${exchangeProperty[microServicePolicy].getName()} creation
+ status
+ </simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
</route>
+
<route id="delete-micro-service-policy">
<from uri="direct:delete-micro-service-policy" />
-
- <log
- loggingLevel="INFO"
- message="Deleting Micro Service Policy: ${header.microServicePolicy.getName()}" />
- <setBody>
- <constant>null</constant>
- </setBody>
- <setHeader headerName="CamelHttpMethod">
- <constant>DELETE</constant>
- </setHeader>
- <setHeader headerName="CamelHttpUri">
- <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies/${header.microServicePolicy.getName()}
- </simple>
- </setHeader>
- <log
- loggingLevel="INFO"
- message="Endpoint to delete microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
- <toD
- uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy deleted successfully','INFO',${header.LoopObject})" />
- <to uri="direct:reset-raise-http-exception-flag" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Deleting Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Micro Service Policy')" />
+ <setBody>
+ <constant>null</constant>
+ </setBody>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>DELETE</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to delete microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0"></log>
+ <toD
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>${exchangeProperty[microServicePolicy].getName()} removal
+ status
+ </simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
</route>
<route id="create-operational-policy">
<from uri="direct:create-operational-policy" />
-
- <log
- loggingLevel="INFO"
- message="Creating Operational Policy: ${header.operationalPolicy.getName()}" />
- <setBody>
- <simple>${header.operationalPolicy.createPolicyPayload()}
- </simple>
- </setBody>
- <setHeader headerName="CamelHttpMethod">
- <constant>POST</constant>
- </setHeader>
- <setHeader headerName="Content-Type">
- <constant>application/yaml; legacy-version</constant>
- </setHeader>
- <setHeader headerName="CamelHttpUri">
- <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies
- </simple>
- </setHeader>
- <log
- loggingLevel="INFO"
- message="Endpoint to create operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
- <toD
- uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy created successfully','INFO',${header.LoopObject})" />
- <to uri="direct:reset-raise-http-exception-flag" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Creating Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Operational Policy')" />
+ <setBody>
+ <simple>${exchangeProperty[operationalPolicy].createPolicyPayload()}
+ </simple>
+ </setBody>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>POST</constant>
+ </setHeader>
+ <setHeader headerName="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to create operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies"></log>
+ <toD
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>${exchangeProperty[operationalPolicy].getName()} creation
+ status
+ </simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
</route>
+
<route id="delete-operational-policy">
<from uri="direct:delete-operational-policy" />
-
- <log
- loggingLevel="INFO"
- message="Deleting Operational Policy: ${header.operationalPolicy.getName()}" />
- <setBody>
- <constant>null</constant>
- </setBody>
- <setHeader headerName="CamelHttpMethod">
- <constant>DELETE</constant>
- </setHeader>
- <setHeader headerName="CamelHttpUri">
- <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies/${header.operationalPolicy.getName()}
- </simple>
- </setHeader>
- <log
- loggingLevel="INFO"
- message="Endpoint to delete operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
- <toD
- uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy deleted successfully','INFO',${header.LoopObject})" />
- <to uri="direct:reset-raise-http-exception-flag" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Deleting Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Operational Policy')" />
+ <setBody>
+ <constant>null</constant>
+ </setBody>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>DELETE</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to delete operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1"></log>
+ <toD
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>${exchangeProperty[operationalPolicy].getName()} removal
+ status
+ </simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
</route>
<route id="create-guard-policy">
<from uri="direct:create-guard-policy" />
-
- <log
- loggingLevel="INFO"
- message="Creating Guard Policy: ${header.guardPolicy.getKey()}" />
- <setBody>
- <simple>${header.guardPolicy.getValue()}
- </simple>
- </setBody>
- <setHeader headerName="CamelHttpMethod">
- <constant>POST</constant>
- </setHeader>
- <setHeader headerName="Content-Type">
- <constant>application/json</constant>
- </setHeader>
- <setHeader headerName="CamelHttpUri">
- <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies
- </simple>
- </setHeader>
- <log
- loggingLevel="INFO"
- message="Endpoint to create guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
- <toD
- uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy created successfully','INFO',${header.LoopObject})" />
- <to uri="direct:reset-raise-http-exception-flag" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Creating Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Guard Policy')" />
+ <setBody>
+ <simple>${exchangeProperty[guardPolicy].getValue()}
+ </simple>
+ </setBody>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>POST</constant>
+ </setHeader>
+ <setHeader headerName="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to create guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies"></log>
+ <toD
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>${exchangeProperty[guardPolicy].getKey()} creation status
+ </simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
</route>
+
<route id="delete-guard-policy">
<from uri="direct:delete-guard-policy" />
-
- <log
- loggingLevel="INFO"
- message="Deleting Guard Policy: ${header.guardPolicy.getKey()}" />
- <setBody>
- <constant>null</constant>
- </setBody>
- <setHeader headerName="CamelHttpMethod">
- <constant>DELETE</constant>
- </setHeader>
- <setHeader headerName="CamelHttpUri">
- <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${header.guardPolicy.getKey()}
- </simple>
- </setHeader>
- <log
- loggingLevel="INFO"
- message="Endpoint to delete guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
- <toD
- uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy deleted successfully','INFO',${header.LoopObject})" />
- <to uri="direct:reset-raise-http-exception-flag" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Deleting Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Guard Policy')" />
+ <setBody>
+ <constant>null</constant>
+ </setBody>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>DELETE</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to delete guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1"></log>
+ <toD
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>${exchangeProperty[guardPolicy].getKey()} removal status
+ </simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
</route>
+
<route id="add-all-to-active-pdp-group">
<from uri="direct:add-all-to-active-pdp-group" />
-
- <log
- loggingLevel="INFO"
- message="Adding loop policies to PDP Group: ${header.LoopObject.getName()}" />
- <setBody>
- <simple>${header.LoopObject.createPoliciesPayloadPdpGroup()}
- </simple>
- </setBody>
- <setHeader headerName="CamelHttpMethod">
- <constant>POST</constant>
- </setHeader>
- <setHeader headerName="Content-Type">
- <constant>application/json</constant>
- </setHeader>
- <setHeader headerName="CamelHttpUri">
- <simple>{{clamp.config.policy.url}}/policy/pap/v1/pdps
- </simple>
- </setHeader>
- <log
- loggingLevel="INFO"
- message="Endpoint to add policies to PDP Group: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
- <toD
- uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Policies pushed to PDP Group successfully','INFO',${header.LoopObject})" />
- <to uri="direct:reset-raise-http-exception-flag" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Adding loop policies to PDP Group: ${exchangeProperty[loopObject].getName()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Add policies to PDP group')" />
+ <setBody>
+ <simple>${exchangeProperty[loopObject].createPoliciesPayloadPdpGroup()}
+ </simple>
+ </setBody>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>POST</constant>
+ </setHeader>
+ <setHeader headerName="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies"></log>
+ <toD
+ uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;useSystemProperties=true&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
+
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>PDP Group push ALL status</simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
</route>
<route id="remove-all-policy-from-active-pdp-group">
<from uri="direct:remove-all-policy-from-active-pdp-group" />
- <log
- loggingLevel="INFO"
- message="Removing policies from active PDP group for loop: ${header.LoopObject.getName()}" />
- <split>
- <simple>${header.LoopObject.listPolicyNamesPdpGroup()}</simple>
- <setHeader headerName="PolicyName">
- <simple>${body}</simple>
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Removing policies from active PDP group for loop: ${exchangeProperty[loopObject].getName()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Removing policies PDP group')" />
+ <split>
+ <simple>${exchangeProperty[loopObject].listPolicyNamesPdpGroup()}
+ </simple>
+ <setProperty propertyName="policyName">
+ <simple>${body}</simple>
+ </setProperty>
+ <setBody>
+ <constant>null</constant>
+ </setBody>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>DELETE</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log>
+ <toD
+ uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
+ <setProperty propertyName="logMessage">
+ <simple>${exchangeProperty[policyName]} PDP Group removal status
+ </simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </split>
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <setProperty propertyName="logMessage">
+ <simple>PDP Group removal, Error reported: ${exception}</simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doCatch>
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ </doFinally>
+ </doTry>
+ </route>
+ <route id="deploy-loop">
+ <from uri="direct:deploy-loop" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Deploying the loop: ${exchangeProperty[loopObject].getName()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploying the loop')" />
+ <setBody>
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="getDeployPayload(${exchangeProperty[loopObject]})" />
+ </setBody>
+ <setProperty propertyName="deploymentId">
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="getDeploymentId(${exchangeProperty[loopObject]})" />
+ </setProperty>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>PUT</constant>
+ </setHeader>
+ <setHeader headerName="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
</setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to deploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}"></log>
+ <toD
+ uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},${exchangeProperty[deploymentId]})" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>DEPLOY loop status (id:${exchangeProperty[deploymentId]})</simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
+ </route>
+
+ <route id="undeploy-loop">
+ <from uri="direct:undeploy-loop" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Undeploying the loop: ${exchangeProperty[loopObject].getName()} : ${exchangeProperty[loopObject].getDcaeDeploymentId()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploying the loop')" />
+
<setBody>
- <constant>null</constant>
+ <simple>{\"serviceTypeId\": \"${exchangeProperty[loopObject].getDcaeBlueprintId()}\"}
+ </simple>
</setBody>
<setHeader headerName="CamelHttpMethod">
<constant>DELETE</constant>
</setHeader>
- <setHeader headerName="CamelHttpUri">
- <simple>{{clamp.config.policy.url}}/pdps/policies/${header.PolicyName}/versions/1.0.0
+ <setHeader headerName="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
</simple>
</setHeader>
<log
loggingLevel="INFO"
- message="Endpoint to delete policy from PDP Group: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
+ message="Endpoint to undeploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}"></log>
<toD
- uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
+ uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog(${header.PolicyName}' Policy removed from PDP Group successfully','INFO',${header.LoopObject})" />
- </split>
- <to uri="direct:reset-raise-http-exception-flag" />
+ uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},null)" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>UNDEPLOY loop status</simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
+ </route>
+ <route id="get-status-from-policy">
+ <from uri="direct:get-status-from-policy" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Query Closed Loop status from policy PDP: ${exchangeProperty[loopObject].getName()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Query operational policies to PDP group')" />
+ <setProperty propertyName="operationalPolicyName">
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="getOperationalPolicyName(${exchangeProperty[loopObject]})" />
+ </setProperty>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>GET</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to query from Policy PDP: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicyName]}/versions/deployed"></log>
+ <toD
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicyName]}/versions/deployed?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>Policy deployment status</simple>
+ </setProperty>
+ <setProperty propertyName="policyStatus">
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="analysePolicyResponse(${header.CamelHttpResponseCode})" />
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
+ </route>
+ <route id="get-status-from-dcae">
+ <from uri="direct:get-status-from-dcae" />
+ <log
+ loggingLevel="INFO"
+ message="Query Closed Loop status from DCAE ${exchangeProperty[loopObject].getName()}" />
+ <choice>
+ <when>
+ <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} == null
+ </simple>
+ <setProperty propertyName="dcaeStatus">
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="analyseDcaeResponse(*,null)" />
+ </setProperty>
+ <log
+ loggingLevel="INFO"
+ message="dcae status: ${exchangeProperty[dcaeStatus]}"></log>
+ </when>
+ <otherwise>
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Query Closed Loop status from Dcae" />
+ <setHeader headerName="CamelHttpMethod">
+ <constant>GET</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to query Closed Loop status: ${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}"></log>
+ <toD
+ uri="${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authMethod=Basic&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>DCAE deployment status</simple>
+ </setProperty>
+ <setProperty propertyName="dcaeStatus">
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="analyseDcaeResponse(*,${header.CamelHttpResponseCode})" />
+ </setProperty>
+ <log
+ loggingLevel="INFO"
+ message="dcae status: ${exchangeProperty[dcaeStatus]}"></log>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
+ </otherwise>
+ </choice>
</route>
-
<route id="reset-raise-http-exception-flag">
<from uri="direct:reset-raise-http-exception-flag" />
- <setHeader headerName="RaiseHttpExceptionFlag">
+ <setProperty propertyName="raiseHttpExceptionFlag">
<simple resultType="java.lang.Boolean">true</simple>
- </setHeader>
+ </setProperty>
+ </route>
+
+ <route id="dump-loop-log-http-response">
+ <from uri="direct:dump-loop-log-http-response" />
+ <log loggingLevel="INFO" message="${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO',${exchangeProperty[loopObject]})" />
</route>
</routes> \ No newline at end of file
diff --git a/src/main/resources/logback-default.xml b/src/main/resources/logback-default.xml
index c2524bec2..bc8ebb909 100644
--- a/src/main/resources/logback-default.xml
+++ b/src/main/resources/logback-default.xml
@@ -1,66 +1,97 @@
<included>
<jmxConfigurator />
<!-- Example evaluator filter applied against console appender -->
-<property name="p_tim" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}"/>
- <property name="p_lvl" value="%level"/>
- <property name="p_log" value="%logger"/>
- <property name="p_mdc" value="%replace(%replace(%mdc){'\t','\\\\t'}){'\n', '\\\\n'}"/>
- <property name="p_msg" value="%replace(%replace(%msg){'\t', '\\\\t'}){'\n','\\\\n'}"/>
- <property name="p_exc" value="%replace(%replace(%rootException){'\t', '\\\\t'}){'\n','\\\\n'}"/>
- <property name="p_mak" value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}"/>
- <property name="p_thr" value="%thread"/>
- <property name="defaultPattern" value="%nopexception${p_tim}\t${p_thr}\t${p_lvl}\t${p_log}\t${p_mdc}\t${p_msg}\t${p_exc}\t${p_mak}\t%n"/>
- <property name="debugPattern" value="%nopexception${p_tim}|${p_lvl}|${p_mdc}|${p_exc}|%msg%n"/>
+ <property
+ name="p_tim"
+ value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}" />
+ <property
+ name="p_lvl"
+ value="%level" />
+ <property
+ name="p_log"
+ value="%logger" />
+ <property
+ name="p_mdc"
+ value="%replace(%replace(%mdc){'\t','\\\\t'}){'\n', '\\\\n'}" />
+ <property
+ name="p_msg"
+ value="%replace(%replace(%msg){'\t', '\\\\t'}){'\n','\\\\n'}" />
+ <property
+ name="p_exc"
+ value="%replace(%replace(%rootException){'\t', '\\\\t'}){'\n','\\\\n'}" />
+ <property
+ name="p_mak"
+ value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}" />
+ <property
+ name="p_thr"
+ value="%thread" />
+ <property
+ name="defaultPattern"
+ value="%nopexception${p_tim}\t${p_thr}\t${p_lvl}\t${p_log}\t${p_mdc}\t${p_msg}\t${p_exc}\t${p_mak}\t%n" />
+ <property
+ name="debugPattern"
+ value="%nopexception${p_tim}|${p_lvl}|${p_mdc}|${p_exc}|%msg%n" />
- <!-- Example evaluator filter applied against console appender -->
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
- <level>INFO</level>
- </filter>
- <encoder>
- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n</pattern>
- </encoder>
- </appender>
+ <!-- Example evaluator filter applied against console appender -->
+ <appender
+ name="STDOUT"
+ class="ch.qos.logback.core.ConsoleAppender">
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>INFO</level>
+ </filter>
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n
+ </pattern>
+ </encoder>
+ </appender>
- <appender name="ERROR"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
- <level>INFO</level>
- </filter>
- <file>${logDirectory}/error.log</file>
- <append>true</append>
- <encoder>
- <pattern>${defaultPattern}</pattern>
- </encoder>
- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <fileNamePattern>${outputDirectory}/clamp/error.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
- <maxFileSize>50MB</maxFileSize>
- <maxHistory>30</maxHistory>
- <totalSizeCap>10GB</totalSizeCap>
- </rollingPolicy>
- <triggeringPolicy
- class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
- <maxFileSize>10MB</maxFileSize>
- </triggeringPolicy>
- </appender>
+ <appender
+ name="ERROR"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>INFO</level>
+ </filter>
+ <file>${logDirectory}/error.log</file>
+ <append>true</append>
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${outputDirectory}/clamp/error.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>50MB</maxFileSize>
+ <maxHistory>30</maxHistory>
+ <totalSizeCap>10GB</totalSizeCap>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>10MB</maxFileSize>
+ </triggeringPolicy>
+ </appender>
- <appender name="DEBUG"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${logDirectory}/debug.log</file>
- <append>true</append>
- <encoder>
- <pattern>${debugPattern}</pattern>
- </encoder>
- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <fileNamePattern>${outputDirectory}/clamp/debug.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
- <maxFileSize>50MB</maxFileSize>
- <maxHistory>30</maxHistory>
- <totalSizeCap>10GB</totalSizeCap>
- </rollingPolicy>
- </appender>
+ <appender
+ name="DEBUG"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/debug.log</file>
+ <append>true</append>
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n
+ </pattern>
+ </encoder>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${outputDirectory}/clamp/debug.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>50MB</maxFileSize>
+ <maxHistory>30</maxHistory>
+ <totalSizeCap>10GB</totalSizeCap>
+ </rollingPolicy>
+ </appender>
- <appender name="AUDIT"
+ <appender
+ name="AUDIT"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${logDirectory}/audit.log</file>
<append>true</append>
@@ -79,13 +110,15 @@
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
</appender>
- <appender name="asyncEELFAudit"
+ <appender
+ name="asyncEELFAudit"
class="ch.qos.logback.classic.AsyncAppender">
<queueSize>256</queueSize>
<appender-ref ref="AUDIT" />
</appender>
- <appender name="METRIC"
+ <appender
+ name="METRIC"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${logDirectory}/metric.log</file>
<append>true</append>
@@ -104,14 +137,16 @@
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
</appender>
- <appender name="asyncEELFMetrics"
+ <appender
+ name="asyncEELFMetrics"
class="ch.qos.logback.classic.AsyncAppender">
<queueSize>256</queueSize>
<appender-ref ref="METRIC" />
</appender>
<!-- SECURITY related loggers -->
- <appender name="SECURITY"
+ <appender
+ name="SECURITY"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${logDirectory}/security.log</file>
<append>true</append>
@@ -130,55 +165,15 @@
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
</appender>
- <appender name="asyncEELFSecurity"
+ <appender
+ name="asyncEELFSecurity"
class="ch.qos.logback.classic.AsyncAppender">
<queueSize>256</queueSize>
<appender-ref ref="SECURITY" />
</appender>
- <!-- AAF related loggers -->
- <logger name="org.onap.aaf" level="INFO" additivity="true">
- <appender-ref ref="DEBUG" />
- </logger>
- <logger name="org.apache.catalina.core" level="INFO"
- additivity="true">
- <appender-ref ref="DEBUG" />
- </logger>
- <!-- CLDS related loggers -->
- <logger name="org.onap.clamp.clds" level="INFO"
- additivity="true">
- <appender-ref ref="ERROR" />
- </logger>
-
- <!-- CLDS related loggers -->
- <logger name="com.att.eelf.error" level="OFF" additivity="true">
- <appender-ref ref="ERROR" />
- </logger>
- <!-- EELF related loggers -->
- <logger name="com.att.eelf.audit" level="INFO"
- additivity="false">
- <appender-ref ref="asyncEELFAudit" />
- </logger>
- <logger name="com.att.eelf.metrics" level="DEBUG"
- additivity="false">
- <appender-ref ref="asyncEELFMetrics" />
- </logger>
- <logger name="com.att.eelf.security" level="DEBUG"
- additivity="false">
- <appender-ref ref="asyncEELFSecurity" />
- </logger>
-
- <!-- Spring related loggers -->
- <logger name="org.springframework" level="DEBUG" />
-
- <!-- Other Loggers that may help troubleshoot -->
- <logger name="org.apache" level="DEBUG" />
-
- <!-- logback internals logging -->
- <logger name="ch.qos.logback.classic" level="INFO" />
- <logger name="ch.qos.logback.core" level="INFO" />
-
<!-- logback jms appenders & loggers definition starts here -->
- <appender name="auditLogs"
+ <appender
+ name="auditLogs"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
</filter>
@@ -198,7 +193,8 @@
<pattern>"%d [%thread] %-5level %logger{1024} - %msg%n"</pattern>
</encoder>
</appender>
- <appender name="perfLogs"
+ <appender
+ name="perfLogs"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
</filter>
@@ -218,14 +214,81 @@
<pattern>"%d [%thread] %-5level %logger{1024} - %msg%n"</pattern>
</encoder>
</appender>
- <logger name="AuditRecord" level="INFO" additivity="FALSE">
+
+ <logger
+ name="org.onap.aaf"
+ level="DEBUG">
+ <appender-ref ref="DEBUG" />
+ </logger>
+ <logger
+ name="org.apache"
+ level="DEBUG">
+ <appender-ref ref="DEBUG" />
+ </logger>
+ <!-- Spring related loggers -->
+ <logger
+ name="org.springframework"
+ level="DEBUG">
+ <appender-ref ref="DEBUG" />
+ </logger>
+
+ <!-- CLDS related loggers -->
+ <logger
+ name="org.onap.clamp"
+ level="DEBUG">
+ <appender-ref ref="ERROR" />
+ <appender-ref ref="DEBUG" />
+ </logger>
+
+ <!-- CLDS related loggers -->
+ <logger
+ name="com.att.eelf.error"
+ level="OFF">
+ <appender-ref ref="ERROR" />
+ </logger>
+ <!-- EELF related loggers -->
+ <logger
+ name="com.att.eelf.audit"
+ level="INFO"
+ additivity="false">
+ <appender-ref ref="asyncEELFAudit" />
+ </logger>
+ <logger
+ name="com.att.eelf.metrics"
+ level="DEBUG"
+ additivity="false">
+ <appender-ref ref="asyncEELFMetrics" />
+ </logger>
+ <logger
+ name="com.att.eelf.security"
+ level="DEBUG"
+ additivity="false">
+ <appender-ref ref="asyncEELFSecurity" />
+ </logger>
+
+ <!-- logback internals logging -->
+ <logger
+ name="ch.qos.logback.classic"
+ level="INFO" />
+ <logger
+ name="ch.qos.logback.core"
+ level="INFO" />
+ <logger
+ name="AuditRecord"
+ level="INFO"
+ additivity="false">
<appender-ref ref="auditLogs" />
</logger>
- <logger name="AuditRecord_DirectCall" level="INFO"
- additivity="FALSE">
+ <logger
+ name="AuditRecord_DirectCall"
+ level="INFO"
+ additivity="false">
<appender-ref ref="auditLogs" />
</logger>
- <logger name="PerfTrackerRecord" level="INFO" additivity="FALSE">
+ <logger
+ name="PerfTrackerRecord"
+ level="INFO"
+ additivity="false">
<appender-ref ref="perfLogs" />
</logger>
<!-- logback jms appenders & loggers definition ends here -->
diff --git a/src/test/java/org/onap/clamp/clds/client/GuardPolicyDeleteDelegateTest.java b/src/test/java/org/onap/clamp/clds/client/GuardPolicyDeleteDelegateTest.java
new file mode 100644
index 000000000..2ff8166b9
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/client/GuardPolicyDeleteDelegateTest.java
@@ -0,0 +1,117 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 Samsung. 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.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.client;
+
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.apache.camel.Exchange;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.clamp.clds.client.req.policy.PolicyClient;
+import org.onap.clamp.clds.exception.ModelBpmnException;
+
+@RunWith(MockitoJUnitRunner.class)
+public class GuardPolicyDeleteDelegateTest {
+
+ private static final String MODEL_BPMN_KEY = "modelBpmnProp";
+ private static final String MODEL_PROP_KEY = "modelProp";
+ private static final String TEST_KEY = "isTest";
+ private static final String EVENT_ACTION_KEY = "eventAction";
+
+ private static final String POLICY_ID_FROM_JSON = "{policy:[{id:Policy_7,from:''}]}";
+ private static final String TCA_ID_FROM_JSON = "{tca:[{id:'',from:''}]}";
+ private static final String ID_JSON = "{Policy_7:{r:["
+ + "{name:pid,value:pid334},"
+ + "{name:timeout,value:50},"
+ + "{name:policyType,value:pt},"
+ + "{policyConfigurations:[["
+ + "{name:_id,value:ret345},"
+ + "{name:recipe,value:make},"
+ + "{name:maxRetries,value:5},"
+ + "{name:retryTimeLimit,value:100},"
+ + "{name:enableGuardPolicy,value:on}]]}]}}";
+ private static final String NOT_JSON = "not json";
+ private static final String EVENT_ACTION_VALUE = "action";
+
+ @Mock
+ private Exchange exchange;
+
+ @Mock
+ private PolicyClient policyClient;
+
+ @InjectMocks
+ private GuardPolicyDeleteDelegate guardPolicyDeleteDelegate;
+
+ @Test
+ public void shouldExecuteSuccessfully() {
+ // given
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(POLICY_ID_FROM_JSON);
+ when(exchange.getProperty(eq(MODEL_PROP_KEY))).thenReturn(ID_JSON);
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+ when(exchange.getProperty(eq(EVENT_ACTION_KEY))).thenReturn(EVENT_ACTION_VALUE);
+
+ // when
+ guardPolicyDeleteDelegate.execute(exchange);
+
+ // then
+ verify(policyClient).deleteGuard(any());
+ }
+
+ @Test
+ public void shouldExecutePolicyNotFound() {
+ // given
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(TCA_ID_FROM_JSON);
+ when(exchange.getProperty(eq(MODEL_PROP_KEY))).thenReturn(ID_JSON);
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+ when(exchange.getProperty(eq(EVENT_ACTION_KEY))).thenReturn(EVENT_ACTION_VALUE);
+
+ // when
+ guardPolicyDeleteDelegate.execute(exchange);
+
+ // then
+ verify(policyClient, never()).deleteGuard(any());
+ }
+
+ @Test(expected = ModelBpmnException.class)
+ public void shouldThrowModelBpmnException() {
+ // given
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(NOT_JSON);
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+
+ // when
+ guardPolicyDeleteDelegate.execute(exchange);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void shouldThrowNullPointerException() {
+ // when
+ guardPolicyDeleteDelegate.execute(exchange);
+ }
+}
diff --git a/src/test/java/org/onap/clamp/clds/client/HolmesPolicyDelegateTest.java b/src/test/java/org/onap/clamp/clds/client/HolmesPolicyDelegateTest.java
new file mode 100644
index 000000000..1d3f1ce61
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/client/HolmesPolicyDelegateTest.java
@@ -0,0 +1,183 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 Samsung. 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.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.client;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+
+import java.io.IOException;
+
+import org.apache.camel.Exchange;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.clamp.clds.client.req.policy.PolicyClient;
+import org.onap.clamp.clds.config.ClampProperties;
+import org.onap.clamp.clds.dao.CldsDao;
+import org.onap.clamp.clds.exception.ModelBpmnException;
+import org.onap.clamp.clds.model.CldsModel;
+import org.onap.clamp.clds.model.properties.Holmes;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.util.JsonUtils;
+
+@RunWith(MockitoJUnitRunner.class)
+public class HolmesPolicyDelegateTest {
+
+ private static final String ID_JSON = "{\"id\":{\"r\":[{},{\"serviceConfigurations\":"
+ + "[[\"x\",\"+\",\"2\",\"y\"]]}]}}";
+ private static final String METRICS_JSON = "{\"metricsPerEventName\":[{\"thresholds\":[]}]}";
+ private static final String CONTENT_JSON = "{\"content\":{}}";
+ private static final String NULL_JSON = "{}";
+ private static final String HOLMES_ID_FROM_JSON = "{\"holmes\":[{\"id\":\"id\",\"from\":\"\"}]}";
+ private static final String TCA_ID_FROM_JSON = "{\"tca\":[{\"id\":\"\",\"from\":\"\"}]}";
+ private static final String CORRELATION_LOGIC_JSON = "{\"name\":\"correlationalLogic\"}";
+ private static final String NOT_JSON = "not json";
+ private static final String MODEL_BPMN_KEY = "modelBpmnProp";
+ private static final String MODEL_PROP_KEY = "modelProp";
+ private static final String MODEL_NAME_KEY = "modelName";
+ private static final String TEST_KEY = "isTest";
+ private static final String USERID_KEY = "userid";
+ private static final String TCA_TEMPLATE_KEY = "tca.template";
+ private static final String TCA_POLICY_TEMPLATE_KEY = "tca.policy.template";
+ private static final String TCA_THRESHOLDS_TEMPLATE_KEY = "tca.thresholds.template";
+ private static final String HOLMES_POLICY_RESPONSE_MESSAGE_KEY = "holmesPolicyResponseMessage";
+ private static final String RESPONSE_MESSAGE_VALUE = "responseMessage";
+ private static final String MODEL_NAME_VALUE = "model.name";
+ private static final String CONTROL_NAME_VALUE = "control.name";
+ private static final String USERID_VALUE = "user";
+ private static final String CLDS_MODEL_ID = "id";
+ private static final String CLDS_MODEL_PROP_TEXT = "propText";
+
+ @Mock
+ private Exchange exchange;
+
+ @Mock
+ private PolicyClient policyClient;
+
+ @Mock
+ private ClampProperties clampProperties;
+
+ @Mock
+ private CldsDao cldsDao;
+
+ @InjectMocks
+ private HolmesPolicyDelegate holmesPolicyDelegateTest;
+
+ @Test
+ public void shouldExecuteSuccessfully() throws IOException {
+ // given
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(HOLMES_ID_FROM_JSON);
+ when(exchange.getProperty(eq(MODEL_PROP_KEY))).thenReturn(ID_JSON);
+ when(exchange.getProperty(eq(MODEL_NAME_KEY))).thenReturn(MODEL_NAME_VALUE);
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+ when(exchange.getProperty(eq(USERID_KEY))).thenReturn(USERID_VALUE);
+
+ JsonElement jsonTemplateA = mock(JsonElement.class);
+ when(clampProperties.getJsonTemplate(eq(TCA_TEMPLATE_KEY), anyString())).thenReturn(jsonTemplateA);
+ when(jsonTemplateA.getAsJsonObject()).thenReturn(getJsonObject(METRICS_JSON));
+
+ JsonElement jsonTemplateB = mock(JsonElement.class);
+ when(clampProperties.getJsonTemplate(eq(TCA_POLICY_TEMPLATE_KEY), anyString())).thenReturn(jsonTemplateB);
+ when(jsonTemplateB.getAsJsonObject()).thenReturn(getJsonObject(CONTENT_JSON));
+
+ JsonElement jsonTemplateC = mock(JsonElement.class);
+ when(clampProperties.getJsonTemplate(eq(TCA_THRESHOLDS_TEMPLATE_KEY), anyString())).thenReturn(jsonTemplateC);
+ when(jsonTemplateC.getAsJsonObject()).thenReturn(getJsonObject(NULL_JSON));
+
+ when(policyClient.sendBasePolicyInOther(anyString(), anyString(), any(), anyString()))
+ .thenReturn(RESPONSE_MESSAGE_VALUE);
+
+ CldsModel cldsModel = new CldsModel();
+ cldsModel.setId(CLDS_MODEL_ID);
+ cldsModel.setPropText(CLDS_MODEL_PROP_TEXT);
+ when(cldsDao.getModelTemplate(eq(MODEL_NAME_VALUE))).thenReturn(cldsModel);
+
+ // when
+ holmesPolicyDelegateTest.execute(exchange);
+
+ // then
+ verify(exchange).setProperty(eq(HOLMES_POLICY_RESPONSE_MESSAGE_KEY), eq(RESPONSE_MESSAGE_VALUE.getBytes()));
+ verify(cldsDao).setModel(eq(cldsModel), eq(USERID_VALUE));
+ }
+
+ @Test
+ public void shouldExecuteHolmesNotFound() {
+ // given
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(TCA_ID_FROM_JSON);
+ when(exchange.getProperty(eq(MODEL_PROP_KEY))).thenReturn(ID_JSON);
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+
+ // when
+ holmesPolicyDelegateTest.execute(exchange);
+
+ // then
+ verify(policyClient, never()).sendBasePolicyInOther(anyString(), anyString(), any(), anyString());
+ verify(exchange, never()).setProperty(eq(HOLMES_POLICY_RESPONSE_MESSAGE_KEY), any());
+ verify(cldsDao, never()).setModel(any(), anyString());
+ }
+
+ @Test(expected = ModelBpmnException.class)
+ public void shouldThrowModelBpmnException() {
+ // given
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(NOT_JSON);
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+
+ // when
+ holmesPolicyDelegateTest.execute(exchange);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void shouldThrowNullPointerException() {
+ // when
+ holmesPolicyDelegateTest.execute(exchange);
+ }
+
+ @Test
+ public void shouldDoFormatHolmesConfigBodySuccessfully() {
+ // given
+ ModelProperties prop = new ModelProperties(null, CONTROL_NAME_VALUE, null, false,
+ HOLMES_ID_FROM_JSON, "{\"id\":" + CORRELATION_LOGIC_JSON + "}");
+ Holmes holmes = prop.getType(Holmes.class);
+
+ // when
+ String result = HolmesPolicyDelegate.formatHolmesConfigBody(prop, holmes);
+
+ // then
+ assertEquals(CONTROL_NAME_VALUE + "$$$" + CORRELATION_LOGIC_JSON, result);
+ }
+
+ private static JsonObject getJsonObject(String jsonText) {
+ return JsonUtils.GSON.fromJson(jsonText, JsonObject.class);
+ }
+}
diff --git a/src/test/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegateTest.java b/src/test/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegateTest.java
new file mode 100644
index 000000000..ccebbfbe3
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegateTest.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 Samsung. 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.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.client;
+
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.apache.camel.Exchange;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.clamp.clds.client.req.policy.PolicyClient;
+import org.onap.clamp.clds.exception.ModelBpmnException;
+
+@RunWith(MockitoJUnitRunner.class)
+public class HolmesPolicyDeleteDelegateTest {
+
+ private static final String MODEL_BPMN_KEY = "modelBpmnProp";
+ private static final String MODEL_PROP_KEY = "modelProp";
+ private static final String TEST_KEY = "isTest";
+
+ private static final String HOLMES_ID_FROM_JSON = "{\"holmes\":[{\"id\":\"\",\"from\":\"\"}]}";
+ private static final String TCA_ID_FROM_JSON = "{\"tca\":[{\"id\":\"\",\"from\":\"\"}]}";
+ private static final String ID_JSON = "{\"id\":\"\"}";
+ private static final String NOT_JSON = "not json";
+
+ @Mock
+ private Exchange exchange;
+
+ @Mock
+ private PolicyClient policyClient;
+
+ @InjectMocks
+ private HolmesPolicyDeleteDelegate holmesPolicyDeleteDelegate;
+
+ @Test
+ public void shouldExecuteSuccessfully() {
+ // given
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(HOLMES_ID_FROM_JSON);
+ when(exchange.getProperty(eq(MODEL_PROP_KEY))).thenReturn(ID_JSON);
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+
+ // when
+ holmesPolicyDeleteDelegate.execute(exchange);
+
+ // then
+ verify(policyClient).deleteBasePolicy(any());
+ }
+
+ @Test
+ public void shouldExecuteHolmesNotFound() {
+ // given
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(TCA_ID_FROM_JSON);
+ when(exchange.getProperty(eq(MODEL_PROP_KEY))).thenReturn(ID_JSON);
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+
+ // when
+ holmesPolicyDeleteDelegate.execute(exchange);
+
+ // then
+ verify(policyClient, never()).deleteBasePolicy(any());
+ }
+
+ @Test(expected = ModelBpmnException.class)
+ public void shouldThrowModelBpmnException() {
+ // given
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(NOT_JSON);
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+
+ // when
+ holmesPolicyDeleteDelegate.execute(exchange);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void shouldThrowNullPointerException() {
+ // when
+ holmesPolicyDeleteDelegate.execute(exchange);
+ }
+}
diff --git a/src/test/java/org/onap/clamp/clds/client/ModelDeleteDelegateTest.java b/src/test/java/org/onap/clamp/clds/client/ModelDeleteDelegateTest.java
new file mode 100644
index 000000000..06b94225d
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/client/ModelDeleteDelegateTest.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 Samsung. 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.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.client;
+
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.apache.camel.Exchange;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.clamp.clds.dao.CldsDao;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ModelDeleteDelegateTest {
+
+ private static final String NAME_KEY = "modelName";
+ private static final String NAME_VALUE = "model.name";
+
+ @Mock
+ private Exchange exchange;
+
+ @Mock
+ private CldsDao cldsDao;
+
+ @InjectMocks
+ private ModelDeleteDelegate modelDeleteDelegate;
+
+ @Test
+ public void shouldExecuteSuccessfully() {
+ // given
+ when(exchange.getProperty(eq(NAME_KEY))).thenReturn(NAME_VALUE);
+
+ // when
+ modelDeleteDelegate.execute(exchange);
+
+ // then
+ verify(cldsDao).deleteModel(eq(NAME_VALUE));
+ }
+}
diff --git a/src/test/java/org/onap/clamp/clds/client/OperationalPolicyDelegateTest.java b/src/test/java/org/onap/clamp/clds/client/OperationalPolicyDelegateTest.java
new file mode 100644
index 000000000..75be799b7
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/client/OperationalPolicyDelegateTest.java
@@ -0,0 +1,125 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 Samsung. 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.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.client;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.io.UnsupportedEncodingException;
+
+import org.apache.camel.Exchange;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.clamp.clds.client.req.policy.PolicyClient;
+import org.onap.clamp.clds.config.ClampProperties;
+import org.onap.clamp.clds.exception.ModelBpmnException;
+import org.onap.policy.controlloop.policy.builder.BuilderException;
+
+@RunWith(MockitoJUnitRunner.class)
+public class OperationalPolicyDelegateTest {
+
+ private static final String TEST_KEY = "isTest";
+ private static final String MODEL_BPMN_KEY = "modelBpmnProp";
+ private static final String MODEL_PROP_KEY = "modelProp";
+ private static final String RECIPE_TOPIC_KEY = "op.recipeTopic";
+ private static final String MESSAGE_KEY = "operationalPolicyResponseMessage";
+ private static final String SERVICE_NAME = "service.name";
+ private static final String POLICY_ID_FROM_JSON = "{policy:[{id:Oper12,from:''}]}";
+ private static final String ID_WITH_CHAIN_JSON = "{Oper12:{ab:["
+ + "{name:timeout,value:500},"
+ + "{policyConfigurations:["
+ + "[{name:maxRetries,value:5},"
+ + "{name:retryTimeLimit,value:1000},"
+ + "{name:recipe,value:go},"
+ + "{name:targetResourceId,"
+ + "value:resid234}]]}]},"
+ + "global:[{name:service,value:" + SERVICE_NAME + "}]}";
+ private static final String SIMPLE_JSON = "{}";
+ private static final String NOT_JSON = "not json";
+ private static final String MESSAGE_VALUE = "message";
+ private static final String RECIPE_TOPIC_VALUE = "recipe.topic";
+
+ @Mock
+ private Exchange exchange;
+
+ @Mock
+ private PolicyClient policyClient;
+
+ @Mock
+ private ClampProperties refProp;
+
+ @InjectMocks
+ private OperationalPolicyDelegate operationalPolicyDelegate;
+
+ @Test
+ public void shouldExecuteSuccessfully() throws BuilderException, UnsupportedEncodingException {
+ // given
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(true);
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(POLICY_ID_FROM_JSON);
+ when(exchange.getProperty(eq(MODEL_PROP_KEY))).thenReturn(ID_WITH_CHAIN_JSON);
+ when(policyClient.sendBrmsPolicy(any(), any(), any())).thenReturn(MESSAGE_VALUE);
+ when(refProp.getStringValue(eq(RECIPE_TOPIC_KEY), eq(SERVICE_NAME))).thenReturn(RECIPE_TOPIC_VALUE);
+
+ // when
+ operationalPolicyDelegate.execute(exchange);
+
+ // then
+ verify(exchange).setProperty(eq(MESSAGE_KEY), eq(MESSAGE_VALUE.getBytes()));
+ }
+
+ @Test
+ public void shouldExecutePolicyNotFound() throws BuilderException, UnsupportedEncodingException {
+ // given
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(SIMPLE_JSON);
+ when(exchange.getProperty(eq(MODEL_PROP_KEY))).thenReturn(SIMPLE_JSON);
+
+ // when
+ operationalPolicyDelegate.execute(exchange);
+
+ // then
+ verify(policyClient, never()).sendBrmsPolicy(any(), any(), any());
+ }
+
+ @Test(expected = ModelBpmnException.class)
+ public void shouldThrowModelBpmnException() throws BuilderException, UnsupportedEncodingException {
+ // given
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(true);
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(NOT_JSON);
+
+ // when
+ operationalPolicyDelegate.execute(exchange);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void shouldThrowNullPointerException() throws BuilderException, UnsupportedEncodingException {
+ // when
+ operationalPolicyDelegate.execute(exchange);
+ }
+}
diff --git a/src/test/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegateTest.java b/src/test/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegateTest.java
new file mode 100644
index 000000000..9d87e7e97
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/client/OperationalPolicyDeleteDelegateTest.java
@@ -0,0 +1,108 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 Samsung. 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.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.client;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.apache.camel.Exchange;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.clamp.clds.client.req.policy.PolicyClient;
+import org.onap.clamp.clds.exception.ModelBpmnException;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+
+@RunWith(MockitoJUnitRunner.class)
+public class OperationalPolicyDeleteDelegateTest {
+
+ private static final String TEST_KEY = "isTest";
+ private static final String MODEL_BPMN_KEY = "modelBpmnProp";
+ private static final String MODEL_PROP_KEY = "modelProp";
+ private static final String EVENT_ACTION_KEY = "eventAction";
+ private static final String POLICY_ID_FROM_JSON = "{policy:[{id:Poli2,from:''}]}";
+ private static final String ID_WITH_CHAIN_JSON = "{Poli2:{ab:c,xy:z}}";
+ private static final String ID_NO_CHAIN_JSON = "{Poli2:{}}";
+ private static final String EVENT_ACTION_VALUE = "still";
+ private static final String NOT_JSON = "23e";
+
+ @Mock
+ private Exchange exchange;
+
+ @Mock
+ private PolicyClient policyClient;
+
+ @InjectMocks
+ private OperationalPolicyDeleteDelegate operationalPolicyDeleteDelegate;
+
+ @Test
+ public void shouldExecuteSuccessfully() {
+ // given
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(POLICY_ID_FROM_JSON);
+ when(exchange.getProperty(eq(MODEL_PROP_KEY))).thenReturn(ID_WITH_CHAIN_JSON);
+ when(exchange.getProperty(eq(EVENT_ACTION_KEY))).thenReturn(EVENT_ACTION_VALUE);
+
+ // when
+ operationalPolicyDeleteDelegate.execute(exchange);
+
+ // then
+ verify(policyClient, times(2)).deleteBrms(any(ModelProperties.class));
+ }
+
+ @Test
+ public void shouldExecuteTcaNotFound() {
+ // given
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(true);
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(POLICY_ID_FROM_JSON);
+ when(exchange.getProperty(eq(MODEL_PROP_KEY))).thenReturn(ID_NO_CHAIN_JSON);
+
+ // when
+ operationalPolicyDeleteDelegate.execute(exchange);
+
+ // then
+ verify(policyClient, never()).deleteBrms(any(ModelProperties.class));
+ }
+
+ @Test(expected = ModelBpmnException.class)
+ public void shouldThrowModelBpmnException() {
+ // given
+ when(exchange.getProperty(eq(TEST_KEY))).thenReturn(false);
+ when(exchange.getProperty(eq(MODEL_BPMN_KEY))).thenReturn(NOT_JSON);
+
+ // when
+ operationalPolicyDeleteDelegate.execute(exchange);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void shouldThrowNullPointerException() {
+ // when
+ operationalPolicyDeleteDelegate.execute(exchange);
+ }
+}
diff --git a/src/test/java/org/onap/clamp/clds/client/TcaPolicyDeleteDelegateTest.java b/src/test/java/org/onap/clamp/clds/client/TcaPolicyDeleteDelegateTest.java
new file mode 100644
index 000000000..70edabe68
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/client/TcaPolicyDeleteDelegateTest.java
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 Samsung. 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.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.client;
+
+import org.apache.camel.Exchange;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.clamp.clds.client.req.policy.PolicyClient;
+import org.onap.clamp.clds.exception.ModelBpmnException;
+
+@RunWith(MockitoJUnitRunner.class)
+public class TcaPolicyDeleteDelegateTest {
+
+ private static final String TCA_ID_FROM_JSON = "{\"tca\":[{\"id\":\"\",\"from\":\"\"}]}";
+ private static final String HOLMES_ID_FROM_JSON = "{\"holmes\":[{\"id\":\"\",\"from\":\"\"}]}";
+ private static final String ID_JSON = "{\"id\":\"\"}";
+ private static final String NOT_JSON = "not json";
+ private static final String MODEL_BPMN_KEY = "modelBpmnProp";
+ private static final String MODEL_PROP_KEY = "modelProp";
+ private static final String TEST_KEY = "isTest";
+ private static final String PROPERTY_NAME = "tcaPolicyDeleteResponseMessage";
+ private static final String MESSAGE = "message";
+
+ @Mock
+ private Exchange camelExchange;
+
+ @Mock
+ private PolicyClient policyClient;
+
+ @InjectMocks
+ private TcaPolicyDeleteDelegate tcaPolicyDeleteDelegate;
+
+ @Test
+ public void shouldExecuteSuccessfully() {
+ //given
+ Mockito.when(camelExchange.getProperty(MODEL_BPMN_KEY)).thenReturn(TCA_ID_FROM_JSON);
+ Mockito.when(camelExchange.getProperty(MODEL_PROP_KEY)).thenReturn(ID_JSON);
+ Mockito.when(camelExchange.getProperty(TEST_KEY)).thenReturn(false);
+
+ Mockito.when(policyClient.deleteMicrosService(Mockito.any())).thenReturn(MESSAGE);
+
+ //when
+ tcaPolicyDeleteDelegate.execute(camelExchange);
+
+ //then
+ Mockito.verify(camelExchange).setProperty(PROPERTY_NAME, MESSAGE.getBytes());
+ }
+
+ @Test
+ public void shouldExecuteTcaNotFound() {
+ //given
+ Mockito.when(camelExchange.getProperty(MODEL_BPMN_KEY)).thenReturn(HOLMES_ID_FROM_JSON);
+ Mockito.when(camelExchange.getProperty(MODEL_PROP_KEY)).thenReturn(ID_JSON);
+ Mockito.when(camelExchange.getProperty(TEST_KEY)).thenReturn(false);
+
+ //when
+ tcaPolicyDeleteDelegate.execute(camelExchange);
+
+ //then
+ Mockito.verify(policyClient, Mockito.never()).deleteMicrosService(Mockito.any());
+ Mockito.verify(camelExchange, Mockito.never()).setProperty(Mockito.any(), Mockito.any());
+ }
+
+ @Test(expected = ModelBpmnException.class)
+ public void shouldThrowModelBpmnException() {
+ //given
+ Mockito.when(camelExchange.getProperty(MODEL_BPMN_KEY)).thenReturn(NOT_JSON);
+ Mockito.when(camelExchange.getProperty(TEST_KEY)).thenReturn(false);
+
+ //when
+ tcaPolicyDeleteDelegate.execute(camelExchange);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void shouldThrowNullPointerException() {
+ //when
+ tcaPolicyDeleteDelegate.execute(camelExchange);
+ }
+}
diff --git a/src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java b/src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java
index a32a60351..549c91321 100644
--- a/src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java
+++ b/src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -25,10 +27,11 @@
package org.onap.clamp.clds.config;
import static org.assertj.core.api.Assertions.assertThat;
-
import org.junit.Test;
+import org.onap.clamp.clds.exception.CldsUsersException;
import org.onap.clamp.clds.service.CldsUser;
+
public class CldsUserJsonDecoderTest {
private String user1 = "admin1";
@@ -92,4 +95,12 @@ public class CldsUserJsonDecoderTest {
assertThat(user.getPassword()).isEqualTo(password);
assertThat(user.getPermissionsString()).isEqualTo(incompletePermissionsArray);
}
+
+ @Test(expected = CldsUsersException.class)
+ public void shouldThrowCldsUsersException() {
+ //when
+ CldsUserJsonDecoder
+ .decodeJson(this.getClass().getResourceAsStream("/clds/clds-parse-exception.json"));
+ }
+
}
diff --git a/src/test/java/org/onap/clamp/clds/it/CldsHealthcheckServiceItCase.java b/src/test/java/org/onap/clamp/clds/it/CldsHealthcheckServiceItCase.java
index 5d8910352..1dbea376d 100644
--- a/src/test/java/org/onap/clamp/clds/it/CldsHealthcheckServiceItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/CldsHealthcheckServiceItCase.java
@@ -25,8 +25,6 @@ package org.onap.clamp.clds.it;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import javax.ws.rs.core.Response;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.clamp.clds.model.CldsHealthCheck;
diff --git a/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java b/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java
index 347de4a78..faeb04182 100644
--- a/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java
@@ -149,6 +149,7 @@ public class CldsServiceItCase {
Properties prop = new Properties();
InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("clds-version.properties");
prop.load(in);
+ assertNotNull(in);
in.close();
assertEquals(cldsInfo.getCldsVersion(), prop.getProperty("clds.version"));
assertEquals(cldsInfo.getUserName(), "admin");
diff --git a/src/test/java/org/onap/clamp/clds/it/CldsToscaServiceItCase.java b/src/test/java/org/onap/clamp/clds/it/CldsToscaServiceItCase.java
index 7d48086cb..992c06e8c 100644
--- a/src/test/java/org/onap/clamp/clds/it/CldsToscaServiceItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/CldsToscaServiceItCase.java
@@ -69,7 +69,7 @@ public class CldsToscaServiceItCase {
private String toscaModelYaml;
private Authentication authentication;
private CldsToscaModel cldsToscaModel;
- private List<GrantedAuthority> authList = new LinkedList<GrantedAuthority>();
+ private List<GrantedAuthority> authList = new LinkedList<>();
private LoggingUtils util;
/**
diff --git a/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java
index d3a823fbc..e1b963cc4 100644
--- a/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java
@@ -5,6 +5,8 @@
* Copyright (C) 2018 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications copyright (c) 2019 Nokia
+ * ===================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -60,6 +62,7 @@ import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
import org.onap.sdc.toscaparser.api.elements.Metadata;
import org.skyscreamer.jsonassert.JSONAssert;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@@ -74,8 +77,11 @@ public class CsarInstallerItCase {
private static final String INVARIANT_RESOURCE2_UUID = "023a3f0d-1161-45ff-b4cf-8918a8ccf3ad";
private static final String RESOURCE_INSTANCE_NAME_RESOURCE1 = "ResourceInstanceName1";
private static final String RESOURCE_INSTANCE_NAME_RESOURCE2 = "ResourceInstanceName2";
+
@Autowired
+ @Qualifier("oldModelInstaller")
private CsarInstaller csarInstaller;
+
@Autowired
private CldsDao cldsDao;
@@ -173,10 +179,9 @@ public class CsarInstallerItCase {
ResourceFileUtil.getResourceAsStream("example/sdc/blueprint-dcae/prop-text-for-tca-2.json"),
StandardCharsets.UTF_8), cldsModel2.getPropText(), true);
CldsModel cldsModel3 = verifyClosedLoopModelLoadedInDb(csar, "tca_3.yaml");
- JSONAssert.assertEquals(
- IOUtils.toString(ResourceFileUtil.getResourceAsStream("example/sdc/blueprint-dcae/prop-text-for-tca.json"),
- StandardCharsets.UTF_8),
- cldsModel3.getPropText(), true);
+ JSONAssert.assertEquals(IOUtils.toString(
+ ResourceFileUtil.getResourceAsStream("example/sdc/blueprint-dcae/prop-text-for-tca-3.json"),
+ StandardCharsets.UTF_8), cldsModel3.getPropText(), true);
}
private CldsModel verifyClosedLoopModelLoadedInDb(CsarHandler csar, String artifactName)
diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java
index e86fb27d0..dec639770 100644
--- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java
+++ b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java
@@ -142,18 +142,18 @@ public class BlueprintParserTest {
public void getNodeRepresentationFromCompleteYaml() {
final JsonObject jsonObject = jsonObjectBlueprintValid;
- MicroService expected = new MicroService(SECOND_APPP, MODEL_TYPE1, FIRST_APPP, "", SECOND_APPP);
+ MicroService expected = new MicroService(SECOND_APPP, MODEL_TYPE1, FIRST_APPP, "");
Entry<String, JsonElement> entry = jsonObject.entrySet().iterator().next();
- MicroService actual = new BlueprintParser().getNodeRepresentation(entry);
+ MicroService actual = new BlueprintParser().getNodeRepresentation(entry, jsonObject, null);
Assert.assertEquals(expected, actual);
}
@Test
public void getMicroServicesFromBlueprintTest() {
- MicroService thirdApp = new MicroService(THIRD_APPP, MODEL_TYPE3, "", "", THIRD_APPP);
- MicroService firstApp = new MicroService(FIRST_APPP, MODEL_TYPE1, THIRD_APPP, "", FIRST_APPP);
- MicroService secondApp = new MicroService(SECOND_APPP, MODEL_TYPE2, FIRST_APPP, "", SECOND_APPP);
+ MicroService thirdApp = new MicroService(THIRD_APPP, MODEL_TYPE3, "", "");
+ MicroService firstApp = new MicroService(FIRST_APPP, MODEL_TYPE1, THIRD_APPP, "");
+ MicroService secondApp = new MicroService(SECOND_APPP, MODEL_TYPE2, FIRST_APPP, "");
Set<MicroService> expected = new HashSet<>(Arrays.asList(firstApp, secondApp, thirdApp));
Set<MicroService> actual = new BlueprintParser().getMicroServices(microServiceTheWholeBlueprintValid);
@@ -163,7 +163,7 @@ public class BlueprintParserTest {
@Test
public void fallBackToOneMicroServiceTCATest() {
- MicroService tcaMS = new MicroService(BlueprintParser.TCA, "onap.policy.monitoring.cdap.tca.hi.lo.app", "", "",
+ MicroService tcaMS = new MicroService(BlueprintParser.TCA, "onap.policies.monitoring.cdap.tca.hi.lo.app", "",
"");
List<MicroService> expected = Collections.singletonList(tcaMS);
@@ -174,8 +174,8 @@ public class BlueprintParserTest {
@Test
public void fallBackToOneMicroServiceHolmesTest() {
- MicroService holmesMS = new MicroService(BlueprintParser.HOLMES, "onap.policy.monitoring.cdap.tca.hi.lo.app",
- "", "", "");
+ MicroService holmesMS = new MicroService(BlueprintParser.HOLMES, "onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "", "");
List<MicroService> expected = Collections.singletonList(holmesMS);
List<MicroService> actual = new BlueprintParser()
diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java
index 1eb66eadd..4b41ee818 100644
--- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java
+++ b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java
@@ -38,10 +38,10 @@ public class ChainGeneratorTest {
@Test
public void getChainOfMicroServicesTest() {
- MicroService ms1 = new MicroService(FIRST_APPP, "", "", "", "");
- MicroService ms2 = new MicroService(SECOND_APPP, "", FIRST_APPP, "", "");
- MicroService ms3 = new MicroService(THIRD_APPP, "", SECOND_APPP, "", "");
- MicroService ms4 = new MicroService(FOURTH_APPP, "", THIRD_APPP, "", "");
+ MicroService ms1 = new MicroService(FIRST_APPP, "", "", "");
+ MicroService ms2 = new MicroService(SECOND_APPP, "", FIRST_APPP, "");
+ MicroService ms3 = new MicroService(THIRD_APPP, "", SECOND_APPP, "");
+ MicroService ms4 = new MicroService(FOURTH_APPP, "", THIRD_APPP, "");
List<MicroService> expectedList = Arrays.asList(ms1, ms2, ms3, ms4);
Set<MicroService> inputSet = new HashSet<>(expectedList);
@@ -52,10 +52,10 @@ public class ChainGeneratorTest {
@Test
public void getChainOfMicroServicesTwiceNoInputTest() {
- MicroService ms1 = new MicroService(FIRST_APPP, "", "", "", "");
- MicroService ms2 = new MicroService(SECOND_APPP, "", "", "", "");
- MicroService ms3 = new MicroService(THIRD_APPP, "", SECOND_APPP, "", "");
- MicroService ms4 = new MicroService(FOURTH_APPP, "", FIRST_APPP, "", "");
+ MicroService ms1 = new MicroService(FIRST_APPP, "", "", "");
+ MicroService ms2 = new MicroService(SECOND_APPP, "", "", "");
+ MicroService ms3 = new MicroService(THIRD_APPP, "", SECOND_APPP, "");
+ MicroService ms4 = new MicroService(FOURTH_APPP, "", FIRST_APPP, "");
Set<MicroService> inputSet = new HashSet<>(Arrays.asList(ms1, ms2, ms3, ms4));
List<MicroService> actualList = new ChainGenerator().getChainOfMicroServices(inputSet);
@@ -64,10 +64,10 @@ public class ChainGeneratorTest {
@Test
public void getChainOfMicroServicesBranchingTest() {
- MicroService ms1 = new MicroService(FIRST_APPP, "", "", "", "");
- MicroService ms2 = new MicroService(SECOND_APPP, "", FIRST_APPP, "", "");
- MicroService ms3 = new MicroService(THIRD_APPP, "", FIRST_APPP, "", "");
- MicroService ms4 = new MicroService(FOURTH_APPP, "", FIRST_APPP, "", "");
+ MicroService ms1 = new MicroService(FIRST_APPP, "", "", "");
+ MicroService ms2 = new MicroService(SECOND_APPP, "", FIRST_APPP, "");
+ MicroService ms3 = new MicroService(THIRD_APPP, "", FIRST_APPP, "");
+ MicroService ms4 = new MicroService(FOURTH_APPP, "", FIRST_APPP, "");
Set<MicroService> inputSet = new HashSet<>(Arrays.asList(ms1, ms2, ms3, ms4));
List<MicroService> actualList = new ChainGenerator().getChainOfMicroServices(inputSet);
diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImplTest.java b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/LoopCsarInstallerTest.java
index 17e27d519..e462455fd 100644
--- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImplTest.java
+++ b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/LoopCsarInstallerTest.java
@@ -53,7 +53,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.core.io.Resource;
@RunWith(MockitoJUnitRunner.class)
-public class CsarInstallerImplTest {
+public class LoopCsarInstallerTest {
@Mock
private CsarHandler csarHandler;
diff --git a/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java b/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java
index 603d2d28f..1e6742c98 100644
--- a/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java
+++ b/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java
@@ -5,7 +5,9 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -26,17 +28,30 @@ package org.onap.clamp.clds.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.eq;
+
+import java.security.InvalidKeyException;
+
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.ArrayUtils;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
-
+@RunWith(PowerMockRunner.class)
+@PowerMockIgnore({"javax.crypto.*"})
public class CryptoUtilsTest {
private final String data = "This is a test string";
@Test
+ @PrepareForTest({CryptoUtils.class})
public final void testEncryption() throws Exception {
String encodedString = CryptoUtils.encrypt(data);
assertNotNull(encodedString);
@@ -44,6 +59,7 @@ public class CryptoUtilsTest {
}
@Test
+ @PrepareForTest({CryptoUtils.class})
public final void testEncryptedStringIsDifferent() throws Exception {
String encodedString1 = CryptoUtils.encrypt(data);
String encodedString2 = CryptoUtils.encrypt(data);
@@ -56,4 +72,30 @@ public class CryptoUtilsTest {
byte[] subData2 = ArrayUtils.subarray(encryptedMessage2, 16, encryptedMessage2.length);
assertNotEquals(subData1, subData2);
}
-} \ No newline at end of file
+
+ @Test
+ @PrepareForTest({CryptoUtils.class})
+ public final void testEncryptionBaseOnRandomKey() throws Exception {
+ SecretKey secretKey = KeyGenerator.getInstance("AES").generateKey();
+ final String encryptionKey = String.valueOf(Hex.encodeHex(secretKey.getEncoded()));
+ setAesEncryptionKeyEnv(encryptionKey);
+
+ String encodedString = CryptoUtils.encrypt(data);
+ String decodedString = CryptoUtils.decrypt(encodedString);
+ assertEquals(data, decodedString);
+ }
+
+ @Test(expected = InvalidKeyException.class)
+ @PrepareForTest({CryptoUtils.class})
+ public final void testEncryptionBadKey() throws Exception {
+ final String badEncryptionKey = "93210sd";
+ setAesEncryptionKeyEnv(badEncryptionKey);
+
+ CryptoUtils.encrypt(data);
+ }
+
+ private static void setAesEncryptionKeyEnv(String value) {
+ PowerMockito.mockStatic(System.class);
+ PowerMockito.when(System.getenv(eq("AES_ENCRYPTION_KEY"))).thenReturn(value);
+ }
+}
diff --git a/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java b/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java
index 82c2162a5..d1adc166f 100644
--- a/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java
+++ b/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java
@@ -5,6 +5,8 @@
* Copyright (C) 2018 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -155,4 +157,9 @@ public class JsonUtilsTest {
// then
assertThat(timeoutValue).isEqualTo(500);
}
+
+ @Test(expected = IllegalArgumentException.class)
+ public void shouldThrowExceptionFileNotExists() throws IOException {
+ ResourceFileUtil.getResourceAsString("example/notExist.json");
+ }
}
diff --git a/src/test/java/org/onap/clamp/clds/util/drawing/ClampGraphBuilderTest.java b/src/test/java/org/onap/clamp/clds/util/drawing/ClampGraphBuilderTest.java
index f7d2fe76e..ff6e1b5d4 100644
--- a/src/test/java/org/onap/clamp/clds/util/drawing/ClampGraphBuilderTest.java
+++ b/src/test/java/org/onap/clamp/clds/util/drawing/ClampGraphBuilderTest.java
@@ -56,10 +56,10 @@ public class ClampGraphBuilderTest {
@Test
public void clampGraphBuilderCompleteChainTest() {
String collector = "VES";
- MicroService ms1 = new MicroService("ms1", "", "", "ms1_jpa_id", "");
- MicroService ms2 = new MicroService("ms2", "", "", "ms2_jpa_id", "");
- ;
- String policy = "Policy";
+ MicroService ms1 = new MicroService("ms1", "", "", "ms1_jpa_id");
+ MicroService ms2 = new MicroService("ms2", "", "", "ms2_jpa_id");
+
+ String policy = "OperationalPolicy";
List<MicroService> microServices = Arrays.asList(ms1, ms2);
ClampGraphBuilder clampGraphBuilder = new ClampGraphBuilder(mockPainter);
@@ -76,8 +76,8 @@ public class ClampGraphBuilderTest {
@Test(expected = InvalidStateException.class)
public void clampGraphBuilderNoPolicyGivenTest() {
String collector = "VES";
- MicroService ms1 = new MicroService("ms1", "", "", "ms1_jpa_id", "");
- MicroService ms2 = new MicroService("ms2", "", "", "ms2_jpa_id", "");
+ MicroService ms1 = new MicroService("ms1", "", "", "ms1_jpa_id");
+ MicroService ms2 = new MicroService("ms2", "", "", "ms2_jpa_id");
ClampGraphBuilder clampGraphBuilder = new ClampGraphBuilder(mockPainter);
clampGraphBuilder.collector(collector).addMicroService(ms1).addMicroService(ms2).build();
@@ -86,7 +86,7 @@ public class ClampGraphBuilderTest {
@Test(expected = InvalidStateException.class)
public void clampGraphBuilderNoMicroServiceGivenTest() {
String collector = "VES";
- String policy = "Policy";
+ String policy = "OperationalPolicy";
ClampGraphBuilder clampGraphBuilder = new ClampGraphBuilder(mockPainter);
clampGraphBuilder.collector(collector).policy(policy).build();
diff --git a/src/test/java/org/onap/clamp/clds/util/drawing/DocumentBuilderTest.java b/src/test/java/org/onap/clamp/clds/util/drawing/DocumentBuilderTest.java
index 6546553c7..63a1fa3e7 100644
--- a/src/test/java/org/onap/clamp/clds/util/drawing/DocumentBuilderTest.java
+++ b/src/test/java/org/onap/clamp/clds/util/drawing/DocumentBuilderTest.java
@@ -47,9 +47,6 @@ public class DocumentBuilderTest {
@Mock
private SVGGraphics2D mockG2d;
- @Mock
- private Document mockDomImpl;
-
@Test
public void pushChangestoDocumentTest() throws IOException, ParserConfigurationException, SAXException {
String dataElementId = "someId";
diff --git a/src/test/java/org/onap/clamp/flow/FlowLogOperationTest.java b/src/test/java/org/onap/clamp/flow/FlowLogOperationTest.java
new file mode 100644
index 000000000..16136ae2e
--- /dev/null
+++ b/src/test/java/org/onap/clamp/flow/FlowLogOperationTest.java
@@ -0,0 +1,99 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 Samsung. 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.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.flow;
+
+import static junit.framework.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultExchange;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.onap.clamp.clds.util.LoggingUtils;
+import org.onap.clamp.clds.util.ONAPLogConstants;
+import org.onap.clamp.flow.log.FlowLogOperation;
+import org.slf4j.MDC;
+import org.slf4j.spi.MDCAdapter;
+import org.springframework.test.util.ReflectionTestUtils;
+
+public class FlowLogOperationTest {
+
+ private FlowLogOperation flowLogOperation = new FlowLogOperation();
+
+ @Test
+ public void testStratLog() {
+ //given
+ Exchange exchange = new DefaultExchange(mock(CamelContext.class));
+ LoggingUtils loggingUtils = mock(LoggingUtils.class);
+ ReflectionTestUtils.setField(flowLogOperation, "util", loggingUtils);
+
+ //when
+ Mockito.when(loggingUtils.getProperties(ONAPLogConstants.MDCs.REQUEST_ID)).thenReturn("MockRequestId");
+ Mockito.when(loggingUtils.getProperties(ONAPLogConstants.MDCs.INVOCATION_ID)).thenReturn("MockInvocationId");
+ Mockito.when(loggingUtils.getProperties(ONAPLogConstants.MDCs.PARTNER_NAME)).thenReturn("MockPartnerName");
+ flowLogOperation.startLog(exchange, "serviceName");
+
+ //then
+ assertThat(exchange.getProperty(ONAPLogConstants.Headers.REQUEST_ID)).isEqualTo("MockRequestId");
+ assertThat(exchange.getProperty(ONAPLogConstants.Headers.INVOCATION_ID)).isEqualTo("MockInvocationId");
+ assertThat(exchange.getProperty(ONAPLogConstants.Headers.PARTNER_NAME)).isEqualTo("MockPartnerName");
+ }
+
+ @Test
+ public void testInvokeLog() {
+ //given
+ final String mockEntity = "mockEntity";
+ final String mockServiceName = "mockSerivceName";
+ MDCAdapter mdcAdapter = MDC.getMDCAdapter();
+ //when
+ flowLogOperation.invokeLog(mockEntity, mockServiceName);
+ //then
+ String entity = mdcAdapter.get(ONAPLogConstants.MDCs.TARGET_ENTITY);
+ String serviceName = mdcAdapter.get(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME);
+ assertEquals(entity,mockEntity);
+ assertEquals(serviceName,mockServiceName);
+ }
+
+ @Test
+ public void testEndLog() {
+ //given
+ MDC.put(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP, "2019-05-19T00:00:00.007Z");
+ MDCAdapter mdcAdapter = MDC.getMDCAdapter();
+ ///when
+ flowLogOperation.endLog();
+ //then
+ assertThat(mdcAdapter.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP)).isNull();
+ }
+
+ @Test
+ public void testErrorLog() {
+ //given
+ MDC.put(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP, "2019-05-19T00:00:00.007Z");
+ MDCAdapter mdcAdapter = MDC.getMDCAdapter();
+ //when
+ flowLogOperation.errorLog();
+ //then
+ assertThat(mdcAdapter.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP)).isNull();
+ }
+} \ No newline at end of file
diff --git a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
index 0cadef9ae..ed912831e 100644
--- a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
@@ -5,6 +5,9 @@
* Copyright (C) 2019 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications copyright (c) 2019 Nokia
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -24,6 +27,7 @@
package org.onap.clamp.loop;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Matchers.any;
import java.io.IOException;
import java.util.ArrayList;
@@ -47,7 +51,9 @@ import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerExceptio
import org.onap.clamp.clds.sdc.controller.installer.BlueprintArtifact;
import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
+import org.onap.clamp.clds.util.JsonUtils;
import org.onap.clamp.clds.util.ResourceFileUtil;
+import org.onap.clamp.policy.microservice.MicroServicePolicy;
import org.onap.sdc.api.notification.IArtifactInfo;
import org.onap.sdc.api.notification.INotificationData;
import org.onap.sdc.api.notification.IResourceInstance;
@@ -55,9 +61,10 @@ import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.skyscreamer.jsonassert.JSONAssert;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@@ -66,7 +73,7 @@ import org.springframework.test.context.junit4.SpringRunner;
@ActiveProfiles(profiles = "clamp-default,clamp-default-user,clamp-sdc-controller-new")
public class CsarInstallerItCase {
- private static final String CSAR_ARTIFACT_NAME = "example/sdc/service-Vloadbalancerms-csar.csar";
+ private static final String CSAR_ARTIFACT_NAME = "example/sdc/service_Vloadbalancerms_csar.csar";
private static final String INVARIANT_SERVICE_UUID = "4cc5b45a-1f63-4194-8100-cd8e14248c92";
private static final String INVARIANT_RESOURCE1_UUID = "07e266fc-49ab-4cd7-8378-ca4676f1b9ec";
private static final String INVARIANT_RESOURCE2_UUID = "023a3f0d-1161-45ff-b4cf-8918a8ccf3ad";
@@ -77,6 +84,7 @@ public class CsarInstallerItCase {
private LoopsRepository loopsRepo;
@Autowired
+ @Qualifier("loopInstaller")
private CsarInstaller csarInstaller;
private BlueprintArtifact buildFakeBuildprintArtifact(String instanceName, String invariantResourceUuid,
@@ -133,8 +141,7 @@ public class CsarInstallerItCase {
// set
SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
String path = Thread.currentThread().getContextClassLoader().getResource(CSAR_ARTIFACT_NAME).getFile();
- ISdcCsarHelper sdcHelper = factory
- .getSdcCsarHelper(path);
+ ISdcCsarHelper sdcHelper = factory.getSdcCsarHelper(path);
Mockito.when(csarHandler.getSdcCsarHelper()).thenReturn(sdcHelper);
// Mockito.when(csarHandler.getSdcCsarHelper()).thenReturn(csarHelper);
@@ -154,11 +161,11 @@ public class CsarInstallerItCase {
Mockito.when(notificationData.getServiceArtifacts()).thenReturn(serviceArtifactsList);
CsarHandler csarHandler = new CsarHandler(notificationData, "", "");
- csarHandler.setFilePath(Thread.currentThread().getContextClassLoader()
- .getResource(CSAR_ARTIFACT_NAME).getFile());
+ csarHandler
+ .setFilePath(Thread.currentThread().getContextClassLoader().getResource(CSAR_ARTIFACT_NAME).getFile());
Optional<String> testyaml = csarHandler.getPolicyModelYaml();
- Assert.assertEquals(testyaml, Optional.ofNullable(ResourceFileUtil
- .getResourceAsString("example/sdc/expected-result/policy-data.yaml")));
+ Assert.assertEquals(testyaml,
+ Optional.ofNullable(ResourceFileUtil.getResourceAsString("example/sdc/expected-result/policy-data.yaml")));
}
@Test
@@ -174,6 +181,7 @@ public class CsarInstallerItCase {
@Test
@Transactional
+ @Rollback(value = false)
public void testInstallTheCsarTca() throws SdcArtifactInstallerException, SdcToscaParserException,
CsarHandlerException, IOException, JSONException, InterruptedException, PolicyModelException {
String generatedName = RandomStringUtils.randomAlphanumeric(5);
@@ -198,6 +206,27 @@ public class CsarInstallerItCase {
assertThat(loop.getOperationalPolicies()).hasSize(1);
assertThat(loop.getModelPropertiesJson().get("serviceDetails")).isNotNull();
assertThat(loop.getModelPropertiesJson().get("resourceDetails")).isNotNull();
+ JSONAssert.assertEquals(ResourceFileUtil.getResourceAsString("tosca/model-properties.json"),
+ JsonUtils.GSON.toJson(loop.getModelPropertiesJson()), true);
+ assertThat(((MicroServicePolicy) (loop.getMicroServicePolicies().toArray()[0])).getModelType()).isNotEmpty();
+
+ loop = loopsRepo
+ .findById(Loop.generateLoopName(generatedName, "1.0", RESOURCE_INSTANCE_NAME_RESOURCE1, "tca_3.yaml"))
+ .get();
+ assertThat(((MicroServicePolicy) (loop.getMicroServicePolicies().toArray()[0])).getModelType()).isNotEmpty();
+
+ loop = loopsRepo
+ .findById(Loop.generateLoopName(generatedName, "1.0", RESOURCE_INSTANCE_NAME_RESOURCE2, "tca_2.yaml"))
+ .get();
+ assertThat(((MicroServicePolicy) (loop.getMicroServicePolicies().toArray()[0])).getModelType()).isNotEmpty();
}
+ @Test(expected = SdcArtifactInstallerException.class)
+ @Transactional
+ public void shouldThrowSdcArtifactInstallerException() throws SdcArtifactInstallerException, SdcToscaParserException, IOException, InterruptedException, PolicyModelException {
+ String generatedName = RandomStringUtils.randomAlphanumeric(5);
+ CsarHandler csarHandler = buildFakeCsarHandler(generatedName);
+ Mockito.when(csarHandler.getMapOfBlueprints()).thenThrow(IOException.class);
+ csarInstaller.installTheCsar(csarHandler);
+ }
}
diff --git a/src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java b/src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java
new file mode 100644
index 000000000..a2c97e0c0
--- /dev/null
+++ b/src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java
@@ -0,0 +1,244 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 Nokia Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.loop;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonObject;
+
+import java.io.IOException;
+import java.util.HashSet;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.json.simple.parser.ParseException;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.onap.clamp.clds.Application;
+import org.onap.clamp.loop.LoopOperation.TempLoopState;
+import org.onap.clamp.policy.microservice.MicroServicePolicy;
+import org.onap.clamp.policy.operational.OperationalPolicy;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = Application.class)
+public class LoopOperationTestItCase {
+
+ private Gson gson = new GsonBuilder().setPrettyPrinting().excludeFieldsWithoutExposeAnnotation().create();
+ @Autowired
+ LoopService loopService;
+
+ private Loop createTestLoop() {
+ String yaml = "imports:\n" + " - \"http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\"\n"
+ + "node_templates:\n" + " docker_service_host:\n" + " type: dcae.nodes.SelectedDockerHost";
+
+ Loop loopTest = new Loop("ControlLoopTest", yaml, "<xml></xml>");
+ loopTest.setGlobalPropertiesJson(
+ new Gson().fromJson("{\"dcaeDeployParameters\":" + "{\"policy_id\": \"name\"}}", JsonObject.class));
+ loopTest.setLastComputedState(LoopState.DESIGN);
+ loopTest.setDcaeDeploymentId("123456789");
+ loopTest.setDcaeDeploymentStatusUrl("http4://localhost:8085");
+ loopTest.setDcaeBlueprintId("UUID-blueprint");
+
+ MicroServicePolicy microServicePolicy = new MicroServicePolicy("configPolicyTest", "",
+ "tosca_definitions_version: tosca_simple_yaml_1_0_0", true,
+ gson.fromJson("{\"configtype\":\"json\"}", JsonObject.class), new HashSet<>());
+ microServicePolicy.setProperties(new Gson().fromJson("{\"param1\":\"value1\"}", JsonObject.class));
+
+ loopTest.addMicroServicePolicy(microServicePolicy);
+ return loopTest;
+ }
+
+ @Test
+ public void testAnalysePolicyResponse() {
+ LoopOperation loopOp = new LoopOperation(loopService);
+ String status1 = loopOp.analysePolicyResponse(200);
+ String status2 = loopOp.analysePolicyResponse(404);
+ String status3 = loopOp.analysePolicyResponse(500);
+ String status4 = loopOp.analysePolicyResponse(503);
+
+ // then
+ assertThat(status1).isEqualTo("SUBMITTED");
+ assertThat(status2).isEqualTo("NOT_SUBMITTED");
+ assertThat(status3).isEqualTo("IN_ERROR");
+ assertThat(status4).isEqualTo("IN_ERROR");
+ }
+
+ @Test
+ public void testGetOperationalPolicyName() {
+ LoopOperation loopOp = new LoopOperation(loopService);
+ Loop loop = this.createTestLoop();
+ String opName1 = loopOp.getOperationalPolicyName(loop);
+ assertThat(opName1).isNull();
+
+ OperationalPolicy opPolicy1 = new OperationalPolicy("OperationalPolicyTest1", null,
+ gson.fromJson("{\"type\":\"Operational\"}", JsonObject.class));
+ loop.addOperationalPolicy(opPolicy1);
+ String opName2 = loopOp.getOperationalPolicyName(loop);
+ assertThat(opName2).isEqualTo("OperationalPolicyTest1");
+ }
+
+ @Test
+ public void testAnalyseDcaeResponse() throws ParseException {
+ LoopOperation loopOp = new LoopOperation(loopService);
+ String dcaeStatus1 = loopOp.analyseDcaeResponse(null, null);
+ assertThat(dcaeStatus1).isEqualTo("NOT_DEPLOYED");
+
+ String dcaeStatus2 = loopOp.analyseDcaeResponse(null, 500);
+ assertThat(dcaeStatus2).isEqualTo("IN_ERROR");
+
+ String dcaeStatus3 = loopOp.analyseDcaeResponse(null, 404);
+ assertThat(dcaeStatus3).isEqualTo("NOT_DEPLOYED");
+
+ Exchange camelExchange = Mockito.mock(Exchange.class);
+ Message mockMessage = Mockito.mock(Message.class);
+ Mockito.when(camelExchange.getIn()).thenReturn(mockMessage);
+ Mockito.when(mockMessage.getBody(String.class))
+ .thenReturn("{\"operationType\":\"install\",\"status\":\"succeeded\"}");
+ String dcaeStatus4 = loopOp.analyseDcaeResponse(camelExchange, 200);
+ assertThat(dcaeStatus4).isEqualTo("DEPLOYED");
+
+ Mockito.when(mockMessage.getBody(String.class))
+ .thenReturn("{\"operationType\":\"install\",\"status\":\"processing\"}");
+ String dcaeStatus5 = loopOp.analyseDcaeResponse(camelExchange, 200);
+ assertThat(dcaeStatus5).isEqualTo("PROCESSING");
+
+ Mockito.when(mockMessage.getBody(String.class))
+ .thenReturn("{\"operationType\":\"install\",\"status\":\"failed\"}");
+ String dcaeStatus6 = loopOp.analyseDcaeResponse(camelExchange, 200);
+ assertThat(dcaeStatus6).isEqualTo("IN_ERROR");
+
+ Mockito.when(mockMessage.getBody(String.class))
+ .thenReturn("{\"operationType\":\"uninstall\",\"status\":\"succeeded\"}");
+ String dcaeStatus7 = loopOp.analyseDcaeResponse(camelExchange, 200);
+ assertThat(dcaeStatus7).isEqualTo("NOT_DEPLOYED");
+
+ Mockito.when(mockMessage.getBody(String.class))
+ .thenReturn("{\"operationType\":\"uninstall\",\"status\":\"processing\"}");
+ String dcaeStatus8 = loopOp.analyseDcaeResponse(camelExchange, 200);
+ assertThat(dcaeStatus8).isEqualTo("PROCESSING");
+
+ Mockito.when(mockMessage.getBody(String.class))
+ .thenReturn("{\"operationType\":\"uninstall\",\"status\":\"failed\"}");
+ String dcaeStatus9 = loopOp.analyseDcaeResponse(camelExchange, 200);
+ assertThat(dcaeStatus9).isEqualTo("IN_ERROR");
+ }
+
+ @Test
+ public void testUpdateLoopStatus() {
+ LoopOperation loopOp = new LoopOperation(loopService);
+ Loop loop = this.createTestLoop();
+ loopService.saveOrUpdateLoop(loop);
+ LoopState newState1 = loopOp.updateLoopStatus(loop, TempLoopState.SUBMITTED, TempLoopState.DEPLOYED);
+ LoopState dbState1 = loopService.getLoop(loop.getName()).getLastComputedState();
+ assertThat(newState1).isEqualTo(LoopState.DEPLOYED);
+ assertThat(dbState1).isEqualTo(LoopState.DEPLOYED);
+
+ LoopState newState2 = loopOp.updateLoopStatus(loop, TempLoopState.SUBMITTED, TempLoopState.NOT_DEPLOYED);
+ LoopState dbState2 = loopService.getLoop(loop.getName()).getLastComputedState();
+ assertThat(newState2).isEqualTo(LoopState.SUBMITTED);
+ assertThat(dbState2).isEqualTo(LoopState.SUBMITTED);
+
+ LoopState newState3 = loopOp.updateLoopStatus(loop, TempLoopState.SUBMITTED, TempLoopState.PROCESSING);
+ assertThat(newState3).isEqualTo(LoopState.WAITING);
+
+ LoopState newState4 = loopOp.updateLoopStatus(loop, TempLoopState.SUBMITTED, TempLoopState.IN_ERROR);
+ assertThat(newState4).isEqualTo(LoopState.IN_ERROR);
+
+ LoopState newState5 = loopOp.updateLoopStatus(loop, TempLoopState.NOT_SUBMITTED, TempLoopState.DEPLOYED);
+ assertThat(newState5).isEqualTo(LoopState.IN_ERROR);
+
+ LoopState newState6 = loopOp.updateLoopStatus(loop, TempLoopState.NOT_SUBMITTED, TempLoopState.PROCESSING);
+ assertThat(newState6).isEqualTo(LoopState.IN_ERROR);
+
+ LoopState newState7 = loopOp.updateLoopStatus(loop, TempLoopState.NOT_SUBMITTED, TempLoopState.NOT_DEPLOYED);
+ assertThat(newState7).isEqualTo(LoopState.DESIGN);
+
+ LoopState newState8 = loopOp.updateLoopStatus(loop, TempLoopState.IN_ERROR, TempLoopState.DEPLOYED);
+ assertThat(newState8).isEqualTo(LoopState.IN_ERROR);
+
+ LoopState newState9 = loopOp.updateLoopStatus(loop, TempLoopState.IN_ERROR, TempLoopState.NOT_DEPLOYED);
+ assertThat(newState9).isEqualTo(LoopState.IN_ERROR);
+
+ LoopState newState10 = loopOp.updateLoopStatus(loop, TempLoopState.IN_ERROR, TempLoopState.PROCESSING);
+ assertThat(newState10).isEqualTo(LoopState.IN_ERROR);
+
+ LoopState newState11 = loopOp.updateLoopStatus(loop, TempLoopState.IN_ERROR, TempLoopState.IN_ERROR);
+ assertThat(newState11).isEqualTo(LoopState.IN_ERROR);
+ }
+
+ @Test
+ public void testUpdateLoopInfo() throws ParseException {
+ Loop loop = this.createTestLoop();
+ loopService.saveOrUpdateLoop(loop);
+
+ Exchange camelExchange = Mockito.mock(Exchange.class);
+ Message mockMessage = Mockito.mock(Message.class);
+ Mockito.when(camelExchange.getIn()).thenReturn(mockMessage);
+ Mockito.when(mockMessage.getBody(String.class))
+ .thenReturn("{\"links\":{\"status\":\"http://testhost/dcae-operationstatus\",\"test2\":\"test2\"}}");
+
+ LoopOperation loopOp = new LoopOperation(loopService);
+ loopOp.updateLoopInfo(camelExchange, loop, "testNewId");
+
+ Loop newLoop = loopService.getLoop(loop.getName());
+ String newDeployId = newLoop.getDcaeDeploymentId();
+ String newDeploymentStatusUrl = newLoop.getDcaeDeploymentStatusUrl();
+
+ assertThat(newDeployId).isEqualTo("testNewId");
+ assertThat(newDeploymentStatusUrl).isEqualTo("http4://testhost/dcae-operationstatus");
+ }
+
+ @Test
+ public void testGetDeploymentId() {
+ Loop loop = this.createTestLoop();
+ LoopOperation loopOp = new LoopOperation(loopService);
+ String deploymentId1 = loopOp.getDeploymentId(loop);
+ assertThat(deploymentId1).isEqualTo("123456789");
+
+ loop.setDcaeDeploymentId(null);
+ String deploymentId2 = loopOp.getDeploymentId(loop);
+ assertThat(deploymentId2).startsWith("CLAMP_");
+
+ loop.setDcaeDeploymentId("");
+ String deploymentId3 = loopOp.getDeploymentId(loop);
+ assertThat(deploymentId3).startsWith("CLAMP_");
+ assertThat(deploymentId3).isNotEqualTo(deploymentId2);
+ }
+
+ @Test
+ public void testGetDeployPayload() throws IOException {
+ Loop loop = this.createTestLoop();
+ LoopOperation loopOp = new LoopOperation(loopService);
+ String deploymentPayload = loopOp.getDeployPayload(loop);
+
+ String expectedPayload = "{\"serviceTypeId\":\"UUID-blueprint\",\"inputs\":{\"policy_id\":\"name\"}}";
+ assertThat(deploymentPayload).isEqualTo(expectedPayload);
+ }
+} \ No newline at end of file
diff --git a/src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java b/src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java
index c511f3415..68925a913 100644
--- a/src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java
+++ b/src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java
@@ -37,7 +37,7 @@ public class MicroServicePayloadTest {
@Test
public void testPayloadConstruction() throws IOException {
- MicroServicePolicy policy = new MicroServicePolicy("testPolicy", "onap.policy.monitoring.cdap.tca.hi.lo.app",
+ MicroServicePolicy policy = new MicroServicePolicy("testPolicy", "onap.policies.monitoring.cdap.tca.hi.lo.app",
ResourceFileUtil.getResourceAsString("tosca/tosca_example.yaml"), false, new HashSet<>());
policy.setProperties(JsonUtils.GSON.fromJson(
ResourceFileUtil.getResourceAsString("tosca/micro-service-policy-properties.json"), JsonObject.class));
diff --git a/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java b/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java
index 76e29c31f..8972e5117 100644
--- a/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java
+++ b/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java
@@ -33,6 +33,7 @@ import java.util.Map;
import org.junit.Test;
import org.onap.clamp.clds.util.ResourceFileUtil;
+import org.onap.clamp.policy.operational.LegacyOperationalPolicy;
import org.onap.clamp.policy.operational.OperationalPolicy;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -43,8 +44,20 @@ public class OperationalPolicyPayloadTest {
JsonObject jsonConfig = new GsonBuilder().create().fromJson(
ResourceFileUtil.getResourceAsString("tosca/operational-policy-properties.json"), JsonObject.class);
OperationalPolicy policy = new OperationalPolicy("testPolicy", null, jsonConfig);
- assertThat(policy.createPolicyPayload())
+
+ assertThat(policy.createPolicyPayloadYaml())
.isEqualTo(ResourceFileUtil.getResourceAsString("tosca/operational-policy-payload.yaml"));
+
+ assertThat(policy.createPolicyPayload())
+ .isEqualTo(ResourceFileUtil.getResourceAsString("tosca/operational-policy-payload.json"));
+ }
+
+ @Test
+ public void testLegacyOperationalPolicyPayloadConstruction() throws IOException {
+ JsonObject jsonConfig = new GsonBuilder().create().fromJson(
+ ResourceFileUtil.getResourceAsString("tosca/operational-policy-properties.json"), JsonObject.class);
+ assertThat(LegacyOperationalPolicy.createPolicyPayloadYamlLegacy(jsonConfig.get("operational_policy")))
+ .isEqualTo(ResourceFileUtil.getResourceAsString("tosca/operational-policy-payload-legacy.yaml"));
}
@Test
diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties
index 9f711e3e9..7b29e179f 100644
--- a/src/test/resources/application.properties
+++ b/src/test/resources/application.properties
@@ -1,109 +1,109 @@
-###
-# ============LICENSE_START=======================================================
-# ONAP CLAMP
-# ================================================================================
-# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
-# reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END============================================
-# ===================================================================
-#
-###
-
-info.build.artifact=@project.artifactId@
-info.build.name=@project.name@
-info.build.description=@project.description@
-info.build.version=@project.version@
-
-### Set the port for HTTP or HTTPS protocol (Controlled by Spring framework, only one at a time).
-### (See below for the parameter 'server.http.port' if you want to have both enabled)
-### To have only HTTP, keep the lines server.ssl.* commented
-### To have only HTTPS enabled, uncomment the server.ssl.* lines and specify a right keystore location
-server.port=${clamp.it.tests.http}
-### Settings for HTTPS (this automatically enables the HTTPS on the port 'server.port')
-#server.ssl.key-store=file:/tmp/mykey.jks
-#server.ssl.key-store-password=pass
-#server.ssl.key-password=pass
-
-### In order to be user friendly when HTTPS is enabled,
-### you can add another HTTP port that will be automatically redirected to HTTPS
-### by enabling this parameter (server.http.port) and set it to another port (80 or 8080, 8090, etc ...)
-#server.http-to-https-redirection.port=8090
-
-### HTTP Example:
-###--------------
-### server.port=8080
-
-### HTTPS Example:
-### --------------
-### server.port=8443
-### server.ssl.key-store=file:/tmp/mykey.jks
-### server.ssl.key-store-password=mypass
-### server.ssl.key-password=mypass
-
-### HTTP (Redirected to HTTPS) and HTTPS Example:
-### --------------------------------------------
-### server.port=8443 <-- The HTTPS port
-### server.ssl.key-store=file:/tmp/mykey.jks
-### server.ssl.key-store-password=mypass
-### server.ssl.key-password=mypass
-### server.http-to-https-redirection.port=8090 <-- The HTTP port
-
-server.servlet.context-path=/
-#Modified engine-rest applicationpath
-spring.profiles.active=clamp-default,clamp-default-user
-spring.http.converters.preferred-json-mapper=gson
-
-#The max number of active threads in this pool
-server.tomcat.max-threads=200
-#The minimum number of threads always kept alive
-server.tomcat.min-Spare-Threads=25
-#The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads
-server.tomcat.max-idle-time=60000
-
-#Servlet context parameters
-server.context_parameters.p-name=value #context parameter with p-name as key and value as value.
-
-camel.springboot.consumer-template-cache-size=1000
-camel.springboot.producer-template-cache-size=1000
-# JMX enabled to have Camel Swagger runtime working
-camel.springboot.jmx-enabled=true
-camel.defaultthreadpool.poolsize=10
-camel.defaultthreadpool.maxpoolsize=20
-camel.defaultthreadpool.maxqueuesize=1000
-camel.defaultthreadpool.keepaliveTime=60
-camel.defaultthreadpool.rejectpolicy=CallerRuns
-#camel.springboot.xmlRoutes = false
-camel.springboot.xmlRoutes=classpath:/clds/camel/routes/*.xml
-camel.springboot.xmlRests=classpath:/clds/camel/rest/*.xml
-#camel.springboot.typeConversion = false
-
-#clds datasource connection details
-spring.datasource.cldsdb.driverClassName=org.mariadb.jdbc.Driver
-spring.datasource.cldsdb.url=jdbc:mariadb:sequential://localhost:3306,localhost:${docker.mariadb.port.host}/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3
-spring.datasource.cldsdb.username=clds
-spring.datasource.cldsdb.password=4c90a0b48204383f4283448d23e0b885a47237b2a23588e7c4651604f51c1067
-spring.datasource.cldsdb.validationQuery=SELECT 1
-spring.datasource.cldsdb.validationQueryTimeout=20000
-spring.datasource.cldsdb.validationInterval=30000
-spring.datasource.cldsdb.testWhileIdle = true
-spring.datasource.cldsdb.minIdle = 0
-spring.datasource.cldsdb.initialSize=0
-# Automatically test whether a connection provided is good or not
-spring.datasource.cldsdb.testOnBorrow=true
-spring.datasource.cldsdb.ignoreExceptionOnPreLoad=true
-
+###
+# ============LICENSE_START=======================================================
+# ONAP CLAMP
+# ================================================================================
+# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
+# reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END============================================
+# ===================================================================
+#
+###
+
+info.build.artifact=@project.artifactId@
+info.build.name=@project.name@
+info.build.description=@project.description@
+info.build.version=@project.version@
+
+### Set the port for HTTP or HTTPS protocol (Controlled by Spring framework, only one at a time).
+### (See below for the parameter 'server.http.port' if you want to have both enabled)
+### To have only HTTP, keep the lines server.ssl.* commented
+### To have only HTTPS enabled, uncomment the server.ssl.* lines and specify a right keystore location
+server.port=${clamp.it.tests.http}
+### Settings for HTTPS (this automatically enables the HTTPS on the port 'server.port')
+#server.ssl.key-store=file:/tmp/mykey.jks
+#server.ssl.key-store-password=pass
+#server.ssl.key-password=pass
+
+### In order to be user friendly when HTTPS is enabled,
+### you can add another HTTP port that will be automatically redirected to HTTPS
+### by enabling this parameter (server.http.port) and set it to another port (80 or 8080, 8090, etc ...)
+#server.http-to-https-redirection.port=8090
+
+### HTTP Example:
+###--------------
+### server.port=8080
+
+### HTTPS Example:
+### --------------
+### server.port=8443
+### server.ssl.key-store=file:/tmp/mykey.jks
+### server.ssl.key-store-password=mypass
+### server.ssl.key-password=mypass
+
+### HTTP (Redirected to HTTPS) and HTTPS Example:
+### --------------------------------------------
+### server.port=8443 <-- The HTTPS port
+### server.ssl.key-store=file:/tmp/mykey.jks
+### server.ssl.key-store-password=mypass
+### server.ssl.key-password=mypass
+### server.http-to-https-redirection.port=8090 <-- The HTTP port
+
+server.servlet.context-path=/
+#Modified engine-rest applicationpath
+spring.profiles.active=clamp-default,clamp-default-user
+spring.http.converters.preferred-json-mapper=gson
+
+#The max number of active threads in this pool
+server.tomcat.max-threads=200
+#The minimum number of threads always kept alive
+server.tomcat.min-Spare-Threads=25
+#The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads
+server.tomcat.max-idle-time=60000
+
+#Servlet context parameters
+server.context_parameters.p-name=value #context parameter with p-name as key and value as value.
+
+camel.springboot.consumer-template-cache-size=1000
+camel.springboot.producer-template-cache-size=1000
+# JMX enabled to have Camel Swagger runtime working
+camel.springboot.jmx-enabled=true
+camel.defaultthreadpool.poolsize=10
+camel.defaultthreadpool.maxpoolsize=20
+camel.defaultthreadpool.maxqueuesize=1000
+camel.defaultthreadpool.keepaliveTime=60
+camel.defaultthreadpool.rejectpolicy=CallerRuns
+#camel.springboot.xmlRoutes = false
+camel.springboot.xmlRoutes=classpath:/clds/camel/routes/*.xml
+camel.springboot.xmlRests=classpath:/clds/camel/rest/*.xml
+#camel.springboot.typeConversion = false
+
+#clds datasource connection details
+spring.datasource.cldsdb.driverClassName=org.mariadb.jdbc.Driver
+spring.datasource.cldsdb.url=jdbc:mariadb:sequential://localhost:3306,localhost:${docker.mariadb.port.host}/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3
+spring.datasource.cldsdb.username=clds
+spring.datasource.cldsdb.password=4c90a0b48204383f4283448d23e0b885a47237b2a23588e7c4651604f51c1067
+spring.datasource.cldsdb.validationQuery=SELECT 1
+spring.datasource.cldsdb.validationQueryTimeout=20000
+spring.datasource.cldsdb.validationInterval=30000
+spring.datasource.cldsdb.testWhileIdle = true
+spring.datasource.cldsdb.minIdle = 0
+spring.datasource.cldsdb.initialSize=0
+# Automatically test whether a connection provided is good or not
+spring.datasource.cldsdb.testOnBorrow=true
+spring.datasource.cldsdb.ignoreExceptionOnPreLoad=true
+
spring.jpa.properties.javax.persistence.schema-generation.database.action=drop-and-create
#spring.jpa.properties.javax.persistence.schema-generation.create-source=metadata
#spring.jpa.properties.javax.persistence.schema-generation.scripts.action=create
@@ -118,108 +118,117 @@ spring.jpa.properties.hibernate.use-new-id-generator-mappings=true
# Whether to enable logging of SQL statements.
spring.jpa.show-sql=true
-#Async Executor default Parameters
-async.core.pool.size=10
-async.max.pool.size=20
-async.queue.capacity=500
-
-#For EELF logback file
-#com.att.eelf.logging.path=
-clamp.config.logback.filename=logback-default.xml
-#The log folder that will be used in logback.xml file
-clamp.config.log.path=log
-clamp.config.files.systemProperties=classpath:/system.properties
-clamp.config.files.cldsUsers=classpath:/clds/clds-users.json
-clamp.config.files.globalProperties=classpath:/clds/templates/globalProperties.json
-clamp.config.files.sdcController=classpath:/clds/sdc-controllers-config.json
-
-# Properties for Clamp
-# DCAE request build properties
-#
-clamp.config.dcae.template=classpath:/clds/templates/dcae-template.json
-clamp.config.dcae.deployment.template=classpath:/clds/templates/dcae-deployment-template.json
-#
-#
-# Configuration Settings for Policy Engine Components
-clamp.config.policy.url=http://localhost:${docker.http-cache.port.host}
-clamp.config.policy.userName=test
-clamp.config.policy.password=test
-clamp.config.policy.pdpUrl1=http://localhost:${docker.http-cache.port.host}/pdp/ , testpdp, alpha123
-clamp.config.policy.pdpUrl2=http://localhost:${docker.http-cache.port.host}/pdp/ , testpdp, alpha123
-clamp.config.policy.papUrl=http://localhost:${docker.http-cache.port.host}/pap/ , testpap, alpha123
-clamp.config.policy.notificationType=websocket
-clamp.config.policy.notificationUebServers=localhost
-clamp.config.policy.notificationTopic=
-clamp.config.policy.clientId=python
-# base64 encoding
-clamp.config.policy.clientKey=dGVzdA==
-#DEVL for development
-#TEST for Test environments
-#PROD for prod environments
-clamp.config.policy.policyEnvironment=DEVL
-# General Policy request properties
-#
-clamp.config.policy.onap.name=DCAE
-clamp.config.policy.pdp.group=default
-clamp.config.policy.ms.type=MicroService
-clamp.config.policy.ms.policyNamePrefix=Config_MS_
-clamp.config.policy.op.policyNamePrefix=Config_BRMS_Param_
-clamp.config.policy.base.policyNamePrefix=Config_
-clamp.config.policy.op.type=BRMS_Param
-
-clamp.config.import.tosca.model=false
-clamp.config.tosca.policyTypes=tca
-clamp.config.tosca.filePath=/tmp/tosca-models
-
-# TCA MicroService Policy request build properties
-#
-clamp.config.tca.policyid.prefix=DCAE.Config_
-clamp.config.tca.policy.template=classpath:/clds/templates/tca-policy-template.json
-clamp.config.tca.template=classpath:/clds/templates/tca-template.json
-clamp.config.tca.thresholds.template=classpath:/clds/templates/tca-thresholds-template.json
-
-#
-#
-# Operational Policy request build properties
-#
-clamp.config.op.policyDescription=from clds
-# default
-clamp.config.op.templateName=ClosedLoopControlName
-clamp.config.op.operationTopic=APPC-CL
-clamp.config.op.notificationTopic=POLICY-CL-MGT
-clamp.config.op.controller=amsterdam
-clamp.config.op.policy.appc=APPC
-#
-# Sdc service properties
-#
-clamp.config.sdc.csarFolder = ${project.build.directory}/sdc-tests
-clamp.config.sdc.blueprint.parser.mapping = classpath:/clds/blueprint-parser-mapping.json
-#
-clamp.config.ui.location.default=classpath:/clds/templates/ui-location-default.json
-#
-# if action.test.override is true, then any action will be marked as test=true (even if incoming action request had test=false); otherwise, test flag will be unchanged on the action request
-clamp.config.action.test.override=false
-# if action.insert.test.event is true, then insert event even if the action is set to test
-clamp.config.action.insert.test.event=false
-clamp.config.clds.service.cache.invalidate.after.seconds=120
-
-#DCAE Inventory Url Properties
-clamp.config.dcae.inventory.url=http://localhost:${docker.http-cache.port.host}
-clamp.config.dcae.intentory.retry.interval=100
-clamp.config.dcae.intentory.retry.limit=1
-
-#DCAE Dispatcher Url Properties
-clamp.config.dcae.dispatcher.url=http://localhost:${docker.http-cache.port.host}
-clamp.config.dcae.dispatcher.retry.interval=100
-clamp.config.dcae.dispatcher.retry.limit=1
-
-#Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case !
-clamp.config.security.permission.type.cl=permission-type-cl
-clamp.config.security.permission.type.cl.manage=permission-type-cl-manage
-clamp.config.security.permission.type.cl.event=permission-type-cl-event
-clamp.config.security.permission.type.filter.vf=permission-type-filter-vf
-clamp.config.security.permission.type.template=permission-type-template
-clamp.config.security.permission.type.tosca=permission-type-tosca
-#This one indicates the type of instances (dev|prod|perf...), this must be set accordingly in clds-users.properties
-clamp.config.security.permission.instance=dev
+#Async Executor default Parameters
+async.core.pool.size=10
+async.max.pool.size=20
+async.queue.capacity=500
+
+#For EELF logback file
+#com.att.eelf.logging.path=
+clamp.config.logback.filename=logback-default.xml
+#The log folder that will be used in logback.xml file
+clamp.config.log.path=log
+clamp.config.files.systemProperties=classpath:/system.properties
+clamp.config.files.cldsUsers=classpath:/clds/clds-users.json
+clamp.config.files.globalProperties=classpath:/clds/templates/globalProperties.json
+clamp.config.files.sdcController=classpath:/clds/sdc-controllers-config.json
+
+# Properties for Clamp
+# DCAE request build properties
+#
+clamp.config.dcae.template=classpath:/clds/templates/dcae-template.json
+clamp.config.dcae.deployment.template=classpath:/clds/templates/dcae-deployment-template.json
+#
+#
+# Configuration Settings for Policy Engine Components
+clamp.config.policy.api.url=http4://localhost:${docker.http-cache.port.host}
+clamp.config.policy.api.userName=healthcheck
+clamp.config.policy.api.password=zb!XztG34
+clamp.config.policy.pap.url=http4://localhost:${docker.http-cache.port.host}
+clamp.config.policy.pap.userName=healthcheck
+clamp.config.policy.pap.password=zb!XztG34
+
+clamp.config.policy.pdpUrl1=http://localhost:${docker.http-cache.port.host}/pdp/ , testpdp, alpha123
+clamp.config.policy.pdpUrl2=http://localhost:${docker.http-cache.port.host}/pdp/ , testpdp, alpha123
+clamp.config.policy.papUrl=http://localhost:${docker.http-cache.port.host}/pap/ , testpap, alpha123
+clamp.config.policy.notificationType=websocket
+clamp.config.policy.notificationUebServers=localhost
+clamp.config.policy.notificationTopic=
+clamp.config.policy.clientId=python
+# base64 encoding
+clamp.config.policy.clientKey=dGVzdA==
+#DEVL for development
+#TEST for Test environments
+#PROD for prod environments
+clamp.config.policy.policyEnvironment=DEVL
+# General Policy request properties
+#
+clamp.config.policy.onap.name=DCAE
+clamp.config.policy.pdp.group=default
+clamp.config.policy.ms.type=MicroService
+clamp.config.policy.ms.policyNamePrefix=Config_MS_
+clamp.config.policy.op.policyNamePrefix=Config_BRMS_Param_
+clamp.config.policy.base.policyNamePrefix=Config_
+clamp.config.policy.op.type=BRMS_Param
+
+clamp.config.import.tosca.model=false
+clamp.config.tosca.policyTypes=tca
+clamp.config.tosca.filePath=/tmp/tosca-models
+
+# TCA MicroService Policy request build properties
+#
+clamp.config.tca.policyid.prefix=DCAE.Config_
+clamp.config.tca.policy.template=classpath:/clds/templates/tca-policy-template.json
+clamp.config.tca.template=classpath:/clds/templates/tca-template.json
+clamp.config.tca.thresholds.template=classpath:/clds/templates/tca-thresholds-template.json
+
+#
+#
+# Operational Policy request build properties
+#
+clamp.config.op.policyDescription=from clds
+# default
+clamp.config.op.templateName=ClosedLoopControlName
+clamp.config.op.operationTopic=APPC-CL
+clamp.config.op.notificationTopic=POLICY-CL-MGT
+clamp.config.op.controller=amsterdam
+clamp.config.op.policy.appc=APPC
+#
+# Sdc service properties
+#
+clamp.config.sdc.csarFolder = ${project.build.directory}/sdc-tests
+clamp.config.sdc.blueprint.parser.mapping = classpath:/clds/blueprint-parser-mapping.json
+#
+clamp.config.ui.location.default=classpath:/clds/templates/ui-location-default.json
+#
+# if action.test.override is true, then any action will be marked as test=true (even if incoming action request had test=false); otherwise, test flag will be unchanged on the action request
+clamp.config.action.test.override=false
+# if action.insert.test.event is true, then insert event even if the action is set to test
+clamp.config.action.insert.test.event=false
+clamp.config.clds.service.cache.invalidate.after.seconds=120
+
+#DCAE Inventory Url Properties
+clamp.config.dcae.inventory.url=http://localhost:${docker.http-cache.port.host}
+clamp.config.dcae.intentory.retry.interval=100
+clamp.config.dcae.intentory.retry.limit=1
+
+#DCAE Dispatcher Url Properties
+clamp.config.dcae.dispatcher.url=http://localhost:${docker.http-cache.port.host}
+clamp.config.dcae.dispatcher.retry.interval=100
+clamp.config.dcae.dispatcher.retry.limit=1
+
+#DCAE Deployment Url Properties
+clamp.config.dcae.deployment.url=http4://localhost:${docker.http-cache.port.host}
+clamp.config.dcae.deployment.userName=test
+clamp.config.dcae.deployment.password=test
+
+#Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case !
+clamp.config.security.permission.type.cl=permission-type-cl
+clamp.config.security.permission.type.cl.manage=permission-type-cl-manage
+clamp.config.security.permission.type.cl.event=permission-type-cl-event
+clamp.config.security.permission.type.filter.vf=permission-type-filter-vf
+clamp.config.security.permission.type.template=permission-type-template
+clamp.config.security.permission.type.tosca=permission-type-tosca
+#This one indicates the type of instances (dev|prod|perf...), this must be set accordingly in clds-users.properties
+clamp.config.security.permission.instance=dev
clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal \ No newline at end of file
diff --git a/src/test/resources/clds/blueprint-with-microservice-chain.yaml b/src/test/resources/clds/blueprint-with-microservice-chain.yaml
index 4a7e5d7aa..fa2d72052 100644
--- a/src/test/resources/clds/blueprint-with-microservice-chain.yaml
+++ b/src/test/resources/clds/blueprint-with-microservice-chain.yaml
@@ -31,7 +31,7 @@ node_templates:
service_component_name_override: second_app
image: { get_input: second_app_docker_image }
policy_id:
- policy_type_id: type2
+ policy_model_id: "type2"
interfaces:
cloudify.interfaces.lifecycle:
start:
@@ -56,7 +56,7 @@ node_templates:
image: { get_input: first_app_docker_image }
container_port: 6565
policy_id:
- policy_type_id: type1
+ policy_model_id: "type1"
interfaces:
cloudify.interfaces.lifecycle:
start:
@@ -81,7 +81,7 @@ node_templates:
image: { get_input: third_app_docker_image }
container_port: 443
policy_id:
- policy_type_id: type3
+ policy_model_id: "type3"
interfaces:
cloudify.interfaces.lifecycle:
start:
diff --git a/src/test/resources/clds/clds-parse-exception.json b/src/test/resources/clds/clds-parse-exception.json
new file mode 100644
index 000000000..1c06a3947
--- /dev/null
+++ b/src/test/resources/clds/clds-parse-exception.json
@@ -0,0 +1 @@
+This is not json \ No newline at end of file
diff --git a/src/test/resources/clds/single-microservice-fragment-valid.yaml b/src/test/resources/clds/single-microservice-fragment-valid.yaml
index 269ee5062..2c1680717 100644
--- a/src/test/resources/clds/single-microservice-fragment-valid.yaml
+++ b/src/test/resources/clds/single-microservice-fragment-valid.yaml
@@ -6,7 +6,7 @@ second_app:
image: { get_input: second_app_docker_image }
name: second_app
policy_id:
- policy_type_id: type1
+ policy_model_id: "type1"
interfaces:
cloudify.interfaces.lifecycle:
start:
diff --git a/src/test/resources/example/sdc/blueprint-dcae/prop-text-for-tca-2.json b/src/test/resources/example/sdc/blueprint-dcae/prop-text-for-tca-2.json
index 41ca2de22..d7a54162f 100644
--- a/src/test/resources/example/sdc/blueprint-dcae/prop-text-for-tca-2.json
+++ b/src/test/resources/example/sdc/blueprint-dcae/prop-text-for-tca-2.json
@@ -27,23 +27,22 @@
{
"name": "deployParameters",
"value": {
- "dh_override": "component_dockerhost",
- "dh_location_id": "zone1",
- "aaiEnrichmentHost": "none",
- "aaiEnrichmentPort": 8443,
- "enableAAIEnrichment": false,
- "dmaap_host": "dmaap.onap-message-router",
- "dmaap_port": 3904,
+ "aaiEnrichmentHost": "aai.onap.svc.cluster.local",
+ "aaiEnrichmentPort": "8443",
+ "enableAAIEnrichment": true,
+ "dmaap_host": "message-router.onap",
+ "dmaap_port": "3904",
"enableRedisCaching": false,
- "redisHosts": "",
- "tag_version": "nexus3.onap.org:10001/onap//onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0",
- "consul_host": "consul-server.onap-consul",
+ "redisHosts": "dcae-redis.onap.svc.cluster.local:6379",
+ "tag_version": "nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.1.1",
+ "consul_host": "consul-server.onap",
"consul_port": "8500",
- "cbs_host": "config-binding-service.dcae",
+ "cbs_host": "config-binding-servicel",
"cbs_port": "10000",
- "external_port": "32010",
+ "external_port": "32012",
+ "policy_model_id": "onap.policies.monitoring.cdap.tca.hi.lo.app",
"policy_id": "AUTO_GENERATED_POLICY_ID_AT_SUBMIT"
}
}
]
-}
+} \ No newline at end of file
diff --git a/src/test/resources/example/sdc/blueprint-dcae/prop-text-for-tca-3.json b/src/test/resources/example/sdc/blueprint-dcae/prop-text-for-tca-3.json
new file mode 100644
index 000000000..012c46e9c
--- /dev/null
+++ b/src/test/resources/example/sdc/blueprint-dcae/prop-text-for-tca-3.json
@@ -0,0 +1,48 @@
+{
+ "global": [
+ {
+ "name": "service",
+ "value": [
+ "4cc5b45a-1f63-4194-8100-cd8e14248c92"
+ ]
+ },
+ {
+ "name": "vf",
+ "value": [
+ "07e266fc-49ab-4cd7-8378-ca4676f1b9ec"
+ ]
+ },
+ {
+ "name": "actionSet",
+ "value": [
+ "vnfRecipe"
+ ]
+ },
+ {
+ "name": "location",
+ "value": [
+ "DC1"
+ ]
+ },
+ {
+ "name": "deployParameters",
+ "value": {
+ "aaiEnrichmentHost": "aai.onap.svc.cluster.local",
+ "aaiEnrichmentPort": "8443",
+ "enableAAIEnrichment": true,
+ "dmaap_host": "message-router.onap.svc.cluster.local",
+ "dmaap_port": "3904",
+ "enableRedisCaching": false,
+ "redisHosts": "dcae-redis.onap.svc.cluster.local:6379",
+ "tag_version": "nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.1.0-STAGING-latest",
+ "consul_host": "consul-server.onap.svc.cluster.local",
+ "consul_port": "8500",
+ "cbs_host": "config-binding-service.dcae.svc.cluster.local",
+ "cbs_port": "10000",
+ "external_port": "32012",
+ "policy_id": "AUTO_GENERATED_POLICY_ID_AT_SUBMIT",
+ "policy_model_id": "onap.policies.monitoring.cdap.tca.hi.lo.app"
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/src/test/resources/example/sdc/blueprint-dcae/tca.yaml b/src/test/resources/example/sdc/blueprint-dcae/tca.yaml
index b2bf8bb96..0cb9cdb68 100644
--- a/src/test/resources/example/sdc/blueprint-dcae/tca.yaml
+++ b/src/test/resources/example/sdc/blueprint-dcae/tca.yaml
@@ -17,7 +17,7 @@ node_templates:
properties:
policy_id:
get_input: policy_id
- policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.app
+ policy_model_id: "onap.policies.monitoring.cdap.tca.hi.lo.app"
cdap_host_host:
type: dcae.nodes.StreamingAnalytics.SelectedCDAPInfrastructure
properties:
diff --git a/src/test/resources/example/sdc/blueprint-dcae/tca_2.yaml b/src/test/resources/example/sdc/blueprint-dcae/tca_2.yaml
index fb042575b..00ebfe7fe 100644
--- a/src/test/resources/example/sdc/blueprint-dcae/tca_2.yaml
+++ b/src/test/resources/example/sdc/blueprint-dcae/tca_2.yaml
@@ -1,76 +1,92 @@
+#
+# ============LICENSE_START====================================================
+# =============================================================================
+# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+# =============================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END======================================================
+
tosca_definitions_version: cloudify_dsl_1_3
-imports:
- - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml"
- - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R2/dockerplugin/3.2.0/dockerplugin_types.yaml
- - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R2/relationshipplugin/1.0.0/relationshipplugin_types.yaml
- - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R2/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml
+description: >
+ This blueprint deploys/manages the TCA module as a Docker container
+
+imports:
+ - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
+ - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/k8splugin/1.4.12/k8splugin_types.yaml
+# - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml
+ - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/clamppolicyplugin/1.0.0/clamppolicyplugin_types.yaml
inputs:
- dh_override:
- type: string
- default: "component_dockerhost"
- dh_location_id:
- type: string
- default: "zone1"
aaiEnrichmentHost:
type: string
- default: "none"
+ default: "aai.onap.svc.cluster.local"
aaiEnrichmentPort:
- type: string
- default: 8443
+ type: string
+ default: "8443"
enableAAIEnrichment:
type: string
- default: false
+ default: true
dmaap_host:
type: string
- default: dmaap.onap-message-router
+ default: message-router.onap
dmaap_port:
type: string
- default: 3904
+ default: "3904"
enableRedisCaching:
type: string
- default: false
+ default: false
redisHosts:
- type: string
+ type: string
+ default: dcae-redis.onap.svc.cluster.local:6379
tag_version:
type: string
- default: "nexus3.onap.org:10001/onap//onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0"
+ default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.1.1"
consul_host:
type: string
- default: consul-server.onap-consul
+ default: consul-server.onap
consul_port:
type: string
default: "8500"
cbs_host:
type: string
- default: "config-binding-service.dcae"
+ default: "config-binding-servicel"
cbs_port:
type: string
default: "10000"
policy_id:
type: string
- default: "none"
+ default: "onap.restart.tca"
external_port:
type: string
- description: "Port for CDAPgui to be exposed"
- default: "32010"
-
+ description: Kubernetes node port on which CDAPgui is exposed
+ default: "32012"
+ policy_model_id:
+ type: string
+ default: "onap.policies.monitoring.cdap.tca.hi.lo.app"
node_templates:
- docker_service_host:
- properties:
- docker_host_override:
- get_input: dh_override
- location_id:
- get_input: dh_location_id
- type: dcae.nodes.SelectedDockerHost
- tca_docker:
+ tca_k8s:
+ type: dcae.nodes.ContainerizedServiceComponent
relationships:
- - type: dcae.relationships.component_contained_in
- target: docker_service_host
- - target: tca_policy
- type: cloudify.relationships.depends_on
- type: dcae.nodes.DockerContainerForComponentsUsingDmaap
+ - target: tca_policy
+ type: cloudify.relationships.depends_on
properties:
+ service_component_type: 'dcaegen2-analytics-tca'
+ application_config: {}
+ docker_config: {}
+ image:
+ get_input: tag_version
+ log_info:
+ log_directory: "/opt/app/TCAnalytics/logs"
application_config:
app_config:
appDescription: DCAE Analytics Threshold Crossing Alert Application
@@ -84,87 +100,75 @@ node_templates:
tcaVESMessageStatusTableTTLSeconds: '86400'
thresholdCalculatorFlowletInstances: '2'
app_preferences:
- aaiEnrichmentHost:
+ aaiEnrichmentHost:
get_input: aaiEnrichmentHost
aaiEnrichmentIgnoreSSLCertificateErrors: 'true'
aaiEnrichmentPortNumber: '8443'
aaiEnrichmentProtocol: https
- aaiEnrichmentUserName: DCAE
- aaiEnrichmentUserPassword: DCAE
+ aaiEnrichmentUserName: dcae@dcae.onap.org
+ aaiEnrichmentUserPassword: demo123456!
aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query
aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf
- enableAAIEnrichment:
+ enableAAIEnrichment:
get_input: enableAAIEnrichment
- enableRedisCaching:
+ enableRedisCaching:
get_input: enableRedisCaching
- redisHosts:
+ redisHosts:
get_input: redisHosts
enableAlertCEFFormat: 'false'
publisherContentType: application/json
- publisherHostName:
+ publisherHostName:
get_input: dmaap_host
- publisherHostPort:
- get_input: dmaap_port
+ publisherHostPort:
+ get_input: dmaap_port
publisherMaxBatchSize: '1'
publisherMaxRecoveryQueueSize: '100000'
publisherPollingInterval: '20000'
publisherProtocol: http
publisherTopicName: unauthenticated.DCAE_CL_OUTPUT
- subscriberConsumerGroup: OpenDCAE-c12
+ subscriberConsumerGroup: OpenDCAE-clamp
subscriberConsumerId: c12
subscriberContentType: application/json
- subscriberHostName:
+ subscriberHostName:
get_input: dmaap_host
subscriberHostPort:
- get_input: dmaap_port
+ get_input: dmaap_port
subscriberMessageLimit: '-1'
subscriberPollingInterval: '30000'
subscriberProtocol: http
subscriberTimeoutMS: '-1'
- subscriberTopicName: unauthenticated.SEC_MEASUREMENT_OUTPUT
- tca_policy_default: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"LESS_OR_EQUAL","severity":"MAJOR","closedLoopEventStatus":"ONSET"},{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":700,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"Measurement_vGMUX","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"EQUAL","severity":"MAJOR","closedLoopEventStatus":"ABATED"},{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"GREATER","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]}]}'
- service_component_type: dcaegen2-analytics_tca
- docker_config:
- healthcheck:
- endpoint: /healthcheck
- interval: 15s
- timeout: 1s
- type: http
- image:
- get_input: tag_version
+ subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT
+# tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"LESS_OR_EQUAL","severity":"MAJOR","closedLoopEventStatus":"ONSET"},{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":700,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"Measurement_vGMUX","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"EQUAL","severity":"MAJOR","closedLoopEventStatus":"ABATED"},{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"GREATER","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]}]}'
+ service_component_type: dcaegen2-analytics_tca
interfaces:
cloudify.interfaces.lifecycle:
start:
inputs:
envs:
- DMAAPHOST:
+ DMAAPHOST:
{ get_input: dmaap_host }
DMAAPPORT:
{ get_input: dmaap_port }
DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT"
- DMAAPSUBTOPIC: "unauthenticated.SEC_MEASUREMENT_OUTPUT"
- AAIHOST:
+ DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT"
+ AAIHOST:
{ get_input: aaiEnrichmentHost }
- AAIPORT:
+ AAIPORT:
{ get_input: aaiEnrichmentPort }
- CONSUL_HOST:
+ CONSUL_HOST:
{ get_input: consul_host }
- CONSUL_PORT:
+ CONSUL_PORT:
{ get_input: consul_port }
- CBS_HOST:
+ CBS_HOST:
{ get_input: cbs_host }
- CBS_PORT:
+ CBS_PORT:
{ get_input: cbs_port }
- CONFIG_BINDING_SERVICE: "config_binding_service"
+ CONFIG_BINDING_SERVICE: "config_binding_service"
ports:
- - concat: ["11011:", { get_input: external_port }]
- stop:
- inputs:
- cleanup_image: true
+ - concat: ["11011:", { get_input: external_port }]
tca_policy:
- type: dcae.nodes.policy
+ type: clamp.nodes.policy
properties:
policy_id:
get_input: policy_id
- policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.app
-
+ policy_model_id: "onap.policies.monitoring.cdap.tca.hi.lo.app"
diff --git a/src/test/resources/example/sdc/blueprint-dcae/tca_3.yaml b/src/test/resources/example/sdc/blueprint-dcae/tca_3.yaml
index b2bf8bb96..6fab504b2 100644
--- a/src/test/resources/example/sdc/blueprint-dcae/tca_3.yaml
+++ b/src/test/resources/example/sdc/blueprint-dcae/tca_3.yaml
@@ -1,105 +1,157 @@
tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+ This blueprint deploys/manages the TCA module as a Docker container
+
imports:
-- http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
-- https://onap.org:8443/repository/solutioning01-mte2-raw/type_files/docker/2.2.0/node-type.yaml
-- https://onap.org:8443/repository/solutioning01-mte2-raw/type_files/relationship/1.0.0/node-type.yaml
-- http://onap.org:8081/repository/solutioning01-mte2-raw/type_files/dmaap/dmaap_mr.yaml
+ - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
+ - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/k8splugin/1.4.12/k8splugin_types.yaml
+ - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml
inputs:
- location_id:
+ aaiEnrichmentHost:
type: string
- service_id:
+ default: "aai.onap.svc.cluster.local"
+ aaiEnrichmentPort:
type: string
+ default: "8443"
+ enableAAIEnrichment:
+ type: string
+ default: true
+ dmaap_host:
+ type: string
+ default: message-router.onap.svc.cluster.local
+ dmaap_port:
+ type: string
+ default: "3904"
+ enableRedisCaching:
+ type: string
+ default: false
+ redisHosts:
+ type: string
+ default: dcae-redis.onap.svc.cluster.local:6379
+ tag_version:
+ type: string
+ default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.1.0-STAGING-latest"
+ consul_host:
+ type: string
+ default: consul-server.onap.svc.cluster.local
+ consul_port:
+ type: string
+ default: "8500"
+ cbs_host:
+ type: string
+ default: "config-binding-service.dcae.svc.cluster.local"
+ cbs_port:
+ type: string
+ default: "10000"
policy_id:
type: string
+ default: "none"
+ external_port:
+ type: string
+ description: Kubernetes node port on which CDAPgui is exposed
+ default: "32012"
+ policy_model_id:
+ type: string
+ default: "onap.policies.monitoring.cdap.tca.hi.lo.app"
+
node_templates:
- policy_0:
- type: dcae.nodes.policy
- properties:
- policy_id:
- get_input: policy_id
- policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.app
- cdap_host_host:
- type: dcae.nodes.StreamingAnalytics.SelectedCDAPInfrastructure
- properties:
- location_id:
- get_input: location_id
- scn_override: cdap_broker.solutioning-central.dcae.onap.org
- interfaces:
- cloudify.interfaces.lifecycle: {
- }
- tca_tca:
- type: dcae.nodes.MicroService.cdap
- properties:
- app_config:
- appDescription: DCAE Analytics Threshold Crossing Alert Application
- appName: dcae-tca
- tcaSubscriberOutputStreamName: TCASubscriberOutputStream
- tcaVESAlertsTableName: TCAVESAlertsTable
- tcaVESAlertsTableTTLSeconds: '1728000'
- tcaVESMessageStatusTableName: TCAVESMessageStatusTable
- tcaVESMessageStatusTableTTLSeconds: '86400'
- thresholdCalculatorFlowletInstances: '2'
- app_preferences:
- publisherContentType: application/json
- publisherHostName: mrlocal-mtnjftle01.onap.org
- publisherHostPort: '3905'
- publisherMaxBatchSize: '10'
- publisherMaxRecoveryQueueSize: '100000'
- publisherPollingInterval: '20000'
- publisherProtocol: https
- publisherTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESPub
- publisherUserName: test@tca.af.dcae.onap.org
- publisherUserPassword: password
- subscriberConsumerGroup: OpenDCAE-c12
- subscriberConsumerId: c12
- subscriberContentType: application/json
- subscriberHostName: mrlocal-mtnjftle01.onap.org
- subscriberHostPort: '3905'
- subscriberMessageLimit: '-1'
- subscriberPollingInterval: '20000'
- subscriberProtocol: https
- subscriberTimeoutMS: '-1'
- subscriberTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESSub
- subscriberUserName: test@tca.af.dcae.onap.org
- subscriberUserPassword: password
- tca_policy: null
- artifact_name: dcae-analytics-tca
- artifact_version: 1.0.0
- connections:
- streams_publishes: [
- ]
- streams_subscribes: [
- ]
- jar_url: http://somejar
- location_id:
- get_input: location_id
- namespace: cdap_tca_hi_lo
- programs:
- - program_id: TCAVESCollectorFlow
- program_type: flows
- - program_id: TCADMaaPMRSubscriberWorker
- program_type: workers
- - program_id: TCADMaaPMRPublisherWorker
- program_type: workers
- service_component_type: cdap_app_tca
- service_id:
- get_input: service_id
- streamname: TCASubscriberOutputStream
+ tca_k8s:
+ type: dcae.nodes.ContainerizedServiceComponent
relationships:
- - target: topic0
- type: dcae.relationships.subscribe_to_events
- - target: topic1
- type: dcae.relationships.publish_events
- - target: cdap_host_host
- type: dcae.relationships.component_contained_in
- - target: policy_0
- type: dcae.relationships.depends_on
- topic0:
- type: dcae.nodes.Topic
+ - target: tca_policy
+ type: cloudify.relationships.depends_on
properties:
- topic_name: ''
- topic1:
- type: dcae.nodes.Topic
+ service_component_type: 'dcaegen2-analytics-tca'
+ application_config: {}
+ docker_config: {}
+ image:
+ get_input: tag_version
+ log_info:
+ log_directory: "/opt/app/TCAnalytics/logs"
+ application_config:
+ app_config:
+ appDescription: DCAE Analytics Threshold Crossing Alert Application
+ appName: dcae-tca
+ tcaAlertsAbatementTableName: TCAAlertsAbatementTable
+ tcaAlertsAbatementTableTTLSeconds: '1728000'
+ tcaSubscriberOutputStreamName: TCASubscriberOutputStream
+ tcaVESAlertsTableName: TCAVESAlertsTable
+ tcaVESAlertsTableTTLSeconds: '1728000'
+ tcaVESMessageStatusTableName: TCAVESMessageStatusTable
+ tcaVESMessageStatusTableTTLSeconds: '86400'
+ thresholdCalculatorFlowletInstances: '2'
+ app_preferences:
+ aaiEnrichmentHost:
+ get_input: aaiEnrichmentHost
+ aaiEnrichmentIgnoreSSLCertificateErrors: 'true'
+ aaiEnrichmentPortNumber: '8443'
+ aaiEnrichmentProtocol: https
+ aaiEnrichmentUserName: dcae@dcae.onap.org
+ aaiEnrichmentUserPassword: demo123456!
+ aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query
+ aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf
+ enableAAIEnrichment:
+ get_input: enableAAIEnrichment
+ enableRedisCaching:
+ get_input: enableRedisCaching
+ redisHosts:
+ get_input: redisHosts
+ enableAlertCEFFormat: 'false'
+ publisherContentType: application/json
+ publisherHostName:
+ get_input: dmaap_host
+ publisherHostPort:
+ get_input: dmaap_port
+ publisherMaxBatchSize: '1'
+ publisherMaxRecoveryQueueSize: '100000'
+ publisherPollingInterval: '20000'
+ publisherProtocol: http
+ publisherTopicName: unauthenticated.DCAE_CL_OUTPUT
+ subscriberConsumerGroup: OpenDCAE-c12
+ subscriberConsumerId: c12
+ subscriberContentType: application/json
+ subscriberHostName:
+ get_input: dmaap_host
+ subscriberHostPort:
+ get_input: dmaap_port
+ subscriberMessageLimit: '-1'
+ subscriberPollingInterval: '30000'
+ subscriberProtocol: http
+ subscriberTimeoutMS: '-1'
+ subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT
+ tca_policy: ''
+ service_component_type: dcaegen2-analytics_tca
+ interfaces:
+ cloudify.interfaces.lifecycle:
+ start:
+ inputs:
+ envs:
+ DMAAPHOST:
+ { get_input: dmaap_host }
+ DMAAPPORT:
+ { get_input: dmaap_port }
+ DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT"
+ DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT"
+ AAIHOST:
+ { get_input: aaiEnrichmentHost }
+ AAIPORT:
+ { get_input: aaiEnrichmentPort }
+ CONSUL_HOST:
+ { get_input: consul_host }
+ CONSUL_PORT:
+ { get_input: consul_port }
+ CBS_HOST:
+ { get_input: cbs_host }
+ CBS_PORT:
+ { get_input: cbs_port }
+ CONFIG_BINDING_SERVICE: "config_binding_service"
+ ports:
+ - concat: ["11011:", { get_input: external_port }]
+ tca_policy:
+ type: dcae.nodes.policy
properties:
- topic_name: ''
-
+ policy_id:
+ get_input: policy_id
+ policy_model_id:
+ get_input: policy_model_id
diff --git a/src/test/resources/example/sdc/expected-result/policy-data.yaml b/src/test/resources/example/sdc/expected-result/policy-data.yaml
index 7f2c4847b..3cf5e975c 100644
--- a/src/test/resources/example/sdc/expected-result/policy-data.yaml
+++ b/src/test/resources/example/sdc/expected-result/policy-data.yaml
@@ -132,11 +132,11 @@ policy_types:
type: string
description: The name of the policy, that related to specific type, same as it is defined in the source.
required: false
- tosca.policies.Monitoring:
+ onap.policies.Monitoring:
derived_from: tosca.policies.Root
description: A base policy type for all policies that governs monitoring provisioning
- onap.policy.monitoring.cdap.tca.hi.lo.app:
- derived_from: tosca.policies.Monitoring
+ onap.policies.monitoring.cdap.tca.hi.lo.app:
+ derived_from: onap.policies.Monitoring
version: 1.0.0
properties:
tca_policy:
@@ -144,6 +144,316 @@ policy_types:
description: TCA Policy JSON
entry_schema:
type: onap.datatypes.monitoring.tca_policy
+ tosca.policies.nfv.InstantiationLevels:
+ derived_from: tosca.policies.Root
+ description: The InstantiationLevels type is a policy type representing all the instantiation levels of resources to be instantiated within a deployment flavour and including default instantiation level in term of the number of VNFC instances to be created as defined in ETSI GS NFV-IFA 011 [1].
+ properties:
+ levels:
+ type: map
+ description: Describes the various levels of resources that can be used to instantiate the VNF using this flavour.
+ required: true
+ entry_schema:
+ type: tosca.datatypes.nfv.InstantiationLevel
+ default_level:
+ type: string
+ description: The default instantiation level for this flavour.
+ required: false
+ tosca.policies.nfv.VduInstantiationLevels:
+ derived_from: tosca.policies.Root
+ description: The VduInstantiationLevels type is a policy type representing all the instantiation levels of resources to be instantiated within a deployment flavour in term of the number of VNFC instances to be created from each vdu.Compute. as defined in ETSI GS NFV-IFA 011 [1]
+ properties:
+ levels:
+ type: map
+ description: Describes the Vdu.Compute levels of resources that can be used to instantiate the VNF using this flavour
+ required: true
+ entry_schema:
+ type: tosca.datatypes.nfv.VduLevel
+ targets:
+ - tosca.nodes.nfv.Vdu.Compute
+ tosca.policies.nfv.VirtualLinkInstantiationLevels:
+ derived_from: tosca.policies.Root
+ description: The VirtualLinkInstantiationLevels type is a policy type representing all the instantiation levels of virtual link resources to be instantiated within a deployment flavour as defined in ETSI GS NFV-IFA 011 [1].
+ properties:
+ levels:
+ type: map
+ description: Describes the virtual link levels of resources that can be used to instantiate the VNF using this flavour.
+ required: true
+ entry_schema:
+ type: tosca.datatypes.nfv.VirtualLinkBitrateLevel
+ targets:
+ - tosca.nodes.nfv.VnfVirtualLink
+ tosca.policies.nfv.ScalingAspects:
+ derived_from: tosca.policies.Root
+ description: The ScalingAspects type is a policy type representing the scaling aspects used for horizontal scaling as defined in ETSI GS NFV-IFA 011 [1].
+ properties:
+ aspects:
+ type: map
+ description: Describe maximum scale level for total number of scaling steps that can be applied to a particular aspect
+ required: true
+ entry_schema:
+ type: tosca.datatypes.nfv.ScalingAspect
+ tosca.policies.nfv.VduScalingAspectDeltas:
+ derived_from: tosca.policies.Root
+ description: The VduScalingAspectDeltas type is a policy type representing the Vdu.Compute detail of an aspect deltas used for horizontal scaling, as defined in ETSI GS NFV-IFA 011 [1].
+ properties:
+ aspect:
+ type: string
+ description: Represents the scaling aspect to which this policy applies
+ required: true
+ deltas:
+ type: map
+ description: Describes the Vdu.Compute scaling deltas to be applied for every scaling steps of a particular aspect.
+ required: true
+ entry_schema:
+ type: tosca.datatypes.nfv.VduLevel
+ targets:
+ - tosca.nodes.nfv.Vdu.Compute
+ tosca.policies.nfv.VirtualLinkBitrateScalingAspectDeltas:
+ derived_from: tosca.policies.Root
+ description: The VirtualLinkBitrateScalingAspectDeltas type is a policy type representing the VnfVirtualLink detail of an aspect deltas used for horizontal scaling, as defined in ETSI GS NFV-IFA 011 [1].
+ properties:
+ aspect:
+ type: string
+ description: Represents the scaling aspect to which this policy applies.
+ required: true
+ deltas:
+ type: map
+ description: Describes the VnfVirtualLink scaling deltas to be applied for every scaling steps of a particular aspect.
+ required: true
+ entry_schema:
+ type: tosca.datatypes.nfv.VirtualLinkBitrateLevel
+ targets:
+ - tosca.nodes.nfv.VnfVirtualLink
+ tosca.policies.nfv.VduInitialDelta:
+ derived_from: tosca.policies.Root
+ description: The VduInitialDelta type is a policy type representing the Vdu.Compute detail of an initial delta used for horizontal scaling, as defined in ETSI GS NFV-IFA 011 [1].
+ properties:
+ initial_delta:
+ type: tosca.datatypes.nfv.VduLevel
+ description: Represents the initial minimum size of the VNF.
+ required: true
+ targets:
+ - tosca.nodes.nfv.Vdu.Compute
+ tosca.policies.nfv.VirtualLinkBitrateInitialDelta:
+ derived_from: tosca.policies.Root
+ description: The VirtualLinkBitrateInitialDelta type is a policy type representing the VnfVirtualLink detail of an initial deltas used for horizontal scaling, as defined in ETSI GS NFV-IFA 011 [1].
+ properties:
+ initial_delta:
+ type: tosca.datatypes.nfv.VirtualLinkBitrateLevel
+ description: Represents the initial minimum size of the VNF.
+ required: true
+ targets:
+ - tosca.nodes.nfv.VnfVirtualLink
+ tosca.policies.nfv.SecurityGroupRule:
+ derived_from: tosca.policies.Root
+ description: The SecurityGroupRule type is a policy type specified the matching criteria for the ingress and/or egress traffic to/from visited connection points as defined in ETSI GS NFV-IFA 011 [1].
+ properties:
+ description:
+ type: string
+ description: Human readable description of the security group rule.
+ required: false
+ direction:
+ type: string
+ description: The direction in which the security group rule is applied. The direction of 'ingress' or 'egress' is specified against the associated CP. I.e., 'ingress' means the packets entering a CP, while 'egress' means the packets sent out of a CP.
+ required: false
+ constraints:
+ - valid_values:
+ - ingress
+ - egress
+ default: ingress
+ ether_type:
+ type: string
+ description: Indicates the protocol carried over the Ethernet layer.
+ required: false
+ constraints:
+ - valid_values:
+ - ipv4
+ - ipv6
+ default: ipv4
+ protocol:
+ type: string
+ description: Indicates the protocol carried over the IP layer. Permitted values include any protocol defined in the IANA protocol registry, e.g. TCP, UDP, ICMP, etc.
+ required: false
+ constraints:
+ - valid_values:
+ - hopopt
+ - icmp
+ - igmp
+ - ggp
+ - ipv4
+ - st
+ - tcp
+ - cbt
+ - egp
+ - igp
+ - bbn_rcc_mon
+ - nvp_ii
+ - pup
+ - argus
+ - emcon
+ - xnet
+ - chaos
+ - udp
+ - mux
+ - dcn_meas
+ - hmp
+ - prm
+ - xns_idp
+ - trunk_1
+ - trunk_2
+ - leaf_1
+ - leaf_2
+ - rdp
+ - irtp
+ - iso_tp4
+ - netblt
+ - mfe_nsp
+ - merit_inp
+ - dccp
+ - 3pc
+ - idpr
+ - xtp
+ - ddp
+ - idpr_cmtp
+ - tp++
+ - il
+ - ipv6
+ - sdrp
+ - ipv6_route
+ - ipv6_frag
+ - idrp
+ - rsvp
+ - gre
+ - dsr
+ - bna
+ - esp
+ - ah
+ - i_nlsp
+ - swipe
+ - narp
+ - mobile
+ - tlsp
+ - skip
+ - ipv6_icmp
+ - ipv6_no_nxt
+ - ipv6_opts
+ - cftp
+ - sat_expak
+ - kryptolan
+ - rvd
+ - ippc
+ - sat_mon
+ - visa
+ - ipcv
+ - cpnx
+ - cphb
+ - wsn
+ - pvp
+ - br_sat_mon
+ - sun_nd
+ - wb_mon
+ - wb_expak
+ - iso_ip
+ - vmtp
+ - secure_vmtp
+ - vines
+ - ttp
+ - iptm
+ - nsfnet_igp
+ - dgp
+ - tcf
+ - eigrp
+ - ospfigp
+ - sprite_rpc
+ - larp
+ - mtp
+ - ax.25
+ - ipip
+ - micp
+ - scc_sp
+ - etherip
+ - encap
+ - gmtp
+ - ifmp
+ - pnni
+ - pim
+ - aris
+ - scps
+ - qnx
+ - a/n
+ - ip_comp
+ - snp
+ - compaq_peer
+ - ipx_in_ip
+ - vrrp
+ - pgm
+ - l2tp
+ - ddx
+ - iatp
+ - stp
+ - srp
+ - uti
+ - smp
+ - sm
+ - ptp
+ - isis
+ - fire
+ - crtp
+ - crudp
+ - sscopmce
+ - iplt
+ - sps
+ - pipe
+ - sctp
+ - fc
+ - rsvp_e2e_ignore
+ - mobility
+ - udp_lite
+ - mpls_in_ip
+ - manet
+ - hip
+ - shim6
+ - wesp
+ - rohc
+ default: tcp
+ port_range_min:
+ type: integer
+ description: Indicates minimum port number in the range that is matched by the security group rule. If a value is provided at design-time, this value may be overridden at run-time based on other deployment requirements or constraints.
+ required: false
+ constraints:
+ - greater_or_equal: 0
+ - less_or_equal: 65535
+ default: 0
+ port_range_max:
+ type: integer
+ description: Indicates maximum port number in the range that is matched by the security group rule. If a value is provided at design-time, this value may be overridden at run-time based on other deployment requirements or constraints.
+ required: false
+ constraints:
+ - greater_or_equal: 0
+ - less_or_equal: 65535
+ default: 65535
+ targets:
+ - tosca.nodes.nfv.VduCp
+ - tosca.nodes.nfv.VnfExtCp
+ tosca.policies.nfv.SupportedVnfInterface:
+ derived_from: tosca.policies.Root
+ description: this policy type represents interfaces produced by a VNF, the details to access them and the applicable connection points to use to access these interfaces
+ properties:
+ interface_name:
+ type: string
+ description: Identifies an interface produced by the VNF.
+ required: true
+ constraints:
+ - valid_values:
+ - vnf_indicator
+ - vnf_configuration
+ details:
+ type: tosca.datatypes.nfv.InterfaceDetails
+ description: Provide additional data to access the interface endpoint
+ required: false
+ targets:
+ - tosca.nodes.nfv.VnfExtCp
+ - tosca.nodes.nfv.VduCp
data_types:
tosca.datatypes.Root:
description: The TOSCA root Data Type all other TOSCA base Data Types derive from
@@ -1381,119 +1691,159 @@ data_types:
type: string
description: The network role of the related network, sharing provider network.
required: false
+ tosca.datatypes.nfv.VnfcAdditionalConfigurableProperties:
+ derived_from: tosca.datatypes.Root
+ description: VnfcAdditionalConfigurableProperties type is an empty base type for deriving data types for describing additional configurable properties for a given VNFC.
+ properties:
+ description:
+ type: string
+ required: false
tosca.datatypes.nfv.VnfcConfigurableProperties:
derived_from: tosca.datatypes.Root
+ description: Defines the configurable properties of a VNFC
properties:
additional_vnfc_configurable_properties:
- type: map
- entry_schema:
- type: string
+ type: tosca.datatypes.nfv.VnfcAdditionalConfigurableProperties
+ description: Describes additional configuration for VNFC that can be modified using the ModifyVnfInfo operation
required: false
tosca.datatypes.nfv.RequestedAdditionalCapability:
derived_from: tosca.datatypes.Root
+ description: describes requested additional capability for a particular VDU
properties:
+ requested_additional_capability_name:
+ type: string
+ description: Identifies a requested additional capability for the VDU.
+ required: true
support_mandatory:
type: boolean
+ description: Indicates whether the requested additional capability is mandatory for successful operation.
required: true
min_requested_additional_capability_version:
type: string
+ description: Identifies the minimum version of the requested additional capability.
required: false
preferred_requested_additional_capability_version:
type: string
+ description: Identifies the preferred version of the requested additional capability.
required: false
- requested_additional_capability_name:
- type: string
- required: true
target_performance_parameters:
type: map
+ description: Identifies specific attributes, dependent on the requested additional capability type.
+ required: true
entry_schema:
type: string
- required: true
tosca.datatypes.nfv.VirtualMemory:
derived_from: tosca.datatypes.Root
+ description: supports the specification of requirements related to virtual memory of a virtual compute resource
properties:
virtual_mem_size:
type: scalar-unit.size
+ description: Amount of virtual memory.
required: true
virtual_mem_oversubscription_policy:
type: string
+ description: The memory core oversubscription policy in terms of virtual memory to physical memory on the platform.
required: false
- vdu_memory_requirements:
+ vdu_mem_requirements:
type: map
+ description: The hardware platform specific VDU memory requirements. A map of strings that contains a set of key-value pairs that describes hardware platform specific VDU memory requirements.
+ required: false
entry_schema:
type: string
- required: false
numa_enabled:
type: boolean
+ description: It specifies the memory allocation to be cognisant of the relevant process/core allocation.
required: false
+ default: false
tosca.datatypes.nfv.VirtualCpuPinning:
derived_from: tosca.datatypes.Root
+ description: Supports the specification of requirements related to the virtual CPU pinning configuration of a virtual compute resource
properties:
- cpu_pinning_policy:
+ virtual_cpu_pinning_policy:
type: string
+ description: 'Indicates the policy for CPU pinning. The policy can take values
+ of "static" or "dynamic". In case of "dynamic" the allocation of virtual
+ CPU cores to logical CPU cores is decided by the VIM. (e.g.: SMT (Simultaneous
+ Multi-Threading) requirements). In case of "static" the allocation is requested
+ to be according to the virtual_cpu_pinning_rule.'
+ required: false
constraints:
- valid_values:
- static
- dynamic
+ virtual_cpu_pinning_rule:
+ type: list
+ description: Provides the list of rules for allocating virtual CPU cores to logical CPU cores/threads
required: false
- cpu_pinning_map:
- type: map
entry_schema:
type: string
- required: false
tosca.datatypes.nfv.VirtualCpu:
derived_from: tosca.datatypes.Root
+ description: Supports the specification of requirements related to virtual CPU(s) of a virtual compute resource
properties:
cpu_architecture:
type: string
+ description: CPU architecture type. Examples are x86, ARM
required: false
num_virtual_cpu:
type: integer
+ description: Number of virtual CPUs
required: true
+ constraints:
+ - greater_than: 0
virtual_cpu_clock:
type: scalar-unit.frequency
+ description: Minimum virtual CPU clock rate
required: false
virtual_cpu_oversubscription_policy:
type: string
+ description: CPU core oversubscription policy e.g. the relation of virtual CPU cores to physical CPU cores/threads.
required: false
vdu_cpu_requirements:
type: map
+ description: The hardware platform specific VDU CPU requirements. A map of strings that contains a set of key-value pairs describing VDU CPU specific hardware platform requirements.
+ required: false
entry_schema:
type: string
- required: false
virtual_cpu_pinning:
type: tosca.datatypes.nfv.VirtualCpuPinning
+ description: The virtual CPU pinning configuration for the virtualised compute resource.
required: false
tosca.datatypes.nfv.LogicalNodeData:
derived_from: tosca.datatypes.Root
+ description: Describes compute, memory and I/O requirements associated with a particular VDU.
properties:
logical_node_requirements:
type: map
+ description: The logical node-level compute, memory and I/O requirements. A map of strings that contains a set of key-value pairs that describes hardware platform specific deployment requirements, including the number of CPU cores on this logical node, a memory configuration specific to a logical node or a requirement related to the association of an I/O device with the logical node.
+ required: false
entry_schema:
type: string
- required: false
tosca.datatypes.nfv.VirtualNetworkInterfaceRequirements:
derived_from: tosca.datatypes.Root
+ description: Describes requirements on a virtual network interface
properties:
name:
type: string
+ description: Provides a human readable name for the requirement.
required: false
description:
type: string
+ description: Provides a human readable description of the requirement.
required: false
support_mandatory:
type: boolean
+ description: Indicates whether fulfilling the constraint is mandatory (TRUE) for successful operation or desirable (FALSE).
required: true
- requirement:
- type: string
- required: false
network_interface_requirements:
type: map
+ description: The network interface requirements. A map of strings that contain a set of key-value pairs that describes the hardware platform specific network interface deployment requirements.
+ required: true
entry_schema:
type: string
- required: true
nic_io_requirements:
type: tosca.datatypes.nfv.LogicalNodeData
+ description: references (couples) the CP with any logical node I/O requirements (for network devices) that may have been created. Linking these attributes is necessary so that so that I/O requirements that need to be articulated at the logical node level can be associated with the network interface requirements associated with the CP.
required: false
tosca.datatypes.nfv.injectFile:
derived_from: tosca.datatypes.Root
@@ -1506,24 +1856,27 @@ data_types:
required: true
tosca.datatypes.nfv.L2AddressData:
derived_from: tosca.datatypes.Root
+ description: Describes the information on the MAC addresses to be assigned to a connection point.
properties:
mac_address_assignment:
type: boolean
+ description: Specifies if the address assignment is the responsibility of management and orchestration function or not. If it is set to True, it is the management and orchestration function responsibility
required: true
- address:
- type: string
- required: false
tosca.datatypes.nfv.L3AddressData:
derived_from: tosca.datatypes.Root
+ description: Provides information about Layer 3 level addressing scheme and parameters applicable to a CP
properties:
ip_address_assignment:
type: boolean
+ description: Specifies if the address assignment is the responsibility of management and orchestration function or not. If it is set to True, it is the management and orchestration function responsibility
required: true
floating_ip_activated:
type: boolean
+ description: Specifies if the floating IP scheme is activated on the Connection Point or not
required: true
ip_address_type:
type: string
+ description: Defines address type. The address type should be aligned with the address type supported by the layer_protocols properties of the parent VnfExtCp
required: false
constraints:
- valid_values:
@@ -1531,49 +1884,62 @@ data_types:
- ipv6
number_of_ip_address:
type: integer
+ description: Minimum number of IP addresses to be assigned
required: false
+ constraints:
+ - greater_than: 0
fixed_ip_address:
type: list
entry_schema:
type: string
required: false
tosca.datatypes.nfv.AddressData:
+ derived_from: tosca.datatypes.Root
+ description: Describes information about the addressing scheme and parameters applicable to a CP
properties:
address_type:
+ type: string
+ description: Describes the type of the address to be assigned to a connection point. The content type shall be aligned with the address type supported by the layerProtocol property of the connection point
+ required: true
constraints:
- valid_values:
- mac_address
- ip_address
- type: string
- required: true
l2_address_data:
- required: false
type: tosca.datatypes.nfv.L2AddressData
- l3_address_data:
+ description: Provides the information on the MAC addresses to be assigned to a connection point.
required: false
+ l3_address_data:
type: tosca.datatypes.nfv.L3AddressData
+ description: Provides the information on the IP addresses to be assigned to a connection point
+ required: false
tosca.datatypes.nfv.ConnectivityType:
derived_from: tosca.datatypes.Root
+ description: describes additional connectivity information of a virtualLink
properties:
- layer_protocol:
- type: string
+ layer_protocols:
+ type: list
+ description: Identifies the protocol a virtualLink gives access to (ethernet, mpls, odu2, ipv4, ipv6, pseudo-wire).The top layer protocol of the virtualLink protocol stack shall always be provided. The lower layer protocols may be included when there are specific requirements on these layers.
required: true
- constraints:
- - valid_values:
- - ethernet
- - mpls
- - odu2
- - ipv4
- - ipv6
- - pseudo_wire
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - ethernet
+ - mpls
+ - odu2
+ - ipv4
+ - ipv6
+ - pseudo-wire
flow_pattern:
type: string
+ description: Identifies the flow pattern of the connectivity
required: false
constraints:
- valid_values:
- - Line
- - Tree
- - Mesh
+ - line
+ - tree
+ - mesh
tosca.datatypes.nfv.VlFlavour:
derived_from: tosca.datatypes.Root
properties:
@@ -1640,108 +2006,223 @@ data_types:
required: false
tosca.datatypes.nfv.VduProfile:
derived_from: tosca.datatypes.Root
+ description: describes additional instantiation data for a given Vdu.Compute used in a specific deployment flavour.
properties:
min_number_of_instances:
type: integer
+ description: Minimum number of instances of the VNFC based on this Vdu.Compute that is permitted to exist for a particular VNF deployment flavour.
required: true
+ constraints:
+ - greater_or_equal: 0
max_number_of_instances:
type: integer
+ description: Maximum number of instances of the VNFC based on this Vdu.Compute that is permitted to exist for a particular VNF deployment flavour.
required: true
+ constraints:
+ - greater_or_equal: 0
watchdog:
type: string
required: true
vmBootUpTimeOut:
type: integer
required: false
- tosca.datatypes.nfv.LinkBitRateRequirements:
+ tosca.datatypes.nfv.LinkBitrateRequirements:
derived_from: tosca.datatypes.Root
+ description: describes the requirements in terms of bitrate for a virtual link
properties:
root:
type: integer
+ description: Specifies the throughput requirement in bits per second of the link (e.g. bitrate of E-Line, root bitrate of E-Tree, aggregate capacity of E-LAN).
required: true
+ constraints:
+ - greater_or_equal: 0
leaf:
type: integer
- required: true
+ description: Specifies the throughput requirement in bits per second of leaf connections to the link when applicable to the connectivity type (e.g. for E-Tree and E LAN branches).
+ required: false
+ constraints:
+ - greater_or_equal: 0
tosca.datatypes.nfv.Qos:
derived_from: tosca.datatypes.Root
+ description: describes QoS data for a given VL used in a VNF deployment flavour
properties:
latency:
- type: integer
+ type: scalar-unit.time
+ description: Specifies the maximum latency
required: true
+ constraints:
+ - greater_than: 0 s
packet_delay_variation:
- type: integer
+ type: scalar-unit.time
+ description: Specifies the maximum jitter
required: true
+ constraints:
+ - greater_or_equal: 0 s
packet_loss_ratio:
type: float
+ description: Specifies the maximum packet loss ratio
+ required: false
constraints:
- in_range:
- 0.0
- 1.0
- required: false
- tosca.datatypes.nfv.VlProfile:
+ tosca.datatypes.nfv.IpAllocationPool:
derived_from: tosca.datatypes.Root
+ description: Specifies a range of IP addresses
properties:
- max_bit_rate_requirements:
- type: tosca.datatypes.nfv.LinkBitRateRequirements
+ start_ip_address:
+ type: string
+ description: The IP address to be used as the first one in a pool of addresses derived from the cidr block full IP range
required: true
- min_bit_rate_requirements:
- type: tosca.datatypes.nfv.LinkBitRateRequirements
+ end_ip_address:
+ type: string
+ description: The IP address to be used as the last one in a pool of addresses derived from the cidr block full IP range
required: true
- qos:
- type: tosca.datatypes.nfv.Qos
- required: false
- initiationParameters:
- type: map
- entry_schema:
- type: string
+ tosca.datatypes.nfv.L2ProtocolData:
+ derived_from: tosca.datatypes.Root
+ description: describes L2 protocol data for a given virtual link used in a specific VNF deployment flavour.
+ properties:
+ name:
+ type: string
+ description: Identifies the network name associated with this L2 protocol.
required: false
- cidr:
+ network_type:
type: string
+ description: Specifies the network type for this L2 protocol.The value may be overridden at run-time.
required: false
- networkName:
+ constraints:
+ - valid_values:
+ - flat
+ - vlan
+ - vxlan
+ - gre
+ vlan_transparent:
+ type: boolean
+ description: Specifies whether to support VLAN transparency for this L2 protocol or not.
+ required: false
+ default: false
+ mtu:
+ type: integer
+ description: Specifies the maximum transmission unit (MTU) value for this L2 protocol.
+ required: false
+ constraints:
+ - greater_than: 0
+ segmentation_id:
+ type: integer
+ required: false
+ physical_network:
type: string
required: false
- startIp:
+ tosca.datatypes.nfv.L3ProtocolData:
+ derived_from: tosca.datatypes.Root
+ description: describes L3 protocol data for a given virtual link used in a specific VNF deployment flavour.
+ properties:
+ name:
type: string
+ description: Identifies the network name associated with this L3 protocol.
required: false
- endIp:
+ ip_version:
type: string
+ description: Specifies IP version of this L3 protocol.The value of the ip_version property shall be consistent with the value of the layer_protocol in the connectivity_type property of the virtual link node.
+ required: true
+ constraints:
+ - valid_values:
+ - ipv4
+ - ipv6
+ cidr:
+ type: string
+ description: Specifies the CIDR (Classless Inter-Domain Routing) of this L3 protocol. The value may be overridden at run-time.
+ required: true
+ ip_allocation_pools:
+ type: list
+ description: Specifies the allocation pools with start and end IP addresses for this L3 protocol. The value may be overridden at run-time.
required: false
- gatewayIp:
+ entry_schema:
+ type: tosca.datatypes.nfv.IpAllocationPool
+ gateway_ip:
type: string
+ description: Specifies the gateway IP address for this L3 protocol. The value may be overridden at run-time.
required: false
- segmentationId:
- type: integer
+ dhcp_enabled:
+ type: boolean
+ description: Indicates whether DHCP (Dynamic Host Configuration Protocol) is enabled or disabled for this L3 protocol. The value may be overridden at run-time.
required: false
- physicalNetwork:
+ ipv6_address_mode:
type: string
+ description: Specifies IPv6 address mode. May be present when the value of the ipVersion attribute is "ipv6" and shall be absent otherwise. The value may be overridden at run-time.
required: false
- networkType:
+ constraints:
+ - valid_values:
+ - slaac
+ - dhcpv6-stateful
+ - dhcpv6-stateless
+ tosca.datatypes.nfv.VirtualLinkProtocolData:
+ derived_from: tosca.datatypes.Root
+ description: describes one protocol layer and associated protocol data for a given virtual link used in a specific VNF deployment flavour
+ properties:
+ associated_layer_protocol:
type: string
- required: false
+ description: Identifies one of the protocols a virtualLink gives access to (ethernet, mpls, odu2, ipv4, ipv6, pseudo-wire) as specified by the connectivity_type property.
+ required: true
constraints:
- valid_values:
- - VLAN
- - VXLAN
- dhcpEnabled:
- type: boolean
+ - ethernet
+ - mpls
+ - odu2
+ - ipv4
+ - ipv6
+ - pseudo-wire
+ l2_protocol_data:
+ type: tosca.datatypes.nfv.L2ProtocolData
+ description: Specifies the L2 protocol data for a virtual link. Shall be present when the associatedLayerProtocol attribute indicates a L2 protocol and shall be absent otherwise.
required: false
- vlanTransparent:
- type: boolean
+ l3_protocol_data:
+ type: tosca.datatypes.nfv.L3ProtocolData
+ description: Specifies the L3 protocol data for this virtual link. Shall be present when the associatedLayerProtocol attribute indicates a L3 protocol and shall be absent otherwise.
required: false
+ tosca.datatypes.nfv.VlProfile:
+ derived_from: tosca.datatypes.Root
+ description: Describes additional instantiation data for a given VL used in a specific VNF deployment flavour.
+ properties:
+ max_bitrate_requirements:
+ type: tosca.datatypes.nfv.LinkBitrateRequirements
+ description: Specifies the maximum bitrate requirements for a VL instantiated according to this profile.
+ required: true
+ min_bitrate_requirements:
+ type: tosca.datatypes.nfv.LinkBitrateRequirements
+ description: Specifies the minimum bitrate requirements for a VL instantiated according to this profile.
+ required: true
+ qos:
+ type: tosca.datatypes.nfv.Qos
+ description: Specifies the QoS requirements of a VL instantiated according to this profile.
+ required: false
+ virtual_link_protocol_data:
+ type: list
+ description: Specifies the protocol data for a virtual link.
+ required: false
+ entry_schema:
+ type: tosca.datatypes.nfv.VirtualLinkProtocolData
tosca.datatypes.nfv.VduLevel:
derived_from: tosca.datatypes.Root
+ description: Indicates for a given Vdu.Compute in a given level the number of instances to deploy
properties:
number_of_instances:
type: integer
+ description: Number of instances of VNFC based on this VDU to deploy for this level.
required: true
+ constraints:
+ - greater_or_equal: 0
tosca.datatypes.nfv.ScaleInfo:
derived_from: tosca.datatypes.Root
+ description: Indicates for a given scaleAspect the corresponding scaleLevel
properties:
- scaleLevel:
+ scale_level:
type: integer
+ description: The scale level for a particular aspect
required: true
- tosca.datatypes.nfv.ScaleAspect:
+ constraints:
+ - greater_or_equal: 0
+ tosca.datatypes.nfv.ScalingAspect:
derived_from: tosca.datatypes.Root
properties:
name:
@@ -1750,77 +2231,302 @@ data_types:
description:
type: string
required: true
- associated_group:
- type: string
- required: false
max_scale_level:
type: integer
required: true
+ constraints:
+ - greater_or_equal: 0
+ step_deltas:
+ type: list
+ required: false
+ entry_schema:
+ type: string
tosca.datatypes.nfv.InstantiationLevel:
derived_from: tosca.datatypes.Root
+ description: Describes the scale level for each aspect that corresponds to a given level of resources to be instantiated within a deployment flavour in term of the number VNFC instances
properties:
description:
type: string
+ description: Human readable description of the level
required: true
- vdu_levels:
- type: map
- required: true
- entry_schema:
- type: tosca.datatypes.nfv.VduLevel
scale_info:
type: map
+ description: Represents for each aspect the scale level that corresponds to this instantiation level. scale_info shall be present if the VNF supports scaling.
required: false
entry_schema:
type: tosca.datatypes.nfv.ScaleInfo
+ tosca.datatypes.nfv.VnfInstantiateOperationConfiguration:
+ derived_from: tosca.datatypes.Root
+ description: represents information that affect the invocation of the InstantiateVnf operation.
+ properties:
+ description:
+ type: string
+ required: false
tosca.datatypes.nfv.VnfScaleOperationConfiguration:
derived_from: tosca.datatypes.Root
+ description: Represents information that affect the invocation of the ScaleVnf operation
properties:
scaling_by_more_than_one_step_supported:
type: boolean
+ description: Signals whether passing a value larger than one in the numScalingSteps parameter of the ScaleVnf operation is supported by this VNF.
+ required: false
+ default: false
tosca.datatypes.nfv.VnfScaleToLevelOperationConfiguration:
derived_from: tosca.datatypes.Root
+ description: represents information that affect the invocation of the ScaleVnfToLevel operation
properties:
arbitrary_target_levels_supported:
type: boolean
+ description: Signals whether scaling according to the parameter "scaleInfo" is supported by this VNF
+ required: true
tosca.datatypes.nfv.VnfHealOperationConfiguration:
derived_from: tosca.datatypes.Root
+ description: represents information that affect the invocation of the HealVnf operation
properties:
causes:
type: list
+ description: Supported "cause" parameter values
+ required: false
entry_schema:
type: string
tosca.datatypes.nfv.VnfTerminateOperationConfiguration:
derived_from: tosca.datatypes.Root
+ description: represents information that affect the invocation of the TerminateVnf
properties:
min_graceful_termination_timeout:
- type: integer
+ type: scalar-unit.time
+ description: Minimum timeout value for graceful termination of a VNF instance
+ required: true
max_recommended_graceful_termination_timeout:
- type: integer
+ type: scalar-unit.time
+ description: Maximum recommended timeout value that can be needed to gracefully terminate a VNF instance of a particular type under certain conditions, such as maximum load condition. This is provided by VNF provider as information for the operator facilitating the selection of optimal timeout value. This value is not used as constraint
+ required: false
tosca.datatypes.nfv.VnfOperateOperationConfiguration:
derived_from: tosca.datatypes.Root
+ description: represents information that affect the invocation of the OperateVnf operation
properties:
- min_graceful_termination_timeout:
+ min_graceful_stop_timeout:
+ type: scalar-unit.time
+ description: Minimum timeout value for graceful stop of a VNF instance
+ required: true
+ max_recommended_graceful_stop_timeout:
+ type: scalar-unit.time
+ description: Maximum recommended timeout value that can be needed to gracefully stop a VNF instance of a particular type under certain conditions, such as maximum load condition. This is provided by VNF provider as information for the operator facilitating the selection of optimal timeout value. This value is not used as constraint
+ required: false
+ tosca.datatypes.nfv.VnfChangeFlavourOperationConfiguration:
+ derived_from: tosca.datatypes.Root
+ description: represents information that affect the invocation of the ChangeVnfFlavour operation
+ properties:
+ description:
+ type: string
+ required: false
+ tosca.datatypes.nfv.VnfProfile:
+ derived_from: tosca.datatypes.Root
+ description: describes a profile for instantiating VNFs of a particular NS DF according to a specific VNFD and VNF DF.
+ properties:
+ instantiation_level:
+ type: string
+ description: Identifier of the instantiation level of the VNF DF to be used for instantiation. If not present, the default instantiation level as declared in the VNFD shall be used.
+ required: false
+ min_number_of_instances:
type: integer
- max_recommended_graceful_termination_timeout:
+ description: Minimum number of instances of the VNF based on this VNFD that is permitted to exist for this VnfProfile.
+ required: true
+ constraints:
+ - greater_or_equal: 0
+ max_number_of_instances:
type: integer
+ description: Maximum number of instances of the VNF based on this VNFD that is permitted to exist for this VnfProfile.
+ required: true
+ constraints:
+ - greater_or_equal: 0
+ tosca.datatypes.nfv.UriAuthority:
+ derived_from: tosca.datatypes.Root
+ description: information that corresponds to the authority component of a URI as specified in IETF RFC 3986 [8]
+ properties:
+ user_info:
+ type: string
+ description: user_info field of the authority component of a URI
+ required: false
+ host:
+ type: string
+ description: host field of the authority component of a URI
+ required: false
+ port:
+ type: string
+ description: port field of the authority component of a URI
+ required: false
+ tosca.datatypes.nfv.UriComponents:
+ derived_from: tosca.datatypes.Root
+ description: information used to build a URI that complies with IETF RFC 3986 [8].
+ properties:
+ scheme:
+ type: string
+ description: scheme component of a URI.
+ required: true
+ authority:
+ type: tosca.datatypes.nfv.UriAuthority
+ description: Authority component of a URI
+ required: false
+ path:
+ type: string
+ description: path component of a URI.
+ required: false
+ query:
+ type: string
+ description: query component of a URI.
+ required: false
+ fragment:
+ type: string
+ description: fragment component of a URI.
+ required: false
+ tosca.datatypes.nfv.InterfaceDetails:
+ derived_from: tosca.datatypes.Root
+ description: information used to access an interface exposed by a VNF
+ properties:
+ uri_components:
+ type: tosca.datatypes.nfv.UriComponents
+ description: Provides components to build a Uniform Ressource Identifier (URI) where to access the interface end point.
+ required: false
+ interface_specific_data:
+ type: map
+ description: Provides additional details that are specific to the type of interface considered.
+ required: false
+ entry_schema:
+ type: string
+ tosca.datatypes.nfv.VirtualLinkMonitoringParameter:
+ derived_from: tosca.datatypes.Root
+ description: Represents information on virtualised resource related performance metrics applicable to the VNF.
+ properties:
+ name:
+ type: string
+ description: Human readable name of the monitoring parameter
+ required: true
+ performance_metric:
+ type: string
+ description: Identifies a performance metric derived from those defined in ETSI GS NFV-IFA 027.The packetOutgoingVirtualLink and packetIncomingVirtualLink metrics shall be obtained by aggregation the PacketOutgoing and PacketIncoming measurements defined in clause 7.1 of GS NFV-IFA 027 of all virtual link ports attached to the virtual link to which the metrics apply.
+ required: true
+ constraints:
+ - valid_values:
+ - packet_outgoing_virtual_link
+ - packet_incoming_virtual_link
+ collection_period:
+ type: scalar-unit.time
+ description: Describes the recommended periodicity at which to collect the performance information.
+ required: false
+ constraints:
+ - greater_than: 0 s
+ tosca.datatypes.nfv.VnfcMonitoringParameter:
+ derived_from: tosca.datatypes.Root
+ description: Represents information on virtualised resource related performance metrics applicable to the VNF.
+ properties:
+ name:
+ type: string
+ description: Human readable name of the monitoring parameter
+ required: true
+ performance_metric:
+ type: string
+ description: Identifies the performance metric, according to ETSI GS NFV-IFA 027.
+ required: true
+ constraints:
+ - valid_values:
+ - v_cpu_usage_mean_vnf
+ - v_cpu_usage_peak_vnf
+ - v_memory_usage_mean_vnf
+ - v_memory_usage_peak_vnf
+ - v_disk_usage_mean_vnf
+ - v_disk_usage_peak_vnf
+ - byte_incoming_vnf_int_cp
+ - byte_outgoing_vnf_int_cp
+ - packet_incoming_vnf_int_cp
+ - packet_outgoing_vnf_int_cp
+ collection_period:
+ type: scalar-unit.time
+ description: Describes the recommended periodicity at which to collect the performance information.
+ required: false
+ constraints:
+ - greater_than: 0 s
+ tosca.datatypes.nfv.VnfChangeExtConnectivityOperationConfiguration:
+ derived_from: tosca.datatypes.Root
+ description: represents information that affect the invocation of the ChangeExtVnfConnectivity operation
+ properties:
+ description:
+ type: string
+ required: false
+ tosca.datatypes.nfv.VnfMonitoringParameter:
+ derived_from: tosca.datatypes.Root
+ description: Represents information on virtualised resource related performance metrics applicable to the VNF.
+ properties:
+ name:
+ type: string
+ description: Human readable name of the monitoring parameter
+ required: true
+ performance_metric:
+ type: string
+ description: Identifies the performance metric, according to ETSI GS NFV-IFA 027.
+ required: true
+ constraints:
+ - valid_values:
+ - v_cpu_usage_mean_vnf
+ - v_cpu_usage_peak_vnf
+ - v_memory_usage_mean_vnf
+ - v_memory_usage_peak_vnf
+ - v_disk_usage_mean_vnf
+ - v_disk_usage_peak_vnf
+ - byte_incoming_vnf_ext_cp
+ - byte_outgoing_vnf_ext_cp
+ - packet_incoming_vnf_ext_cp
+ - packet_outgoing_vnf_ext_cp
+ collection_period:
+ type: scalar-unit.time
+ description: Describes the recommended periodicity at which to collect the performance information.
+ required: false
+ constraints:
+ - greater_than: 0 s
tosca.datatypes.nfv.VnfLcmOperationsConfiguration:
derived_from: tosca.datatypes.Root
+ description: Represents information to configure lifecycle management operations
properties:
+ instantiate:
+ type: tosca.datatypes.nfv.VnfInstantiateOperationConfiguration
+ description: Configuration parameters for the InstantiateVnf operation
+ required: false
scale:
type: tosca.datatypes.nfv.VnfScaleOperationConfiguration
+ description: Configuration parameters for the ScaleVnf operation
+ required: false
scale_to_level:
type: tosca.datatypes.nfv.VnfScaleToLevelOperationConfiguration
+ description: Configuration parameters for the ScaleVnfToLevel operation
+ required: false
+ change_flavour:
+ type: tosca.datatypes.nfv.VnfChangeFlavourOperationConfiguration
+ description: Configuration parameters for the changeVnfFlavourOpConfig operation
+ required: false
heal:
type: tosca.datatypes.nfv.VnfHealOperationConfiguration
+ description: Configuration parameters for the HealVnf operation
+ required: false
terminate:
type: tosca.datatypes.nfv.VnfTerminateOperationConfiguration
+ description: Configuration parameters for the TerminateVnf operation
+ required: false
operate:
type: tosca.datatypes.nfv.VnfOperateOperationConfiguration
+ description: Configuration parameters for the OperateVnf operation
+ required: false
+ change_ext_connectivity:
+ type: tosca.datatypes.nfv.VnfChangeExtConnectivityOperationConfiguration
+ description: Configuration parameters for the changeExtVnfConnectivityOpConfig operation
+ required: false
tosca.datatypes.nfv.CpProtocolData:
derived_from: tosca.datatypes.Root
+ description: Describes and associates the protocol layer that a CP uses together with other protocol and connection point information
properties:
- asscociated_layer_protocol:
+ associated_layer_protocol:
type: string
+ required: true
+ description: One of the values of the property layer_protocols of the CP
constraints:
- valid_values:
- ethernet
@@ -1829,40 +2535,185 @@ data_types:
- ipv4
- ipv6
- pseudo-wire
- required: true
address_data:
- type: tosca.datatypes.nfv.AddressData
+ type: list
+ description: Provides information on the addresses to be assigned to the CP
+ entry_schema:
+ type: tosca.datatypes.nfv.AddressData
+ required: false
+ tosca.datatypes.nfv.VnfAdditionalConfigurableProperties:
+ derived_from: tosca.datatypes.Root
+ description: is an empty base type for deriving data types for describing additional configurable properties for a given VNF
+ properties:
+ description:
+ type: string
required: false
tosca.datatypes.nfv.VnfConfigurableProperties:
derived_from: tosca.datatypes.Root
+ description: indicates configuration properties for a given VNF (e.g. related to auto scaling and auto healing).
properties:
is_autoscale_enabled:
type: boolean
+ description: It permits to enable (TRUE)/disable (FALSE) the auto-scaling functionality. If the properties is not present for configuring, then VNF property is not supported
required: false
is_autoheal_enabled:
type: boolean
+ description: It permits to enable (TRUE)/disable (FALSE) the auto-healing functionality. If the properties is not present for configuring, then VNF property is not supported
+ required: false
+ additional_configurable_properties:
+ description: It provides VNF specific configurable properties that can be modified using the ModifyVnfInfo operation
required: false
+ type: tosca.datatypes.nfv.VnfAdditionalConfigurableProperties
tosca.datatypes.nfv.VnfInfoModifiableAttributesExtensions:
derived_from: tosca.datatypes.Root
+ description: is an empty base type for deriving data types for describing VNF-specific extension
properties:
description:
type: string
required: false
tosca.datatypes.nfv.VnfInfoModifiableAttributesMetadata:
derived_from: tosca.datatypes.Root
+ description: is an empty base type for deriving data types for describing VNF-specific metadata
properties:
description:
type: string
required: false
tosca.datatypes.nfv.VnfInfoModifiableAttributes:
derived_from: tosca.datatypes.Root
+ description: Describes VNF-specific extension and metadata for a given VNF
properties:
extensions:
type: tosca.datatypes.nfv.VnfInfoModifiableAttributesExtensions
+ description: \"Extension\" properties of VnfInfo that are writeable
required: false
metadata:
type: tosca.datatypes.nfv.VnfInfoModifiableAttributesMetadata
+ description: \"Metadata\" properties of VnfInfo that are writeable
required: false
+ tosca.datatypes.nfv.VirtualLinkBitrateLevel:
+ derived_from: tosca.datatypes.Root
+ description: Describes bitrate requirements applicable to the virtual link instantiated from a particicular VnfVirtualLink
+ properties:
+ description:
+ type: string
+ required: false
+ bitrate_requirements:
+ type: tosca.datatypes.nfv.LinkBitrateRequirements
+ description: Virtual link bitrate requirements for an instantiation level or bitrate delta for a scaling step
+ required: true
+ tosca.datatypes.nfv.VnfOperationAdditionalParameters:
+ derived_from: tosca.datatypes.Root
+ description: Is an empty base type for deriving data type for describing VNF-specific parameters to be passed when invoking lifecycle management operations
+ properties:
+ description:
+ type: string
+ required: false
+ tosca.datatypes.nfv.VirtualFileStorageData:
+ derived_from: tosca.datatypes.Root
+ description: VirtualFileStorageData describes file storage requirements associated with compute resources in a particular VDU
+ properties:
+ size_of_storage:
+ type: scalar-unit.size
+ description: Size of virtualized storage resource
+ required: true
+ file_system_protocol:
+ type: string
+ description: The shared file system protocol (e.g. NFS, CIFS)
+ required: true
+ tosca.datatypes.nfv.VirtualObjectStorageData:
+ derived_from: tosca.datatypes.Root
+ description: VirtualObjectStorageData describes object storage requirements associated with compute resources in a particular VDU
+ properties:
+ max_size_of_storage:
+ type: scalar-unit.size
+ description: Maximum size of virtualized storage resource
+ required: false
+ tosca.datatypes.nfv.VirtualBlockStorageData:
+ derived_from: tosca.datatypes.Root
+ description: VirtualBlockStorageData describes block storage requirements associated with compute resources in a particular VDU, either as a local disk or as virtual attached storage
+ properties:
+ size_of_storage:
+ type: scalar-unit.size
+ description: Size of virtualised storage resource
+ required: true
+ vdu_storage_requirements:
+ type: map
+ description: The hardware platform specific storage requirements. A map of strings that contains a set of key-value pairs that represents the hardware platform specific storage deployment requirements.
+ required: false
+ entry_schema:
+ type: string
+ rdma_enabled:
+ type: boolean
+ description: Indicates if the storage support RDMA
+ required: false
+ default: false
+ tosca.datatypes.nfv.SwImageData:
+ derived_from: tosca.datatypes.Root
+ description: describes information related to a software image artifact
+ properties:
+ name:
+ type: string
+ description: Name of this software image
+ required: true
+ version:
+ type: string
+ description: Version of this software image
+ required: true
+ checksum:
+ type: string
+ description: Checksum of the software image file
+ required: true
+ container_format:
+ type: string
+ description: The container format describes the container file format in which software image is provided
+ required: true
+ constraints:
+ - valid_values:
+ - aki
+ - ami
+ - ari
+ - bare
+ - docker
+ - ova
+ - ovf
+ disk_format:
+ type: string
+ description: The disk format of a software image is the format of the underlying disk image
+ required: true
+ constraints:
+ - valid_values:
+ - aki
+ - ami
+ - ari
+ - iso
+ - qcow2
+ - raw
+ - vdi
+ - vhd
+ - vhdx
+ - vmdk
+ min_disk:
+ type: scalar-unit.size
+ description: The minimal disk size requirement for this software image
+ required: true
+ min_ram:
+ type: scalar-unit.size
+ description: The minimal RAM requirement for this software image
+ required: false
+ size:
+ type: scalar-unit.size
+ description: The size of this software image
+ required: true
+ operating_system:
+ type: string
+ description: Identifies the operating system used in the software image
+ required: false
+ supported_virtualisation_environments:
+ type: list
+ description: Identifies the virtualisation environments (e.g. hypervisor) compatible with this software image
+ required: false
+ entry_schema:
+ type: string
onap.datatypes.monitoring.metricsPerEventName:
derived_from: tosca.datatypes.Root
properties:
diff --git a/src/test/resources/example/sdc/service-Vloadbalancerms-csar.csar b/src/test/resources/example/sdc/service-Vloadbalancerms-csar.csar
deleted file mode 100755
index b5fe39d31..000000000
--- a/src/test/resources/example/sdc/service-Vloadbalancerms-csar.csar
+++ /dev/null
Binary files differ
diff --git a/src/test/resources/example/sdc/service_Vloadbalancerms_csar.csar b/src/test/resources/example/sdc/service_Vloadbalancerms_csar.csar
new file mode 100644
index 000000000..3330dd1e8
--- /dev/null
+++ b/src/test/resources/example/sdc/service_Vloadbalancerms_csar.csar
Binary files differ
diff --git a/src/test/resources/http-cache/third_party_proxy.py b/src/test/resources/http-cache/third_party_proxy.py
index f19aa0da4..0db977bb4 100755
--- a/src/test/resources/http-cache/third_party_proxy.py
+++ b/src/test/resources/http-cache/third_party_proxy.py
@@ -199,6 +199,18 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
with open(cached_file_content, 'w+') as f:
f.write(self.data_string)
return True
+ elif self.path.startswith("/policy/api/v1/policytypes/") and http_type == "GET":
+ print "self.path start with /policy/api/v1/policytypes/, generating response json..."
+ jsonGenerated = "{\"policyTypeId\": \"onap.policies.controlloop.operational\",\"policyTypeVersion\": \"1.0.0\",\"policyId\": \"OPERATIONAL_z711F_v1_0_ResourceInstanceName1_tca\"}"
+ print "jsonGenerated: " + jsonGenerated
+ if not os.path.exists(cached_file_folder):
+ os.makedirs(cached_file_folder, 0777)
+
+ with open(cached_file_header, 'w') as f:
+ f.write("{\"Content-Length\": \"" + str(len(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}")
+ with open(cached_file_content, 'w') as f:
+ f.write(jsonGenerated)
+ return True
else:
return False
diff --git a/src/test/resources/tosca/guard1-policy-payload.json b/src/test/resources/tosca/guard1-policy-payload.json
index bacf174fe..b4e0809c9 100644
--- a/src/test/resources/tosca/guard1-policy-payload.json
+++ b/src/test/resources/tosca/guard1-policy-payload.json
@@ -1,15 +1,15 @@
{
"policy-id": "guard1",
- "contents": {
+ "content": {
"recipe": "Rebuild",
"actor": "SO",
"clname": "testloop",
- "guardTargets": ".*",
- "minGuard": "3",
- "maxGuard": "7",
- "limitGuard": "",
- "timeUnitsGuard": "",
- "timeWindowGuard": "",
+ "targets": ".*",
+ "min": "3",
+ "max": "7",
+ "limit": "",
+ "timeUnits": "",
+ "timeWindow": "",
"guardActiveStart": "00:00:01-05:00",
"guardActiveEnd": "23:59:01-05:00"
}
diff --git a/src/test/resources/tosca/guard2-policy-payload.json b/src/test/resources/tosca/guard2-policy-payload.json
index 89f7ec89c..29beb6b98 100644
--- a/src/test/resources/tosca/guard2-policy-payload.json
+++ b/src/test/resources/tosca/guard2-policy-payload.json
@@ -1,15 +1,15 @@
{
"policy-id": "guard2",
- "contents": {
+ "content": {
"recipe": "Migrate",
"actor": "SO",
"clname": "testloop",
- "guardTargets": ".*",
- "minGuard": "1",
- "maxGuard": "2",
- "limitGuard": "",
- "timeUnitsGuard": "",
- "timeWindowGuard": "",
+ "targets": ".*",
+ "min": "1",
+ "max": "2",
+ "limit": "",
+ "timeUnits": "",
+ "timeWindow": "",
"guardActiveStart": "00:00:01-05:00",
"guardActiveEnd": "23:59:01-05:00"
}
diff --git a/src/test/resources/tosca/micro-service-policy-payload.json b/src/test/resources/tosca/micro-service-policy-payload.json
index 01d6d275c..2de06b083 100644
--- a/src/test/resources/tosca/micro-service-policy-payload.json
+++ b/src/test/resources/tosca/micro-service-policy-payload.json
@@ -4,7 +4,7 @@
"policies": [
{
"testPolicy": {
- "type": "onap.policy.monitoring.cdap.tca.hi.lo.app",
+ "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
"version": "1.0.0",
"metadata": {
"policy-id": "testPolicy"
diff --git a/src/test/resources/tosca/model-properties.json b/src/test/resources/tosca/model-properties.json
new file mode 100644
index 000000000..9e7db8ebc
--- /dev/null
+++ b/src/test/resources/tosca/model-properties.json
@@ -0,0 +1,123 @@
+{
+ "serviceDetails": {
+ "serviceType": "",
+ "namingPolicy": "",
+ "environmentContext": "General_Revenue-Bearing",
+ "serviceEcompNaming": "true",
+ "serviceRole": "",
+ "name": "vLoadBalancerMS",
+ "description": "vLBMS",
+ "invariantUUID": "30ec5b59-4799-48d8-ac5f-1058a6b0e48f",
+ "ecompGeneratedNaming": "true",
+ "category": "Network L4+",
+ "type": "Service",
+ "UUID": "63cac700-ab9a-4115-a74f-7eac85e3fce0",
+ "instantiationType": "A-la-carte"
+ },
+ "resourceDetails": {
+ "CP": {
+
+ },
+ "VL": {
+
+ },
+ "VF": {
+ "vLoadBalancerMS 0": {
+ "resourceVendor": "Test",
+ "resourceVendorModelNumber": "",
+ "name": "vLoadBalancerMS",
+ "description": "vLBMS",
+ "invariantUUID": "1a31b9f2-e50d-43b7-89b3-a040250cf506",
+ "subcategory": "Load Balancer",
+ "category": "Application L4+",
+ "type": "VF",
+ "UUID": "b4c4f3d7-929e-4b6d-a1cd-57e952ddc3e6",
+ "version": "1.0",
+ "resourceVendorRelease": "1.0",
+ "customizationUUID": "465246dc-7748-45f4-a013-308d92922552"
+ }
+ },
+ "CR": {
+
+ },
+ "VFC": {
+
+ },
+ "PNF": {
+
+ },
+ "Service": {
+
+ },
+ "CVFC": {
+
+ },
+ "Service Proxy": {
+
+ },
+ "Configuration": {
+
+ },
+ "AllottedResource": {
+
+ },
+ "VFModule": {
+ "Vloadbalancerms..vpkg..module-1": {
+ "vfModuleModelInvariantUUID": "ca052563-eb92-4b5b-ad41-9111768ce043",
+ "vfModuleModelVersion": "1",
+ "vfModuleModelName": "Vloadbalancerms..vpkg..module-1",
+ "vfModuleModelUUID": "1e725ccc-b823-4f67-82b9-4f4367070dbc",
+ "vfModuleModelCustomizationUUID": "1bffdc31-a37d-4dee-b65c-dde623a76e52",
+ "min_vf_module_instances": 0,
+ "vf_module_label": "vpkg",
+ "max_vf_module_instances": 1,
+ "vf_module_type": "Expansion",
+ "isBase": false,
+ "initial_count": 0,
+ "volume_group": false
+ },
+ "Vloadbalancerms..vdns..module-3": {
+ "vfModuleModelInvariantUUID": "4c10ba9b-f88f-415e-9de3-5d33336047fa",
+ "vfModuleModelVersion": "1",
+ "vfModuleModelName": "Vloadbalancerms..vdns..module-3",
+ "vfModuleModelUUID": "4fa73b49-8a6c-493e-816b-eb401567b720",
+ "vfModuleModelCustomizationUUID": "bafcdab0-801d-4d81-9ead-f464640a38b1",
+ "min_vf_module_instances": 0,
+ "vf_module_label": "vdns",
+ "max_vf_module_instances": 50,
+ "vf_module_type": "Expansion",
+ "isBase": false,
+ "initial_count": 0,
+ "volume_group": false
+ },
+ "Vloadbalancerms..base_template..module-0": {
+ "vfModuleModelInvariantUUID": "921f7c96-ebdd-42e6-81b9-1cfc0c9796f3",
+ "vfModuleModelVersion": "1",
+ "vfModuleModelName": "Vloadbalancerms..base_template..module-0",
+ "vfModuleModelUUID": "63734409-f745-4e4d-a38b-131638a0edce",
+ "vfModuleModelCustomizationUUID": "86baddea-c730-4fb8-9410-cd2e17fd7f27",
+ "min_vf_module_instances": 1,
+ "vf_module_label": "base_template",
+ "max_vf_module_instances": 1,
+ "vf_module_type": "Base",
+ "isBase": true,
+ "initial_count": 1,
+ "volume_group": false
+ },
+ "Vloadbalancerms..vlb..module-2": {
+ "vfModuleModelInvariantUUID": "a772a1f4-0064-412c-833d-4749b15828dd",
+ "vfModuleModelVersion": "1",
+ "vfModuleModelName": "Vloadbalancerms..vlb..module-2",
+ "vfModuleModelUUID": "0f5c3f6a-650a-4303-abb6-fff3e573a07a",
+ "vfModuleModelCustomizationUUID": "96a78aad-4ffb-4ef0-9c4f-deb03bf1d806",
+ "min_vf_module_instances": 0,
+ "vf_module_label": "vlb",
+ "max_vf_module_instances": 1,
+ "vf_module_type": "Expansion",
+ "isBase": false,
+ "initial_count": 0,
+ "volume_group": false
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/tosca/operational-policy-no-guard-properties.json b/src/test/resources/tosca/operational-policy-no-guard-properties.json
index 30c044044..fdb1906a4 100644
--- a/src/test/resources/tosca/operational-policy-no-guard-properties.json
+++ b/src/test/resources/tosca/operational-policy-no-guard-properties.json
@@ -22,7 +22,7 @@
"failure_guard": "",
"target": {
"type": "VM",
- "resourceId": "",
+ "resourceID": "",
"modelInvariantId": "",
"modelVersionId": "",
"modelName": "",
diff --git a/src/test/resources/tosca/operational-policy-payload-legacy.yaml b/src/test/resources/tosca/operational-policy-payload-legacy.yaml
new file mode 100644
index 000000000..41184c9c9
--- /dev/null
+++ b/src/test/resources/tosca/operational-policy-payload-legacy.yaml
@@ -0,0 +1,39 @@
+controlLoop:
+ abatement: true
+ controlLoopName: control loop
+ timeout: 30
+ trigger_policy: new1
+ version: 2.0.0
+policies:
+- actor: SO
+ failure: new2
+ failure_exception: new2
+ failure_guard: new2
+ failure_retries: new2
+ failure_timeout: new2
+ id: new1
+ payload:
+ configurationParameters: '[{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[10].value","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[15].value","enabled":"$.vf-module-topology.vf-module-parameters.param[22].value"}]'
+ requestParameters: '{"usePreload":true,"userParams":[]}'
+ recipe: Rebuild
+ retry: 10
+ success: new2
+ target:
+ resourceTargetId: test
+ type: VFC
+ timeout: 20
+- actor: SDNC
+ failure: final_failure
+ failure_exception: final_failure_exception
+ failure_guard: final_failure_guard
+ failure_retries: final_failure_retries
+ failure_timeout: final_failure_timeout
+ id: new2
+ payload: ''
+ recipe: Migrate
+ retry: 30
+ success: final_success
+ target:
+ resourceTargetId: test
+ type: VFC
+ timeout: 40
diff --git a/src/test/resources/tosca/operational-policy-payload.json b/src/test/resources/tosca/operational-policy-payload.json
new file mode 100644
index 000000000..5097654da
--- /dev/null
+++ b/src/test/resources/tosca/operational-policy-payload.json
@@ -0,0 +1,4 @@
+{
+ "policy-id": "testPolicy",
+ "content": "controlLoop%3A%0A++abatement%3A+true%0A++controlLoopName%3A+control+loop%0A++timeout%3A+30%0A++trigger_policy%3A+new1%0A++version%3A+2.0.0%0Apolicies%3A%0A-+actor%3A+SO%0A++failure%3A+new2%0A++failure_exception%3A+new2%0A++failure_guard%3A+new2%0A++failure_retries%3A+new2%0A++failure_timeout%3A+new2%0A++id%3A+new1%0A++payload%3A%0A++++configurationParameters%3A+%27%5B%7B%22ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B10%5D.value%22%2C%22oam-ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B15%5D.value%22%2C%22enabled%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B22%5D.value%22%7D%5D%27%0A++++requestParameters%3A+%27%7B%22usePreload%22%3Atrue%2C%22userParams%22%3A%5B%5D%7D%27%0A++recipe%3A+Rebuild%0A++retry%3A+10%0A++success%3A+new2%0A++target%3A%0A++++resourceTargetId%3A+test%0A++++type%3A+VFC%0A++timeout%3A+20%0A-+actor%3A+SDNC%0A++failure%3A+final_failure%0A++failure_exception%3A+final_failure_exception%0A++failure_guard%3A+final_failure_guard%0A++failure_retries%3A+final_failure_retries%0A++failure_timeout%3A+final_failure_timeout%0A++id%3A+new2%0A++payload%3A+%27%27%0A++recipe%3A+Migrate%0A++retry%3A+30%0A++success%3A+final_success%0A++target%3A%0A++++resourceTargetId%3A+test%0A++++type%3A+VFC%0A++timeout%3A+40%0A"
+} \ No newline at end of file
diff --git a/src/test/resources/tosca/operational-policy-payload.yaml b/src/test/resources/tosca/operational-policy-payload.yaml
index 68116b00b..c3a6b5c23 100644
--- a/src/test/resources/tosca/operational-policy-payload.yaml
+++ b/src/test/resources/tosca/operational-policy-payload.yaml
@@ -4,28 +4,39 @@ topology_template:
- testPolicy:
type: onap.policies.controlloop.Operational
version: 1.0.0
- metadata: {policy-id: testPolicy}
+ metadata:
+ policy-id: testPolicy
properties:
- controlLoop: {controlLoopName: control loop, version: 2.0.0, trigger_policy: new1,
- timeout: '30', abatement: 'true'}
+ controlLoop:
+ controlLoopName: control loop
+ version: 2.0.0
+ trigger_policy: new1
+ timeout: '30'
+ abatement: 'true'
policies:
- id: new1
recipe: Rebuild
retry: '10'
timeout: '20'
actor: SO
- payload: test
+ payload:
+ requestParameters: '{"usePreload":true,"userParams":[]}'
+ configurationParameters: '[{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[10].value","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[15].value","enabled":"$.vf-module-topology.vf-module-parameters.param[22].value"}]'
success: new2
failure: new2
failure_timeout: new2
failure_retries: new2
failure_exception: new2
failure_guard: new2
- target: {type: VFC, resourceTargetId: test}
+ target:
+ type: VFC
+ resourceTargetId: test
- id: new2
recipe: Migrate
retry: '30'
timeout: '40'
actor: SDNC
- payload: test
- target: {type: VFC, resourceTargetId: test}
+ payload: ''
+ target:
+ type: VFC
+ resourceTargetId: test
diff --git a/src/test/resources/tosca/operational-policy-properties.json b/src/test/resources/tosca/operational-policy-properties.json
index 503616593..bfce6b331 100644
--- a/src/test/resources/tosca/operational-policy-properties.json
+++ b/src/test/resources/tosca/operational-policy-properties.json
@@ -4,12 +4,12 @@
"recipe": "Rebuild",
"actor": "SO",
"clname": "testloop",
- "guardTargets": ".*",
- "minGuard": "3",
- "maxGuard": "7",
- "limitGuard": "",
- "timeUnitsGuard": "",
- "timeWindowGuard": "",
+ "targets": ".*",
+ "min": "3",
+ "max": "7",
+ "limit": "",
+ "timeUnits": "",
+ "timeWindow": "",
"guardActiveStart": "00:00:01-05:00",
"guardActiveEnd": "23:59:01-05:00"
},
@@ -17,12 +17,12 @@
"recipe": "Migrate",
"actor": "SO",
"clname": "testloop",
- "guardTargets": ".*",
- "minGuard": "1",
- "maxGuard": "2",
- "limitGuard": "",
- "timeUnitsGuard": "",
- "timeWindowGuard": "",
+ "targets": ".*",
+ "min": "1",
+ "max": "2",
+ "limit": "",
+ "timeUnits": "",
+ "timeWindow": "",
"guardActiveStart": "00:00:01-05:00",
"guardActiveEnd": "23:59:01-05:00"
}
@@ -42,7 +42,7 @@
"retry": "10",
"timeout": "20",
"actor": "SO",
- "payload": "test",
+ "payload": "requestParameters: '{\"usePreload\":true,\"userParams\":[]}'\r\nconfigurationParameters: '[{\"ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[10].value\",\"oam-ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[15].value\",\"enabled\":\"$.vf-module-topology.vf-module-parameters.param[22].value\"}]'",
"success": "new2",
"failure": "new2",
"failure_timeout": "new2",
@@ -60,7 +60,7 @@
"retry": "30",
"timeout": "40",
"actor": "SDNC",
- "payload": "test",
+ "payload": "",
"target": {
"type": "VFC",
"resourceTargetId": "test"
diff --git a/src/test/resources/tosca/tosca_example.yaml b/src/test/resources/tosca/tosca_example.yaml
index 699cffd7e..b0119f887 100644
--- a/src/test/resources/tosca/tosca_example.yaml
+++ b/src/test/resources/tosca/tosca_example.yaml
@@ -3,7 +3,7 @@ policy_types:
onap.policies.Monitoring:
derived_from: tosca.policies.Root
description: a base policy type for all policies that governs monitoring provisioning
- onap.policy.monitoring.cdap.tca.hi.lo.app:
+ onap.policies.monitoring.cdap.tca.hi.lo.app:
derived_from: onap.policies.Monitoring
version: 1.0.0
properties: