summaryrefslogtreecommitdiff
path: root/pysnmp/hlapi/asyncio
diff options
context:
space:
mode:
Diffstat (limited to 'pysnmp/hlapi/asyncio')
-rw-r--r--pysnmp/hlapi/asyncio/cmdgen.py17
-rw-r--r--pysnmp/hlapi/asyncio/ntforg.py17
2 files changed, 32 insertions, 2 deletions
diff --git a/pysnmp/hlapi/asyncio/cmdgen.py b/pysnmp/hlapi/asyncio/cmdgen.py
index d9a8d4d6..ea65961f 100644
--- a/pysnmp/hlapi/asyncio/cmdgen.py
+++ b/pysnmp/hlapi/asyncio/cmdgen.py
@@ -44,7 +44,7 @@ try:
except ImportError:
import trollius as asyncio
-__all__ = ['getCmd', 'nextCmd', 'setCmd', 'bulkCmd', 'isEndOfMib']
+__all__ = ['getCmd', 'nextCmd', 'setCmd', 'bulkCmd', 'isEndOfMib', 'unconfigureCmdGen']
vbProcessor = CommandGeneratorVarBinds()
lcd = CommandGeneratorLcdConfigurator()
@@ -53,6 +53,21 @@ isEndOfMib = lambda x: not cmdgen.getNextVarBinds(x)[1]
@asyncio.coroutine
+def unconfigureCmdGen(snmpEngine, authData=None):
+ """Remove LCD configuration entry.
+
+ If `authData` is not given, all currently configured LCD entries will be
+ removed.
+
+ Note
+ ----
+ Configuration entry removal may have a side effect of removing unused transport
+ and shutting down unused transport dispatcher.
+ """
+ lcd.unconfigure(snmpEngine, authData)
+
+
+@asyncio.coroutine
def getCmd(snmpEngine, authData, transportTarget, contextData,
*varBinds, **options):
"""Creates a generator to perform SNMP GET query.
diff --git a/pysnmp/hlapi/asyncio/ntforg.py b/pysnmp/hlapi/asyncio/ntforg.py
index 13ec63bd..0541684e 100644
--- a/pysnmp/hlapi/asyncio/ntforg.py
+++ b/pysnmp/hlapi/asyncio/ntforg.py
@@ -21,13 +21,28 @@ try:
except ImportError:
import trollius as asyncio
-__all__ = ['sendNotification']
+__all__ = ['sendNotification', 'unconfigureNtfOrg']
vbProcessor = NotificationOriginatorVarBinds()
lcd = NotificationOriginatorLcdConfigurator()
@asyncio.coroutine
+def unconfigureNtfOrg(snmpEngine, authData=None):
+ """Remove LCD configuration entry.
+
+ If `authData` is not given, all currently configured LCD entries will be
+ removed.
+
+ Note
+ ----
+ Configuration entry removal may have a side effect of removing unused transport
+ and shutting down unused transport dispatcher.
+ """
+ lcd.unconfigure(snmpEngine, authData)
+
+
+@asyncio.coroutine
def sendNotification(snmpEngine, authData, transportTarget, contextData,
notifyType, varBinds, **options):
"""Creates a generator to send SNMP notification.