code fix for OS attach volumes and dettach volumes 97/28797/5
authorkusuma kumari M <km583p@att.com>
Mon, 22 Jan 2018 17:36:00 +0000 (12:36 -0500)
committerTakamune Cho <tc012c@att.com>
Wed, 24 Jan 2018 15:14:28 +0000 (15:14 +0000)
Issue-ID: APPC-448
Change-Id: I348108a8fb49a42c79039975e8470442a0f80dd2
Signed-off-by: kusuma kumari M <km583p@att.com>
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/AttachVolumeServer.java
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/DettachVolumeServer.java
appc-common/src/main/resources/org/onap/appc/i18n/MessageResources.properties
appc-directed-graph/appc-dgraph/provider/src/main/resources/json/APPC/APPC_DetachVolumeVM.json
appc-directed-graph/appc-dgraph/provider/src/main/resources/json/dg_activate.txt

index 3d3b9b7..b62062d 100644 (file)
  * ============LICENSE_END=========================================================
  */
 package org.onap.appc.adapter.iaas.provider.operation.impl;
+
 import static org.onap.appc.adapter.utils.Constants.ADAPTER_NAME;
 import java.util.Map;
+import java.util.List;
+import com.att.cdp.zones.ComputeService;
 import org.glassfish.grizzly.http.util.HttpStatus;
 import org.onap.appc.Constants;
 import org.onap.appc.adapter.iaas.ProviderAdapter;
