Add API queryscadadatabydeviceidandtime
This commit is contained in:
9
main.py
9
main.py
@@ -2091,6 +2091,8 @@ async def get_simulationresult():
|
||||
data = [random.randint(0, 100) for _ in range(100)]
|
||||
return data
|
||||
|
||||
# 下面几个query 函数,都是从 influxdb 中查询的,不与 network 绑定,用固定的network 名字
|
||||
|
||||
# DingZQ 2025-01-31
|
||||
# def query_latest_record_by_ID(ID: str, type: str, bucket: str="realtime_data", client: InfluxDBClient=client) -> dict:
|
||||
@app.get("/querynodelatestrecordbyid/")
|
||||
@@ -2117,6 +2119,13 @@ async def query_node_curve_by_id_property_daterange(id: str, prop: str, startdat
|
||||
async def query_link_curve_by_id_property_daterange(id: str, prop: str, startdate: str, enddate: str):
|
||||
return influxdb_api.query_curve_by_ID_property_daterange(id, type='link', property=prop, start_date=startdate, end_date=enddate, client=influx_client)
|
||||
|
||||
# def query_SCADA_data_by_device_ID_and_time(query_ids_list: List[str], query_time: str, bucket: str="SCADA_data", client: InfluxDBClient=client) -> Dict[str, float]:
|
||||
@app.get("/queryscadadatabydeviceidandtime/")
|
||||
async def query_scada_data_by_device_id_and_time(ids: list[str], querytime: str):
|
||||
return influxdb_api.query_SCADA_data_by_device_ID_and_time(query_ids_list=ids, query_time=querytime, client=influx_client)
|
||||
|
||||
|
||||
|
||||
|
||||
# DingZQ, 2024-12-31, generate openapi.json
|
||||
def generate_openapi_json():
|
||||
|
||||
Reference in New Issue
Block a user