diff options
Diffstat (limited to 'adapters')
4 files changed, 27 insertions, 8 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.2__AddServiceTypeColumnToNorthBoundRequest.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.2__AddServiceTypeColumnToNorthBoundRequest.sql new file mode 100644 index 0000000000..1ead94cd9c --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.2__AddServiceTypeColumnToNorthBoundRequest.sql @@ -0,0 +1,7 @@ +use catalogdb; + +ALTER TABLE northbound_request_ref_lookup ADD COLUMN SERVICE_TYPE varchar(200) NULL; +ALTER TABLE northbound_request_ref_lookup + DROP INDEX UK_northbound_request_ref_lookup; +ALTER TABLE northbound_request_ref_lookup +ADD UNIQUE INDEX `UK_northbound_request_ref_lookup` (`MIN_API_VERSION` ASC, `REQUEST_SCOPE` ASC, `ACTION` ASC, `IS_ALACARTE` ASC, `MACRO_ACTION` ASC, `CLOUD_OWNER` ASC, `SERVICE_TYPE` ASC);
\ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql index 98d1917050..9eb3daa5ae 100644 --- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -211,9 +211,15 @@ VALUES ('volumeGroup', 'createInstance', '1', 'Gr api recipe to create volume-group', '/mso/async/services/WorkflowActionBB', 180, '20c4431c-246d-11e7-93ae-92361f002671'); -INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, CLOUD_OWNER) VALUES -('Service-Create', 'createInstance', 'Service', true, '7','7', 'my-custom-cloud-owner'); +INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, CLOUD_OWNER, SERVICE_TYPE) VALUES +('Service-Create', 'createInstance', 'Service', true, '7','7', 'my-custom-cloud-owner','*'); INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES ('Service-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create' and CLOUD_OWNER = 'my-custom-cloud-owner')); + +INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, CLOUD_OWNER, SERVICE_TYPE) VALUES +('Service-Create', 'createInstance', 'Service', true, '7','7', 'my-custom-cloud-owner','TRANSPORT'); + +INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES +('Service-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create' and CLOUD_OWNER = 'my-custom-cloud-owner' and SERVICE_TYPE = 'TRANSPORT')); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/beans/ValetUpdateResponse.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/beans/ValetUpdateResponse.java index 36f11d30c0..b6cb27caa3 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/beans/ValetUpdateResponse.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/beans/ValetUpdateResponse.java @@ -21,7 +21,7 @@ package org.onap.so.adapters.valet.beans; import java.io.Serializable; -import java.util.Map; +import java.util.HashMap; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -34,7 +34,7 @@ public class ValetUpdateResponse implements Serializable { @JsonProperty("status") private ValetStatus status; @JsonProperty("parameters") - private Map<String, Object> parameters; + private HashMap<String, Object> parameters; public ValetUpdateResponse() { super(); @@ -46,10 +46,10 @@ public class ValetUpdateResponse implements Serializable { public void setStatus(ValetStatus status) { this.status = status; } - public Map<String, Object> getParameters() { + public HashMap<String, Object> getParameters() { return this.parameters; } - public void setParameters(Map<String, Object> parameters) { + public void setParameters(HashMap<String, Object> parameters) { this.parameters = parameters; } diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java index 270b1bd99c..deb39ac54e 100644 --- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java +++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java @@ -60,7 +60,7 @@ public class SDNCServiceRequestTask { private BPRestCallback bpRestCallback; @Async - public void runRequest(SDNCServiceRequest request,String msoRequestId,String msoServiceInstanceId,String myUrlSuffix) throws SDNCAdapterException + public void runRequest(SDNCServiceRequest request,String msoRequestId,String msoServiceInstanceId,String myUrlSuffix) { MsoLogger.setLogContext(msoRequestId, msoServiceInstanceId); MsoLogger.setServiceName(getClass().getSimpleName()); @@ -71,7 +71,13 @@ public class SDNCServiceRequestTask { TypedRequestTunables rt = new TypedRequestTunables(sdncRequestId, myUrlSuffix); rt.setServiceKey(sdncService, sdncOperation); - TypedRequestTunables mappedTunables = mapTunables.setTunables(rt); + TypedRequestTunables mappedTunables; + try { + mappedTunables = mapTunables.setTunables(rt); + } catch(SDNCAdapterException e) { + bpRestCallback.send(request.getBPNotificationUrl(), e.getMessage()); + return; + } if (!mappedTunables.getError().isEmpty()) { // Note that the error was logged and alarmed by setTunables() SDNCServiceError error = new SDNCServiceError(request.getSdncRequestId(), |