Python Api  IE10.1
Classes | Functions | Variables
netbrain.sysapi.duplicateip Namespace Reference

Classes

class  DuplicateIps
 

Functions

def GetAllDuplicateIpIntfs ()
 get all duplicate ips,duplicate ip means witch ip repeat more than once,ignore the mask,ignore the zone. More...
 
def GetDuplicateIpIntfsBySite (siteName)
 get all duplicate ips in same site by siteName. More...
 
def GetDuplicateIpIntfsByZone (zoneName)
 get all duplicate ips in same zone by zoneName. More...
 
def GetSubnetIpInterfacesBySubnets (subnets)
 get all interface datas by subnets More...
 
def GetSubnetIpInterfacesBySubnet (subnet)
 get all interface datas by one subnet More...
 

Variables

 str_stack = traceback.format_exc();
 

Function Documentation

◆ GetAllDuplicateIpIntfs()

def netbrain.sysapi.duplicateip.GetAllDuplicateIpIntfs ( )

get all duplicate ips,duplicate ip means witch ip repeat more than once,ignore the mask,ignore the zone.

ex. 10.10.10.1/16 and 10.10.10.1/8 will consider as duplicate ip;

Returns
[list] All duplicate ip list,each item is one duplicateIp object,not grouped by ip,retult like follow:
duplicateip.GetAllDuplicateIpIntfs()
[{
"devId": "7848d5c3-e4e3-49f5-9e57-f9bd2fb398d1",
"devInterfaceId": "57792cce-9417-4dee-bff3-4f22cecc3f1d",
"ip": "10.10.2.27/22",
"ipInterfaceId": "89892760-d838-40f0-98ed-8033610e18ca",
"ipInterfaceName": "Ethernet0 10.10.2.27/22",
"zone": ""
"deviceName": "10.10.2.27",
"zoneName": "Default Zone"
"siteName": "TestSite1"
}, {
"devId": "016fa17c-cc69-47b7-82c1-35c2ec79b4f2",
"devInterfaceId": "aee8f1d7-fbbf-42f8-af90-5711275b85d5",
"ip": "10.10.2.27/22",
"ipInterfaceId": "4bbd7682-6146-4770-bcb5-f061ae6b4feb",
"ipInterfaceName": "Ethernet0 10.10.2.27/22",
"zone": ""
"deviceName": "10.10.2.27",
"zoneName": "Default Zone"
"siteName": "TestSite1"
}]

◆ GetDuplicateIpIntfsBySite()

def netbrain.sysapi.duplicateip.GetDuplicateIpIntfsBySite (   siteName)

get all duplicate ips in same site by siteName.

ignore the mask ex. 10.10.10.1/16 and 10.10.10.1/8 will consider as duplicate ip; if the same ip interface not in same site, it not consider as duplicate ip;

Parameters
siteName(string) the name of the site.
Returns
[list] All duplicate ip list,each item is one duplicateIp object,not grouped by ip,retult like follow:
duplicateip.GetDuplicateIpIntfsBySite("TestSite1")
[{
"devId": "7848d5c3-e4e3-49f5-9e57-f9bd2fb398d1",
"devInterfaceId": "57792cce-9417-4dee-bff3-4f22cecc3f1d",
"ip": "10.10.2.27/22",
"ipInterfaceId": "89892760-d838-40f0-98ed-8033610e18ca",
"ipInterfaceName": "Ethernet0 10.10.2.27/22",
"zone": ""
"deviceName": "10.10.2.27",
"zoneName": "Default Zone"
"siteName": "TestSite1"
}, {
"devId": "016fa17c-cc69-47b7-82c1-35c2ec79b4f2",
"devInterfaceId": "aee8f1d7-fbbf-42f8-af90-5711275b85d5",
"ip": "10.10.2.27/22",
"ipInterfaceId": "4bbd7682-6146-4770-bcb5-f061ae6b4feb",
"ipInterfaceName": "Ethernet0 10.10.2.27/22",
"zone": ""
"deviceName": "10.10.2.27",
"zoneName": "Default Zone"
"siteName": "TestSite1"
}]

