mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2024-11-22 08:16:25 -06:00
Update integrationUISP.py
This commit is contained in:
parent
13f0df7e0c
commit
2d3ff07f9e
@ -283,19 +283,7 @@ def findNodesBranchedOffPtMP(siteList, dataLinks, sites, rootSite):
|
||||
}
|
||||
return nodeOffPtMP
|
||||
|
||||
def buildFullGraph():
|
||||
# Attempts to build a full network graph, incorporating as much of the UISP
|
||||
# hierarchy as possible.
|
||||
from integrationCommon import NetworkGraph, NetworkNode, NodeType
|
||||
from ispConfig import uispSite, generatedPNUploadMbps, generatedPNDownloadMbps
|
||||
|
||||
# Load network sites
|
||||
print("Loading Data from UISP")
|
||||
sites = uispRequest("sites")
|
||||
devices = uispRequest("devices?withInterfaces=true&authorized=true")
|
||||
dataLinks = uispRequest("data-links?siteLinksOnly=true")
|
||||
|
||||
# If multiple Internet-connected sites, create Internet root node:
|
||||
def handleMultipleInternetNodes(sites, dataLinks, uispSite):
|
||||
internetConnectedSites = []
|
||||
for link in dataLinks:
|
||||
if link['canDelete'] == False:
|
||||
@ -314,6 +302,22 @@ def buildFullGraph():
|
||||
link['from']['site']['identification']['name'] = 'Internet'
|
||||
# Found internet link
|
||||
internetConnectedSites.append(siteID)
|
||||
return(sites, dataLinks, uispSite)
|
||||
|
||||
def buildFullGraph():
|
||||
# Attempts to build a full network graph, incorporating as much of the UISP
|
||||
# hierarchy as possible.
|
||||
from integrationCommon import NetworkGraph, NetworkNode, NodeType
|
||||
from ispConfig import uispSite, generatedPNUploadMbps, generatedPNDownloadMbps
|
||||
|
||||
# Load network sites
|
||||
print("Loading Data from UISP")
|
||||
sites = uispRequest("sites")
|
||||
devices = uispRequest("devices?withInterfaces=true&authorized=true")
|
||||
dataLinks = uispRequest("data-links?siteLinksOnly=true")
|
||||
|
||||
# If multiple Internet-connected sites, create Internet root node:
|
||||
sites, dataLinks, uispSite = handleMultipleInternetNodes(sites, dataLinks, uispSite)
|
||||
|
||||
# Build Site Capacities
|
||||
print("Compiling Site Bandwidths")
|
||||
|
Loading…
Reference in New Issue
Block a user