@@ -49,6 +52,7 @@ import static org.onap.appc.adapter.iaas.provider.operation.common.enums.Operati
 
 public class AttachVolumeServer extends ProviderServerOperation {
     private final EELFLogger logger = EELFManager.getInstance().getLogger(AttachVolumeServer.class);
+
     private Server attachVolume(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
         Server server = null;
         RequestContext rc = new RequestContext(ctx);
@@ -66,32 +70,34 @@ public class AttachVolumeServer extends ProviderServerOperation {
             IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
             String identStr = (ident == null) ? null : ident.toString();
             String vol_id = (volumeid == null) ? null : volumeid.toString();
-            String msg;
             context = getContext(rc, vm_url, identStr);
             if (context != null) {
                 tenantName = context.getTenantName();//this varaible also is used in case of exception
                 rc.reset();
                 server = lookupServer(rc, context, vm.getServerId());
-                logger.debug(Msg.SERVER_FOUND, vm_url, tenantName, server.getStatus().toString());
-                    VolumeService vs = context.getVolumeService();
-                    vs.getVolumes(server);;
-                    Volume vol = new Volume();
-                    vol.setId(vol_id);
-                    logger.info("Server status: "+server.getStatus());
-                    Map volms = server.getVolumes();
-                    logger.info("list of attachments");
-                    logger.info(volms.size()+"initial volumes");
-                    logger.info(vol.getId());
-                    if(server.getVolumes().containsValue(vol_id))
-                    {
-                        logger.info("Alreday volumes exists:");
-                         logger.info( volms.size()+"volumes size if exists");
-                    }
-                    else
-                    {
-                    server.attachVolume(vol, device);
-                    logger.info( volms.size()+"volumes size after attaching volume");
+                logger.debug(Msg.SERVER_FOUND, vm_url, context.getTenantName(), server.getStatus().toString());
+                Context contx = server.getContext();
+                ComputeService service = contx.getComputeService();
+                VolumeService vs = contx.getVolumeService();
+                logger.info("collecting volume status for volume -id:" + vol_id);
+                List<Volume> volList = vs.getVolumes();
+                logger.info("Size of volume list :" + volList.size());
+                if (volList != null && !volList.isEmpty()) {
+                    for (Volume v : volList) {
+                        logger.info("list of volumesif exists" + v.getId());
+                        if (!v.getId().equals(vol_id)) {
+                            v.setId(vol_id);
+                            logger.info("Ready to Attach Volume to the server:" + Volume.Status.ATTACHING);
+                            service.attachVolume(server, v, device);
+                            logger.info("Volume status after performing attach:" + v.getStatus());
+                            doSuccess(rc);
+                        } else {
+                            String msg = "Volume with volume id " + vol_id + " cannot be attached as it already exists";
+                            logger.info("Alreday volumes exists:");
+                            doFailure(rc, HttpStatus.NOT_IMPLEMENTED_501, msg);
+                        }
                     }
+                }
                 context.close();
                 doSuccess(rc);
                 ctx.setAttribute("VOLUME_STATUS", "SUCCESS");
@@ -112,6 +118,7 @@ public class AttachVolumeServer extends ProviderServerOperation {
         }
         return server;
     }
+
     @Override
     protected ModelObject executeProviderOperation(Map<String, String> params, SvcLogicContext context)
             throws APPCException {
index 3dd843b..091edf2 100644 (file)
@@ -10,7 +10,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,6 +26,8 @@ package org.onap.appc.adapter.iaas.provider.operation.impl;
 import static org.onap.appc.adapter.iaas.provider.operation.common.enums.Operation.ATTACHVOLUME_SERVICE;
 import static org.onap.appc.adapter.utils.Constants.ADAPTER_NAME;
 import java.util.Map;
+import java.util.List;
+import com.att.cdp.zones.ComputeService;
 import org.glassfish.grizzly.http.util.HttpStatus;
 import org.onap.appc.Constants;
 import org.onap.appc.adapter.iaas.ProviderAdapter;
@@ -49,8 +51,9 @@ import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 import com.att.eelf.i18n.EELFResourceManager;
 
-public class DettachVolumeServer  extends ProviderServerOperation{
+public class DettachVolumeServer extends ProviderServerOperation {
     private final EELFLogger logger = EELFManager.getInstance().getLogger(DettachVolumeServer.class);
+
     @Override
     protected ModelObject executeProviderOperation(Map<String, String> params, SvcLogicContext context)
             throws APPCException {
@@ -58,6 +61,7 @@ public class DettachVolumeServer  extends ProviderServerOperation{
         logOperation(Msg.DETTACHINGVOLUME_SERVER, params, context);
         return dettachVolume(params, context);
     }
+
     private Server dettachVolume(Map<String, String> params, SvcLogicContext ctx) {
         Server server = null;
         RequestContext rc = new RequestContext(ctx);
@@ -75,29 +79,33 @@ public class DettachVolumeServer  extends ProviderServerOperation{
             IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
             String identStr = (ident == null) ? null : ident.toString();
             String vol_id = (volumeid == null) ? null : volumeid.toString();
-            String msg;
             context = getContext(rc, vm_url, identStr);
             if (context != null) {
                 tenantName = context.getTenantName();//this varaible also is used in case of exception
                 rc.reset();
                 server = lookupServer(rc, context, vm.getServerId());
-                logger.debug(Msg.SERVER_FOUND, vm_url, tenantName, server.getStatus().toString());
-                Volume vol = new Volume();
-                vol.setId(vol_id);
-                Map volms = server.getVolumes();
-                    ComputeService cs = context.getComputeService();
-                    if(server.getVolumes().containsValue(vol_id))
-                    {
-                        logger.info("Alreday volumes exists:");
-                         logger.info( volms.size()+"volumes size if exists");
-                         cs.detachVolume(server, vol);
-                         server.detachVolume(device);
-                    }
-                    else
-                    {
-                        logger.info("volume is not available to detach");
-                        logger.info("Server status: RUNNING");
+                logger.debug(Msg.SERVER_FOUND, vm_url, context.getTenantName(), server.getStatus().toString());
+                Context contx = server.getContext();
+                ComputeService service = contx.getComputeService();
+                VolumeService vs = contx.getVolumeService();
+                logger.info("collecting volume status for volume -id:" + vol_id);
+                List<Volume> volList = vs.getVolumes();
+                logger.info("Size of volume list :" + volList.size());
+                if (volList != null && !volList.isEmpty()) {
+                    for (Volume v : volList) {
+                        logger.info("list of volumesif exists" + v.getId());
+                        if (v.getId().equals(vol_id)) {
+                            v.setId(vol_id);
+                            logger.info("Ready to Detach Volume from the server:" + Volume.Status.DETACHING);
+                            service.detachVolume(server, v);
+                            logger.info("Volume status after performing detach:" + v.getStatus());
+                            doSuccess(rc);
+                        } else {
+                            String msg = "Volume with volume id " + vol_id + " cannot be detached as it doesnot exists";
+                            doFailure(rc, HttpStatus.NOT_IMPLEMENTED_501, msg);
+                        }
                     }
+                }
                 context.close();
                 doSuccess(rc);
                 ctx.setAttribute("VOLUME_STATUS", "SUCCESS");
index 7ffb220..a38a925 100644 (file)
@@ -542,6 +542,18 @@ INVALID_REQUIRED_PROPERTY=APPC0065E|\
     supply the syntax required for the property.|\
   Correct the property and retry.
 
+ATTACHINGVOLUME_SERVER=APPC0068I|\
+  {0} IAAS Adapter attaching of volume to server requested|\
+  No resolution required|\
+  A graph has invoked the IAAS adapter and has requested the attaching of volume to server.  The \
+    properties that govern the request are echoed immediately following this message.
+
+DETTACHINGVOLUME_SERVER=APPC0069I|\
+  {0} IAAS Adapter detaching of volume from server requested|\
+  No resolution required|\
+  A graph has invoked the IAAS adapter and has requested the detaching of volume from server.  The \
+   properties that govern the request are echoed immediately following this message.
+
 MIGRATING_SERVER=APPC066I|\
   {0} IAAS Adapter migrate of server requested|\
   No resolution required|\
@@ -1017,4 +1029,4 @@ IAAS_UNSUPPORTED_IDENTITY_SERVICE=APPC0163E|\
   Verify the identity url provided is correct. Currently supported version of the OpenStack identity servicer\
     are v2 and v3. If a support for a new version in required contact development.|\
   This message indicates that a request was made to connect to an unsupported version of \
-    identity service.
\ No newline at end of file
+    identity service.
index 0e65047..32fe9c2 100644 (file)
-[\r
-    {\r
-        "id": "eeae9def.4d566",\r
-        "type": "dgstart",\r
-        "name": "DGSTART",\r
-        "outputs": 1,\r
-        "x": 93,\r
-        "y": 92,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "f51d1b93.7d168"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "f51d1b93.7d168",\r
-        "type": "service-logic",\r
-        "name": "APPC 4.0.0",\r
-        "module": "APPC",\r
-        "version": "4.0.0",\r
-        "comments": "",\r
-        "xml": "<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='APPC' version='4.0.0'>",\r
-        "outputs": 1,\r
-        "x": 250,\r
-        "y": 92,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "10439b1c.b0fbc5"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "10439b1c.b0fbc5",\r
-        "type": "method",\r
-        "name": "DetachVolume",\r
-        "xml": "<method rpc='DetachVolumeVM' mode='sync'>\n",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 448,\r
-        "y": 94,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "cf4fac38.3b932"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "6f1b4f51.cab76",\r
-        "type": "success",\r
-        "name": "success",\r
-        "xml": "<outcome value='success'>\n",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 815.9999694824219,\r
-        "y": 303.9999694824219,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "f6364905.533518"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "eda3e619.a190e",\r
-        "type": "other",\r
-        "name": "other",\r
-        "xml": "<outcome value='Other'>\n",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 824.9999694824219,\r
-        "y": 182.99996948242188,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "b81aef23.ced6e8"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "361abfaa.ca34b8",\r
-        "type": "returnSuccess",\r
-        "name": "return success",\r
-        "xml": "<return status='success'>",\r
-        "comments": "",\r
-        "x": 1371.9999694824219,\r
-        "y": 275.9999694824219,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": []\r
-    },\r
-    {\r
-        "id": "5b028b69.7d6af4",\r
-        "type": "returnFailure",\r
-        "name": "return failure",\r
-        "xml": "<return status='failure'>\n<parameter name='error-code' value='401' />\n<parameter name='error-message' value='RPC dettachVolume not found' />",\r
-        "comments": "",\r
-        "x": 1132.9999694824219,\r
-        "y": 182.99996948242188,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": []\r
-    },\r
-    {\r
-        "id": "f6364905.533518",\r
-        "type": "switchNode",\r
-        "name": "switch error-code",\r
-        "xml": "<switch test='`$error_code`'>\n",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 1008.9999694824219,\r
-        "y": 304.9999694824219,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "567026e7.afed6",\r
-                "ee60ee08.fb232"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "567026e7.afed6",\r
-        "type": "success",\r
-        "name": "SUCCESS 200",\r
-        "xml": "<outcome value='200'>\n",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 1190.9999694824219,\r
-        "y": 274.9999694824219,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "361abfaa.ca34b8"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "ee60ee08.fb232",\r
-        "type": "outcome",\r
-        "name": "ERROR",\r
-        "xml": "<outcome value='Other'>\n",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 1182.9999694824219,\r
-        "y": 433.9999694824219,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "285baaf0.7d06de"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "285baaf0.7d06de",\r
-        "type": "block",\r
-        "name": "block",\r
-        "xml": "<block>\n",\r
-        "atomic": "false",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 1315.9999694824219,\r
-        "y": 434.9999694824219,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "44fe2b94.9c5d94",\r
-                "961f42bf.beb62"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "44fe2b94.9c5d94",\r
-        "type": "returnFailure",\r
-        "name": "return failure",\r
-        "xml": "<return status='failure'>\n<parameter name='error-code' value='401' />\n<parameter name='error-message' value='`$error-message`' />\n",\r
-        "comments": "",\r
-        "x": 1450.9999694824219,\r
-        "y": 476,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": []\r
-    },\r
-    {\r
-        "id": "b81aef23.ced6e8",\r
-        "type": "block",\r
-        "name": "block",\r
-        "xml": "<block>\n",\r
-        "atomic": "false",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 980.9999694824219,\r
-        "y": 182.99996948242188,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "5b028b69.7d6af4"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "34472fd1.b14ab",\r
-        "type": "record",\r
-        "name": "record",\r
-        "xml": "<record plugin=\"onap.ccsdk.sli.core.sli.recording.Slf4jRecorder\">\n<parameter name=\"level\" value=\"info\"/>\n<parameter name=\"logger\" value=\"message-log\"/>\n<parameter name=\"field1\" value=\"__TIMESTAMP__\"/>\n<parameter name=\"field2\" value=\"`'input.payload = ' + $input.payload`\" />\n<parameter name=\"field3\" value=\"`'vm-id in context=' + $vm-id`\" />\n<parameter name=\"field4\" value=\"`'volumeId in context=' + $volumeId`\" />\n",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 815.11669921875,\r
-        "y": 124,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            []\r
-        ]\r
-    },\r
-    {\r
-        "id": "cf4fac38.3b932",\r
-        "type": "block",\r
-        "name": "block",\r
-        "xml": "<block>\n",\r
-        "atomic": "false",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 636.8666687011719,\r
-        "y": 152.86666870117188,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "34472fd1.b14ab",\r
-                "e021eba0.2f5b7"\r
-            ]\r
-        ]\r
-    },\r
-    {\r
-        "id": "961f42bf.beb62",\r
-        "type": "record",\r
-        "name": "record",\r
-        "xml": "<record plugin=\"onap.ccsdk.sli.core.sli.recording.Slf4jRecorder\">\n<parameter name=\"level\" value=\"info\"/>\n<parameter name=\"logger\" value=\"message-log\"/>\n<parameter name=\"field1\" value=\"__TIMESTAMP__\"/>\n<parameter name=\"field3\" value=\"`'error-message = ' + $error-message`\" />\n<parameter name=\"field4\" value=\"`'error-code = ' + $error_code`\" />",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 1440.8666687011719,\r
-        "y": 406.8666687011719,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            []\r
-        ]\r
-    },\r
-    {\r
-        "id": "e021eba0.2f5b7",\r
-        "type": "execute",\r
-        "name": "DetachVolume",\r
-        "xml": "<execute plugin='org.onap.appc.adapter.iaas.ProviderAdapter' method='attachVolume'>\n<parameter name=\"org.onap.appc.provider.name\" value=\"OpenStack\" />\n<parameter name=\"org.onap.appc.instance.url\" value=\"`$vm-id`\" />\n<parameter name=\"org.onap.appc.identity.url\" value=\"`$identity-url`\" />\n<parameter name=\"org.onap.appc.volumeid\" value=\"`$volumeAttachment.volumeId`\" />\n<parameter name=\"org.onap.appc.device\" value=\"`$volumeAttachment.device`\" />\n<parameter name=\"org.onap.appc.tag\" value=\"`$volumeAttachment.tag`\"/>",\r
-        "comments": "",\r
-        "outputs": 1,\r
-        "x": 652.9999694824219,\r
-        "y": 238,\r
-        "z": "65f0ae97.bfd7e8",\r
-        "wires": [\r
-            [\r
-                "eda3e619.a190e",\r
-                "6f1b4f51.cab76"\r
-            ]\r
-        ]\r
-    }\r
-]\r
+[
+    {
+        "id": "eeae9def.4d566",
+        "type": "dgstart",
+        "name": "DGSTART",
+        "outputs": 1,
+        "x": 93,
+        "y": 92,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "f51d1b93.7d168"
+            ]
+        ]
+    },
+    {
+        "id": "f51d1b93.7d168",
+        "type": "service-logic",
+        "name": "APPC 4.0.0",
+        "module": "APPC",
+        "version": "4.0.0",
+        "comments": "",
+        "xml": "<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='APPC' version='4.0.0'>",
+        "outputs": 1,
+        "x": 250,
+        "y": 92,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "10439b1c.b0fbc5"
+            ]
+        ]
+    },
+    {
+        "id": "10439b1c.b0fbc5",
+        "type": "method",
+        "name": "DetachVolume",
+        "xml": "<method rpc='DetachVolumeVM' mode='sync'>\n",
+        "comments": "",
+        "outputs": 1,
+        "x": 448,
+        "y": 94,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "cf4fac38.3b932"
+            ]
+        ]
+    },
+    {
+        "id": "6f1b4f51.cab76",
+        "type": "success",
+        "name": "success",
+        "xml": "<outcome value='success'>\n",
+        "comments": "",
+        "outputs": 1,
+        "x": 815.9999694824219,
+        "y": 303.9999694824219,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "f6364905.533518"
+            ]
+        ]
+    },
+    {
+        "id": "eda3e619.a190e",
+        "type": "other",
+        "name": "other",
+        "xml": "<outcome value='Other'>\n",
+        "comments": "",
+        "outputs": 1,
+        "x": 824.9999694824219,
+        "y": 182.99996948242188,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "b81aef23.ced6e8"
+            ]
+        ]
+    },
+    {
+        "id": "361abfaa.ca34b8",
+        "type": "returnSuccess",
+        "name": "return success",
+        "xml": "<return status='success'>",
+        "comments": "",
+        "x": 1371.9999694824219,
+        "y": 275.9999694824219,
+        "z": "65f0ae97.bfd7e8",
+        "wires": []
+    },
+    {
+        "id": "5b028b69.7d6af4",
+        "type": "returnFailure",
+        "name": "return failure",
+        "xml": "<return status='failure'>\n<parameter name='error-code' value='401' />\n<parameter name='error-message' value='RPC dettachVolume not found' />",
+        "comments": "",
+        "x": 1132.9999694824219,
+        "y": 182.99996948242188,
+        "z": "65f0ae97.bfd7e8",
+        "wires": []
+    },
+    {
+        "id": "f6364905.533518",
+        "type": "switchNode",
+        "name": "switch error-code",
+        "xml": "<switch test='`$error_code`'>\n",
+        "comments": "",
+        "outputs": 1,
+        "x": 1008.9999694824219,
+        "y": 304.9999694824219,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "567026e7.afed6",
+                "ee60ee08.fb232"
+            ]
+        ]
+    },
+    {
+        "id": "567026e7.afed6",
+        "type": "success",
+        "name": "SUCCESS 200",
+        "xml": "<outcome value='200'>\n",
+        "comments": "",
+        "outputs": 1,
+        "x": 1190.9999694824219,
+        "y": 274.9999694824219,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "361abfaa.ca34b8"
+            ]
+        ]
+    },
+    {
+        "id": "ee60ee08.fb232",
+        "type": "outcome",
+        "name": "ERROR",
+        "xml": "<outcome value='Other'>\n",
+        "comments": "",
+        "outputs": 1,
+        "x": 1182.9999694824219,
+        "y": 433.9999694824219,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "285baaf0.7d06de"
+            ]
+        ]
+    },
+    {
+        "id": "285baaf0.7d06de",
+        "type": "block",
+        "name": "block",
+        "xml": "<block>\n",
+        "atomic": "false",
+        "comments": "",
+        "outputs": 1,
+        "x": 1315.9999694824219,
+        "y": 434.9999694824219,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "44fe2b94.9c5d94",
+                "961f42bf.beb62"
+            ]
+        ]
+    },
+    {
+        "id": "44fe2b94.9c5d94",
+        "type": "returnFailure",
+        "name": "return failure",
+        "xml": "<return status='failure'>\n<parameter name='error-code' value='401' />\n<parameter name='error-message' value='`$error-message`' />\n",
+        "comments": "",
+        "x": 1450.9999694824219,
+        "y": 476,
+        "z": "65f0ae97.bfd7e8",
+        "wires": []
+    },
+    {
+        "id": "b81aef23.ced6e8",
+        "type": "block",
+        "name": "block",
+        "xml": "<block>\n",
+        "atomic": "false",
+        "comments": "",
+        "outputs": 1,
+        "x": 980.9999694824219,
+        "y": 182.99996948242188,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "5b028b69.7d6af4"
+            ]
+        ]
+    },
+    {
+        "id": "34472fd1.b14ab",
+        "type": "record",
+        "name": "record",
+        "xml": "<record plugin=\"onap.ccsdk.sli.core.sli.recording.Slf4jRecorder\">\n<parameter name=\"level\" value=\"info\"/>\n<parameter name=\"logger\" value=\"message-log\"/>\n<parameter name=\"field1\" value=\"__TIMESTAMP__\"/>\n<parameter name=\"field2\" value=\"`'input.payload = ' + $input.payload`\" />\n<parameter name=\"field3\" value=\"`'vm-id in context=' + $vm-id`\" />\n<parameter name=\"field4\" value=\"`'volumeId in context=' + $volumeId`\" />\n",
+        "comments": "",
+        "outputs": 1,
+        "x": 815.11669921875,
+        "y": 124,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            []
+        ]
+    },
+    {
+        "id": "cf4fac38.3b932",
+        "type": "block",
+        "name": "block",
+        "xml": "<block>\n",
+        "atomic": "false",
+        "comments": "",
+        "outputs": 1,
+        "x": 636.8666687011719,
+        "y": 152.86666870117188,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "34472fd1.b14ab",
+                "e021eba0.2f5b7"
+            ]
+        ]
+    },
+    {
+        "id": "961f42bf.beb62",
+        "type": "record",
+        "name": "record",
+        "xml": "<record plugin=\"onap.ccsdk.sli.core.sli.recording.Slf4jRecorder\">\n<parameter name=\"level\" value=\"info\"/>\n<parameter name=\"logger\" value=\"message-log\"/>\n<parameter name=\"field1\" value=\"__TIMESTAMP__\"/>\n<parameter name=\"field3\" value=\"`'error-message = ' + $error-message`\" />\n<parameter name=\"field4\" value=\"`'error-code = ' + $error_code`\" />",
+        "comments": "",
+        "outputs": 1,
+        "x": 1440.8666687011719,
+        "y": 406.8666687011719,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            []
+        ]
+    },
+    {
+        "id": "e021eba0.2f5b7",
+        "type": "execute",
+        "name": "DetachVolume",
+        "xml": "<execute plugin='org.onap.appc.adapter.iaas.ProviderAdapter' method='dettachVolume'>\n<parameter name=\"org.onap.appc.provider.name\" value=\"OpenStack\" />\n<parameter name=\"org.onap.appc.instance.url\" value=\"`$vm-id`\" />\n<parameter name=\"org.onap.appc.identity.url\" value=\"`$identity-url`\" />\n<parameter name=\"org.onap.appc.volumeid\" value=\"`$volumeAttachment.volumeId`\" />\n<parameter name=\"org.onap.appc.device\" value=\"`$volumeAttachment.device`\" />\n<parameter name=\"org.onap.appc.tag\" value=\"`$volumeAttachment.tag`\"/>",
+        "comments": "",
+        "outputs": 1,
+        "x": 652.9999694824219,
+        "y": 238,
+        "z": "65f0ae97.bfd7e8",
+        "wires": [
+            [
+                "eda3e619.a190e",
+                "6f1b4f51.cab76"
+            ]
+        ]
+    }
+]
index 4ebbfa0..76d66bc 100644 (file)
@@ -1,86 +1,86 @@
-# MODULE NAME:RPC NAME:VERSION:MODE\r
-# Example -> APPC:GetDeviceRunningConfiguration:3.0.0:sync\r
-APPC:CheckConfigStatus:4.0.0:sync\r
-APPC:CommonConfiguration:4.0.0:sync\r
-APPC:Configure:4.0.0:sync\r
-APPC:DownloadCliConfig:4.0.0:sync\r
-APPC:DownloadIsbcConfig:4.0.0:sync\r
-APPC:DownloadRestconfConfig:4.0.0:sync\r
-APPC:DownloadSBGConfig:4.0.0:sync\r
-APPC:DownloadvIRCChefConfig:4.0.0:sync\r
-APPC:DownloadXmlConfig:4.0.0:sync\r
-APPC:GenerateTemplateConfig:4.0.0:sync\r
-APPC:GetConfigParams:4.0.0:sync\r
-APPC:GetDeviceRunningConfig:4.0.0:sync\r
-APPC:GenerateConfig:4.0.0:sync\r
-APPC:SaveRunningConfig:4.0.0:sync\r
-APPC:SetStatus:4.0.0:sync\r
-APPC:UpdateAaiInfo:4.0.0:sync\r
-APPC:GetAaiInfo:4.0.0:sync\r
-APPC:GetVfModuleInfo:4.0.0:sync\r
-APPC:ProcessParameterDefinition:4.0.0:sync\r
-APPC:PublishConfiguration:4.0.0:sync\r
-APPC:topology-operation-all:2.0.0:sync\r
-SDC-MESSAGE:configuration-document-request:3.0.0:sync\r
-\r
-Appc-API:service-configuration-operation:4.0.0:sync\r
-Appc-API:service-configuration-prepare:4.0.0:sync\r
-Appc-API:service-configuration-activate:4.0.0:sync\r
-Appc-API:service-configuration-backup:4.0.0:sync\r
-Appc-API:service-configuration-notification:4.0.0:sync\r
-Appc-API:audit-configuration-operation:4.0.0:sync\r
-Appc-API:audit-configuration-notification:4.0.0:sync\r
-Appc-API:update-aai:4.0.0:sync\r
-Appc-API:update-aai-sbg:4.0.0:sync\r
-Appc-API:update-vserver-info:4.0.0:sync\r
-Appc-API:update-vnfc-info:4.0.0:sync\r
-\r
-Appc-API:Generic_Evacuate:2.0.0:sync\r
-\r
-#\r
-APPC:GetRunningConfig:2.0.0:sync\r
-APPC:Restart-Active-Active_VNFC:2.0.0:sync\r
-APPC:Restart-Active-Passive_VNFC:2.0.0:sync\r
-APPC:Check-Active_VNFC_vSCP:2.0.0:sync\r
-APPC:HealthCheck_VNF_vSCP:2.0.0:sync\r
-APPC:Restart_VNF:2.0.0:sync\r
-APPC:Restart_VNFC:2.0.0:sync\r
-APPC:Restart_VM:2.0.0:sync\r
-APPC:Stop_VNFC:2.0.2:sync\r
-APPC:Stop_VNF:2.0.2:sync\r
-APPC:StopVM_VM:2.0.0:sync\r
-APPC:Stop_VM:2.0.0:sync\r
-APPC:StopApplication_VM_vSCP:2.0.0:sync\r
-APPC:Generic_Sync:2.0.0:sync\r
-APPC:Generic_Audit:2.0.0:sync\r
-APPC:Start_VNF:2.0.0:sync\r
-APPC:Start_VNFC:2.0.0:sync\r
-APPC:Start_VM:2.0.0:sync\r
-APPC:StartApplication_VM_vSCP:2.0.0:sync\r
-APPC:RestartVM_VM:2.0.0:sync\r
-APPC:Rebuild_VM:2.0.0:sync\r
-\r
-APPC:EvacuateVM:2.0.0:sync\r
-APPC:RebuildVM:2.0.0:sync\r
-APPC:CreateSnapShotVM:2.0.0:sync\r
-APPC:MigrateVM:2.0.0:sync\r
-APPC:RestartVMCommonFlow:2.0.0:sync\r
-APPC:RestartVMVNFCommonFlow:2.0.0:sync\r
-\r
-APPC:setInputParams:4.0.0:sync\r
-APPC:healthcheck:4.0.0:sync\r
-APPC:chef:3.0.0:sync\r
-APPC:ansible-adapter-1.0:2.0.1:sync\r
-APPC:Generic_AnsibleDG:4.0.0:sync\r
-APPC:GetTemplateConfig_Ansible:4.0.0:sync\r
-APPC:GetTemplateConfig_Chef:4.0.0:sync\r
-APPC:Generic_ChefDG:4.0.0:sync\r
-APPC:loadTeamplate:4.0.0:sync\r
-APPC:MergeTemplateData:4.0.0:sync\r
-APPC:UpdateAaiforPayloadInput:4.0.0:sync\r
-APPC:UpdateAaiforReferenceData:4.0.0:sync\r
-APPC:DGOrchestrator:4.0.0:sync\r
-APPC:VM_Start:2.0.0:sync\r
-APPC:VM_Stop:2.0.0:sync\r
-APPC:AttachVolumeVM:4.0.0:sync\r
+# MODULE NAME:RPC NAME:VERSION:MODE
+# Example -> APPC:GetDeviceRunningConfiguration:3.0.0:sync
+APPC:CheckConfigStatus:4.0.0:sync
+APPC:CommonConfiguration:4.0.0:sync
+APPC:Configure:4.0.0:sync
+APPC:DownloadCliConfig:4.0.0:sync
+APPC:DownloadIsbcConfig:4.0.0:sync
+APPC:DownloadRestconfConfig:4.0.0:sync
+APPC:DownloadSBGConfig:4.0.0:sync
+APPC:DownloadvIRCChefConfig:4.0.0:sync
+APPC:DownloadXmlConfig:4.0.0:sync
+APPC:GenerateTemplateConfig:4.0.0:sync
+APPC:GetConfigParams:4.0.0:sync
+APPC:GetDeviceRunningConfig:4.0.0:sync
+APPC:GenerateConfig:4.0.0:sync
+APPC:SaveRunningConfig:4.0.0:sync
+APPC:SetStatus:4.0.0:sync
+APPC:UpdateAaiInfo:4.0.0:sync
+APPC:GetAaiInfo:4.0.0:sync
+APPC:GetVfModuleInfo:4.0.0:sync
+APPC:ProcessParameterDefinition:4.0.0:sync
+APPC:PublishConfiguration:4.0.0:sync
+APPC:topology-operation-all:2.0.0:sync
+SDC-MESSAGE:configuration-document-request:3.0.0:sync
+
+Appc-API:service-configuration-operation:4.0.0:sync
+Appc-API:service-configuration-prepare:4.0.0:sync
+Appc-API:service-configuration-activate:4.0.0:sync
+Appc-API:service-configuration-backup:4.0.0:sync
+Appc-API:service-configuration-notification:4.0.0:sync
+Appc-API:audit-configuration-operation:4.0.0:sync
+Appc-API:audit-configuration-notification:4.0.0:sync
+Appc-API:update-aai:4.0.0:sync
+Appc-API:update-aai-sbg:4.0.0:sync
+Appc-API:update-vserver-info:4.0.0:sync
+Appc-API:update-vnfc-info:4.0.0:sync
+Appc-API:legacy_operation:2.0.0.0:sync
+Appc-API:Generic_Evacuate:2.0.0:sync
+
+#
+APPC:GetRunningConfig:2.0.0:sync
+APPC:Restart-Active-Active_VNFC:2.0.0:sync
+APPC:Restart-Active-Passive_VNFC:2.0.0:sync
+APPC:Check-Active_VNFC_vSCP:2.0.0:sync
+APPC:HealthCheck_VNF_vSCP:2.0.0:sync
+APPC:Restart_VNF:2.0.0:sync
+APPC:Restart_VNFC:2.0.0:sync
+APPC:Restart_VM:2.0.0:sync
+APPC:Stop_VNFC:2.0.2:sync
+APPC:Stop_VNF:2.0.2:sync
+APPC:StopVM_VM:2.0.0:sync
+APPC:Stop_VM:2.0.0:sync
+APPC:StopApplication_VM_vSCP:2.0.0:sync
+APPC:Generic_Sync:2.0.0:sync
+APPC:Generic_Audit:2.0.0:sync
+APPC:Start_VNF:2.0.0:sync
+APPC:Start_VNFC:2.0.0:sync
+APPC:Start_VM:2.0.0:sync
+APPC:StartApplication_VM_vSCP:2.0.0:sync
+APPC:RestartVM_VM:2.0.0:sync
+APPC:Rebuild_VM:2.0.0:sync
+
+APPC:EvacuateVM:2.0.0:sync
+APPC:RebuildVM:2.0.0:sync
+APPC:CreateSnapShotVM:2.0.0:sync
+APPC:MigrateVM:2.0.0:sync
+APPC:RestartVMCommonFlow:2.0.0:sync
+APPC:RestartVMVNFCommonFlow:2.0.0:sync
+
+APPC:setInputParams:4.0.0:sync
+APPC:healthcheck:4.0.0:sync
+APPC:chef:3.0.0:sync
+APPC:ansible-adapter-1.0:2.0.1:sync
+APPC:Generic_AnsibleDG:4.0.0:sync
+APPC:GetTemplateConfig_Ansible:4.0.0:sync
+APPC:GetTemplateConfig_Chef:4.0.0:sync
+APPC:Generic_ChefDG:4.0.0:sync
+APPC:loadTeamplate:4.0.0:sync
+APPC:MergeTemplateData:4.0.0:sync
+APPC:UpdateAaiforPayloadInput:4.0.0:sync
+APPC:UpdateAaiforReferenceData:4.0.0:sync
+APPC:DGOrchestrator:4.0.0:sync
+APPC:VM_Start:2.0.0:sync
+APPC:VM_Stop:2.0.0:sync
+APPC:AttachVolumeVM:4.0.0:sync
 APPC:DetachVolumeVM:4.0.0:sync
\ No newline at end of file