support ec2 apis

pull/842/head
Jingyi 2024-07-03 11:24:15 +08:00
parent a9f1e66f53
commit 8802090295
2 changed files with 3 additions and 4 deletions

View File

@ -1283,17 +1283,17 @@ if is_on_ec2:
response = requests.get(f"{api_url}/schemas", headers=headers, params=params)
if response.status_code != 200:
resp = response.json()
return web.Response(status=500, content_type='application/json',
body=json.dumps({"result": False, "message": 'List schemas failed'}))
body=json.dumps({"result": False, "message": f'List schemas failed: {resp["message"]}'}))
data = response.json()['data']
return web.Response(status=200, content_type='application/json',
body=json.dumps({"result": True, "data": data}))
except Exception as e:
logger.info(e)
return web.Response(status=500, content_type='application/json',
body=json.dumps({"result": False, "message": 'List schemas failed'}))
body=json.dumps({"result": False, "message": f'List schemas failed: {e}'}))
@server.PromptServer.instance.routes.post("/schemas")
async def create_schema(request):

View File

@ -35,7 +35,6 @@ def handler(event, ctx):
scan_kwargs = {
'Limit': limit,
"ScanIndexForward": False
}
if exclusive_start_key: