general operator for fastapi write sql and redis
Project description
node_object_module version 2.3.3
- API node rule
- API node 包含四張表(node, node_base, device_info, third_dimension_instance)一對一關係
- 只能透過API node的update去修改或新增device_info和third_dimension_instance這兩張表
- node只能有一個parent node, 可以有多個child nodes
- 跟node groups的關係是多對多
- 刪除node會連同底下所有的child nodes和所有此node和child nodes底下的object都刪除
- API object rule
- API object 包含四張表(object, object_base, fake_data_config, fake_data_config_base)一對一關係
- 只能透過API object的update去修改或新增其他一對一的表
- object只能綁定一個node
- 跟object groups的關係是多對多
- insert object的value會完全取代原本的value, 只修改redis的表, 不修改sql
- API object value
- history value儲存在influxDB
- latest value存redis和influxDB
- 取得history value從influxDB讀取
- 取得latest value從redis取
- 取得即時有改變的資料使用websocket連線(ws://{host}:{port}/ws/)
- API control href group
- create 可以創建group 和 item
- update 如果item有帶id就是修改, 如果沒有帶id就是創建新的item, 如果帶負數id會刪除此item
- delete 會連同底下item一起刪除
Design
General Table Operate CRUD
Read Data
Create Data
Update Data
Delete Data
DB diagram
Deploy
1. Use docker-compose
-
install mysql, redis and influxdb
docker pull mssql
docker pull redis
docker pull influxdb
-
start docker-compose.yaml
docker-compose up --build -d
2. Use Dockerfile
需要先啟動mysql, redis, influxdb 可用環境變數db_host, redis_host去改變sql和redis的連線ip
-
build docker image "node_object"
docker build -t node_object:latest .
-
run node_object image
docker run --name node_object --network="host" -p 9330:9330 node_object:latest
有環境變數
docker run --name node_object --network="host" -e db_host=192.168.1.11 -e redis_host=192.168.1.11 -e influx_host=192.168.1.11 -p 9330:9330 -d node_object:latest
Swagger API Document
http://{host}:{port}/docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file general_util-0.0.14.tar.gz
.
File metadata
- Download URL: general_util-0.0.14.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2efda0cffdadbc496fbc1f610c054606289d74cc207a889d97774b471230b2d2 |
|
MD5 | a70191fac0728ca56f94f4499450e8f8 |
|
BLAKE2b-256 | 809111f1a601bb4ff5de553626284bc42ee633ba42a008ae56fee3a5e6ad5174 |
File details
Details for the file general_util-0.0.14-py3-none-any.whl
.
File metadata
- Download URL: general_util-0.0.14-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 820cb7f0b28c4f6ccd387f8fce06996130f8018f1dbc7bff359a826b15e5176f |
|
MD5 | 4242c839adbfa768056d257284e43711 |
|
BLAKE2b-256 | acd7fecc45ad766bd6b552446aebc55859a36ec1575df41c37e2c35cf8478759 |