- use only one level subdomain urls on service list

- add status
This commit is contained in:
Robert Resch 2021-04-19 14:03:45 +02:00
parent ca32e0e2bc
commit 13421189c6
No known key found for this signature in database
GPG key ID: 6B360759EB2ACAEE
2 changed files with 29 additions and 15 deletions

View file

@ -350,6 +350,7 @@ def bot_toEcoVacsHome_JSON(bot): # EcoVacs Home
# "jmq": "jmq-ngiot-eu.dc.ww.ecouser.net",
# "mqs": "api-ngiot.dc-as.ww.ecouser.net"
# }
bot["status"] = 1 if bot["mqtt_connection"] or bot["xmpp_connection"] else 0
return json.dumps(
bot, default=lambda o: o.__dict__, sort_keys=False

View file

@ -1,12 +1,10 @@
#!/usr/bin/env python3
import asyncio
from aiohttp import web
from bumper import plugins
import logging
import bumper
from bumper.models import *
from aiohttp import web
from bumper import plugins
from datetime import datetime, timedelta
from bumper.models import *
class portal_api_appsvr(plugins.ConfServerApp):
@ -159,17 +157,31 @@ class portal_api_appsvr(plugins.ConfServerApp):
async def handle_appsvr_service_list(self, request):
try:
# original urls comment out as they are sub sub domain, which the current certificate is not valid
# using url, where the certs is valid
# data = {
# "account": "users-base.dc-eu.ww.ecouser.net",
# "jmq": "jmq-ngiot-eu.dc.ww.ecouser.net",
# "lb": "lbo.ecouser.net",
# "magw": "api-app.dc-eu.ww.ecouser.net",
# "msgcloud": "msg-eu.ecouser.net:5223",
# "ngiotLb": "jmq-ngiot-eu.area.ww.ecouser.net",
# "rop": "api-rop.dc-eu.ww.ecouser.net"
# }
data = {
"account": "users-base.ecouser.net",
"jmq": "jmq-ngiot-eu.ecouser.net",
"lb": "lbo.ecouser.net",
"magw": "api-app.ecouser.net",
"msgcloud": "msg-eu.ecouser.net:5223",
"ngiotLb": "jmq-ngiot-eu.ecouser.net",
"rop": "api-rop.ecouser.net"
}
body = {
"code": 0,
"data": {
"account": "users-base.dc-eu.ww.ecouser.net",
"jmq": "jmq-ngiot-eu.dc.ww.ecouser.net",
"lb": "lbo.ecouser.net",
"magw": "api-app.dc-eu.ww.ecouser.net",
"msgcloud": "msg-eu.ecouser.net:5223",
"ngiotLb": "jmq-ngiot-eu.area.ww.ecouser.net",
"rop": "api-rop.dc-eu.ww.ecouser.net"
},
"data": data,
"ret": "ok",
"todo": "result"
}
@ -195,4 +207,5 @@ class portal_api_appsvr(plugins.ConfServerApp):
except Exception as e:
logging.exception("{}".format(e))
plugin = portal_api_appsvr()