Map<String, ToscaNodeType> nodeTypes) {
log.debug("start convert node type for {}", component.getUniqueId());
ToscaNodeType toscaNodeType = createNodeType(component);
-
+ toscaNode.setInterface_types(addInterfaceTypeElement(component));
Either<Map<String, DataTypeDefinition>, TitanOperationStatus> dataTypesEither = dataTypeCache.getAll();
if (dataTypesEither.isRight()) {
log.debug("Failed to fetch all data types :", dataTypesEither.right().value());
return null;
}
final Map<String, InterfaceDefinition> interfaces = component.getInterfaces();
+ if (MapUtils.isEmpty(interfaces)) {
+ return null;
+ }
Map<String, Object> toscaInterfaceTypes = new HashMap<>();
for (InterfaceDefinition interfaceDefinition : interfaces.values()) {
ToscaInterfaceNodeType toscaInterfaceType = new ToscaInterfaceNodeType();
import org.openecomp.sdc.be.model.InputDefinition;
import org.openecomp.sdc.be.model.InterfaceDefinition;
import org.openecomp.sdc.be.model.Operation;
+import org.openecomp.sdc.common.util.ValidationUtils;
public class InterfaceUtils {
public static String createInterfaceToscaResourceName(String resourceName) {
StringBuilder sb = new StringBuilder();
try(Formatter formatter = new Formatter(sb)){
- return formatter.format(INTERFACE_TOSCA_RESOURCE_NAME, resourceName).toString();
+ return formatter.format(INTERFACE_TOSCA_RESOURCE_NAME, ValidationUtils.convertToSystemName(resourceName)).toString();
}
}