mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
@@ -9,7 +9,7 @@
|
||||
- OSPF primary link (low cost) through the server running LibreQoS
|
||||
- OSPF backup link (high cost, maybe 200 for example)
|
||||
|
||||

|
||||

|
||||
|
||||
### Network Interface Card
|
||||
|
||||
|
||||
BIN
docs/design.png
BIN
docs/design.png
Binary file not shown.
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 347 KiB |
@@ -21,21 +21,20 @@ def getCustomerInfo():
|
||||
r = requests.post(url, data=data, headers=headers, verify=False, timeout=10)
|
||||
return r.json()
|
||||
|
||||
def getServiceInfo(customerID):
|
||||
def getListServices():
|
||||
headers= {'Content-Type': 'application/x-www-form-urlencoded'}
|
||||
url = powercode_api_url + ":444/api/1/index.php"
|
||||
url = powercode_api_url + ":444/api/preseem/index.php"
|
||||
data = {}
|
||||
data['apiKey'] = powercode_api_key
|
||||
data['action'] = 'readCustomerService'
|
||||
data['customerID'] = customerID
|
||||
data['action'] = 'list_services'
|
||||
|
||||
r = requests.post(url, data=data, headers=headers, verify=False, timeout=10)
|
||||
servicesDict = {}
|
||||
for service in r.json()['services']:
|
||||
if 'internetInfo' in service:
|
||||
servicesDict[service['serviceID']] = {}
|
||||
servicesDict[service['serviceID']]['downloadMbps'] = int(round(int(service['internetInfo']['maxIn']) / 1000))
|
||||
servicesDict[service['serviceID']]['uploadMbps'] = int(round(int(service['internetInfo']['maxOut']) / 1000))
|
||||
for service in r.json():
|
||||
if service['rate_down'] and service['rate_up']:
|
||||
servicesDict[service['id']] = {}
|
||||
servicesDict[service['id']]['downloadMbps'] = int(round(int(service['rate_down']) / 1000))
|
||||
servicesDict[service['id']]['uploadMbps'] = int(round(int(service['rate_up']) / 1000))
|
||||
return servicesDict
|
||||
|
||||
def createShaper():
|
||||
@@ -56,9 +55,7 @@ def createShaper():
|
||||
if customerIDint not in customerIDs:
|
||||
customerIDs.append(customerIDint)
|
||||
|
||||
allServices = {}
|
||||
for customerID in customerIDs:
|
||||
allServices.update(getServiceInfo(customerID))
|
||||
allServices = getListServices()
|
||||
|
||||
acceptableEquipment = ['Customer Owned Equipment', 'Router', 'Customer Owned Equipment', 'Managed Routers'] #'CPE'
|
||||
|
||||
@@ -111,6 +108,7 @@ def createShaper():
|
||||
ipv6=[]
|
||||
)
|
||||
net.addRawNode(newDevice)
|
||||
print("Imported " + str(len(devicesByCustomerID)) + " customers")
|
||||
net.prepareTree()
|
||||
net.plotNetworkGraph(False)
|
||||
if net.doesNetworkJsonExist():
|
||||
|
||||
Reference in New Issue
Block a user