From 2e418dcb84134695a2669ddbe76d1513742bce77 Mon Sep 17 00:00:00 2001 From: Shadi Haidar Date: Mon, 15 Apr 2019 09:37:43 -0400 Subject: Enhance DH uninstall workflow Make force uninstall configurable and set ignore_failure to true in order to have the uninstall execution complete as much as possible Coverage summary Statements : 80.79% ( 997/1234 ) Branches : 58.06% ( 306/527 ) Functions : 81.13% ( 172/212 ) Lines : 81.3% ( 987/1214 ) Issue-ID: DCAEGEN2-1439 Change-Id: I5f0cd55c4d5eeead9bb2874f83bb4db1809fbc8d Signed-off-by: Shadi Haidar --- deployment-handler-API.yaml | 6 ++++++ lib/cloudify.js | 6 ++++++ package.json | 2 +- pom.xml | 2 +- version.properties | 4 ++-- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/deployment-handler-API.yaml b/deployment-handler-API.yaml index 9359d24..47cf4d6 100644 --- a/deployment-handler-API.yaml +++ b/deployment-handler-API.yaml @@ -213,6 +213,12 @@ paths: in: path type: string required: true + - name: force_uninstall + description: | + Set the "force" boolean flag when performing an uninstall in Cloudify. Optional, if not specified, "false" will be used. + in: query + type: string + required: false responses: diff --git a/lib/cloudify.js b/lib/cloudify.js index 49c26dd..e0683bf 100644 --- a/lib/cloudify.js +++ b/lib/cloudify.js @@ -138,6 +138,12 @@ const startWorkflowExecution = function(mainReq, deployment_id, workflow_id, par "deployment_id" : deployment_id, "workflow_id" : workflow_id }; + + if ( workflow_id === 'uninstall' ) { + body.force = (mainReq.query.force_uninstall === 'true') || false; + parameters = {"ignore_failure":"true"} + } + if (parameters) {body.parameters = parameters;} // Make the POST request diff --git a/package.json b/package.json index 8dff5cf..1029624 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "onap-dcae-deployment-handler", - "version": "6.0.1", + "version": "6.0.2", "description": "ONAP DCAE Deployment Handler", "main": "deployment-handler.js", "dependencies": { diff --git a/pom.xml b/pom.xml index 01e2e74..fa13097 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. org.onap.dcaegen2.platform deployment-handler dcaegen2-platform-deployment-handler - 4.0.1-SNAPSHOT + 4.1.0-SNAPSHOT http://maven.apache.org UTF-8 diff --git a/version.properties b/version.properties index 7e4f439..63f7e0d 100644 --- a/version.properties +++ b/version.properties @@ -1,6 +1,6 @@ major=4 -minor=0 -patch=1 +minor=1 +patch=0 base_version=${major}.${minor}.${patch} release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg