diff --git a/pom.xml b/pom.xml
index 990a7c9..5a2d1be 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,8 +4,8 @@
 
 	<groupId>org.onap.sdc.jtosca</groupId>
 	<artifactId>jtosca</artifactId>
-	<version>1.3.4-SNAPSHOT</version>
-        <name>sdc-jtosca</name>
+	<version>1.3.5-SNAPSHOT</version>
+	<name>sdc-jtosca</name>
 	<properties>
 
 		<!-- ==================== -->
diff --git a/src/main/java/org/onap/sdc/toscaparser/api/NodeTemplate.java b/src/main/java/org/onap/sdc/toscaparser/api/NodeTemplate.java
index 20bc210..73b2341 100644
--- a/src/main/java/org/onap/sdc/toscaparser/api/NodeTemplate.java
+++ b/src/main/java/org/onap/sdc/toscaparser/api/NodeTemplate.java
@@ -1,5 +1,6 @@
 package org.onap.sdc.toscaparser.api;
 
+import static org.onap.sdc.toscaparser.api.elements.EntityType.TOSCA_DEF;
 import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue;
 
 import java.util.ArrayList;
@@ -405,6 +406,46 @@
 		return allowedOperations;
 	}
 
+	/**
+	 * Get all interface details for given node template.<br>
+	 * @return Map that contains the list of all interfaces and their definitions.
+	 * If none found, an empty map will be returned.
+	 */
+	public Map<String, List<InterfacesDef>> getAllInterfaceDetailsForNodeType(){
+		Map<String, List<InterfacesDef>> interfaceMap = new LinkedHashMap<>();
+
+		// Get custom interface details
+		Map<String, Object> customInterfacesDetails = ((NodeType)typeDefinition).getInterfaces();
+		// Get native interface details from tosca definitions
+		Object nativeInterfaceDetails = TOSCA_DEF.get(InterfacesDef.LIFECYCLE);
+		Map<String, Object> allInterfaceDetails = new LinkedHashMap<>();
+		allInterfaceDetails.putAll(customInterfacesDetails);
+		if (nativeInterfaceDetails != null){
+			allInterfaceDetails.put(InterfacesDef.LIFECYCLE, nativeInterfaceDetails);
+		}
+
+		// Process all interface details from combined collection and return an interface Map with
+		// interface names and their definitions
+		for(Map.Entry<String,Object> me: allInterfaceDetails.entrySet()) {
+			ArrayList<InterfacesDef> interfaces = new ArrayList<>();
+			String interfaceType = me.getKey();
+			Map<String,Object> interfaceValue = (Map<String,Object>)me.getValue();
+			if(interfaceValue.containsKey("type")){
+				interfaceType = (String) interfaceValue.get("type");
+			}
+
+			for(Map.Entry<String,Object> ve: interfaceValue.entrySet()) {
+				// Filter type as this is a reserved key and not an operation
+				if(!ve.getKey().equals("type")){
+					InterfacesDef iface = new InterfacesDef(typeDefinition, interfaceType,this, ve.getKey(), ve.getValue());
+					interfaces.add(iface);
+				}
+			}
+			interfaceMap.put(interfaceType, interfaces);
+		}
+		return interfaceMap;
+	}
+
 	private void _validateFields(LinkedHashMap<String,Object> nodetemplate) {
 		for(String ntname: nodetemplate.keySet()) {
 			boolean bFound = false;
diff --git a/src/main/java/org/onap/sdc/toscaparser/api/elements/InterfacesDef.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/InterfacesDef.java
index f8669ed..86333d6 100644
--- a/src/main/java/org/onap/sdc/toscaparser/api/elements/InterfacesDef.java
+++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/InterfacesDef.java
@@ -20,88 +20,88 @@
 	};
 
 	public static final String IMPLEMENTATION = "implementation";
+	public static final String DESCRIPTION = "description";
 	public static final String INPUTS = "inputs";
-	
-	public static final String INTERFACEVALUE[] = {IMPLEMENTATION, INPUTS};
 
 	public static final String INTERFACE_DEF_RESERVED_WORDS[] = {
 			"type", "inputs", "derived_from", "version", "description"};
-	
+
 	private EntityType ntype;
 	private EntityTemplate nodeTemplate;
-	private String name;
-	private Object value;
+
+	private String operationName;
+	private Object operationDef;
 	private String implementation;
 	private LinkedHashMap<String,Object> inputs;
+	private String description;
 
-	
 	@SuppressWarnings("unchecked")
 	public InterfacesDef(EntityType inodeType,
-					     String interfaceType,
-					     EntityTemplate inodeTemplate,
-					     String iname,
-					     Object ivalue) {
+			String interfaceType,
+			EntityTemplate inodeTemplate,
+			String iname,
+			Object ivalue) {
 		// void
 		super();
-		
-        ntype = inodeType;
-        nodeTemplate = inodeTemplate;
-        type = interfaceType;
-        name = iname;
-        value = ivalue;
-        implementation = null;
-        inputs = null;
-        defs = new LinkedHashMap<String,Object>();
 
-        if(interfaceType.equals(LIFECYCLE_SHORTNAME)) {
-            interfaceType = LIFECYCLE;
-        }
-        if(interfaceType.equals(CONFIGURE_SHORTNAME)) {
-            interfaceType = CONFIGURE;
-        }
-      
-        // only NodeType has getInterfaces "hasattr(ntype,interfaces)"
-        // while RelationshipType does not
-        if(ntype instanceof NodeType) {
-	        if(((NodeType)ntype).getInterfaces() != null &&
-	        		((NodeType)ntype).getInterfaces().values().contains(interfaceType)) {
-	        	LinkedHashMap<String,Object> nii = (LinkedHashMap<String,Object>)
-	        			((NodeType)ntype).getInterfaces().get(interfaceType);
-	        	interfaceType = (String)nii.get("type");
-	        }
-        }
-        if(inodeType != null) {
-        	if(nodeTemplate != null && nodeTemplate.getCustomDef() != null &&
-        			nodeTemplate.getCustomDef().values().contains(interfaceType)) {
-        		defs = (LinkedHashMap<String,Object>)
-        					nodeTemplate.getCustomDef().get(interfaceType);
-        	}
-        	else {
-        		defs = (LinkedHashMap<String,Object>)TOSCA_DEF.get(interfaceType);
-        	}
-        }
-        
-        if(ivalue != null) {
-        	if(ivalue instanceof LinkedHashMap) {
-        		for(Map.Entry<String,Object> me: ((LinkedHashMap<String,Object>)ivalue).entrySet()) {
-        			if(me.getKey().equals("implementation")) {
-        				implementation = (String)me.getValue();
-        			}
-        			else if(me.getKey().equals("inputs")) {
-        				inputs = (LinkedHashMap<String,Object>)me.getValue();
-        			}
-        			else {
-                        ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE123", String.format(
-                            "UnknownFieldError: \"interfaces\" of template \"%s\" contain unknown field \"%s\"",
-                            nodeTemplate.getName(),me.getKey()))); 
-        			}
-        		}
-        	}
-    		else {
-    			implementation = (String)ivalue;
-    		}
-        }
- 	}
+		ntype = inodeType;
+		nodeTemplate = inodeTemplate;
+		type = interfaceType;
+		operationName = iname;
+		operationDef = ivalue;
+		implementation = null;
+		inputs = null;
+		defs = new LinkedHashMap<String,Object>();
+
+		if(interfaceType.equals(LIFECYCLE_SHORTNAME)) {
+			interfaceType = LIFECYCLE;
+		}
+		if(interfaceType.equals(CONFIGURE_SHORTNAME)) {
+			interfaceType = CONFIGURE;
+		}
+
+		// only NodeType has getInterfaces "hasattr(ntype,interfaces)"
+		// while RelationshipType does not
+		if(ntype instanceof NodeType) {
+			if(((NodeType)ntype).getInterfaces() != null &&
+					((NodeType)ntype).getInterfaces().values().contains(interfaceType)) {
+				LinkedHashMap<String,Object> nii = (LinkedHashMap<String,Object>)
+						((NodeType)ntype).getInterfaces().get(interfaceType);
+				interfaceType = (String)nii.get("type");
+			}
+		}
+		if(inodeType != null) {
+			if(nodeTemplate != null && nodeTemplate.getCustomDef() != null &&
+					nodeTemplate.getCustomDef().containsKey(interfaceType)) {
+				defs = (LinkedHashMap<String,Object>)
+						nodeTemplate.getCustomDef().get(interfaceType);
+			}
+			else {
+				defs = (LinkedHashMap<String,Object>)TOSCA_DEF.get(interfaceType);
+			}
+		}
+
+		if(ivalue != null) {
+			if(ivalue instanceof LinkedHashMap) {
+				for(Map.Entry<String,Object> me: ((LinkedHashMap<String,Object>)ivalue).entrySet()) {
+					if(me.getKey().equals(IMPLEMENTATION)) {
+						implementation = (String)me.getValue();
+					}
+					else if(me.getKey().equals(INPUTS)) {
+						inputs = (LinkedHashMap<String,Object>)me.getValue();
+					}
+					else if(me.getKey().equals(DESCRIPTION)) {
+						description = (String)me.getValue();
+					}
+					else {
+						ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE123", String.format(
+								"UnknownFieldError: \"interfaces\" of template \"%s\" contain unknown field \"%s\"",
+								nodeTemplate.getName(),me.getKey())));
+					}
+				}
+			}
+		}
+	}
 
 	public ArrayList<String> getLifecycleOps() {
 		if(defs != null) {
@@ -111,7 +111,20 @@
 		}
 		return null;
 	}
