aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-06-06 17:13:36 +0200
committersebdet <sebastien.determe@intl.att.com>2019-06-06 17:13:36 +0200
commitc76aea9d08f82651783d0f2cc76c4152c0be9d7b (patch)
tree8f4fc05503d621def75cdc492f828face315813e
parent60d8a197a65db5b53bae5ea6950cb9af559b643f (diff)
Fix the DCAE calls
Fix the DCAE calls due to Policy fix + add a log to display the response body retuned by policy/dcae in case of HTTP 4XX Issue-ID: CLAMP-407 Change-Id: I16fc5fff03759e2e24f564bc8dbd6689f58782d0 Signed-off-by: sebdet <sebastien.determe@intl.att.com>
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml14
-rw-r--r--src/main/resources/clds/camel/routes/flexible-flow.xml24
-rwxr-xr-xsrc/test/resources/http-cache/third_party_proxy.py39
3 files changed, 51 insertions, 26 deletions
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 da856e94..94b322fa 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -251,7 +251,7 @@
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]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -308,7 +308,7 @@
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]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -352,7 +352,7 @@
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]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -397,7 +397,7 @@
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]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception} - Body: ${exception.responseBody}','INFO',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -503,7 +503,7 @@
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]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -585,7 +585,7 @@
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]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -634,7 +634,7 @@
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]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
<doFinally>
<to
diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml
index 4b4ad771..f14d6359 100644
--- a/src/main/resources/clds/camel/routes/flexible-flow.xml
+++ b/src/main/resources/clds/camel/routes/flexible-flow.xml
@@ -133,7 +133,7 @@
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;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ 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;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
@@ -178,7 +178,7 @@
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;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ 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;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
@@ -228,7 +228,7 @@
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;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ 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;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
@@ -273,7 +273,7 @@
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;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ 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;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
@@ -322,7 +322,7 @@
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;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ 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;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
@@ -366,7 +366,7 @@
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;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ 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;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
@@ -415,7 +415,7 @@
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;useSystemProperties=true&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;useSystemProperties=true&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
@@ -465,7 +465,7 @@
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;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ 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;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<setProperty propertyName="logMessage">
<simple>${exchangeProperty[policyName]} PDP Group removal status
</simple>
@@ -527,7 +527,7 @@
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;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=300000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<to
uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},${exchangeProperty[deploymentId]})" />
<doFinally>
@@ -577,7 +577,7 @@
loggingLevel="INFO"
message="Endpoint to undeploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}"></log>
<toD
- uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=300000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<to
uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},null)" />
<doFinally>
@@ -622,7 +622,7 @@
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;authMethod=Basic&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ 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;authMethod=Basic&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
@@ -679,7 +679,7 @@
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;authMethod=Basic&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=10000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ uri="${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=30000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
diff --git a/src/test/resources/http-cache/third_party_proxy.py b/src/test/resources/http-cache/third_party_proxy.py
index 0db977bb..5432ab8e 100755
--- a/src/test/resources/http-cache/third_party_proxy.py
+++ b/src/test/resources/http-cache/third_party_proxy.py
@@ -180,7 +180,7 @@ 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 == "POST":
+ elif self.path.startswith("/policy/api/v1/policytypes/") and http_type == "POST":
print "self.path start with POST new policy API /pdp/api/, copying body to response ..."
if not os.path.exists(cached_file_folder):
os.makedirs(cached_file_folder, 0777)
@@ -189,8 +189,8 @@ 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 == "DELETE":
- print "self.path start with DELETE new policy API /policy/api/v1/policyTypes/ ..."
+ elif self.path.startswith("/policy/api/v1/policytypes/") and http_type == "DELETE":
+ print "self.path start with DELETE new policy API /policy/api/v1/policytypes/ ..."
if not os.path.exists(cached_file_folder):
os.makedirs(cached_file_folder, 0777)
@@ -199,6 +199,15 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
with open(cached_file_content, 'w+') as f:
f.write(self.data_string)
return True
+ elif self.path.startswith("/policy/pap/v1/pdps/policies") and http_type == "POST":
+ print "self.path start with POST new policy API /policy/pap/v1/pdps/ ..."
+ 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("")) + "\", \"Content-Type\": \""+str("")+"\"}")
+ 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\"}"
@@ -241,7 +250,9 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
if not HOST:
self.send_response(404)
- return "404 Not found"
+ self.end_headers()
+ self.wfile.write('404 Not found, no remote HOST specified on the emulator !!!')
+ return "404 Not found, no remote HOST specified on the emulator !!!"
url = '%s%s' % (HOST, self.path)
response = requests.get(url, auth=AUTH, headers=HEADERS, stream=True)
@@ -254,6 +265,8 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
print('Status code : %s' % (response.status_code,))
print('Content : %s' % (response.content,))
self.send_response(response.status_code)
+ self.end_headers()
+ self.wfile.write('404 Not found, nothing found on the remote server !!!')
return response.content
else:
print("Request for data currently present in cache: %s" % (cached_file_folder,))
@@ -292,7 +305,9 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
if not HOST:
self.send_response(404)
- return "404 Not found"
+ self.end_headers()
+ self.wfile.write('404 Not found, no remote HOST specified on the emulator !!!')
+ return "404 Not found, no remote HOST specified on the emulator !!!"
print("Request for data currently not present in cache: %s" % (cached_file_folder,))
@@ -308,6 +323,8 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
print('Status code : %s' % (response.status_code,))
print('Content : %s' % (response.content,))
self.send_response(response.status_code)
+ self.end_headers()
+ self.wfile.write('404 Not found, nothing found on the remote server !!!')
return response.content
else:
print("Request for data present in cache: %s" % (cached_file_folder,))
@@ -339,7 +356,9 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
if not _file_available:
if not HOST:
self.send_response(404)
- return "404 Not found"
+ self.end_headers()
+ self.wfile.write('404 Not found, no remote HOST specified on the emulator !!!')
+ return "404 Not found, no remote HOST specified on the emulator !!!"
print("Request for data currently not present in cache: %s" % (cached_file_folder,))
@@ -355,6 +374,8 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
print('Status code : %s' % (response.status_code,))
print('Content : %s' % (response.content,))
self.send_response(response.status_code)
+ self.end_headers()
+ self.wfile.write('404 Not found, nothing found on the remote server !!!')
return response.content
else:
print("Request for data present in cache: %s" % (cached_file_folder,))
@@ -389,7 +410,9 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
if not _file_available:
if not HOST:
self.send_response(404)
- return "404 Not found"
+ self.end_headers()
+ self.wfile.write('404 Not found, no remote HOST specified on the emulator !!!')
+ return "404 Not found, no remote HOST specified on the emulator !!!"
print("Request for data currently not present in cache: %s" % (cached_file_folder,))
@@ -405,6 +428,8 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
print('Status code : %s' % (response.status_code,))
print('Content : %s' % (response.content,))
self.send_response(response.status_code)
+ self.end_headers()
+ self.wfile.write('404 Not found, nothing found on the remote server !!!')
return response.content
else:
print("Request for data present in cache: %s" % (cached_file_folder,))