◆ GetDuplicateIpIntfsByZone()

def netbrain.sysapi.duplicateip.GetDuplicateIpIntfsByZone (   zoneName)

get all duplicate ips in same zone by zoneName.

ignore the mask ex. 10.10.10.1/16 and 10.10.10.1/8 will consider as duplicate ip; if the same ip interface not in same zone, it not consider as duplicate ip;

Parameters
zoneName(string) the name of the site.
Returns
[list] All duplicate ip list,each item is one duplicateIp object,not grouped by ip,retult like follow:
duplicateip.GetDuplicateIpIntfsByZone("Default Zone")
[{
"devId": "7848d5c3-e4e3-49f5-9e57-f9bd2fb398d1",
"devInterfaceId": "57792cce-9417-4dee-bff3-4f22cecc3f1d",
"ip": "10.10.2.27/22",
"ipInterfaceId": "89892760-d838-40f0-98ed-8033610e18ca",
"ipInterfaceName": "Ethernet0 10.10.2.27/22",
"zone": ""
"deviceName": "10.10.2.27",
"zoneName": "Default Zone"
"siteName": "TestSite1"
}, {
"devId": "016fa17c-cc69-47b7-82c1-35c2ec79b4f2",
"devInterfaceId": "aee8f1d7-fbbf-42f8-af90-5711275b85d5",
"ip": "10.10.2.27/22",
"ipInterfaceId": "4bbd7682-6146-4770-bcb5-f061ae6b4feb",
"ipInterfaceName": "Ethernet0 10.10.2.27/22",
"zone": ""
"deviceName": "10.10.2.27",
"zoneName": "Default Zone"
"siteName": "TestSite1"
}]

◆ GetSubnetIpInterfacesBySubnet()

def netbrain.sysapi.duplicateip.GetSubnetIpInterfacesBySubnet (   subnet)

get all interface datas by one subnet

Parameters
subnet(string) subnet list,ex. "10.10.32.0/22"
Returns
(list) ex.
duplicateip.GetSubnetIpInterfacesBySubnet("10.10.32.0/22")
[{
"description": "",
"devId": "7e6df18c-4a1a-49e5-bf7c-4e5c4d5726b6",
"devInterfaceId": "a3d0bc4d-996a-49f8-8a1a-dd175b2baca5",
"deviceName": "10.10.32.57",
"ip": "10.10.32.57/22",
"ipInterfaceId": "a28dbd9d-acc6-42de-8252-247e658677f0",
"ipInterfaceName": "Ethernet0 10.10.32.57/22",
"isIpConflicted": false,
"nonDuplicateIP": false,
"vrf": "",
"zone": "1111f87d-f168-4b70-86f2-6ad91d30579a"
},
{
//...
}]

◆ GetSubnetIpInterfacesBySubnets()

def netbrain.sysapi.duplicateip.GetSubnetIpInterfacesBySubnets (   subnets)

get all interface datas by subnets

Parameters
subnets(list) subnet list,ex. ["10.10.32.0/22"]
Returns
(list) ex.
duplicateip.GetSubnetIpInterfacesBySubnets(["10.10.32.0/22"])
[{
"ipIntfs" : [
{
"description" : "",
"devId" : "7e6df18c-4a1a-49e5-bf7c-4e5c4d5726b6",
"devInterfaceId" : "a3d0bc4d-996a-49f8-8a1a-dd175b2baca5",
"deviceName" : "10.10.32.57",
"ip" : "10.10.32.57/22",
"ipInterfaceId" : "a28dbd9d-acc6-42de-8252-247e658677f0",
"ipInterfaceName" : "Ethernet0 10.10.32.57/22",
"isIpConflicted" : false,
"nonDuplicateIP" : false,
"vrf" : "",
"zone" : "1111f87d-f168-4b70-86f2-6ad91d30579a"
}
],
"subnet" : "10.10.32.0/22",
"zone" : "1111f87d-f168-4b70-86f2-6ad91d30579a"
}]

Variable Documentation

◆ str_stack

netbrain.sysapi.duplicateip.str_stack = traceback.format_exc();