From 1f2d62dd48694fa78041572a200b3e5d04bd268e Mon Sep 17 00:00:00 2001 From: sebdet Date: Wed, 7 Apr 2021 10:10:45 +0200 Subject: Update dependencies Update dependencies to remove some issues reported by Nexus-IQ. Issue-ID: POLICY-3169 Issue-ID: POLICY-3120 Signed-off-by: sebdet Change-Id: Ia8939f0c85ac4087c3fc2c71b66914d6c7178347 --- docs/index.rst | 8 +- extra/docker/clamp/clamp.env | 2 +- pom.xml | 77 ++++----- .../authorization/AuthorizationController.java | 43 +++-- .../policy/clamp/authorization/UserService.java | 6 +- .../org/onap/policy/clamp/clds/Application.java | 18 ++- .../onap/policy/clamp/clds/client/CdsServices.java | 22 ++- .../clamp/clds/client/DcaeInventoryServices.java | 2 +- .../clamp/clds/config/CamelConfiguration.java | 160 +++++++++++-------- .../onap/policy/clamp/clds/util/LoggingUtils.java | 8 +- .../clamp/configuration/ClampGsonDataFormat.java | 4 +- .../loop/components/external/DcaeComponent.java | 6 +- .../policy/clamp/policy/PolicyEngineServices.java | 15 +- src/main/resources/application-noaaf.properties | 25 +-- src/main/resources/application.properties | 22 +-- .../resources/clds/camel/rest/clamp-api-v2.xml | 161 +++++++++---------- .../resources/clds/camel/rest/clds-services.xml | 2 +- src/main/resources/clds/camel/routes/cds-flows.xml | 12 +- .../resources/clds/camel/routes/dcae-flows.xml | 152 +++++++++--------- .../resources/clds/camel/routes/loop-flows.xml | 74 ++++----- .../resources/clds/camel/routes/policy-flows.xml | 175 +++++++++++---------- .../resources/clds/camel/routes/utils-flows.xml | 4 +- .../policy/clamp/flow/FlowLogOperationTest.java | 10 +- .../policy/clamp/loop/CsarInstallerItCase.java | 20 +-- .../onap/policy/clamp/loop/DcaeComponentTest.java | 41 +---- .../policy/clamp/loop/LoopServiceTestItCase.java | 4 +- src/test/resources/application.properties | 24 +-- .../resources/example/dcae/inventory-response.json | 78 +++++++++ src/test/resources/https/https-test.properties | 12 +- .../robotframework/robotframework-test.properties | 24 +-- 30 files changed, 654 insertions(+), 557 deletions(-) create mode 100644 src/test/resources/example/dcae/inventory-response.json diff --git a/docs/index.rst b/docs/index.rst index d1aedae45..4fd4def67 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -83,14 +83,14 @@ There are one datasource for Clamp. By default, it will try to connect to the lo "spring.datasource.cldsdb.url": "jdbc:mariadb:sequential://clampdb.{{ include "common.namespace" . }}:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3", "clamp.config.files.sdcController": "file:/opt/clamp/sdc-controllers-config.json", "clamp.config.dcae.inventory.url": "https://inventory.{{ include "common.namespace" . }}:8080", - "clamp.config.dcae.dispatcher.url": "https4://deployment-handler.{{ include "common.namespace" . }}:8443", - "clamp.config.dcae.deployment.url": "https4://deployment-handler.{{ include "common.namespace" . }}:8443", + "clamp.config.dcae.dispatcher.url": "https://deployment-handler.{{ include "common.namespace" . }}:8443", + "clamp.config.dcae.deployment.url": "https://deployment-handler.{{ include "common.namespace" . }}:8443", "clamp.config.dcae.deployment.userName": "none", "clamp.config.dcae.deployment.password": "none", - "clamp.config.policy.api.url": "https4://policy-api.{{ include "common.namespace" . }}:6969", + "clamp.config.policy.api.url": "https://policy-api.{{ include "common.namespace" . }}:6969", "clamp.config.policy.api.userName": "healthcheck", "clamp.config.policy.api.password": "zb!XztG34", - "clamp.config.policy.pap.url": "https4://policy-pap.{{ include "common.namespace" . }}:6969", + "clamp.config.policy.pap.url": "https://policy-pap.{{ include "common.namespace" . }}:6969", "clamp.config.policy.pap.userName": "healthcheck", "clamp.config.policy.pap.password": "zb!XztG34", "clamp.config.cadi.aafLocateUrl": "https://aaf-locate.{{ include "common.namespace" . }}:8095", diff --git a/extra/docker/clamp/clamp.env b/extra/docker/clamp/clamp.env index eb9e54784..5d31aa42e 100644 --- a/extra/docker/clamp/clamp.env +++ b/extra/docker/clamp/clamp.env @@ -1,2 +1,2 @@ ### Be careful, this must be in one line only ### -SPRING_APPLICATION_JSON={"spring.datasource.url":"jdbc:mariadb:sequential://db:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3","spring.profiles.active":"clamp-default,clamp-default-user,clamp-sdc-controller,clamp-ssl-config,clamp-policy-controller,default-dictionary-elements","clamp.config.policy.api.url":"http4://third-party-proxy:8085","clamp.config.policy.pap.url":"http4://third-party-proxy:8085","clamp.config.dcae.inventory.url":"http://third-party-proxy:8085","clamp.config.dcae.deployment.url":"http4://third-party-proxy:8085"} +SPRING_APPLICATION_JSON={"spring.datasource.url":"jdbc:mariadb:sequential://db:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3","spring.profiles.active":"clamp-default,clamp-default-user,clamp-sdc-controller,clamp-ssl-config,clamp-policy-controller,default-dictionary-elements","clamp.config.policy.api.url":"http://third-party-proxy:8085","clamp.config.policy.pap.url":"http://third-party-proxy:8085","clamp.config.dcae.inventory.url":"http://third-party-proxy:8085","clamp.config.dcae.deployment.url":"http://third-party-proxy:8085"} diff --git a/pom.xml b/pom.xml index f20d46ffb..d7a624164 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ - The ONAP POLICY-CLAMP JAR that contains CLAMP back-end code. - The DOCKER images for: * POLICY-CLAMP backend (Java Spring) - * POLICY-CLAMP frontend (Javscript React) + * POLICY-CLAMP frontend (Javascript React) It can test: - The POLICY-CLAMP backend, JAVA unit testing @@ -79,8 +79,8 @@ UTF-8 1.0.0 - 2.25.3 - 2.2.13.RELEASE + 3.7.3 + 2.4.4 jacoco ${project.build.directory}/surefire-reports @@ -105,7 +105,7 @@ true false - 9.0.37 + 9.0.45 ui-react ui-react-lib https://nexus3.onap.org/repository/npm.snapshot/ @@ -253,8 +253,8 @@ - org.apache.camel - camel-spring-boot-dependencies + org.apache.camel.springboot + camel-spring-boot-bom ${camel.version} pom import @@ -305,27 +305,27 @@ - org.apache.camel - camel-http4-starter + org.apache.camel.springboot + camel-http-starter - org.apache.camel + org.apache.camel.springboot camel-spring-boot-starter - org.apache.camel + org.apache.camel.springboot camel-jaxb-starter - org.apache.camel + org.apache.camel.springboot camel-servlet-starter - org.apache.camel + org.apache.camel.springboot camel-gson-starter - org.apache.camel + org.apache.camel.springboot camel-swagger-java-starter @@ -422,7 +422,7 @@ commons-io commons-io - 2.6 + 2.8.0 com.googlecode.json-simple @@ -432,7 +432,7 @@ org.apache.commons commons-vfs2 - 2.2 + 2.8.0 org.slf4j @@ -452,34 +452,25 @@ commons-codec commons-codec - 1.14 - - - org.springframework.security - spring-security-web - 5.2.3.RELEASE + 1.15 org.codehaus.plexus plexus-utils - 3.0.24 + 3.3.0 org.jboss.spec.javax.ws.rs jboss-jaxrs-api_2.0_spec 1.0.1.Final - - com.google.guava - guava - 27.0-jre - + org.mariadb.jdbc mariadb-java-client - 2.6.2 + 2.7.2 @@ -501,7 +492,7 @@ org.yaml snakeyaml - 1.26 + 1.28 org.dom4j @@ -511,10 +502,10 @@ - junit - junit + org.junit.vintage + junit-vintage-engine + 5.7.1 test - 4.13 org.assertj @@ -522,12 +513,6 @@ 3.10.0 test - - org.mockito - mockito-core - 2.28.2 - test - org.powermock powermock-api-mockito2 @@ -543,7 +528,7 @@ com.github.docker-java docker-java-core - 3.2.1 + 3.2.7 test @@ -555,7 +540,7 @@ com.github.docker-java docker-java - 3.2.1 + 3.2.7 test @@ -819,7 +804,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.0.2 + 3.2.0 jar-with-only-classes @@ -839,7 +824,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.0.0 + 3.2.0 @@ -931,7 +916,7 @@ io.fabric8 docker-maven-plugin - 0.31.0 + 0.35.0 org.apache.httpcomponents @@ -1168,7 +1153,7 @@ com.github.eirslett frontend-maven-plugin - 1.8.0 + 1.11.3 ${project.build.directory}/${ui.react.src} ${repo.npm} @@ -1181,8 +1166,8 @@ generate-sources - v12.13.0 - 6.13.0 + v14.16.1 + 6.14.12 diff --git a/src/main/java/org/onap/policy/clamp/authorization/AuthorizationController.java b/src/main/java/org/onap/policy/clamp/authorization/AuthorizationController.java index f703e3363..89be4fc28 100644 --- a/src/main/java/org/onap/policy/clamp/authorization/AuthorizationController.java +++ b/src/main/java/org/onap/policy/clamp/authorization/AuthorizationController.java @@ -1,8 +1,8 @@ /*- * ============LICENSE_START======================================================= - * ONAP CLAMP + * ONAP POLICY-CLAMP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights + * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Modifications Copyright (c) 2019 Samsung @@ -48,17 +48,14 @@ import org.springframework.stereotype.Component; public class AuthorizationController { protected static final EELFLogger logger = - EELFManager.getInstance().getLogger(AuthorizationController.class); + EELFManager.getInstance().getLogger(AuthorizationController.class); protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); - protected static final EELFLogger securityLogger = - EELFManager.getInstance().getSecurityLogger(); + protected static final EELFLogger securityLogger = EELFManager.getInstance().getSecurityLogger(); // By default we'll set it to a default handler @Autowired private ClampProperties refProp; - private SecurityContext securityContext = SecurityContextHolder.getContext(); - public static final String PERM_PREFIX = "security.permission.type."; private static final String PERM_INSTANCE = "security.permission.instance"; @@ -81,23 +78,19 @@ public class AuthorizationController { */ public static String getPrincipalName(SecurityContext securityContext) { String principal = AuthorizationController.retrieveUserName(securityContext); - String name = "Not found"; - if (principal != null) { - name = principal; - } - return name; + return principal != null ? principal : "Not found"; } /** * Insert authorize the api based on the permission. * * @param camelExchange The Camel Exchange object containing the properties - * @param typeVar The type of the permissions - * @param instanceVar The instance of the permissions. e.g. dev - * @param action The action of the permissions. e.g. read + * @param typeVar The type of the permissions + * @param instanceVar The instance of the permissions. e.g. dev + * @param action The action of the permissions. e.g. read */ public void authorize(Exchange camelExchange, String typeVar, String instanceVar, - String action) { + String action) { String type = refProp.getStringValue(PERM_PREFIX + typeVar); String instance = refProp.getStringValue(PERM_INSTANCE); @@ -108,7 +101,7 @@ public class AuthorizationController { if (null != instanceVar && !instanceVar.isEmpty()) { instance = instanceVar; } - String principalName = AuthorizationController.getPrincipalName(this.securityContext); + String principalName = AuthorizationController.getPrincipalName(SecurityContextHolder.getContext()); SecureServicePermission perm = SecureServicePermission.create(type, instance, action); Date startTime = new Date(); LoggingUtils.setTargetContext("Clamp", "authorize"); @@ -131,23 +124,23 @@ public class AuthorizationController { */ public boolean isUserPermitted(SecureServicePermission inPermission) { - String principalName = AuthorizationController.getPrincipalName(this.securityContext); + String principalName = AuthorizationController.getPrincipalName(SecurityContextHolder.getContext()); // check if the user has the permission key or the permission key with a // combination of all instance and/or all action. if (hasRole(inPermission.getKey()) || hasRole(inPermission.getKeyAllInstance())) { auditLogger.info("{} authorized because user has permission with * for instance: {}", - principalName, inPermission.getKey().replace("|", ":")); + principalName, inPermission.getKey().replace("|", ":")); return true; // the rest of these don't seem to be required - isUserInRole method // appears to take * as a wildcard } else if (hasRole(inPermission.getKeyAllInstanceAction())) { auditLogger.info( - "{} authorized because user has permission with * for instance and * for action: {}", - principalName, inPermission.getKey().replace("|", ":")); + "{} authorized because user has permission with * for instance and * for action: {}", + principalName, inPermission.getKey().replace("|", ":")); return true; } else if (hasRole(inPermission.getKeyAllAction())) { auditLogger.info("{} authorized because user has permission with * for action: {}", - principalName, inPermission.getKey().replace("|", ":")); + principalName, inPermission.getKey().replace("|", ":")); return true; } else { return false; @@ -155,7 +148,7 @@ public class AuthorizationController { } protected boolean hasRole(String role) { - Authentication authentication = securityContext.getAuthentication(); + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication == null) { return false; } @@ -176,11 +169,11 @@ public class AuthorizationController { */ public ClampInformation getClampInformation() { ClampInformation clampInfo = new ClampInformation(); - Authentication authentication = securityContext.getAuthentication(); + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication == null) { return new ClampInformation(); } - clampInfo.setUserName(AuthorizationController.getPrincipalName(this.securityContext)); + clampInfo.setUserName(AuthorizationController.getPrincipalName(SecurityContextHolder.getContext())); for (GrantedAuthority auth : authentication.getAuthorities()) { clampInfo.getAllPermissions().add(auth.getAuthority()); } diff --git a/src/main/java/org/onap/policy/clamp/authorization/UserService.java b/src/main/java/org/onap/policy/clamp/authorization/UserService.java index c748a5a54..96347f82f 100644 --- a/src/main/java/org/onap/policy/clamp/authorization/UserService.java +++ b/src/main/java/org/onap/policy/clamp/authorization/UserService.java @@ -22,8 +22,6 @@ package org.onap.policy.clamp.authorization; - -import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; @@ -34,14 +32,12 @@ import org.springframework.stereotype.Controller; @Controller public class UserService { - private SecurityContext securityContext = SecurityContextHolder.getContext(); - /** * REST service that returns the username. * * @return the user name */ public String getUser() { - return AuthorizationController.getPrincipalName(securityContext); + return AuthorizationController.getPrincipalName(SecurityContextHolder.getContext()); } } \ No newline at end of file diff --git a/src/main/java/org/onap/policy/clamp/clds/Application.java b/src/main/java/org/onap/policy/clamp/clds/Application.java index 79247ca63..17f08c973 100644 --- a/src/main/java/org/onap/policy/clamp/clds/Application.java +++ b/src/main/java/org/onap/policy/clamp/clds/Application.java @@ -1,8 +1,8 @@ /*- * ============LICENSE_START======================================================= - * ONAP CLAMP + * ONAP POLICY-CLAMP * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights + * Copyright (C) 2017-2018, 2021 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Modifications Copyright (c) 2019 Samsung @@ -35,6 +35,7 @@ import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.Enumeration; +import org.apache.camel.component.servlet.springboot.ServletMappingAutoConfiguration; import org.apache.catalina.connector.Connector; import org.onap.policy.clamp.clds.util.ClampVersioning; import org.onap.policy.clamp.clds.util.ResourceFileUtils; @@ -61,10 +62,11 @@ import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.transaction.annotation.EnableTransactionManagement; -@ComponentScan(basePackages = { "org.onap.policy.clamp" }) -@SpringBootApplication(exclude = { SecurityAutoConfiguration.class, UserDetailsServiceAutoConfiguration.class }) -@EnableJpaRepositories(basePackages = { "org.onap.policy.clamp" }) -@EntityScan(basePackages = { "org.onap.policy.clamp" }) +@ComponentScan(basePackages = {"org.onap.policy.clamp"}) +@SpringBootApplication(exclude = {SecurityAutoConfiguration.class, UserDetailsServiceAutoConfiguration.class, + ServletMappingAutoConfiguration.class}) +@EnableJpaRepositories(basePackages = {"org.onap.policy.clamp"}) +@EntityScan(basePackages = {"org.onap.policy.clamp"}) @EnableTransactionManagement @EnableConfigurationProperties @EnableAsync @@ -95,6 +97,10 @@ public class Application extends SpringBootServletInitializer { return application.sources(Application.class); } + /** + * Main method that starts the Clamp backend. + * @param args app params + */ public static void main(String[] args) { // Start the Spring application SpringApplication.run(Application.class, args); diff --git a/src/main/java/org/onap/policy/clamp/clds/client/CdsServices.java b/src/main/java/org/onap/policy/clamp/clds/client/CdsServices.java index ff79ef413..085e905e9 100644 --- a/src/main/java/org/onap/policy/clamp/clds/client/CdsServices.java +++ b/src/main/java/org/onap/policy/clamp/clds/client/CdsServices.java @@ -74,12 +74,10 @@ public class CdsServices { public CdsBpWorkFlowListResponse getBlueprintWorkflowList(String blueprintName, String blueprintVersion) { LoggingUtils.setTargetContext("CDS", "getBlueprintWorkflowList"); - Exchange myCamelExchange = ExchangeBuilder.anExchange(camelContext) - .withProperty("blueprintName", blueprintName).withProperty("blueprintVersion", blueprintVersion) - .build(); - Exchange exchangeResponse = camelContext.createProducerTemplate() - .send("direct:get-blueprint-workflow-list", myCamelExchange); + .send("direct:get-blueprint-workflow-list", ExchangeBuilder.anExchange(camelContext) + .withProperty("blueprintName", blueprintName).withProperty("blueprintVersion", blueprintVersion) + .withProperty("raiseHttpExceptionFlag", true).build()); if (Integer.valueOf(200).equals(exchangeResponse.getIn().getHeader("CamelHttpResponseCode"))) { String cdsResponse = (String) exchangeResponse.getIn().getBody(); @@ -107,12 +105,10 @@ public class CdsServices { String workflow) { LoggingUtils.setTargetContext("CDS", "getWorkflowInputProperties"); - Exchange myCamelExchange = ExchangeBuilder.anExchange(camelContext) - .withBody(getCdsPayloadForWorkFlow(blueprintName, blueprintVersion, workflow)) - .build(); - Exchange exchangeResponse = camelContext.createProducerTemplate() - .send("direct:get-blueprint-workflow-input-properties", myCamelExchange); + .send("direct:get-blueprint-workflow-input-properties", ExchangeBuilder.anExchange(camelContext) + .withBody(getCdsPayloadForWorkFlow(blueprintName, blueprintVersion, workflow)) + .withProperty("raiseHttpExceptionFlag", true).build()); if (Integer.valueOf(200).equals(exchangeResponse.getIn().getHeader("CamelHttpResponseCode"))) { String cdsResponse = (String) exchangeResponse.getIn().getBody(); @@ -159,9 +155,9 @@ public class CdsServices { } private void handleListType(String propertyName, - JsonObject inputProperty, - JsonObject dataTypes, - JsonObject inputObject) { + JsonObject inputProperty, + JsonObject dataTypes, + JsonObject inputObject) { if (inputProperty.get("entry_schema") == null) { throw new CdsParametersException("Entry schema is null for " + propertyName); } diff --git a/src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java b/src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java index fed061e7d..1956a962f 100644 --- a/src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java +++ b/src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java @@ -109,7 +109,7 @@ public class DcaeInventoryServices { for (int i = 0; i < retryLimit; i++) { Exchange myCamelExchange = ExchangeBuilder.anExchange(camelContext) .withProperty("blueprintResourceId", resourceUuid).withProperty("blueprintServiceId", serviceUuid) - .withProperty("blueprintName", artifactName).build(); + .withProperty("blueprintName", artifactName).withProperty("raiseHttpExceptionFlag", true).build(); metricsLogger.info("Attempt n°" + i + " to contact DCAE inventory"); Exchange exchangeResponse = camelContext.createProducerTemplate() diff --git a/src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java b/src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java index 9431f40e8..5f10c0afb 100644 --- a/src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java @@ -1,8 +1,8 @@ /*- * ============LICENSE_START======================================================= - * ONAP CLAMP + * ONAP POLICY-CLAMP * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights + * Copyright (C) 2018, 2021 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,112 +23,144 @@ package org.onap.policy.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 java.util.Objects; 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.component.http.HttpComponent; import org.apache.camel.model.rest.RestBindingMode; +import org.apache.http.client.config.RequestConfig; 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.policy.clamp.clds.util.ClampVersioning; import org.onap.policy.clamp.clds.util.ResourceFileUtils; import org.onap.policy.clamp.util.PassDecoder; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component public class CamelConfiguration extends RouteBuilder { + private static final String HTTP = "http"; + private static final String HTTPS = "https"; + @Autowired CamelContext camelContext; + @Value("${server.ssl.key-store:#{null}}") + private String keyStore; + + @Value("${server.ssl.key-store-type:JKS}") + private String keyStoreType; + + @Value("${server.ssl.key-store-password:#{null}}") + private String keyStorePass; + + @Value("${server.ssl.trust-store:#{null}}") + private String trustStore; + + @Value("${server.ssl.trust-store-password:#{null}}") + private String trustStorePass; + + @Value("${server.ssl.trust-store-type:JKS}") + private String trustStoreType; + + @Value("${server.ssl.trust-store-algorithm:PKIX}") + private String trustStoreAlgorithm; + + @Value("${clamp.config.httpclient.connectTimeout:-1}") + private int connectTimeout; + + @Value("${clamp.config.httpclient.connectRequestTimeout:-1}") + private int connectRequestTimeout; + + @Value("${clamp.config.httpclient.socketTimeout:-1}") + private int socketTimeout; + + @Value("${clamp.config.keyFile:#{null}}") + private String keyFile; + + @Autowired - private Environment env; - - private void configureDefaultSslProperties() throws IOException { - if (env.getProperty("server.ssl.trust-store") != null) { - URL storeResource = Thread.currentThread().getContextClassLoader() - .getResource(env.getProperty("server.ssl.trust-store").replaceFirst("classpath:", "")); - System.setProperty("javax.net.ssl.trustStore", storeResource.getPath()); - String keyFile = env.getProperty("clamp.config.keyFile"); - String trustStorePass = PassDecoder.decode(env.getProperty("server.ssl.trust-store-password"), - keyFile); - System.setProperty("javax.net.ssl.trustStorePassword", trustStorePass); - System.setProperty("javax.net.ssl.trustStoreType", "jks"); - System.setProperty("ssl.TrustManagerFactory.algorithm", "PKIX"); - storeResource = Thread.currentThread().getContextClassLoader() - .getResource(env.getProperty("server.ssl.key-store").replaceFirst("classpath:", "")); - System.setProperty("javax.net.ssl.keyStore", storeResource.getPath()); - - String keyStorePass = PassDecoder.decode(env.getProperty("server.ssl.key-store-password"), - keyFile); - System.setProperty("javax.net.ssl.keyStorePassword", keyStorePass); - System.setProperty("javax.net.ssl.keyStoreType", env.getProperty("server.ssl.key-store-type")); + private ClampProperties clampProperties; + + private void configureDefaultSslProperties() { + if (trustStore != null) { + System.setProperty("javax.net.ssl.trustStore", Thread.currentThread().getContextClassLoader() + .getResource(trustStore.replaceFirst("classpath:", "")).getPath()); + System.setProperty("javax.net.ssl.trustStorePassword", Objects.requireNonNull( + PassDecoder.decode(trustStorePass, keyFile))); + System.setProperty("javax.net.ssl.trustStoreType", trustStoreType); + System.setProperty("ssl.TrustManagerFactory.algorithm", trustStoreAlgorithm); + } + if (keyStore != null) { + System.setProperty("javax.net.ssl.keyStore", Thread.currentThread().getContextClassLoader() + .getResource(keyStore.replaceFirst("classpath:", "")).getPath()); + System.setProperty("javax.net.ssl.keyStorePassword", Objects.requireNonNull( + PassDecoder.decode(keyStorePass, keyFile))); + System.setProperty("javax.net.ssl.keyStoreType", keyStoreType); } + } - private void registerTrustStore() - throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException, CertificateException, IOException { - if (env.getProperty("server.ssl.trust-store") != null) { - KeyStore truststore = KeyStore.getInstance("JKS"); - String keyFile = env.getProperty("clamp.config.keyFile"); - String password = PassDecoder.decode(env.getProperty("server.ssl.trust-store-password"), keyFile); - truststore.load( - ResourceFileUtils.getResourceAsStream(env.getProperty("server.ssl.trust-store")), - password.toCharArray()); + private void configureCamelHttpComponent() + throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException, CertificateException, + IOException { + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(connectTimeout) + .setConnectionRequestTimeout(connectRequestTimeout) + .setSocketTimeout(socketTimeout).build(); - TrustManagerFactory trustFactory = TrustManagerFactory.getInstance("PKIX"); + if (trustStore != null) { + KeyStore truststore = KeyStore.getInstance(trustStoreType); + truststore.load( + ResourceFileUtils.getResourceAsStream(trustStore), + Objects.requireNonNull(PassDecoder.decode(trustStorePass, keyFile)).toCharArray()); + TrustManagerFactory trustFactory = TrustManagerFactory.getInstance(trustStoreAlgorithm); 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 registry = RegistryBuilder.create() - .register("https", factory).register("http", plainsf).build(); - builder.setConnectionManager(new BasicHttpClientConnectionManager(registry)); - } + camelContext.getComponent(HTTPS, HttpComponent.class).setHttpClientConfigurer(builder -> { + SSLSocketFactory factory = new SSLSocketFactory(sslcontext, + SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); + builder.setSSLSocketFactory(factory); + builder.setConnectionManager(new BasicHttpClientConnectionManager( + RegistryBuilder.create().register(HTTPS, factory).build())) + .setDefaultRequestConfig(requestConfig); }); } + camelContext.getComponent(HTTP, HttpComponent.class).setHttpClientConfigurer(builder -> { + Registry registry = RegistryBuilder.create() + .register(HTTP, PlainConnectionSocketFactory.getSocketFactory()).build(); + builder.setConnectionManager(new BasicHttpClientConnectionManager(registry)) + .setDefaultRequestConfig(requestConfig); + }); } @Override public void configure() - throws KeyManagementException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { + 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/"); - - // camelContext.setTracing(true); + .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/"); + // Configure httpClient properties for Camel HTTP/HTTPS calls configureDefaultSslProperties(); - registerTrustStore(); + configureCamelHttpComponent(); } } diff --git a/src/main/java/org/onap/policy/clamp/clds/util/LoggingUtils.java b/src/main/java/org/onap/policy/clamp/clds/util/LoggingUtils.java index d7a158e73..b5f9837b0 100644 --- a/src/main/java/org/onap/policy/clamp/clds/util/LoggingUtils.java +++ b/src/main/java/org/onap/policy/clamp/clds/util/LoggingUtils.java @@ -1,8 +1,8 @@ /*- * ============LICENSE_START======================================================= - * ONAP CLAMP + * ONAP POLICY-CLAMP * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights + * Copyright (C) 2017-2018, 2021 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -62,10 +62,10 @@ public class LoggingUtils { private static final String EMPTY_MESSAGE = ""; /** Logger delegate. */ - private Logger mlogger; + private final Logger mlogger; /** Automatic UUID, overrideable per adapter or per invocation. */ - private static UUID sInstanceUUID = UUID.randomUUID(); + private static final UUID sInstanceUUID = UUID.randomUUID(); /** * Constructor. diff --git a/src/main/java/org/onap/policy/clamp/configuration/ClampGsonDataFormat.java b/src/main/java/org/onap/policy/clamp/configuration/ClampGsonDataFormat.java index e5f12163e..95d1fe182 100644 --- a/src/main/java/org/onap/policy/clamp/configuration/ClampGsonDataFormat.java +++ b/src/main/java/org/onap/policy/clamp/configuration/ClampGsonDataFormat.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP CLAMP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights + * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,7 +34,7 @@ import java.nio.charset.StandardCharsets; import org.apache.camel.Exchange; import org.apache.camel.spi.DataFormat; import org.apache.camel.spi.DataFormatName; -import org.apache.camel.support.ServiceSupport; +import org.apache.camel.support.service.ServiceSupport; import org.apache.camel.util.IOHelper; import org.onap.policy.clamp.clds.util.JsonUtils; diff --git a/src/main/java/org/onap/policy/clamp/loop/components/external/DcaeComponent.java b/src/main/java/org/onap/policy/clamp/loop/components/external/DcaeComponent.java index 1b36aab55..6a935d011 100644 --- a/src/main/java/org/onap/policy/clamp/loop/components/external/DcaeComponent.java +++ b/src/main/java/org/onap/policy/clamp/loop/components/external/DcaeComponent.java @@ -1,8 +1,8 @@ /*- * ============LICENSE_START======================================================= - * ONAP CLAMP + * ONAP POLICY-CLAMP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights + * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -125,7 +125,7 @@ public class DcaeComponent extends ExternalComponent { * @return the Right Url modified if needed */ public static String getStatusUrl(DcaeOperationStatusResponse dcaeResponse) { - return dcaeResponse.getLinks().getStatus().replaceAll("http:", "http4:").replaceAll("https:", "https4:"); + return dcaeResponse.getLinks().getStatus(); } /** diff --git a/src/main/java/org/onap/policy/clamp/policy/PolicyEngineServices.java b/src/main/java/org/onap/policy/clamp/policy/PolicyEngineServices.java index bdd77cb41..1a936bbca 100644 --- a/src/main/java/org/onap/policy/clamp/policy/PolicyEngineServices.java +++ b/src/main/java/org/onap/policy/clamp/policy/PolicyEngineServices.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * ONAP CLAMP + * ONAP POLICY-CLAMP * ================================================================================ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights * reserved. @@ -145,8 +145,9 @@ public class PolicyEngineServices { * @return A yaml containing all policy Types and all data types */ public String downloadAllPolicyModels() { - return callCamelRoute(ExchangeBuilder.anExchange(camelContext).build(), "direct:get-all-policy-models", - "Get all policies models"); + return callCamelRoute( + ExchangeBuilder.anExchange(camelContext).withProperty("raiseHttpExceptionFlag", true).build(), + "direct:get-all-policy-models", "Get all policies models"); } /** @@ -166,7 +167,8 @@ public class PolicyEngineServices { Yaml yamlParser = new Yaml(options); String responseBody = callCamelRoute( ExchangeBuilder.anExchange(camelContext).withProperty("policyModelType", policyType) - .withProperty("policyModelVersion", policyVersion).build(), "direct:get-policy-tosca-model", + .withProperty("policyModelVersion", policyVersion).withProperty("raiseHttpExceptionFlag", true) + .build(), "direct:get-policy-tosca-model", "Get one policy"); if (responseBody == null || responseBody.isEmpty()) { @@ -182,8 +184,9 @@ public class PolicyEngineServices { */ public void downloadPdpGroups() { String responseBody = - callCamelRoute(ExchangeBuilder.anExchange(camelContext).build(), "direct:get-all-pdp-groups", - "Get Pdp Groups"); + callCamelRoute( + ExchangeBuilder.anExchange(camelContext).withProperty("raiseHttpExceptionFlag", true).build(), + "direct:get-all-pdp-groups", "Get Pdp Groups"); if (responseBody == null || responseBody.isEmpty()) { logger.warn("getPdpGroups returned by policy engine could not be decoded, as it's null or empty"); diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties index f398f8d98..f7f9229f6 100644 --- a/src/main/resources/application-noaaf.properties +++ b/src/main/resources/application-noaaf.properties @@ -1,8 +1,8 @@ ### # ============LICENSE_START======================================================= -# ONAP CLAMP +# ONAP POLICY-CLAMP # ================================================================================ -# Copyright (C) 2017-2019,2021 AT&T Intellectual Property. All rights +# Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights # reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); @@ -90,10 +90,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 +camel.springboot.xml-routes=classpath:/clds/camel/routes/*.xml +camel.springboot.xml-rests=classpath:/clds/camel/rest/*.xml +camel.springboot.backlog-tracing=true +camel.springboot.tracing=true #clds datasource connection details spring.datasource.driverClassName=org.mariadb.jdbc.Driver @@ -141,12 +141,15 @@ 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 +clamp.config.httpclient.socketTimeout=20000 +clamp.config.httpclient.connectTimeout=10000 + # # Configuration Settings for Policy Engine Components -clamp.config.policy.api.url=http4://localhost:8085 +clamp.config.policy.api.url=http://localhost:8085 clamp.config.policy.api.userName=healthcheck clamp.config.policy.api.password=zb!XztG34 -clamp.config.policy.pap.url=http4://localhost:8085 +clamp.config.policy.pap.url=http://localhost:8085 clamp.config.policy.pap.userName=healthcheck clamp.config.policy.pap.password=zb!XztG34 @@ -155,12 +158,12 @@ clamp.config.policy.pap.password=zb!XztG34 clamp.config.sdc.csarFolder = /tmp/sdc-controllers #DCAE Inventory Url Properties -clamp.config.dcae.inventory.url=http4://localhost:8085 +clamp.config.dcae.inventory.url=http://localhost:8085 clamp.config.dcae.intentory.retry.interval=10000 clamp.config.dcae.intentory.retry.limit=5 #DCAE Deployment Url Properties -clamp.config.dcae.deployment.url=http4://localhost:8085 +clamp.config.dcae.deployment.url=http://localhost:8085 clamp.config.dcae.deployment.userName=test clamp.config.dcae.deployment.password=test @@ -182,6 +185,6 @@ clamp.config.tosca.converter.default.datatypes=classpath:/clds/tosca-converter/d clamp.config.tosca.converter.dictionary.support.enabled=true # Configuration settings for CDS -clamp.config.cds.url=http4://cds-blueprints-processor-http:8080 +clamp.config.cds.url=http://cds-blueprints-processor-http:8080 clamp.config.cds.userName=ccsdkapps clamp.config.cds.password=ccsdkapps \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 97870d2b6..a4a51091f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,6 +1,6 @@ ### # ============LICENSE_START======================================================= -# ONAP CLAMP +# ONAP POLICY-CLAMP # ================================================================================ # Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights # reserved. @@ -95,10 +95,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 +camel.springboot.xml-routes=classpath:/clds/camel/routes/*.xml +camel.springboot.xml-rests=classpath:/clds/camel/rest/*.xml +camel.springboot.backlog-tracing=true +camel.springboot.tracing=true #clds datasource connection details spring.datasource.driverClassName=org.mariadb.jdbc.Driver @@ -144,12 +144,14 @@ 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 +clamp.config.httpclient.socketTimeout=20000 +clamp.config.httpclient.connectTimeout=10000 # # Configuration Settings for Policy Engine Components -clamp.config.policy.api.url=http4://policy.api.simpledemo.onap.org:6969 +clamp.config.policy.api.url=http://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.url=http://policy.api.simpledemo.onap.org:6969 clamp.config.policy.pap.userName=healthcheck clamp.config.policy.pap.password=zb!XztG34 @@ -158,12 +160,12 @@ clamp.config.policy.pap.password=zb!XztG34 clamp.config.sdc.csarFolder=/tmp/sdc-controllers #DCAE Inventory Url Properties -clamp.config.dcae.inventory.url=http4://dcae.api.simpledemo.onap.org:8080 +clamp.config.dcae.inventory.url=http://dcae.api.simpledemo.onap.org:8080 clamp.config.dcae.intentory.retry.interval=10000 clamp.config.dcae.intentory.retry.limit=5 #DCAE Deployment Url Properties -clamp.config.dcae.deployment.url=http4://dcae.api.simpledemo.onap.org:8188 +clamp.config.dcae.deployment.url=http://dcae.api.simpledemo.onap.org:8188 clamp.config.dcae.deployment.userName=test clamp.config.dcae.deployment.password=test @@ -196,6 +198,6 @@ clamp.config.tosca.converter.default.datatypes=classpath:/clds/tosca-converter/d clamp.config.tosca.converter.dictionary.support.enabled=true # Configuration settings for CDS -clamp.config.cds.url=http4://cds-blueprints-processor-http:8080 +clamp.config.cds.url=http://cds-blueprints-processor-http:8080 clamp.config.cds.userName=ccsdkapps clamp.config.cds.password=ccsdkapps \ No newline at end of file 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 7129c2828..fe94460c4 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -23,7 +23,7 @@ - + 500 @@ -56,7 +56,7 @@ - + 500 @@ -77,7 +77,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update the global properties')"/> - + ${body} @@ -97,7 +97,7 @@ - + 500 @@ -117,7 +117,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update operational policies')"/> - + ${body} @@ -139,7 +139,7 @@ - + 500 @@ -161,7 +161,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update Microservice policies')"/> - + ${body} @@ -183,7 +183,7 @@ message="UPDATE MicroService policy FAILED for loop: ${header.loopName}, ${exception.stacktrace}"/> - + 500 @@ -200,9 +200,6 @@ - - true - - - + 500 @@ -273,7 +269,7 @@ message="REFRESH json schema request FAILED for loop: ${header.loopName}, ${exception.stacktrace}"/> - + 500 @@ -316,7 +312,7 @@ message="REFRESH json schema request FAILED for loop: ${header.loopName}, ${exception.stacktrace}"/> - + 500 @@ -333,9 +329,6 @@ - - true - - + 500 @@ -379,7 +372,7 @@ - + true - + 500 @@ -425,9 +418,6 @@ - - true - - + 500 @@ -472,7 +462,7 @@ - + true - + false @@ -491,12 +481,12 @@ ${exchangeProperty[loopObject].getMicroServicePolicies()} - + ${body} - + false @@ -507,12 +497,12 @@ ${exchangeProperty[loopObject].getOperationalPolicies()} - + ${body} - + false @@ -543,7 +533,7 @@ message="SUBMIT request FAILED for loop: ${header.loopName}, ${exception.stacktrace}"/> - + 500 @@ -559,7 +549,7 @@ - + true ${exchangeProperty[loopObject].getMicroServicePolicies()} - + ${body} - + false @@ -591,12 +581,12 @@ ${exchangeProperty[loopObject].getOperationalPolicies()} - + ${body} - + false @@ -618,7 +608,7 @@ message="DELETE request FAILED for loop: ${header.loopName}, ${exception.stacktrace}"/> - + 500 @@ -666,7 +656,7 @@ ${exchangeProperty[loopObject]} - + 200 @@ -701,7 +691,7 @@ message="ADD operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}"/> - + 500 @@ -724,17 +714,17 @@ - + ${header.policyName} - + ${exchangeProperty[loopObject].getOperationalPolicy(header.policyName)} - + false - + false @@ -755,7 +745,7 @@ message="REMOVE operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}"/> - + 500 @@ -793,7 +783,7 @@ message="CREATE Loop from Template request failed for loop: ${header.loopName}, ${exception.stacktrace}"/> - + 500 @@ -826,7 +816,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -860,7 +850,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -892,7 +882,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -926,7 +916,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -959,7 +949,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -992,7 +982,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -1011,7 +1001,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary')"/> - + ${body} - + 500 @@ -1049,7 +1039,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary Element')"/> - + ${body} - + 500 @@ -1097,7 +1087,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -1131,7 +1121,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -1165,7 +1155,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -1198,7 +1188,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -1231,7 +1221,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -1253,7 +1243,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')"/> - + ${body} - + 500 @@ -1291,7 +1281,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')"/> - + ${body} - + 500 @@ -1327,13 +1317,15 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Policies List ')"/> - + + true + - + ${body} - + ${body} @@ -1351,7 +1343,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -1376,13 +1368,16 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'CREATE a new Policy ')"/> - + + true + + ${header.policyModelType} - + ${header.policyModelVersion} - + ${body} - + 500 @@ -1424,19 +1419,22 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DELETE a Policy ')"/> - + + true + + ${header.policyModelType} - + ${header.policyModelVersion} - + ${header.policyName} - + ${header.policyVersion} - + false @@ -1452,7 +1450,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 @@ -1478,6 +1476,9 @@ + + false + @@ -1490,7 +1491,7 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/> - + 500 diff --git a/src/main/resources/clds/camel/rest/clds-services.xml b/src/main/resources/clds/camel/rest/clds-services.xml index 61e1efbdc..aa4c3cbee 100644 --- a/src/main/resources/clds/camel/rest/clds-services.xml +++ b/src/main/resources/clds/camel/rest/clds-services.xml @@ -9,7 +9,7 @@ ${body} == 'NOT-OK' - + 404 diff --git a/src/main/resources/clds/camel/routes/cds-flows.xml b/src/main/resources/clds/camel/routes/cds-flows.xml index 73f8cb849..10fcb091e 100644 --- a/src/main/resources/clds/camel/routes/cds-flows.xml +++ b/src/main/resources/clds/camel/routes/cds-flows.xml @@ -5,15 +5,15 @@ message="Getting blueprint workflow list from CDS"/> - + GET - + application/json - + java.lang.Exception @@ -36,15 +36,15 @@ message="Getting blueprint input properties for workflow"/> - + POST - + application/json - + java.lang.Exception diff --git a/src/main/resources/clds/camel/routes/dcae-flows.xml b/src/main/resources/clds/camel/routes/dcae-flows.xml index 1a0eb7b9a..d74bd91bf 100644 --- a/src/main/resources/clds/camel/routes/dcae-flows.xml +++ b/src/main/resources/clds/camel/routes/dcae-flows.xml @@ -5,11 +5,17 @@ ${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true + + true + ${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false + + true + @@ -24,51 +30,51 @@ ${exchangeProperty[loopObject].getMicroServicePolicies()} - + ${body} - + false - + - + PUT - + application/json - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[dcaeDeploymentId]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&authenticationPreemptive=true&connectionClose=true"/> - + - + @@ -82,14 +88,14 @@ false - + DEPLOY micro service failed (MicroService name:${exchangeProperty[microServicePolicy].getName()}), Dep-id:${exchangeProperty[dcaeDeploymentId]}, StatusUrl:${exchangeProperty[dcaeStatusUrl]}) - + DCAE @@ -112,40 +118,40 @@ - + - + PUT - + application/json - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[dcaeDeploymentId]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&authenticationPreemptive=true&connectionClose=true"/> - + - + @@ -155,13 +161,13 @@ - + DEPLOY loop status (Dep-id:${exchangeProperty[dcaeDeploymentId]}, StatusUrl:${exchangeProperty[dcaeStatusUrl]}) - + DCAE @@ -174,11 +180,17 @@ ${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true + + true + ${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false + + true + @@ -193,7 +205,7 @@ ${exchangeProperty[loopObject].getMicroServicePolicies()} - + ${body} - + DELETE - + application/json - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[microServicePolicy].getDcaeDeploymentId()}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&authenticationPreemptive=true&connectionClose=true"/> - + - + @@ -244,7 +256,7 @@ uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','DCAE',${exchangeProperty[loopObject]})"/> - @@ -256,12 +268,12 @@ false - + UNDEPLOY micro service failed (MicroService name:${exchangeProperty[microServicePolicy].getName()}) - + DCAE @@ -281,43 +293,41 @@ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploying the loop')"/> - ${exchangeProperty[loopObject].getDcaeDeploymentId()} - != null - + ${exchangeProperty[loopObject].getDcaeDeploymentId()} != null - + DELETE - + application/json - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&authenticationPreemptive=true&connectionClose=true"/> - + - + @@ -327,10 +337,10 @@ - + UNDEPLOY loop status - + DCAE @@ -338,7 +348,7 @@ - @@ -352,18 +362,18 @@ - + GET - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} @@ -373,18 +383,18 @@ ${exchangeProperty[getStatusUrl].contains("?")} == true - + & - + ? + uri="${exchangeProperty[getStatusUrl]}${exchangeProperty[uriSeparator]}bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&authenticationPreemptive=true&connectionClose=true"/> java.lang.Exception @@ -400,10 +410,10 @@ - + DCAE deployment status - + DCAE @@ -417,25 +427,25 @@ - + GET - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.dcae.inventory.url}}/dcae-service-types?asdcResourceId=${exchangeProperty[blueprintResourceId]}&asdcServiceId=${exchangeProperty[blueprintServiceId]}&typeName=${exchangeProperty[blueprintName]}&bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&authenticationPreemptive=true&connectionClose=true"/> @@ -451,33 +461,33 @@ message="Getting all DCAE blueprint from inventory"/> - + GET - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} - + - + ${exchangeProperty[dcaeResponseList]} - + ${body} diff --git a/src/main/resources/clds/camel/routes/loop-flows.xml b/src/main/resources/clds/camel/routes/loop-flows.xml index f6a838ef0..4a3cc84b2 100644 --- a/src/main/resources/clds/camel/routes/loop-flows.xml +++ b/src/main/resources/clds/camel/routes/loop-flows.xml @@ -4,13 +4,13 @@ ${header.loopName} - + ${exchangeProperty[loopObject]} == null - + 404 @@ -19,14 +19,14 @@ - + ${exchangeProperty[loopObject].getComponent('POLICY')} - + true - + true ${exchangeProperty[loopObject].getMicroServicePolicies()} - + ${body.getName()} - + ${body.getPolicyModel().getPolicyModelType()} - + ${body.getPolicyModel().getVersion()} - + ${body.getPdpGroup()} - + 1.0.0 @@ -61,19 +61,19 @@ ${exchangeProperty[loopObject].getOperationalPolicies()} - + ${body.getName()} - + ${body.getPolicyModel().getPolicyModelType()} - + ${body.getPolicyModel().getVersion()} - + 1.0.0 - + ${body.getPdpGroup()} @@ -83,7 +83,7 @@ message="Processing Operational Policy: ${exchangeProperty[policyName]} of type ${exchangeProperty[policyType]}" /> - + ${exchangeProperty[policyComponent].getState()} @@ -100,29 +100,29 @@ ${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true - + ${exchangeProperty[loopObject].getComponent('DCAE')} ${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} != null - + ${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} - + false ${header.CamelHttpResponseCode} == 200 - + - + ${exchangeProperty[dcaeComponent].computeState(*)} @@ -137,32 +137,32 @@ ${exchangeProperty[loopObject].getMicroServicePolicies()} - + ${body} - + ${exchangeProperty[loopObject].getComponent('DCAE_' + ${exchangeProperty[microServicePolicy].getName()})} ${exchangeProperty[microServicePolicy].getDcaeDeploymentStatusUrl()} != null - + ${exchangeProperty[microServicePolicy].getDcaeDeploymentStatusUrl()} - + false ${header.CamelHttpResponseCode} == 200 - + - + ${exchangeProperty[dcaeComponent].computeState(*)} @@ -181,14 +181,14 @@ ${exchangeProperty['dcaeState'].getStateName()} == - 'BLUEPRINT_DEPLOYED' and ${exchangeProperty['policyState'].getStateName()} + 'BLUEPRINT_DEPLOYED' && ${exchangeProperty['policyState'].getStateName()} == 'NOT_SENT' - ${exchangeProperty['dcaeState'].getStateName()} == 'IN_ERROR' or + ${exchangeProperty['dcaeState'].getStateName()} == 'IN_ERROR' || ${exchangeProperty['dcaeState'].getStateName()} == 'MICROSERVICE_INSTALLATION_FAILED' @@ -197,7 +197,7 @@ ${exchangeProperty['dcaeState'].getStateName()} == - 'MICROSERVICE_UNINSTALLATION_FAILED' or + 'MICROSERVICE_UNINSTALLATION_FAILED' || ${exchangeProperty['policyState'].getStateName()} == 'IN_ERROR' ${exchangeProperty['dcaeState'].getStateName()} == - 'MICROSERVICE_INSTALLED_SUCCESSFULLY' and + 'MICROSERVICE_INSTALLED_SUCCESSFULLY' && ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED' ${exchangeProperty['dcaeState'].getStateName()} == - 'MICROSERVICE_INSTALLED_SUCCESSFULLY' and + 'MICROSERVICE_INSTALLED_SUCCESSFULLY' && ${exchangeProperty['policyState'].getStateName()} == 'SENT' ${exchangeProperty['dcaeState'].getStateName()} == - 'BLUEPRINT_DEPLOYED' or ${exchangeProperty['dcaeState'].getStateName()} == - 'MICROSERVICE_UNINSTALLED_SUCCESSFULLY' and + 'BLUEPRINT_DEPLOYED' || ${exchangeProperty['dcaeState'].getStateName()} == + 'MICROSERVICE_UNINSTALLED_SUCCESSFULLY' && ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED' ${exchangeProperty['dcaeState'].getStateName()} == - 'PROCESSING_MICROSERVICE_INSTALLATION' or + 'PROCESSING_MICROSERVICE_INSTALLATION' || ${exchangeProperty['dcaeState'].getStateName()} == - 'PROCESSING_MICROSERVICE_UNINSTALLATION' and + 'PROCESSING_MICROSERVICE_UNINSTALLATION' && ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED' ${exchangeProperty['dcaeState'].getStateName()} == - 'MICROSERVICE_INSTALLED_SUCCESSFULLY' and + 'MICROSERVICE_INSTALLED_SUCCESSFULLY' && ${exchangeProperty['policyState'].getStateName()} != 'NOT_SENT' - + false ${header.CamelHttpResponseCode} != 200 - + false - + false ${header.CamelHttpResponseCode} != 200 - + false - + ${exchangeProperty[policyComponent].computeState(*)} @@ -37,25 +37,25 @@ message="Getting Policy: ${exchangeProperty[policyName]}"/> - + GET - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/${exchangeProperty[policyTypeVersion]}/policies/${exchangeProperty[policyName]}/versions/${exchangeProperty[policyVersion]}?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&authenticationPreemptive=true&connectionClose=true"/> java.lang.Exception @@ -71,12 +71,12 @@ - + ${exchangeProperty[policyName]} GET Policy status - + POLICY @@ -91,25 +91,25 @@ message="Getting the policy deployment in PDP: ${exchangeProperty[policyName]}"/> - + GET - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/policies/status/${exchangeProperty[policyPdpGroup]}/${exchangeProperty[policyName]}/1.0.0?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&authenticationPreemptive=true&connectionClose=true"/> java.lang.Exception @@ -125,12 +125,12 @@ - + ${exchangeProperty[policyName]} GET Policy deployment status - + POLICY @@ -149,22 +149,22 @@ ${exchangeProperty[policy].createPolicyPayload()} - + ${exchangeProperty[policy].getPolicyModel().getPolicyModelType()} - + ${exchangeProperty[policy].getPolicyModel().getVersion()} - + ${exchangeProperty[policy].getName()} creation status - + POLICY @@ -179,28 +179,28 @@ message="Deleting Policy in a loop: ${exchangeProperty[policy].getName()}"/> - + ${exchangeProperty[policy].getPolicyModel().getPolicyModelType()} - + ${exchangeProperty[policy].getPolicyModel().getVersion()} - + ${exchangeProperty[policy].getName()} - + 1.0.0 - + ${exchangeProperty[policy].getName()} removal status - + POLICY @@ -220,14 +220,17 @@ ${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject],"POST")} + + true + - + PDP Group push ALL status - + POLICY @@ -247,37 +250,37 @@ ${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject],"DELETE")} - + POST - + application/json - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&useSystemProperties=true&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&authenticationPreemptive=true&connectionClose=true"/> - + PDP Group remove ALL status - + POLICY @@ -292,15 +295,15 @@ message="Removing policy from active PDP group for loop: ${exchangeProperty[loopObject].getName()}"/> - + 1.0.0 - + ${exchangeProperty[policyName]} PDP Group removal status - + POLICY @@ -309,10 +312,10 @@ false - + PDP Group removal, Error reported: ${exception} - + POLICY @@ -331,25 +334,25 @@ - + GET - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&authenticationPreemptive=true&connectionClose=true"/> @@ -366,25 +369,25 @@ message="Getting the policy tosca model: ${exchangeProperty[policyModelType]}/${exchangeProperty[policyModelVersion]}"/> - + GET - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelType]}/versions/${exchangeProperty[policyModelVersion]}?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&authenticationPreemptive=true&connectionClose=true"/> @@ -401,25 +404,25 @@ message="Getting the list of PDP Groups"/> - + GET - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&authenticationPreemptive=true&connectionClose=true"/> @@ -436,25 +439,25 @@ message="Getting the policies list"/> - + GET - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policies?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&authenticationPreemptive=true&connectionClose=true"/> @@ -471,28 +474,28 @@ message="Add policies to PDP group"/> - + POST - + application/json - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&useSystemProperties=true&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&authenticationPreemptive=true&connectionClose=true"/> null - + DELETE - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies/${exchangeProperty[policyName]}/versions/${exchangeProperty[policyVersion]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&authenticationPreemptive=true&connectionClose=true"/> - + POST - + application/json - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelType]}/versions/${exchangeProperty[policyModelVersion]}/policies?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&authenticationPreemptive=true&connectionClose=true"/> null - + DELETE - + ${exchangeProperty[X-ONAP-RequestID]} - + ${exchangeProperty[X-ONAP-InvocationID]} - + ${exchangeProperty[X-ONAP-PartnerName]} + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelType]}/versions/${exchangeProperty[policyModelVersion]}/policies/${exchangeProperty[policyName]}/versions/${exchangeProperty[policyVersion]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&authenticationPreemptive=true&connectionClose=true"/> diff --git a/src/main/resources/clds/camel/routes/utils-flows.xml b/src/main/resources/clds/camel/routes/utils-flows.xml index d5da4faee..90900f842 100644 --- a/src/main/resources/clds/camel/routes/utils-flows.xml +++ b/src/main/resources/clds/camel/routes/utils-flows.xml @@ -1,7 +1,7 @@ - + true @@ -19,7 +19,7 @@ - + null diff --git a/src/test/java/org/onap/policy/clamp/flow/FlowLogOperationTest.java b/src/test/java/org/onap/policy/clamp/flow/FlowLogOperationTest.java index 51c4c078a..622fd5999 100644 --- a/src/test/java/org/onap/policy/clamp/flow/FlowLogOperationTest.java +++ b/src/test/java/org/onap/policy/clamp/flow/FlowLogOperationTest.java @@ -1,9 +1,11 @@ /*- * ============LICENSE_START======================================================= - * ONAP CLAMP + * ONAP POLICY-CLAMP * ================================================================================ * Copyright (C) 2019 Samsung. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2021 AT&T + * ================================================================================ * 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 @@ -28,7 +30,7 @@ import static org.mockito.Mockito.mock; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; -import org.apache.camel.impl.DefaultExchange; +import org.apache.camel.support.DefaultExchange; import org.junit.Test; import org.mockito.Mockito; import org.onap.policy.clamp.clds.util.LoggingUtils; @@ -43,7 +45,7 @@ public class FlowLogOperationTest { private FlowLogOperation flowLogOperation = new FlowLogOperation(); @Test - public void testStratLog() { + public void testStartLog() { // given LoggingUtils loggingUtils = mock(LoggingUtils.class); ReflectionTestUtils.setField(flowLogOperation, "util", loggingUtils); @@ -65,7 +67,7 @@ public class FlowLogOperationTest { public void testInvokeLog() { // given final String mockEntity = "mockEntity"; - final String mockServiceName = "mockSerivceName"; + final String mockServiceName = "mockServiceName"; MDCAdapter mdcAdapter = MDC.getMDCAdapter(); // when flowLogOperation.invokeLog(mockEntity, mockServiceName); diff --git a/src/test/java/org/onap/policy/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/policy/clamp/loop/CsarInstallerItCase.java index 5b67f1f3a..b0abf832b 100644 --- a/src/test/java/org/onap/policy/clamp/loop/CsarInstallerItCase.java +++ b/src/test/java/org/onap/policy/clamp/loop/CsarInstallerItCase.java @@ -1,8 +1,8 @@ /*- * ============LICENSE_START======================================================= - * ONAP CLAMP + * ONAP POLICY-CLAMP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights + * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Modifications copyright (c) 2019 Nokia @@ -98,9 +98,9 @@ public class CsarInstallerItCase { @Qualifier("csarInstaller") private CsarInstaller csarInstaller; - private BlueprintArtifact buildFakeBuildprintArtifact(String instanceName, String invariantResourceUuid, - String blueprintFilePath, String artifactName, - String invariantServiceUuid) throws IOException { + private BlueprintArtifact buildFakeBlueprintArtifact(String instanceName, String invariantResourceUuid, + String blueprintFilePath, String artifactName, + String invariantServiceUuid) throws IOException { IResourceInstance resource = Mockito.mock(IResourceInstance.class); Mockito.when(resource.getResourceInstanceName()).thenReturn(instanceName); Mockito.when(resource.getResourceInvariantUUID()).thenReturn(invariantResourceUuid); @@ -127,7 +127,7 @@ public class CsarInstallerItCase { Map blueprintMap = new HashMap<>(); Mockito.when(csarHandler.getMapOfBlueprints()).thenReturn(blueprintMap); // Create fake blueprint artifact 1 on resource1 - BlueprintArtifact blueprintArtifact = buildFakeBuildprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1, + BlueprintArtifact blueprintArtifact = buildFakeBlueprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1, INVARIANT_RESOURCE1_UUID, "example/sdc/blueprint-dcae/tca-bad-policy.yaml", "tca-bad-policy.yaml", INVARIANT_SERVICE_UUID); listResources.add(blueprintArtifact.getResourceAttached()); @@ -167,25 +167,25 @@ public class CsarInstallerItCase { Map blueprintMap = new HashMap<>(); Mockito.when(csarHandler.getMapOfBlueprints()).thenReturn(blueprintMap); // Create fake blueprint artifact 1 on resource1 - BlueprintArtifact blueprintArtifact = buildFakeBuildprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1, + BlueprintArtifact blueprintArtifact = buildFakeBlueprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1, INVARIANT_RESOURCE1_UUID, "example/sdc/blueprint-dcae/tca.yaml", "tca.yaml", INVARIANT_SERVICE_UUID); listResources.add(blueprintArtifact.getResourceAttached()); blueprintMap.put(blueprintArtifact.getBlueprintArtifactName(), blueprintArtifact); // Create fake blueprint artifact 2 on resource2 - blueprintArtifact = buildFakeBuildprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE2, INVARIANT_RESOURCE2_UUID, + blueprintArtifact = buildFakeBlueprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE2, INVARIANT_RESOURCE2_UUID, "example/sdc/blueprint-dcae/tca_2.yaml", "tca_2.yaml", INVARIANT_SERVICE_UUID); listResources.add(blueprintArtifact.getResourceAttached()); blueprintMap.put(blueprintArtifact.getBlueprintArtifactName(), blueprintArtifact); // Create fake blueprint artifact 3 on resource 1 so that it's possible to // test multiple CL deployment per Service/vnf - blueprintArtifact = buildFakeBuildprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1, INVARIANT_RESOURCE1_UUID, + blueprintArtifact = buildFakeBlueprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1, INVARIANT_RESOURCE1_UUID, "example/sdc/blueprint-dcae/tca_3.yaml", "tca_3.yaml", INVARIANT_SERVICE_UUID); blueprintMap.put(blueprintArtifact.getBlueprintArtifactName(), blueprintArtifact); // Create fake blueprint artifact 3 on resource 1 so that it's possible to // test multiple CL deployment per Service/vnf - blueprintArtifact = buildFakeBuildprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1, INVARIANT_RESOURCE1_UUID, + blueprintArtifact = buildFakeBlueprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1, INVARIANT_RESOURCE1_UUID, "example/sdc/blueprint-dcae/tca-guilin.yaml", "tca-guilin.yaml", INVARIANT_SERVICE_UUID); blueprintMap.put(blueprintArtifact.getBlueprintArtifactName(), blueprintArtifact); diff --git a/src/test/java/org/onap/policy/clamp/loop/DcaeComponentTest.java b/src/test/java/org/onap/policy/clamp/loop/DcaeComponentTest.java index c94937031..c95725457 100644 --- a/src/test/java/org/onap/policy/clamp/loop/DcaeComponentTest.java +++ b/src/test/java/org/onap/policy/clamp/loop/DcaeComponentTest.java @@ -1,8 +1,8 @@ /*- * ============LICENSE_START======================================================= - * ONAP CLAMP + * ONAP POLICY-CLAMP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights + * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,6 +36,7 @@ import org.junit.Test; import org.mockito.Mockito; import org.onap.policy.clamp.clds.model.dcae.DcaeInventoryResponse; import org.onap.policy.clamp.clds.model.dcae.DcaeOperationStatusResponse; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; import org.onap.policy.clamp.loop.components.external.DcaeComponent; import org.onap.policy.clamp.loop.components.external.ExternalComponentState; import org.onap.policy.clamp.loop.template.LoopTemplate; @@ -52,7 +53,7 @@ public class DcaeComponentTest { JsonObject.class)); loopTest.setLastComputedState(LoopState.DESIGN); loopTest.setDcaeDeploymentId("123456789"); - loopTest.setDcaeDeploymentStatusUrl("http4://localhost:8085"); + loopTest.setDcaeDeploymentStatusUrl("http://localhost:8085"); MicroServicePolicy microServicePolicy = new MicroServicePolicy("configPolicyTest", new PolicyModel("policy1", "tosca_definitions_version: tosca_simple_yaml_1_0_0", "1.0.0"), true, @@ -175,36 +176,10 @@ public class DcaeComponentTest { */ @Test public void convertToDcaeInventoryResponseTest() throws IOException, ParseException { - String dcaeFakeResponse = "{\n" + " \"links\": {\n" + " \"previousLink\": {\n" - + " \"title\": \"string\",\n" + " \"rel\": \"string\",\n" + " \"uri\": \"string\",\n" - + " \"uriBuilder\": {},\n" + " \"rels\": [\n" + " \"string\"\n" + " ],\n" - + " \"params\": {\n" + " \"additionalProp1\": \"string\",\n" - + " \"additionalProp2\": \"string\",\n" + " \"additionalProp3\": \"string\"\n" - + " },\n" + " \"type\": \"string\"\n" + " },\n" + " \"nextLink\": {\n" - + " \"title\": \"string\",\n" + " \"rel\": \"string\",\n" + " \"uri\": \"string\",\n" - + " \"uriBuilder\": {},\n" + " \"rels\": [\n" + " \"string\"\n" + " ],\n" - + " \"params\": {\n" + " \"additionalProp1\": \"string\",\n" - + " \"additionalProp2\": \"string\",\n" + " \"additionalProp3\": \"string\"\n" - + " },\n" + " \"type\": \"string\"\n" + " }\n" + " },\n" + " \"totalCount\": 0,\n" - + " \"items\": [\n" + " {\n" + " \"owner\": \"testOwner\",\n" - + " \"application\": \"testApplication\",\n" + " \"component\": \"testComponent\",\n" - + " \"typeName\": \"testTypeName\",\n" + " \"typeVersion\": 0,\n" - + " \"blueprintTemplate\": \"testBlueprintTemplate\",\n" + " \"serviceIds\": [\n" - + " \"serviceId1\", \"serviceId2\"\n" + " ],\n" + " \"vnfTypes\": [\n" - + " \"vnfType1\", \"vnfType2\"\n" + " ],\n" + " \"serviceLocations\": [\n" - + " \"serviceLocation1\", \"serviceLocation2\"\n" + " ],\n" - + " \"asdcServiceId\": \"testAsdcServiceId\",\n" - + " \"asdcResourceId\": \"testAsdcResourceId\",\n" - + " \"asdcServiceURL\": \"testAsdcServiceURL\",\n" + " \"typeId\": \"testTypeId\",\n" - + " \"selfLink\": {\n" + " \"title\": \"selfLinkTitle\",\n" - + " \"rel\": \"selfLinkRel\",\n" + " \"uri\": \"selfLinkUri\",\n" - + " \"uriBuilder\": {},\n" + " \"rels\": [\n" + " \"string\"\n" + " ],\n" - + " \"params\": {\n" + " \"additionalProp1\": \"string\",\n" - + " \"additionalProp2\": \"string\",\n" + " \"additionalProp3\": \"string\"\n" - + " },\n" + " \"type\": \"string\"\n" + " },\n" - + " \"created\": \"2020-01-22T09:38:15.436Z\",\n" - + " \"deactivated\": \"2020-01-22T09:38:15.437Z\"\n" + " }\n" + " ]\n" + "}"; - List responseObject = DcaeComponent.convertToDcaeInventoryResponse(dcaeFakeResponse); + + List responseObject = DcaeComponent + .convertToDcaeInventoryResponse( + ResourceFileUtils.getResourceAsString("example/dcae/inventory-response.json")); assertThat(responseObject.get(0).getAsdcResourceId()).isEqualTo("testAsdcResourceId"); assertThat(responseObject.get(0).getAsdcServiceId()).isEqualTo("testAsdcServiceId"); assertThat(responseObject.get(0).getTypeName()).isEqualTo("testTypeName"); diff --git a/src/test/java/org/onap/policy/clamp/loop/LoopServiceTestItCase.java b/src/test/java/org/onap/policy/clamp/loop/LoopServiceTestItCase.java index 010c4978a..74092727c 100644 --- a/src/test/java/org/onap/policy/clamp/loop/LoopServiceTestItCase.java +++ b/src/test/java/org/onap/policy/clamp/loop/LoopServiceTestItCase.java @@ -355,10 +355,10 @@ public class LoopServiceTestItCase { saveTestLoopToDb(); Loop loop = loopService.getLoop(EXAMPLE_LOOP_NAME); loopService.updateDcaeDeploymentFields(loop, "CLAMP_c5ce429a-f570-48c5-a7ea-53bed8f86f85", - "https4://deployment-handler.onap:8443"); + "https://deployment-handler.onap:8443"); loop = loopService.getLoop(EXAMPLE_LOOP_NAME); assertThat(loop.getDcaeDeploymentId()).isEqualTo("CLAMP_c5ce429a-f570-48c5-a7ea-53bed8f86f85"); - assertThat(loop.getDcaeDeploymentStatusUrl()).isEqualTo("https4://deployment-handler.onap:8443"); + assertThat(loop.getDcaeDeploymentStatusUrl()).isEqualTo("https://deployment-handler.onap:8443"); } @Test diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index 2a4caee98..d67fe74a3 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -1,6 +1,6 @@ ### # ============LICENSE_START======================================================= -# ONAP CLAMP +# ONAP POLICY-CLAMP # ================================================================================ # Copyright (C) 2017-2018, 2021 AT&T Intellectual Property. All rights # reserved. @@ -79,10 +79,11 @@ 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 +camel.springboot.xml-routes=classpath:/clds/camel/routes/*.xml +camel.springboot.xml-rests=classpath:/clds/camel/rest/*.xml +camel.springboot.backlog-tracing=true +camel.springboot.tracing=true +camel.springboot.message-history=true #clds datasource connection details spring.datasource.driverClassName=org.mariadb.jdbc.Driver @@ -128,12 +129,15 @@ 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 +clamp.config.httpclient.socketTimeout=20000 +clamp.config.httpclient.connectTimeout=10000 + # # Configuration Settings for Policy Engine Components -clamp.config.policy.api.url=http4://localhost:${docker.http-cache.port.host} +clamp.config.policy.api.url=http://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.url=http://localhost:${docker.http-cache.port.host} clamp.config.policy.pap.userName=healthcheck clamp.config.policy.pap.password=zb!XztG34 @@ -142,12 +146,12 @@ clamp.config.policy.pap.password=zb!XztG34 clamp.config.sdc.csarFolder = ${project.build.directory}/sdc-tests #DCAE Inventory Url Properties -clamp.config.dcae.inventory.url=http4://localhost:${docker.http-cache.port.host} +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 Deployment Url Properties -clamp.config.dcae.deployment.url=http4://localhost:${docker.http-cache.port.host} +clamp.config.dcae.deployment.url=http://localhost:${docker.http-cache.port.host} clamp.config.dcae.deployment.userName=test clamp.config.dcae.deployment.password=test @@ -164,7 +168,7 @@ clamp.config.security.permission.instance=dev clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal, org.onap.aaf.cadi.principal.CachedBasicPrincipal # Configuration settings for CDS -clamp.config.cds.url=http4://localhost:${docker.http-cache.port.host} +clamp.config.cds.url=http://localhost:${docker.http-cache.port.host} clamp.config.cds.userName=ccsdkapps clamp.config.cds.password=ccsdkapps diff --git a/src/test/resources/example/dcae/inventory-response.json b/src/test/resources/example/dcae/inventory-response.json new file mode 100644 index 000000000..1ebf068b8 --- /dev/null +++ b/src/test/resources/example/dcae/inventory-response.json @@ -0,0 +1,78 @@ +{ + "links": { + "previousLink": { + "title": "string", + "rel": "string", + "uri": "string", + "uriBuilder": {}, + "rels": [ + "string" + ], + "params": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "type": "string" + }, + "nextLink": { + "title": "string", + "rel": "string", + "uri": "string", + "uriBuilder": {}, + "rels": [ + "string" + ], + "params": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "type": "string" + } + }, + "totalCount": 0, + "items": [ + { + "owner": "testOwner", + "application": "testApplication", + "component": "testComponent", + "typeName": "testTypeName", + "typeVersion": 0, + "blueprintTemplate": "testBlueprintTemplate", + "serviceIds": [ + "serviceId1", + "serviceId2" + ], + "vnfTypes": [ + "vnfType1", + "vnfType2" + ], + "serviceLocations": [ + "serviceLocation1", + "serviceLocation2" + ], + "asdcServiceId": "testAsdcServiceId", + "asdcResourceId": "testAsdcResourceId", + "asdcServiceURL": "testAsdcServiceURL", + "typeId": "testTypeId", + "selfLink": { + "title": "selfLinkTitle", + "rel": "selfLinkRel", + "uri": "selfLinkUri", + "uriBuilder": {}, + "rels": [ + "string" + ], + "params": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "type": "string" + }, + "created": "2020-01-22T09:38:15.436Z", + "deactivated": "2020-01-22T09:38:15.437Z" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/https/https-test.properties b/src/test/resources/https/https-test.properties index b52b16db4..14079a78e 100644 --- a/src/test/resources/https/https-test.properties +++ b/src/test/resources/https/https-test.properties @@ -96,10 +96,11 @@ 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 +camel.springboot.xml-routes=classpath:/clds/camel/routes/*.xml +camel.springboot.xml-rests=classpath:/clds/camel/rest/*.xml +camel.springboot.backlog-tracing=true +camel.springboot.tracing=true +camel.springboot.message-history=true #For EELF logback file #com.att.eelf.logging.path= @@ -107,6 +108,9 @@ com.att.eelf.logging.file=logback-default.xml #The log folder that will be used in logback.xml file clamp.config.log.path=log +clamp.config.httpclient.socketTimeout=20000 +clamp.config.httpclient.connectTimeout=10000 + #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/test/resources/robotframework/robotframework-test.properties b/src/test/resources/robotframework/robotframework-test.properties index 1e173f961..a12f052ad 100644 --- a/src/test/resources/robotframework/robotframework-test.properties +++ b/src/test/resources/robotframework/robotframework-test.properties @@ -1,6 +1,6 @@ ### # ============LICENSE_START======================================================= -# ONAP CLAMP +# ONAP POLICY-CLAMP # ================================================================================ # Copyright (C) 2017-2018, 2021 AT&T Intellectual Property. All rights # reserved. @@ -79,10 +79,11 @@ 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 +camel.springboot.xml-routes=classpath:/clds/camel/routes/*.xml +camel.springboot.xml-rests=classpath:/clds/camel/rest/*.xml +camel.springboot.backlog-tracing=true +camel.springboot.tracing=true +camel.springboot.message-history=true #clds datasource connection details spring.datasource.driverClassName=org.mariadb.jdbc.Driver @@ -128,12 +129,15 @@ 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 +clamp.config.httpclient.socketTimeout=20000 +clamp.config.httpclient.connectTimeout=10000 + # # Configuration Settings for Policy Engine Components -clamp.config.policy.api.url=http4://localhost:${docker.http-cache.port.host} +clamp.config.policy.api.url=http://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.url=http://localhost:${docker.http-cache.port.host} clamp.config.policy.pap.userName=healthcheck clamp.config.policy.pap.password=zb!XztG34 @@ -142,12 +146,12 @@ clamp.config.policy.pap.password=zb!XztG34 clamp.config.sdc.csarFolder = ${project.build.directory}/sdc-tests #DCAE Inventory Url Properties -clamp.config.dcae.inventory.url=http4://localhost:${docker.http-cache.port.host} +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 Deployment Url Properties -clamp.config.dcae.deployment.url=http4://localhost:${docker.http-cache.port.host} +clamp.config.dcae.deployment.url=http://localhost:${docker.http-cache.port.host} clamp.config.dcae.deployment.userName=test clamp.config.dcae.deployment.password=test @@ -164,7 +168,7 @@ clamp.config.security.permission.instance=dev clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal, org.onap.aaf.cadi.principal.CachedBasicPrincipal # Configuration settings for CDS -clamp.config.cds.url=http4://localhost:${docker.http-cache.port.host} +clamp.config.cds.url=http://localhost:${docker.http-cache.port.host} clamp.config.cds.userName=ccsdkapps clamp.config.cds.password=ccsdkapps -- cgit 1.2.3-korg