Adds a Managed Object to UCS.
		
		- inMo, if provided, it acts as a parent for the present operation. It should be None unless a user wants to define a parent scope. 
		  It can be a single MO or a list containing multiple managed objects.
		- classId of the managed object/s to be added.
		- params contains semicolon (;) separated list of key/value pairs(key=value), that are used as filters for selecting specific managed 
		  objects. The key should be a valid property of the managed object to be added.
		- modifyPresent ensures that the add API modify the managed object, if it already exits, instead of returning an error.

def AddManagedObject(self, inMo=None, classId=None, params=None, modifyPresent=False, dumpXml=None):
		"""
		Adds a Managed Object to UCS.
		
		- inMo, if provided, it acts as a parent for the present operation. It should be None unless a user wants to define a parent scope. 
		  It can be a single MO or a list containing multiple managed objects.
		- classId of the managed object/s to be added.
		- params contains semicolon (;) separated list of key/value pairs(key=value), that are used as filters for selecting specific managed 
		  objects. The key should be a valid property of the managed object to be added.
		- modifyPresent ensures that the add API modify the managed object, if it already exits, instead of returning an error.
		"""
		from UcsBase import UcsUtils, ManagedObject, WriteUcsWarning, WriteObject, UcsException, UcsValidationException
		from Ucs import ClassFactory, Pair, ConfigMap

		unknownMo = False
		if (classId == None or classId == ""):
			raise UcsValidationException("classId parameter is not provided.")
		# raise Exception('[Error]: AddManagedObject [Description]: classId is Null')

		metaClassId = UcsUtils.FindClassIdInMoMetaIgnoreCase(classId)
		if (metaClassId != None):
			classId = metaClassId
			moMeta = UcsUtils.GetUcsPropertyMeta(classId, "Meta")
		else:
			unknownMo = True

		configMap = ConfigMap()
		rn = None
		dn = None
		# moMeta = UcsUtils.GetUcsPropertyMeta(classId, "Meta")
		if params != None:
			keys = params.keys()
		else:
			keys = []

		if (not unknownMo):
			rn = moMeta.rn
			for prop in UcsUtils.GetUcsPropertyMetaAttributeList(classId):
				propMeta = UcsUtils.GetUcsPropertyMeta(classId, prop)
				if (propMeta.access != UcsPropertyMeta.Naming):
					continue
				namingPropFound = False
				for k in keys:
					if (k.lower() == prop.lower()):
						rn = re.sub('\[%s\]' % prop, '%s' % params[k], rn)
						namingPropFound = True
						break

				if (namingPropFound == False):
					# TODO: Add Warning/Error messages in Logger.
					WriteUcsWarning(
						"[Warning]: AddManagedObject [Description]:Expected Naming Property %s for ClassId %s not found" % (
							prop, classId))
					rn = re.sub('\[%s\]' % prop, '%s' % "", rn)

		obj = ManagedObject(classId)

		for prop in keys:
			if (not unknownMo):
				propMoMeta = UcsUtils.IsPropertyInMetaIgnoreCase(classId, prop)
				if (propMoMeta != None):
					if (prop.lower() == "rn" or prop.lower() == "dn"):
						pass
					elif (propMoMeta.access == UcsPropertyMeta.ReadOnly):
						# TODO: Add Warning/Error messages in Logger.
						WriteUcsWarning(
							"[Warning]: AddManagedObject [Description]:Attempt to add non-writeable property %s in Class %s" % (
								prop, classId))

					if (prop.lower() == "rn"):
						if ((inMo == None) or (not isinstance(inMo, list)) or (len(inMo) == 0)):
							# TODO: Add Warning/Error messages in Logger.
							WriteUcsWarning(
								"[Warning]: AddManagedObject [Description]:Ignoring Rn since no parent provided")
						if (rn != params[prop]):
							# TODO: Add Warning/Error messages in Logger.
							WriteUcsWarning(
								"[Warning]: AddManagedObject [Description]:Rn Mismatch. Provided %s Computed %s. Ignoring Computed Rn" % (
									params[prop], rn))
							rn = params[
								prop]  # bug fix. if Rn and Name are both provided by user then Rn will get preference.

					if (prop.lower() == "dn"):
						dn = params[prop]

					obj.setattr(propMoMeta.name, str(params[prop]))
				else:
					# Known MO - Unknown Property
					obj.setattr(UcsUtils.WordL(prop), str(params[prop]))
			else:
				# Unknown MO
				if (prop.lower() == "dn"):
					dn = params[prop]

				if prop.lower() == "rn":
					rn = params[prop]
				if rn == None:
					rn = ""

				obj.setattr(UcsUtils.WordL(prop), str(params[prop]))

		if modifyPresent in _AffirmativeList:
			obj.setattr("Status", '%s,%s' % (Status().CREATED, Status().MODIFIED))
		else:
			obj.setattr("Status", Status().CREATED)

		if (dn != None and dn != ""):
			obj.setattr("Dn", dn)
			pair = Pair()
			# pair.setattr("Key", obj.Dn)
			pair.setattr("Key", obj.getattr("Dn"))
			pair.AddChild(obj)
			configMap.AddChild(pair)
		elif ((inMo != None) and (isinstance(inMo, list)) and (len(inMo) > 0)):
			for mo in inMo:
				pdn = mo.getattr("Dn")
				if pdn != None:
					obj.setattr("Dn", pdn + '/' + rn)
					pair = Pair()
					# pair.setattr("Key", obj.Dn)
					pair.setattr("Key", obj.getattr("Dn"))
					pair.AddChild(obj.Clone())
					configMap.AddChild(pair)

		if configMap.GetChildCount() == 0:
			raise UcsValidationException('[Warning]: AddManagedObject [Description]: Nothing to Add')
		# raise Exception('[Warning]: AddManagedObject [Description]: Nothing to Add')

		ccm = self.ConfigConfMos(configMap, False, dumpXml)
		if ccm.errorCode == 0:
			moList = []
			for child in ccm.OutConfigs.GetChild():
				if (isinstance(child, Pair) == True):
					for mo in child.GetChild():
						moList.append(mo)
				elif (isinstance(child, ManagedObject) == True):
					moList.append(child)
			# WriteObject(moList)
			return moList
		else:
			raise UcsException(ccm.errorCode, ccm.errorDescr)