* Licensed under the Apache License, Version 2.0 (the "License");
* 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
String requestScope = requestScopeFromUri(requestUri);
msoRequest.createErrorRequestRecord(Status.FAILED, requestId, validateException.getMessage(), action,
- requestScope, requestJSON, null);
+ requestScope, requestJSON, null, null);
throw validateException;
}
if (StringUtils.isNotBlank(instanceId)) {
if (ModelType.service.name().equalsIgnoreCase(requestScope)) {
currentActiveReq.setServiceInstanceId(instanceId);
- } else if (ModelType.vnf.name().equalsIgnoreCase(requestScope)) {
+ } else if (ModelType.vnf.name().equalsIgnoreCase(requestScope)
+ || ModelType.cnf.name().equalsIgnoreCase(requestScope)) {
currentActiveReq.setVnfId(instanceId);
} else if (ModelType.vfModule.name().equalsIgnoreCase(requestScope)) {
currentActiveReq.setVfModuleId(instanceId);
requestScope = ModelType.vnf.name();
} else if (requestUri.contains(ModelType.pnf.name())) {
requestScope = ModelType.pnf.name();
+
+ } else if (requestUri.contains(ModelType.cnf.name())) {
+ requestScope = ModelType.cnf.name();
} else {
requestScope = ModelType.service.name();
}
throw validateException;
}
+ }
+
+ else if (modelInfo.getModelType().equals(ModelType.pnf)) {
+ recipeLookupResult = new RecipeLookupResult("/mso/async/services/WorkflowActionBB", 180);
} else if (modelInfo.getModelType().equals(ModelType.instanceGroup)) {
recipeLookupResult = new RecipeLookupResult("/mso/async/services/WorkflowActionBB", 180);
+ } else if (modelInfo.getModelType().equals(ModelType.cnf)) {
+ recipeLookupResult = new RecipeLookupResult("/mso/async/services/WorkflowActionBB", 180);
}
if (recipeLookupResult == null) {
if (params.containsKey("service")) {
Service service = serviceMapper(params);
- addUserParams(userParams, service.getInstanceParams());
+ // Filter out non-string params for backward compatibility
+ Map<String, String> svcStrParams = service.getInstanceParams().stream().map(Map::entrySet)
+ .flatMap(Set::stream).filter(e -> e.getValue() instanceof String)
+ .collect(Collectors.toMap(Entry::getKey, e -> (String) e.getValue()));
+ userParams.putAll(svcStrParams);
for (Networks network : service.getResources().getNetworks()) {
addUserParams(userParams, network.getInstanceParams());
throw new ValidationException("vfModuleCustomization");
} else if (vfModule == null && vfmc != null) {
vfModule = vfmc.getVfModule(); // can't be null as vfModuleModelUUID is not-null property in
- // VfModuleCustomization table
+ // VfModuleCustomization table
}
if (modelInfo.getModelVersionId() == null) {