Merge pull request #444 from LibreQoE/main

Update Develop
This commit is contained in:
Robert Chacón
2023-12-20 08:51:48 -07:00
committed by GitHub
3 changed files with 11 additions and 13 deletions

View File

@@ -9,7 +9,7 @@
- OSPF primary link (low cost) through the server running LibreQoS
- OSPF backup link (high cost, maybe 200 for example)
![Offical Configuration](https://raw.githubusercontent.com/rchac/LibreQoS/main/docs/design.png)
![Offical Configuration](https://raw.githubusercontent.com/LibreQoE/LibreQoS/main/docs/design.png)
### Network Interface Card

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 347 KiB

View File

@@ -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():