| 1 |
"""Main module of {{username}}/{{napp}} Kytos Network Application. |
| 2 |
|
| 3 |
{{ description }} |
| 4 |
""" |
| 5 |
|
| 6 |
from kytos.core import KytosNApp, log |
| 7 |
|
| 8 |
from napps.{{username}}.{{napp}} import settings |
| 9 |
|
| 10 |
|
| 11 |
class Main(KytosNApp): |
| 12 |
"""Main class of {{username}}/{{napp}} NApp. |
| 13 |
|
| 14 |
This class is the entry point for this napp. |
| 15 |
""" |
| 16 |
|
| 17 |
def setup(self): |
| 18 |
"""Replace the '__init__' method for the KytosNApp subclass. |
| 19 |
|
| 20 |
The setup method is automatically called by the controller when your |
| 21 |
application is loaded. |
| 22 |
|
| 23 |
So, if you have any setup routine, insert it here. |
| 24 |
""" |
| 25 |
pass |
| 26 |
|
| 27 |
def execute(self): |
| 28 |
"""Run after the setup method execution. |
| 29 |
|
| 30 |
You can also use this method in loop mode if you add to the above setup |
| 31 |
method a line like the following example: |
| 32 |
|
| 33 |
self.execute_as_loop(30) # 30-second interval. |
| 34 |
""" |
| 35 |
pass |
| 36 |
|
| 37 |
def shutdown(self): |
| 38 |
"""Run when your napp is unloaded. |
| 39 |
|
| 40 |
If you have some cleanup procedure, insert it here. |
| 41 |
""" |
| 42 |
pass |
| 43 |
|