Update policy api url 16/100116/1
authorxuegao <xg353y@intl.att.com>
Thu, 9 Jan 2020 08:46:53 +0000 (09:46 +0100)
committerxuegao <xg353y@intl.att.com>
Thu, 9 Jan 2020 08:46:53 +0000 (09:46 +0100)
Update the policy api url, triggering the pap api to get the status of
the deployed policy.

Issue-ID: CLAMP-577
Change-Id: I34222c1158d6f724c8ae740fec81f2085ef91bd0
Signed-off-by: xuegao <xg353y@intl.att.com>
src/main/resources/clds/camel/routes/policy-flows.xml
src/test/resources/http-cache/third_party_proxy.py

index 75ac66c..223498e 100644 (file)
@@ -97,9 +97,9 @@
                                </simple>
                        </setHeader>
                        <log loggingLevel="INFO"
-                               message="Endpoint to get policy deployment status: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/1.0.0/policies/${exchangeProperty[policyName]}/versions/deployed"></log>
+                               message="Endpoint to get policy deployment status: {{clamp.config.policy.pap.url}}/policy/pap/v1/policies/deployed/${exchangeProperty[policyName]}/1.0.0"></log>
                        <toD
-                               uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/1.0.0/policies/${exchangeProperty[policyName]}/versions/deployed?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&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" />
+                               uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/policies/${exchangeProperty[policyName]}/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&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
index 5ec9f46..9dcc4b3 100755 (executable)
@@ -237,7 +237,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 == "GET":
+     elif (self.path.startswith("/policy/api/v1/policytypes/") or self.path.startswith("/policy/pap/v1/policies/deployed/")) and http_type == "GET":
         print "self.path start with /policy/api/v1/policytypes/, generating response json..."
         jsonGenerated =  "{\"policyTypeId\": \"onap.policies.controlloop.operational\",\"policyTypeVersion\": \"1.0.0\",\"policyId\": \"OPERATIONAL_z711F_v1_0_ResourceInstanceName1_tca\"}"
         print "jsonGenerated: " + jsonGenerated