def createSecToGroupTableEntry (self, trxContext, securityModel, securityName): self._log("create-sec-to-group-table-entry").debug2("called. trxContext=%s, securityModel=%s, securityName=%s", trxContext, securityModel, securityName) """ create an entry with the securityName in SNMP-VIEW-BASED-ACM-MIB vacmSecurityToGroupTable vacmSecurityToGroupEntry set vacmSecurityModel to securityModel set vacmSecurityName to securityName set vacmGroupName to notif-only """ self._log("create-sec-to-group-table-entry").debug2("called. trxContext=%s, securityModel=%s, securityName=%s", trxContext, securityModel, securityName) targetKeyPath = KeyPath() valVacm = Value() (tag, ns, prefix) = ("SNMP-VIEW-BASED-ACM-MIB", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z", "SNMP_VIEW_BASED_ACM_MIB") valVacm.setXmlTag((tag, ns, prefix)) targetKeyPath.addKeyPathPostfix(valVacm) tagValueList = TagValues() valVacmSecToGroupTable = Value() (tag, ns, prefix) = ("vacmSecurityToGroupTable", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z", "SNMP_VIEW_BASED_ACM_MIB") valVacmSecToGroupTable.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valVacmSecToGroupTable) valBegin = Value() (tag, ns, prefix) = ("vacmSecurityToGroupEntry", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z", "SNMP_VIEW_BASED_ACM_MIB") valBegin.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valBegin) valKeyModel = Value() valKeyModel.setInt32(securityModel) tagValueList.push(("vacmSecurityModel", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z"), valKeyModel) valKeySecName = Value() valKeySecName.setString(securityName) tagValueList.push(("vacmSecurityName", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z"), valKeySecName) # vacmGroupName to notif-only valGroupName = Value() valGroupName.setString(self.AC_NOTIF_ONLY) tagValueList.push(("vacmGroupName", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z"), valGroupName) valEnd = Value() valEnd.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valEnd) valTargetParamTable = Value() (tag, ns, prefix) = ("vacmSecurityToGroupTable","http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z", "SNMP_VIEW_BASED_ACM_MIB") valTargetParamTable.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valTargetParamTable) res = self._maapiDomain.writeMaapi(tagValueList, targetKeyPath, trxContext) if res != ReturnCodes.kOk: self._log('create-sec-to-group-table-entry-write-domain-failed').error('self._maapiDomain.writeMaapi() failed. PARAMS') return ReturnCodes.kGeneralError self._log("create-sec-to-group-table-entry-done").debug2("done. trxContext=%s, securityModel=%s, securityName=%s", trxContext, securityModel, securityName) return ReturnCodes.kOk
def fillTagValues(self, keyPath, tagValueList, operData): initialListSize = tagValueList.getLen() for logFunc in self._log("fill-tag-values").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize) # fill tag values up to current if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()): i = keyPath.getLen() while i < self.myKeyPath.getLen(): valBegin = Value() (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag() valBegin.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valBegin) for logFunc in self._log( "fill-tag-values-adding").debug3Func(): logFunc( "adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d", i, valBegin, self.myKeyPath.getLen()) i += 1 if operData.isTableLastChangeTicksRequested( ) and operData.hasTableLastChangeTicks(): val = Value() val.setUint32(operData.tableLastChangeTicks) tagValueList.push( ("table-last-change-ticks", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isInterfaceNumberRequested( ) and operData.hasInterfaceNumber(): val = Value() val.setInt32(operData.interfaceNumber) tagValueList.push( ("interface-number", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()): i = self.myKeyPath.getLen() - 1 while i >= keyPath.getLen(): valEnd = Value() (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag() valEnd.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valEnd) i -= 1 for logFunc in self._log("fill-tag-values-ended").debug3Func(): logFunc( "ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d", operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen()) return ReturnCodes.kOk
def setVersionInTargetParamTableEntry (self, trxContext, entryName, snmpVersion): """ sets the entry with the entryName in SNMP-TARGET-MIB snmpTargetParamsTable snmpTargetParamsEntry set snmpTargetParamsMPModel to 0 (v1) or 1 (v2c) set snmpTargetParamsSecurityModel to 1 (v1) or 2 (v2c) """ self._log("set-version-in-target-param-table-entry").debug2("called. trxContext=%s, entryName=%s, snmpVersion=%s", trxContext, entryName, snmpVersion) targetKeyPath = KeyPath() valTarget = Value() (tag, ns, prefix) = ("SNMP-TARGET-MIB", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valTarget.setXmlTag((tag, ns, prefix)) targetKeyPath.addKeyPathPostfix(valTarget) valTargetParamTable = Value() (tag, ns, prefix) = ("snmpTargetParamsTable","http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valTargetParamTable.setXmlTag((tag, ns, prefix)) targetKeyPath.addKeyPathPostfix(valTargetParamTable) valEntry = Value() (tag, ns, prefix) = ("snmpTargetParamsEntry", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valEntry.setXmlTag((tag, ns, prefix)) targetKeyPath.addKeyPathPostfix(valEntry) valKey = Value() valKey.setString(entryName) targetKeyPath.addKeyPathPostfix(valKey) tagValueList = TagValues() valMPModel = Value() # snmpTargetParamsMPModel to 0 (v1) or 1 (v2c) if snmpVersion == SnmpNotificationVersionType.kV1: valMPModel.setInt32(self.MP_MODEL_V1) elif snmpVersion == SnmpNotificationVersionType.kV2c: valMPModel.setInt32(self.MP_MODEL_V2C) tagValueList.push(("snmpTargetParamsMPModel", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valMPModel) # snmpTargetParamsSecurityModel to 1 (v1) valSecurityModel = Value() if snmpVersion == SnmpNotificationVersionType.kV1: valSecurityModel.setInt32(self.SECURITY_MODEL_V1) elif snmpVersion == SnmpNotificationVersionType.kV2c: valSecurityModel.setInt32(self.SECURITY_MODEL_V2C) tagValueList.push(("snmpTargetParamsSecurityModel", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valSecurityModel) res = self._maapiDomain.writeMaapi(tagValueList, targetKeyPath, trxContext) if res != ReturnCodes.kOk: self._log('create-target-param-table-entry-write-domain-failed').error('self._maapiDomain.writeMaapi() failed. PARAMS') return ReturnCodes.kGeneralError self._log("set-version-in-target-param-table-entry-done").debug2("done. trxContext=%s, entryName=%s, snmpVersion=%s", trxContext, entryName, snmpVersion) return ReturnCodes.kOk
def fillTagValues(self, keyPath, tagValueList, operData): initialListSize = tagValueList.getLen() for logFunc in self._log("fill-tag-values").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize) # fill tag values up to current if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()): i = keyPath.getLen() while i < self.myKeyPath.getLen(): valBegin = Value() (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag() valBegin.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valBegin) for logFunc in self._log( "fill-tag-values-adding").debug3Func(): logFunc( "adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d", i, valBegin, self.myKeyPath.getLen()) i += 1 if operData.isInterfaceIndexRequested() and operData.hasInterfaceIndex( ): val = Value() val.setUint32(operData.interfaceIndex) tagValueList.push( ("interface-index", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isSpeedMegabitRequested() and operData.hasSpeedMegabit(): val = Value() val.setUint32(operData.speedMegabit) tagValueList.push( ("speed-megabit", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isMibAdminStatusRequested() and operData.hasMibAdminStatus( ): val = Value() val.setEnum(operData.mibAdminStatus.getValue()) tagValueList.push( ("mib-admin-status", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isPromiscuousRequested() and operData.hasPromiscuous(): val = Value() val.setEnum(operData.promiscuous.getValue()) tagValueList.push( ("promiscuous", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isMibNameRequested() and operData.hasMibName(): val = Value() val.setString(operData.mibName) tagValueList.push( ("mib-name", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isMtuRequested() and operData.hasMtu(): val = Value() val.setInt32(operData.mtu) tagValueList.push( ("mtu", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isCounterDiscontinuityTicksRequested( ) and operData.hasCounterDiscontinuityTicks(): val = Value() val.setUint32(operData.counterDiscontinuityTicks) tagValueList.push( ("counter-discontinuity-ticks", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isMibIanaTypeRequested() and operData.hasMibIanaType(): val = Value() val.setEnum(operData.mibIanaType.getValue()) tagValueList.push( ("mib-iana-type", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isMibSpeed32BitRequested() and operData.hasMibSpeed32Bit(): val = Value() val.setUint32(operData.mibSpeed32Bit) tagValueList.push( ("mib-speed-32bit", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isSpeedRequested() and operData.hasSpeed(): val = Value() val.setUint64(operData.speed) tagValueList.push( ("speed", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isConnectorPresentRequested( ) and operData.hasConnectorPresent(): val = Value() val.setEnum(operData.connectorPresent.getValue()) tagValueList.push( ("connector-present", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isOperationalStatusRequested( ) and operData.hasOperationalStatus(): val = Value() val.setEnum(operData.operationalStatus.getValue()) tagValueList.push( ("operational-status", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()): i = self.myKeyPath.getLen() - 1 while i >= keyPath.getLen(): valEnd = Value() (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag() valEnd.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valEnd) i -= 1 for logFunc in self._log("fill-tag-values-ended").debug3Func(): logFunc( "ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d", operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen()) return ReturnCodes.kOk
def fillTagValues (self, keyPath, tagValueList, operData): initialListSize = tagValueList.getLen() for logFunc in self._log("fill-tag-values").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize) # fill tag values up to current if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()): i = keyPath.getLen() while i < self.myKeyPath.getLen(): valBegin = Value() (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag() valBegin.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valBegin) for logFunc in self._log("fill-tag-values-adding").debug3Func(): logFunc("adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d", i, valBegin, self.myKeyPath.getLen()) i+=1 if operData.isInterfaceIndexRequested() and operData.hasInterfaceIndex(): val = Value() val.setUint32(operData.interfaceIndex) tagValueList.push(("interface-index", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isSpeedMegabitRequested() and operData.hasSpeedMegabit(): val = Value() val.setUint32(operData.speedMegabit) tagValueList.push(("speed-megabit", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isMibAdminStatusRequested() and operData.hasMibAdminStatus(): val = Value() val.setEnum(operData.mibAdminStatus.getValue()) tagValueList.push(("mib-admin-status", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isPromiscuousRequested() and operData.hasPromiscuous(): val = Value() val.setEnum(operData.promiscuous.getValue()) tagValueList.push(("promiscuous", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isMibNameRequested() and operData.hasMibName(): val = Value() val.setString(operData.mibName) tagValueList.push(("mib-name", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isMtuRequested() and operData.hasMtu(): val = Value() val.setInt32(operData.mtu) tagValueList.push(("mtu", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isCounterDiscontinuityTicksRequested() and operData.hasCounterDiscontinuityTicks(): val = Value() val.setUint32(operData.counterDiscontinuityTicks) tagValueList.push(("counter-discontinuity-ticks", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isMibIanaTypeRequested() and operData.hasMibIanaType(): val = Value() val.setEnum(operData.mibIanaType.getValue()) tagValueList.push(("mib-iana-type", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isMibSpeed32BitRequested() and operData.hasMibSpeed32Bit(): val = Value() val.setUint32(operData.mibSpeed32Bit) tagValueList.push(("mib-speed-32bit", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isSpeedRequested() and operData.hasSpeed(): val = Value() val.setUint64(operData.speed) tagValueList.push(("speed", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isConnectorPresentRequested() and operData.hasConnectorPresent(): val = Value() val.setEnum(operData.connectorPresent.getValue()) tagValueList.push(("connector-present", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if operData.isOperationalStatusRequested() and operData.hasOperationalStatus(): val = Value() val.setEnum(operData.operationalStatus.getValue()) tagValueList.push(("operational-status", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), val) if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()): i = self.myKeyPath.getLen() - 1 while i >= keyPath.getLen(): valEnd = Value() (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag() valEnd.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valEnd) i-=1 for logFunc in self._log("fill-tag-values-ended").debug3Func(): logFunc("ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d", operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen()) return ReturnCodes.kOk
def createTargetParamTableEntry (self, trxContext, entryName): """ create an entry with the entryName in SNMP-TARGET-MIB snmpTargetParamsTable snmpTargetParamsEntry set snmpTargetParamsMPModel to 0 (v1) set snmpTargetParamsSecurityModel to 1 (v1) set snmpTargetParamsSecurityName to _<entryName>_notif set snmpTargetParamsSecurityLevel to noAuthNoPriv """ self._log("create-target-param-table-entry").debug2("called. trxContext=%s, entryName=%s", trxContext, entryName) targetKeyPath = KeyPath() valTarget = Value() (tag, ns, prefix) = ("SNMP-TARGET-MIB", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valTarget.setXmlTag((tag, ns, prefix)) targetKeyPath.addKeyPathPostfix(valTarget) tagValueList = TagValues() valTargetParamTable = Value() (tag, ns, prefix) = ("snmpTargetParamsTable","http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valTargetParamTable.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valTargetParamTable) valBegin = Value() (tag, ns, prefix) = ("snmpTargetParamsEntry", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valBegin.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valBegin) valKey = Value() valKey.setString(entryName) tagValueList.push(("snmpTargetParamsName", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valKey) # snmpTargetParamsMPModel to 0 (v1) valMPModel = Value() valMPModel.setInt32(self.MP_MODEL_V1) tagValueList.push(("snmpTargetParamsMPModel", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valMPModel) # snmpTargetParamsSecurityModel to 1 (v1) valSecurityModel = Value() valSecurityModel.setInt32(self.SECURITY_MODEL_V1) tagValueList.push(("snmpTargetParamsSecurityModel", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valSecurityModel) # snmpTargetParamsSecurityName to all-traps valSecurityName = Value() valSecurityName.setString(self.makeSecurityName(entryName)) tagValueList.push(("snmpTargetParamsSecurityName", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valSecurityName) # snmpTargetParamsSecurityLevel to noAuthNoPriv valSecurityLevel = Value() valSecurityLevel.setEnum(self.SECURITY_LEVEL_NO_AUTH_NO_PRIV) tagValueList.push(("snmpTargetParamsSecurityLevel", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valSecurityLevel) valEnd = Value() valEnd.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valEnd) valTargetParamTable = Value() (tag, ns, prefix) = ("snmpTargetParamsTable","http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valTargetParamTable.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valTargetParamTable) res = self._maapiDomain.writeMaapi(tagValueList, targetKeyPath, trxContext) if res != ReturnCodes.kOk: self._log('create-target-param-table-entry-write-domain-failed').error('self._maapiDomain.writeMaapi() failed. PARAMS') return ReturnCodes.kGeneralError self._log("create-target-param-table-entry-done").debug2("done. trxContext=%s, entryName=%s", trxContext, entryName) return ReturnCodes.kOk
def createTargetAddrTableEntry (self, trxContext, entryName): """ create an entry with the same name in SNMP-TARGET-MIB snmpTargetAddrTable snmpTargetAddrEntry set snmpTargetAddrTDomain to 1.3.6.1.6.1.1 set snmpTargetAddrTAddress to 0.0.0.0.0.162 set snmpTargetAddrTagList to the same name set snmpTargetAddrParams to the same name set snmpTargetAddrMMS to 2048 """ self._log("create-target-addr-table-entry").debug2("called. trxContext=%s, entryName=%s", trxContext, entryName) targetKeyPath = KeyPath() valTarget = Value() (tag, ns, prefix) = ("SNMP-TARGET-MIB", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valTarget.setXmlTag((tag, ns, prefix)) targetKeyPath.addKeyPathPostfix(valTarget) tagValueList = TagValues() valTargetAddrTable = Value() (tag, ns, prefix) = ("snmpTargetAddrTable","http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valTargetAddrTable.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valTargetAddrTable) valBegin = Value() (tag, ns, prefix) = ("snmpTargetAddrEntry", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valBegin.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valBegin) valKey = Value() valKey.setString(entryName) tagValueList.push(("snmpTargetAddrName", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valKey) # snmpTargetAddrTDomain to 1.3.6.1.6.1.1 valTDomain = Value() valTDomain.setOid(self.T_DOMAIN_UDP_ADDR) tagValueList.push(("snmpTargetAddrTDomain", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valTDomain) # snmpTargetAddrTAddress to 0.0.0.0.0.162 valTAddr = Value() #addrStr = chr(0)+chr(0)+chr(0)+chr(0)+chr(0)+chr(162) addrStr = chr(0)+chr(0)+chr(0)+chr(0)+chr(0)+chr(162) valTAddr.setBinary(addrStr) tagValueList.push(("snmpTargetAddrTAddress", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valTAddr) # snmpTargetAddrTagList to the same name valTagName = Value() valTagName.setString(self.ALL_TRAPS_TAG_NAME) tagValueList.push(("snmpTargetAddrTagList", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valTagName) # snmpTargetAddrParams to the same name valParamName = Value() valParamName.setString(entryName) tagValueList.push(("snmpTargetAddrParams", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valParamName) # snmpTargetAddrMMS to 2048 valMMS = Value() valMMS.setInt32(self.MAX_MESSAGE_SIZE) tagValueList.push(("snmpTargetAddrMMS", "http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z"), valMMS) valEnd = Value() valEnd.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valEnd) valTargetAddrTable = Value() (tag, ns, prefix) = ("snmpTargetAddrTable","http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z", "SNMP_TARGET_MIB") valTargetAddrTable.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valTargetAddrTable) res = self._maapiDomain.writeMaapi(tagValueList, targetKeyPath, trxContext) if res != ReturnCodes.kOk: self._log('create-target-addr-table-entry-write-domain-failed').error('self._maapiDomain.writeMaapi() failed. PARAMS') return ReturnCodes.kGeneralError self._log("create-target-addr-table-entry-done").debug2("done. trxContext=%s, entryName=%s", trxContext, entryName) return ReturnCodes.kOk