-	
+
+	public ArrayList<String> getInterfaceOps() {
+		if(defs != null) {
+			ArrayList<String> ops = _ops();
+			ArrayList<String> idrw = new ArrayList<>();
+			for(int i=0; i<InterfacesDef.INTERFACE_DEF_RESERVED_WORDS.length; i++) {
+				idrw.add(InterfacesDef.INTERFACE_DEF_RESERVED_WORDS[i]);
+			}
+			ops.removeAll(idrw);
+			return ops;
+		}
+		return null;
+	}
+
 	public ArrayList<String> getConfigureOps() {
 		if(defs != null) {
 			if(type.equals(CONFIGURE)) {
@@ -120,22 +133,48 @@
 		}
 		return null;
 	}
-	
+
 	private ArrayList<String> _ops() {
 		return new ArrayList<String>(defs.keySet());
 	}
-	
+
 	// getters/setters
-	
+
 	public LinkedHashMap<String,Object> getInputs() {
 		return inputs;
 	}
-	
+
 	public void setInput(String name,Object value) {
 		inputs.put(name, value);
 	}
+
+	public String getImplementation(){
+		return  implementation;
+	}
+
+	public void setImplementation(String implementation){
+		this.implementation = implementation;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getOperationName() {
+		return operationName;
+	}
+
+	public void setOperationName(String operationName) {
+		this.operationName = operationName;
+	}
 }
 
+
+
 /*python
 
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
diff --git a/version.properties b/version.properties
index a8f201d..a24b0ee 100644
--- a/version.properties
+++ b/version.properties
@@ -5,7 +5,7 @@
 
 major=1
 minor=3
-patch=4
+patch=5
 
 base_version=${major}.${minor}.${patch}
 
