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_operator-0.2.11.tar.gz
.
File metadata
- Download URL: general_operator-0.2.11.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7baa215df8d76cd0bfd31abb6f549f0ebab7a567d96d0363368eba78993d9f03 |
|
MD5 | f284a6ca9ffea37268a8b3bce3e3755f |
|
BLAKE2b-256 | 9f1b2e0904fb6801cd4c22cd98e52ea80425de03da39bad2aa23818b244dddcc |
File details
Details for the file general_operator-0.2.11-py3-none-any.whl
.
File metadata
- Download URL: general_operator-0.2.11-py3-none-any.whl
- Upload date:
- Size: 18.9 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 | 3cfe1f7b156f1e5c16834a7fed66cc2ce03b1b6fb633e96c7d818bc55a46f70f |
|
MD5 | c76870c369cd6cbc85e42bb453337617 |
|
BLAKE2b-256 | 6050fad75269857fee2ef33da0aede59aea7587d61ab808fff2d9d4d42a83e2c |