aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-01-30 11:58:53 +0000
committerGerrit Code Review <gerrit@onap.org>2018-01-30 11:58:53 +0000
commit40dfc2ade4a4f3614a7f3f6861db82521cb5a4c9 (patch)
tree3d0b608da649437669532c7f2c550ab407d67252 /mso-api-handlers/mso-api-handler-infra
parentb0c50beb440ed7e5573e81bfa6f6d1e7acb030da (diff)
parent6f5c4e507866e2036e293cf90094dd5396eaa5bf (diff)
Merge "Default Recipe Mapping for Service"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
index 3c40003dd0..6f6d2972d1 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
@@ -757,12 +757,16 @@ public class ServiceInstances {
// }
// TODO need to make this a configurable property
- String defaultServiceModelName = msoRequest.getRequestInfo().getSource() + "_DEFAULT";
+ String defaultServiceModelName = "*";
+ String defaultSourceServiceModelName = msoRequest.getRequestInfo().getSource() + "_DEFAULT";
Service serviceRecord;
ModelInfo modelInfo = msoRequest.getModelInfo();
if(msoRequest.getALaCarteFlag()){
- serviceRecord = db.getServiceByModelName(defaultServiceModelName);
+ serviceRecord = db.getServiceByModelName(defaultSourceServiceModelName);
+ if (serviceRecord == null) {
+ serviceRecord = db.getServiceByModelName(defaultServiceModelName);
+ }
}else{
serviceRecord = db.getServiceByModelUUID(modelInfo.getModelVersionId()); // ModelVersionId is not required in v3
if(serviceRecord == null) {
@@ -778,12 +782,16 @@ public class ServiceInstances {
RequestParameters reqParam = msoRequest.getServiceInstancesRequest().getRequestDetails().getRequestParameters();
if(reqParam!=null && reqParam.isaLaCarteSet() && recipe==null){
return null;
- }else if (recipe == null) { //aLaCarte wasn't sent, so we'll try the default
+ }
+
+ //aLaCarte wasn't sent, so we'll try the default
+ serviceRecord = db.getServiceByModelName(defaultSourceServiceModelName);
+ if (serviceRecord == null) {
serviceRecord = db.getServiceByModelName(defaultServiceModelName);
- recipe = db.getServiceRecipeByModelUUID(serviceRecord.getModelUUID(), action.name());
}
- if(modelInfo.getModelVersionId() == null) {
+ recipe = db.getServiceRecipeByModelUUID(serviceRecord.getModelUUID(), action.name());
+ if(modelInfo.getModelVersionId() == null) {
modelInfo.setModelVersionId(serviceRecord.getModelUUID());
}
if(recipe==null){