Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- ##----------------------------------------------------------------------
- ## sa.network_info application
- ##----------------------------------------------------------------------
- ## Copyright (C) 2007-2014 The NOC Project
- ## See LICENSE for details
- ##----------------------------------------------------------------------
- ## NOC modules
- from noc.lib.app import ExtApplication, view
- from noc.ip.models import *
- from noc.inv.models import *
- class network_infoAppplication(ExtApplication):
- """
- sa.network_info application
- """
- title = "Network Info"
- menu = "Network Info"
- @view(method=["GET"], url=r"^$", access="read", api=True)
- def api_main(self, request):
- mo = ManagedObject.objects.get(id=38)
- ni = "L3 device: "+mo.name+"\n"
- arps = mo.scripts.get_arp()
- for arp in arps:
- ni += "ARP entry: "+arp['ip']+" "+arp['mac']+"\n"
- return {
- "network_info": ni,
- "success" : True
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement