mirror of
https://github.com/jbowdre/SWIPAMforvRA8.git
synced 2024-11-21 23:52:18 +00:00
improved logging for get_ip_ranges
This commit is contained in:
parent
4a47e20c72
commit
6543865597
1 changed files with 1 additions and 0 deletions
|
@ -34,6 +34,7 @@ def do_get_ip_ranges(self, auth_credentials, cert):
|
||||||
result_ranges = []
|
result_ranges = []
|
||||||
qResult = swis.query("SELECT DISTINCT GroupID AS id, FriendlyName AS name, Address AS addressSpaceId, CIDR AS subnetPrefixLength, Comments AS description, i.CustomProperties.Gateway as gatewayAddress, i.CustomProperties.DNS_Servers as dnsServers, i.CustomProperties.Site_ID AS siteId FROM IPAM.GroupNode i WHERE GroupTypeText LIKE 'Subnet' AND i.CustomProperties.VRA_Range = TRUE")
|
qResult = swis.query("SELECT DISTINCT GroupID AS id, FriendlyName AS name, Address AS addressSpaceId, CIDR AS subnetPrefixLength, Comments AS description, i.CustomProperties.Gateway as gatewayAddress, i.CustomProperties.DNS_Servers as dnsServers, i.CustomProperties.Site_ID AS siteId FROM IPAM.GroupNode i WHERE GroupTypeText LIKE 'Subnet' AND i.CustomProperties.VRA_Range = TRUE")
|
||||||
for range in qResult['results']:
|
for range in qResult['results']:
|
||||||
|
logging.info(f"Found subnet: {str(range['name'])}")
|
||||||
network = ipaddress.ip_network(str(range['addressSpaceId']) + '/' + str(range['subnetPrefixLength']))
|
network = ipaddress.ip_network(str(range['addressSpaceId']) + '/' + str(range['subnetPrefixLength']))
|
||||||
range['ipVersion'] = 'IPv' + str(network.version)
|
range['ipVersion'] = 'IPv' + str(network.version)
|
||||||
range['startIPAddress'] = str(network[10])
|
range['startIPAddress'] = str(network[10])
|
||||||
|
|
Loading…
Reference in a new issue