diff options
4 files changed, 436 insertions, 430 deletions
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/AttachVolumeServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/AttachVolumeServer.java index fe42076f3..e27b1594d 100644 --- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/AttachVolumeServer.java +++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/AttachVolumeServer.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP : APPC * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs * ============================================================================= @@ -25,7 +25,6 @@ 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 com.att.cdp.exceptions.ZoneException; import com.att.cdp.zones.ComputeService; import com.att.cdp.zones.Context; @@ -74,48 +73,57 @@ public class AttachVolumeServer extends ProviderServerOperation { String identStr = (ident == null) ? null : ident.toString(); context = getContext(requestContext, vmUrl, identStr); if (context != null) { - tenantName = context.getTenantName();// this variable also is used in case of exception + tenantName = context.getTenantName();// this variable also is + // used in case of + // exception requestContext.reset(); server = lookupServer(requestContext, context, vm.getServerId()); logger.debug(Msg.SERVER_FOUND, vmUrl, context.getTenantName(), server.getStatus().toString()); Context contx = server.getContext(); ComputeService service = contx.getComputeService(); VolumeService volumeService = contx.getVolumeService(); - logger.info("Collecting volume status for volume id: " + volumeId); + logger.info("collecting volume status for volume -id:" + volumeId); List<Volume> volumes = volumeService.getVolumes(); - logger.info("Size of volume list: " + volumes.size()); - for (Volume volume : volumes) { - logger.info("Processing volume with id: " + volume.getId()); - if (!volume.getId().equals(volumeId)) { + Volume volume = new Volume(); + logger.info("Size of volume list :" + volumes.size()); + if (volumes != null && !volumes.isEmpty()) { + if (!(volumes.contains(volumeId))) { volume.setId(volumeId); - logger.info("Ready to Attach Volume to the server: " + Volume.Status.ATTACHING); + logger.info("Ready to Attach Volume to the server:"); service.attachVolume(server, volume, device); - logger.info("Volume status after performing attach: " + volume.getStatus()); - - validateAttach(volumeService, volumeId, requestContext); + logger.info("Volume status after performing attach:" + volume.getStatus()); + if (validateAttach(volumeService, volumeId)) { + ctx.setAttribute("VOLUME_STATUS", "SUCCESS"); + doSuccess(requestContext); + } else { + String msg = "Failed to attach Volume"; + logger.info("Volume with " + volumeId + " unable to attach"); + ctx.setAttribute("VOLUME_STATUS", "FAILURE"); + doFailure(requestContext, HttpStatus.NOT_IMPLEMENTED_501, msg); + } } else { - String msg = "Volume with id: " + volumeId + " cannot be attached as it already exists"; - logger.info(msg); + String msg = "Volume with volume id " + volumeId + " cannot be attached as it already exists"; + logger.info("Alreday volumes exists:"); + ctx.setAttribute("VOLUME_STATUS", "FAILURE"); doFailure(requestContext, HttpStatus.NOT_IMPLEMENTED_501, msg); } } context.close(); - doSuccess(requestContext); - ctx.setAttribute("VOLUME_STATUS", "SUCCESS"); } else { ctx.setAttribute("VOLUME_STATUS", "CONTEXT_NOT_FOUND"); } } catch (ZoneException e) { String msg = EELFResourceManager.format(Msg.SERVER_NOT_FOUND, e, vmUrl); logger.error(msg); + ctx.setAttribute("VOLUME_STATUS", "FAILURE"); doFailure(requestContext, HttpStatus.NOT_FOUND_404, msg); } catch (RequestFailedException e) { - logger.error("An error occurred in attachVolume", e); + ctx.setAttribute("VOLUME_STATUS", "FAILURE"); doFailure(requestContext, e.getStatus(), e.getMessage()); } catch (Exception ex) { String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, ex, ex.getClass().getSimpleName(), - ATTACHVOLUME_SERVICE.toString(), vmUrl, tenantName); - logger.error(msg, ex); + ATTACHVOLUME_SERVICE.toString(), vmUrl, tenantName); + ctx.setAttribute("VOLUME_STATUS", "FAILURE"); doFailure(requestContext, HttpStatus.INTERNAL_SERVER_ERROR_500, msg); } return server; @@ -123,24 +131,22 @@ public class AttachVolumeServer extends ProviderServerOperation { @Override protected ModelObject executeProviderOperation(Map<String, String> params, SvcLogicContext context) - throws APPCException { + throws APPCException { setMDC(Operation.ATTACHVOLUME_SERVICE.toString(), "App-C IaaS Adapter:attachVolume", ADAPTER_NAME); logOperation(Msg.ATTACHINGVOLUME_SERVER, params, context); return attachVolume(params, context); } - private void validateAttach(VolumeService vs, String volId, RequestContext requestContext) - throws RequestFailedException, ZoneException { - - List<Volume> volList = vs.getVolumes(); - for (Volume v : volList) { - if (v.getId().equals(volId)) { - logger.info("Volume with id: " + volId + " attached successfully"); - doSuccess(requestContext); - } else { - logger.info("Failed to attach volume with id: " + volId); - } + protected boolean validateAttach(VolumeService volumeService, String volumeId) + throws RequestFailedException, ZoneException { + boolean flag = false; + List<Volume> volumeList = volumeService.getVolumes(); + if (volumeList.contains(volumeId)) { + flag = true; + } else { + flag = false; } + logger.info("validateAttach flag-->" + flag); + return flag; } - } diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/DettachVolumeServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/DettachVolumeServer.java index 6f0ab87be..d9b30cbb8 100644 --- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/DettachVolumeServer.java +++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/DettachVolumeServer.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP : APPC * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs * ============================================================================= @@ -23,9 +23,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.iaas.provider.operation.common.enums.Operation.DETACHVOLUME_SERVICE; import static org.onap.appc.adapter.utils.Constants.ADAPTER_NAME; - import com.att.cdp.exceptions.ZoneException; import com.att.cdp.zones.ComputeService; import com.att.cdp.zones.Context; @@ -52,12 +51,11 @@ import org.onap.appc.i18n.Msg; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; 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 { + throws APPCException { setMDC(Operation.DETACHVOLUME_SERVICE.toString(), "App-C IaaS Adapter:dettachVolume", ADAPTER_NAME); logOperation(Msg.DETTACHINGVOLUME_SERVER, params, context); return dettachVolume(params, context); @@ -65,84 +63,86 @@ public class DettachVolumeServer extends ProviderServerOperation { private Server dettachVolume(Map<String, String> params, SvcLogicContext ctx) { Server server = null; - RequestContext rc = new RequestContext(ctx); - rc.isAlive(); + RequestContext requestContext = new RequestContext(ctx); + requestContext.isAlive(); String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME); String vmUrl = params.get(ProviderAdapter.PROPERTY_INSTANCE_URL); String volumeId = params.get(ProviderAdapter.VOLUME_ID); VMURL vm = VMURL.parseURL(vmUrl); Context context; - String tenantName = "Unknown";//to be used also in case of exception + String tenantName = "Unknown";// to be used also in case of exception try { - if (validateVM(rc, appName, vmUrl, vm)) { + if (validateVM(requestContext, appName, vmUrl, vm)) { return null; } IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL)); String identStr = (ident == null) ? null : ident.toString(); - context = getContext(rc, vmUrl, identStr); + context = getContext(requestContext, vmUrl, identStr); if (context != null) { - tenantName = context.getTenantName();//this variable also is used in case of exception - rc.reset(); - server = lookupServer(rc, context, vm.getServerId()); + tenantName = context.getTenantName();// this variable also is + // used in case of + // exception + requestContext.reset(); + server = lookupServer(requestContext, context, vm.getServerId()); logger.debug(Msg.SERVER_FOUND, vmUrl, context.getTenantName(), server.getStatus().toString()); Context contx = server.getContext(); ComputeService service = contx.getComputeService(); - VolumeService vs = contx.getVolumeService(); + VolumeService volumeService = contx.getVolumeService(); logger.info("collecting volume status for volume -id: " + volumeId); - List<Volume> volList = vs.getVolumes(); - logger.info("Size of volume list: " + volList.size()); - if (!volList.isEmpty()) { - for (Volume v : volList) { - logger.info("list of volumesif exists: " + v.getId()); - if (v.getId().equals(volumeId)) { - v.setId(volumeId); - 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()); - if (validateDetach(vs, volumeId)) { - doSuccess(rc); - } + List<Volume> volumes = volumeService.getVolumes(); + Volume volume = new Volume(); + logger.info("Size of volume list: " + volumes.size()); + if (volumes != null && !volumes.isEmpty()) { + if (volumes.contains(volumeId)) { + volume.setId(volumeId); + logger.info("Ready to Detach Volume from the server: " + Volume.Status.DETACHING); + service.detachVolume(server, volume); + logger.info("Volume status after performing detach: " + volume.getStatus()); + if (validateDetach(volumeService, volumeId)) { + doSuccess(requestContext); } else { - String msg = - "Volume with volume id " + volumeId + " cannot be detached as it doesn't exists"; - doFailure(rc, HttpStatus.NOT_IMPLEMENTED_501, msg); + String msg = "Volume with volume id " + volumeId + " cannot be detached "; + ctx.setAttribute("VOLUME_STATUS", "FAILURE"); + doFailure(requestContext, HttpStatus.NOT_IMPLEMENTED_501, msg); + logger.info("unable to detach volume from the server"); } + } else { + String msg = "Volume with volume id " + volumeId + " cannot be detached as it doesn't exists"; + ctx.setAttribute("VOLUME_STATUS", "FAILURE"); + doFailure(requestContext, HttpStatus.NOT_IMPLEMENTED_501, msg); } + logger.info("volumestatus:" + ctx.getAttribute("VOLUME_STATUS")); } context.close(); - doSuccess(rc); - ctx.setAttribute("VOLUME_STATUS", "SUCCESS"); } else { ctx.setAttribute("VOLUME_STATUS", "CONTEXT_NOT_FOUND"); } } catch (ZoneException e) { String msg = EELFResourceManager.format(Msg.SERVER_NOT_FOUND, e, vmUrl); logger.error(msg); - doFailure(rc, HttpStatus.NOT_FOUND_404, msg); + doFailure(requestContext, HttpStatus.NOT_FOUND_404, msg); } catch (RequestFailedException e) { logger.error("An error occurred when processing the request", e); - doFailure(rc, e.getStatus(), e.getMessage()); + doFailure(requestContext, e.getStatus(), e.getMessage()); } catch (Exception e) { String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e, e.getClass().getSimpleName(), - ATTACHVOLUME_SERVICE.toString(), vmUrl, tenantName); + DETACHVOLUME_SERVICE.toString(), vmUrl, tenantName); logger.error(msg, e); - doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg); + doFailure(requestContext, HttpStatus.INTERNAL_SERVER_ERROR_500, msg); } return server; } - protected boolean validateDetach(VolumeService vs, String volId) throws RequestFailedException, ZoneException { + protected boolean validateDetach(VolumeService volumeService, String volId) + throws RequestFailedException, ZoneException { boolean flag = false; - List<Volume> volList = vs.getVolumes(); - for (Volume v : volList) { - if (!v.getId().equals(volId)) { - logger.info("Volume with " + volId + "detached successsfully"); - flag = true; - } else { - logger.info("failed to detach volume with id" + volId); - flag = false; - } + List<Volume> volumes = volumeService.getVolumes(); + if (!volumes.contains(volId)) { + flag = true; + } else { + flag = false; } + logger.info("validateDetach flag-->" + flag); return flag; } } diff --git a/appc-directed-graph/appc-dgraph/provider/src/main/resources/json/APPC/APPC_AttachVolumeVM.json b/appc-directed-graph/appc-dgraph/provider/src/main/resources/json/APPC/APPC_AttachVolumeVM.json index 8684afa59..2b33c7e1c 100644 --- a/appc-directed-graph/appc-dgraph/provider/src/main/resources/json/APPC/APPC_AttachVolumeVM.json +++ b/appc-directed-graph/appc-dgraph/provider/src/main/resources/json/APPC/APPC_AttachVolumeVM.json @@ -1,20 +1,20 @@ [
{
- "id": "8c8d638b.d864e8",
+ "id": "5007ce02.07f1d",
"type": "dgstart",
"name": "DGSTART",
"outputs": 1,
- "x": 84,
- "y": 84,
- "z": "1eca43d0.41972c",
+ "x": 87,
+ "y": 73.11666870117188,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "67bc77ec.cfab9"
+ "7d845d7f.b28f8c"
]
]
},
{
- "id": "67bc77ec.cfab9",
+ "id": "7d845d7f.b28f8c",
"type": "service-logic",
"name": "APPC 4.0.0",
"module": "APPC",
@@ -22,240 +22,240 @@ "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": 241,
- "y": 84,
- "z": "1eca43d0.41972c",
+ "x": 220,
+ "y": 38.116668701171875,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "9ab2a765.c334e"
+ "2bf8e045.73a448"
]
]
},
{
- "id": "9ab2a765.c334e",
+ "id": "2bf8e045.73a448",
"type": "method",
"name": "AttachVolume",
"xml": "<method rpc='AttachVolumeVM' mode='sync'>\n",
"comments": "",
"outputs": 1,
- "x": 439,
- "y": 86,
- "z": "1eca43d0.41972c",
+ "x": 418,
+ "y": 40.116668701171875,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "af60ef65.5a714"
+ "468a32bf.35f284"
]
]
},
{
- "id": "9d95111e.b625",
+ "id": "6d9a583d.567f7",
"type": "success",
"name": "success",
"xml": "<outcome value='success'>\n",
"comments": "",
"outputs": 1,
- "x": 806.9999694824219,
- "y": 295.9999694824219,
- "z": "1eca43d0.41972c",
+ "x": 785.9999694824219,
+ "y": 250.11663818359375,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "3f10a3d4.fa8644"
+ "9b1062e9.283098"
]
]
},
{
- "id": "98f61d5c.9857e8",
+ "id": "ddd78a95.68e358",
"type": "other",
"name": "other",
"xml": "<outcome value='Other'>\n",
"comments": "",
"outputs": 1,
- "x": 815.9999694824219,
- "y": 174.99996948242188,
- "z": "1eca43d0.41972c",
+ "x": 794.9999694824219,
+ "y": 129.11663818359375,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "b2efb443.b631a"
+ "f06647ab.96aca"
]
]
},
{
- "id": "6be48d2c.b63d8c",
+ "id": "10c52db4.a51652",
"type": "returnSuccess",
"name": "return success",
"xml": "<return status='success'>",
"comments": "",
- "x": 1362.9999694824219,
- "y": 267.9999694824219,
- "z": "1eca43d0.41972c",
+ "x": 1341.9999694824219,
+ "y": 222.11663818359375,
+ "z": "bb7eafb1.d37d2",
"wires": []
},
{
- "id": "3ebaa10e.c55e6e",
+ "id": "84c0dae5.04bb7",
"type": "returnFailure",
"name": "return failure",
"xml": "<return status='failure'>\n<parameter name='error-code' value='401' />\n<parameter name='error-message' value='RPC attachVolume not found' />",
"comments": "",
- "x": 1123.9999694824219,
- "y": 174.99996948242188,
- "z": "1eca43d0.41972c",
+ "x": 1102.9999694824219,
+ "y": 129.11663818359375,
+ "z": "bb7eafb1.d37d2",
"wires": []
},
{
- "id": "3f10a3d4.fa8644",
+ "id": "9b1062e9.283098",
"type": "switchNode",
- "name": "switch error-code",
- "xml": "<switch test='`$error_code`'>\n",
+ "name": "switch status",
+ "xml": "<switch test='`$VOLUME_STATUS`'>\n",
"comments": "",
"outputs": 1,
- "x": 999.9999694824219,
- "y": 296.9999694824219,
- "z": "1eca43d0.41972c",
+ "x": 978.9999694824219,
+ "y": 251.11663818359375,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "78e00fc2.178ca8",
- "5cb2873d.ba509"
+ "69b4b801.d2dd58",
+ "4a833666.1d3a3"
]
]
},
{
- "id": "78e00fc2.178ca8",
+ "id": "69b4b801.d2dd58",
"type": "success",
- "name": "SUCCESS 200",
- "xml": "<outcome value='200'>\n",
+ "name": "success",
+ "xml": "<outcome value='SUCCESS'>\n",
"comments": "",
"outputs": 1,
- "x": 1181.9999694824219,
- "y": 266.9999694824219,
- "z": "1eca43d0.41972c",
+ "x": 1160.9999694824219,
+ "y": 221.11663818359375,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "6be48d2c.b63d8c"
+ "10c52db4.a51652"
]
]
},
{
- "id": "5cb2873d.ba509",
+ "id": "4a833666.1d3a3",
"type": "outcome",
"name": "ERROR",
"xml": "<outcome value='Other'>\n",
"comments": "",
"outputs": 1,
- "x": 1173.9999694824219,
- "y": 425.9999694824219,
- "z": "1eca43d0.41972c",
+ "x": 1152.9999694824219,
+ "y": 380.11663818359375,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "c45d6cad.1266a8"
+ "df65c991.2b7fa8"
]
]
},
{
- "id": "c45d6cad.1266a8",
+ "id": "df65c991.2b7fa8",
"type": "block",
"name": "block",
"xml": "<block>\n",
"atomic": "false",
"comments": "",
"outputs": 1,
- "x": 1306.9999694824219,
- "y": 426.9999694824219,
- "z": "1eca43d0.41972c",
+ "x": 1285.9999694824219,
+ "y": 381.11663818359375,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "4593642b.a03a34",
- "7bdd8ae4.5a04e4"
+ "21987bda.eebd5c",
+ "3d82b93b.845e96"
]
]
},
{
- "id": "4593642b.a03a34",
+ "id": "21987bda.eebd5c",
"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": 1441.9999694824219,
- "y": 468,
- "z": "1eca43d0.41972c",
+ "x": 1420.9999694824219,
+ "y": 422.1166687011719,
+ "z": "bb7eafb1.d37d2",
"wires": []
},
{
- "id": "b2efb443.b631a",
+ "id": "f06647ab.96aca",
"type": "block",
"name": "block",
"xml": "<block>\n",
"atomic": "false",
"comments": "",
"outputs": 1,
- "x": 971.9999694824219,
- "y": 174.99996948242188,
- "z": "1eca43d0.41972c",
+ "x": 950.9999694824219,
+ "y": 129.11663818359375,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "3ebaa10e.c55e6e"
+ "84c0dae5.04bb7"
]
]
},
{
- "id": "80ee82a0.8401c8",
+ "id": "ff624428.83add8",
"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",
+ "xml": "<record plugin=\"org.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": 806.11669921875,
- "y": 116,
- "z": "1eca43d0.41972c",
+ "x": 785.11669921875,
+ "y": 70.11666870117188,
+ "z": "bb7eafb1.d37d2",
"wires": [
[]
]
},
{
- "id": "af60ef65.5a714",
+ "id": "468a32bf.35f284",
"type": "block",
"name": "block",
"xml": "<block>\n",
"atomic": "false",
"comments": "",
"outputs": 1,
- "x": 627.8666687011719,
- "y": 144.86666870117188,
- "z": "1eca43d0.41972c",
+ "x": 606.8666687011719,
+ "y": 98.98333740234375,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "80ee82a0.8401c8",
- "1ecc7492.a889b3"
+ "ff624428.83add8",
+ "18c8070a.4a19b1"
]
]
},
{
- "id": "7bdd8ae4.5a04e4",
+ "id": "3d82b93b.845e96",
"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`\" />",
+ "xml": "<record plugin=\"org.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": 1431.8666687011719,
- "y": 398.8666687011719,
- "z": "1eca43d0.41972c",
+ "x": 1410.8666687011719,
+ "y": 352.98333740234375,
+ "z": "bb7eafb1.d37d2",
"wires": [
[]
]
},
{
- "id": "1ecc7492.a889b3",
+ "id": "18c8070a.4a19b1",
"type": "execute",
"name": "attachVolume",
"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`\" />",
"comments": "",
"outputs": 1,
- "x": 643.9999694824219,
- "y": 230,
- "z": "1eca43d0.41972c",
+ "x": 622.9999694824219,
+ "y": 184.11666870117188,
+ "z": "bb7eafb1.d37d2",
"wires": [
[
- "98f61d5c.9857e8",
- "9d95111e.b625"
+ "ddd78a95.68e358",
+ "6d9a583d.567f7"
]
]
}
diff --git a/appc-directed-graph/appc-dgraph/provider/src/main/resources/json/APPC/APPC_DetachVolumeVM.json b/appc-directed-graph/appc-dgraph/provider/src/main/resources/json/APPC/APPC_DetachVolumeVM.json index 32fe9c2e1..2fbca8f8a 100644 --- a/appc-directed-graph/appc-dgraph/provider/src/main/resources/json/APPC/APPC_DetachVolumeVM.json +++ b/appc-directed-graph/appc-dgraph/provider/src/main/resources/json/APPC/APPC_DetachVolumeVM.json @@ -1,262 +1,262 @@ -[ - { - "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" - ] - ] - } -] +[
+ {
+ "id": "d54b463c.a823b8",
+ "type": "dgstart",
+ "name": "DGSTART",
+ "outputs": 1,
+ "x": 93.11666870117188,
+ "y": 41,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "a2bb678c.5e00c"
+ ]
+ ]
+ },
+ {
+ "id": "a2bb678c.5e00c",
+ "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.11666870117188,
+ "y": 41,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "e60f98b3.977f1"
+ ]
+ ]
+ },
+ {
+ "id": "e60f98b3.977f1",
+ "type": "method",
+ "name": "DetachVolume",
+ "xml": "<method rpc='DetachVolumeVM' mode='sync'>\n",
+ "comments": "",
+ "outputs": 1,
+ "x": 448.1166687011719,
+ "y": 43,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "e8d72dbd.c9baa"
+ ]
+ ]
+ },
+ {
+ "id": "f548774.5415008",
+ "type": "success",
+ "name": "success",
+ "xml": "<outcome value='success'>\n",
+ "comments": "",
+ "outputs": 1,
+ "x": 816.1166381835938,
+ "y": 252.99996948242188,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "329389c7.ceb186"
+ ]
+ ]
+ },
+ {
+ "id": "efa29456.b2b9e",
+ "type": "other",
+ "name": "other",
+ "xml": "<outcome value='Other'>\n",
+ "comments": "",
+ "outputs": 1,
+ "x": 825.1166381835938,
+ "y": 131.99996948242188,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "26584913.762376"
+ ]
+ ]
+ },
+ {
+ "id": "85b565d0.ef33d8",
+ "type": "returnSuccess",
+ "name": "return success",
+ "xml": "<return status='success'>",
+ "comments": "",
+ "x": 1372.1166381835938,
+ "y": 224.99996948242188,
+ "z": "9904acd2.cfae1",
+ "wires": []
+ },
+ {
+ "id": "8cb513a7.354458",
+ "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": 1133.1166381835938,
+ "y": 131.99996948242188,
+ "z": "9904acd2.cfae1",
+ "wires": []
+ },
+ {
+ "id": "329389c7.ceb186",
+ "type": "switchNode",
+ "name": "switch status",
+ "xml": "<switch test='`$VOLUME_STATUS`'>\n",
+ "comments": "",
+ "outputs": 1,
+ "x": 1009.1166381835938,
+ "y": 253.99996948242188,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "720cbf6d.f49518",
+ "1de7a2bc.3c680d"
+ ]
+ ]
+ },
+ {
+ "id": "720cbf6d.f49518",
+ "type": "success",
+ "name": "success",
+ "xml": "<outcome value='SUCCESS'>\n",
+ "comments": "",
+ "outputs": 1,
+ "x": 1191.1166381835938,
+ "y": 223.99996948242188,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "85b565d0.ef33d8"
+ ]
+ ]
+ },
+ {
+ "id": "1de7a2bc.3c680d",
+ "type": "outcome",
+ "name": "ERROR",
+ "xml": "<outcome value='Other'>\n",
+ "comments": "",
+ "outputs": 1,
+ "x": 1183.1166381835938,
+ "y": 382.9999694824219,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "83ea6cce.ef1b58"
+ ]
+ ]
+ },
+ {
+ "id": "83ea6cce.ef1b58",
+ "type": "block",
+ "name": "block",
+ "xml": "<block>\n",
+ "atomic": "false",
+ "comments": "",
+ "outputs": 1,
+ "x": 1316.1166381835938,
+ "y": 383.9999694824219,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "115510d5.27d387",
+ "6be0b92f.7a4028"
+ ]
+ ]
+ },
+ {
+ "id": "115510d5.27d387",
+ "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": 1451.1166381835938,
+ "y": 425,
+ "z": "9904acd2.cfae1",
+ "wires": []
+ },
+ {
+ "id": "26584913.762376",
+ "type": "block",
+ "name": "block",
+ "xml": "<block>\n",
+ "atomic": "false",
+ "comments": "",
+ "outputs": 1,
+ "x": 981.1166381835938,
+ "y": 131.99996948242188,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "8cb513a7.354458"
+ ]
+ ]
+ },
+ {
+ "id": "88de342c.a6a72",
+ "type": "record",
+ "name": "record",
+ "xml": "<record plugin=\"org.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.2333679199219,
+ "y": 73,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ []
+ ]
+ },
+ {
+ "id": "e8d72dbd.c9baa",
+ "type": "block",
+ "name": "block",
+ "xml": "<block>\n",
+ "atomic": "false",
+ "comments": "",
+ "outputs": 1,
+ "x": 636.9833374023438,
+ "y": 101.86666870117188,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "88de342c.a6a72",
+ "62735c5f.2a9b9c"
+ ]
+ ]
+ },
+ {
+ "id": "6be0b92f.7a4028",
+ "type": "record",
+ "name": "record",
+ "xml": "<record plugin=\"org.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.9833374023438,
+ "y": 355.8666687011719,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ []
+ ]
+ },
+ {
+ "id": "62735c5f.2a9b9c",
+ "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": 653.1166381835938,
+ "y": 187,
+ "z": "9904acd2.cfae1",
+ "wires": [
+ [
+ "efa29456.b2b9e",
+ "f548774.5415008"
+ ]
+ ]
+ }
+]
|