add new endpoints for app v2 #116
2 changed files with 29 additions and 15 deletions
|
|
@ -350,6 +350,7 @@ def bot_toEcoVacsHome_JSON(bot): # EcoVacs Home
|
||||||
# "jmq": "jmq-ngiot-eu.dc.ww.ecouser.net",
|
# "jmq": "jmq-ngiot-eu.dc.ww.ecouser.net",
|
||||||
# "mqs": "api-ngiot.dc-as.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(
|
return json.dumps(
|
||||||
bot, default=lambda o: o.__dict__, sort_keys=False
|
bot, default=lambda o: o.__dict__, sort_keys=False
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import asyncio
|
|
||||||
from aiohttp import web
|
|
||||||
from bumper import plugins
|
|
||||||
import logging
|
import logging
|
||||||
import bumper
|
|
||||||
from bumper.models import *
|
from aiohttp import web
|
||||||
|
|
||||||
from bumper import plugins
|
from bumper import plugins
|
||||||
from datetime import datetime, timedelta
|
from bumper.models import *
|
||||||
|
|
||||||
|
|
||||||
class portal_api_appsvr(plugins.ConfServerApp):
|
class portal_api_appsvr(plugins.ConfServerApp):
|
||||||
|
|
@ -159,17 +157,31 @@ class portal_api_appsvr(plugins.ConfServerApp):
|
||||||
|
|
||||||
async def handle_appsvr_service_list(self, request):
|
async def handle_appsvr_service_list(self, request):
|
||||||
try:
|
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 = {
|
body = {
|
||||||
"code": 0,
|
"code": 0,
|
||||||
"data": {
|
"data": 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"
|
|
||||||
},
|
|
||||||
"ret": "ok",
|
"ret": "ok",
|
||||||
"todo": "result"
|
"todo": "result"
|
||||||
}
|
}
|
||||||
|
|
@ -195,4 +207,5 @@ class portal_api_appsvr(plugins.ConfServerApp):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.exception("{}".format(e))
|
logging.exception("{}".format(e))
|
||||||
|
|
||||||
|
|
||||||
plugin = portal_api_appsvr()
|
plugin = portal_api_appsvr()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue