From 39d82def1e54d6584f41ab9f94d30c2057858c32 Mon Sep 17 00:00:00 2001 From: xg353y Date: Fri, 26 Apr 2019 13:26:25 +0200 Subject: Fix the get loop state logic Fix the logic to get the loop state and update the CL deploy/undeploy flow accordingly Issue-ID: CLAMP-362 Change-Id: I34f83bd241b1029417453908bf932c0b69f9f5b2 Signed-off-by: xg353y --- src/main/resources/application-noaaf.properties | 5 + src/main/resources/application.properties | 5 + .../resources/clds/camel/rest/clamp-api-v2.xml | 114 ++++++++++- .../resources/clds/camel/routes/flexible-flow.xml | 217 +++++++++++++++++++++ 4 files changed, 339 insertions(+), 2 deletions(-) (limited to 'src/main/resources') diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties index de3f7c07..52f79bef 100644 --- a/src/main/resources/application-noaaf.properties +++ b/src/main/resources/application-noaaf.properties @@ -210,6 +210,11 @@ clamp.config.dcae.dispatcher.url=http://dcae.api.simpledemo.onap.org:8188 clamp.config.dcae.dispatcher.retry.interval=20000 clamp.config.dcae.dispatcher.retry.limit=30 +#DCAE Deployment Url Properties +clamp.config.dcae.deployment.url=http4://dcae.api.simpledemo.onap.org:8188 +clamp.config.dcae.deployment.userName=test +clamp.config.dcae.deployment.password=test + #Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case ! clamp.config.security.permission.type.cl=org.onap.clamp.clds.cl clamp.config.security.permission.type.cl.manage=org.onap.clamp.clds.cl.manage diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f59b8ac6..534dc481 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -228,6 +228,11 @@ clamp.config.dcae.dispatcher.url=http://dcae.api.simpledemo.onap.org:8188 clamp.config.dcae.dispatcher.retry.interval=20000 clamp.config.dcae.dispatcher.retry.limit=30 +#DCAE Deployment Url Properties +clamp.config.dcae.deployment.url=http4://dcae.api.simpledemo.onap.org:8188 +clamp.config.dcae.deployment.userName=test +clamp.config.dcae.deployment.password=test + #Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case ! clamp.config.security.permission.type.cl=org.onap.clamp.clds.cl clamp.config.security.permission.type.cl.manage=org.onap.clamp.clds.cl.manage diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml index 5c5f122c..2640d6bd 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -206,7 +206,40 @@ + uri="direct:load-loop" /> + + ${exchangeProperty[loopObject].getOperationalPolicies()} + + + ${body} + + + + + + + + + ${exchangeProperty[policyStatus]} == 'SUBMITTED' and + ${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED' + + + + + + + + @@ -216,6 +249,11 @@ + + @@ -234,7 +272,24 @@ + uri="direct:load-loop" /> + + + + ${exchangeProperty[dcaeStatus]} == 'DEPLOYED' + + + + + + + + @@ -244,6 +299,11 @@ + + @@ -526,5 +586,55 @@ + + + + + + + + + + + false + + + + + + + + + + + java.lang.Exception + + false + + + + + + + + diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml index 75341de9..68138008 100644 --- a/src/main/resources/clds/camel/routes/flexible-flow.xml +++ b/src/main/resources/clds/camel/routes/flexible-flow.xml @@ -490,7 +490,224 @@ + + + + + + ${exchangeProperty[loopObject].getOperationalPolicies()} + + + ${body} + + + + + + + + + PUT + + + application/json + + + ${exchangeProperty[X-ONAP-RequestID]} + + + + ${exchangeProperty[X-ONAP-InvocationID]} + + + + ${exchangeProperty[X-ONAP-PartnerName]} + + + + + + + + + + Deploy closed loop status + + + + + + + + + + + + + {\"serviceTypeId\": \"${exchangeProperty[loopObject].getDcaeBlueprintId()}\"} + + + + DELETE + + + application/json + + + ${exchangeProperty[X-ONAP-RequestID]} + + + + ${exchangeProperty[X-ONAP-InvocationID]} + + + + ${exchangeProperty[X-ONAP-PartnerName]} + + + + + + + + + + Undeploy closed loop status + + + + + + + + + + + + null + + + GET + + + ${exchangeProperty[X-ONAP-RequestID]} + + + + ${exchangeProperty[X-ONAP-InvocationID]} + + + + ${exchangeProperty[X-ONAP-PartnerName]} + + + + + + + + + Query closed loop from Policy status + + + + + + + + + + + + + + + ${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} == null + + + + + + + + + + + GET + + + ${exchangeProperty[X-ONAP-RequestID]} + + + + ${exchangeProperty[X-ONAP-InvocationID]} + + + + ${exchangeProperty[X-ONAP-PartnerName]} + + + + + + + + + Query closed loop from DCAE status + + + + + + + + + + + -- cgit 1.2.3-korg