From 72d642fcf65fde420dd23f9f4b96aa4b021b37dc Mon Sep 17 00:00:00 2001 From: Jiang Date: Wed, 11 Mar 2026 17:49:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E3=80=81=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E6=97=A7=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/copilot-instructions.md | 246 +- DEPLOYMENT.md | 391 - DOCUMENTATION_INDEX.md | 269 - INTEGRATION_CHECKLIST.md | 322 - QUICK_START_GUIDE.md | 326 - SECONDARY_DEVELOPMENT_GUIDE.md | 1015 -- SECURITY_IMPLEMENTATION_SUMMARY.md | 370 - SECURITY_README.md | 499 - openapi.json | 13577 ---------------- readme.md | 97 - .../setup_security.sh | 0 setup_influxdb.md | 14 - setup_server.md | 90 - 13 files changed, 61 insertions(+), 17155 deletions(-) delete mode 100644 DEPLOYMENT.md delete mode 100644 DOCUMENTATION_INDEX.md delete mode 100644 INTEGRATION_CHECKLIST.md delete mode 100644 QUICK_START_GUIDE.md delete mode 100644 SECONDARY_DEVELOPMENT_GUIDE.md delete mode 100644 SECURITY_IMPLEMENTATION_SUMMARY.md delete mode 100644 SECURITY_README.md delete mode 100644 openapi.json delete mode 100644 readme.md rename setup_security.sh => scripts/setup_security.sh (100%) delete mode 100644 setup_influxdb.md delete mode 100644 setup_server.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 1fda378..23396a2 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,206 +1,82 @@ -# TJWater Server - Copilot Instructions +# Copilot Instructions for TJWater Server -This is a FastAPI-based water network management system (供水管网智能管理系统) that provides hydraulic simulation, SCADA data integration, network element management, and risk analysis capabilities. +This repository contains the backend code for the TJWater Server, a water distribution network management system built with FastAPI. -## Running the Server +## High-Level Architecture + +The application follows a layered architecture: + +- **Entry Point**: `app/main.py` initializes the FastAPI application, database connections (PostgreSQL & TimescaleDB), and middleware. +- **API Layer**: `app/api/v1` contains the route handlers. +- **Service Layer**: `app/services` contains business logic and orchestration. +- **Infrastructure Layer**: `app/infra` handles database connections (`db`), audit logging (`audit`), and external integrations. +- **Domain Layer**: `app/domain` likely contains core domain models. +- **Native/Algorithms**: `app/native` and `app/algorithms` handle specialized water network calculations (possibly using EPANET/WNTR). + +## Build, Test, and Run Commands + +### Environment Setup + +- Dependencies are listed in `requirements.txt`. +- Configuration is managed via environment variables (see `.env.example` if available, or `app/core/config.py`). +- **Important**: Ensure `.env` is configured with correct database credentials for both PostgreSQL and TimescaleDB. + +If first time setting up, you may want to create a Conda environment: ```bash -# activate the server environment +conda create -n server python=3.12 conda activate server -# Install dependencies - - -# Start the server (default: http://0.0.0.0:8000 with 2 workers) -python scripts/run_server.py - -# Note: On Windows, the script automatically sets WindowsSelectorEventLoopPolicy +pip install uv +uv pip install -r requirements.txt +conda install -c conda-forge pymetis ``` -## Running Tests +### Running the Server + +The preferred way to run the server locally is using the helper script which sets up the Python path correctly: ```bash -# activate the server environment conda activate server +python scripts/run_server.py +``` + +Alternatively, you can run directly with uvicorn (ensure PYTHONPATH includes the root): + +```bash +conda activate server +uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload +``` + +### Running Tests + +Use `pytest` to run tests. The `tests/conftest.py` handles path setup. + +```bash # Run all tests pytest -# Run a specific test file with verbose output -pytest tests/unit/test_pipeline_health_analyzer.py -v +# Run a specific test file +pytest tests/unit/test_specific_file.py -# Run from conftest helper -python tests/conftest.py +# Run a specific test case +pytest tests/unit/test_specific_file.py::test_function_name ``` -## Architecture Overview +### Building (Optional) -### Core Components +The project includes scripts to compile Python modules to `.pyd` files using Cython (see `scripts/build_pyd.py`). This is likely for distribution/performance but not required for standard development. -1. **Native Modules** (`app/native/`): Platform-specific compiled extensions (`.so` for Linux, `.pyd` for Windows) providing performance-critical functionality including: - - SCADA device integration - - Water distribution analysis (WDA) - - Pipe risk probability calculations - - Wrapped through `app.services.tjnetwork` interface +## Key Conventions -2. **Services Layer** (`app/services/`): - - `tjnetwork.py`: Main network API wrapper around native modules - - `simulation.py`: Hydraulic simulation orchestration (EPANET integration) - - `project_info.py`: Project configuration management - - `epanet/`: EPANET hydraulic engine integration +- **Async/Await**: The codebase heavily uses `async` and `await` for I/O operations, especially database interactions. +- **Database Management**: + - Connections are managed globally in `app.infra.db` and initialized in `lifespan` (app/main.py). + - Use `app.infra.db.dynamic_manager` for project-specific database connections (multi-tenancy/dynamic projects). +- **Pydantic**: extensively used for data validation and settings management. +- **Scripts**: The `scripts/` directory contains many utility scripts for maintenance, data processing, and server management. Check there before writing new operational scripts. +- **Water Network Modeling**: Interactions with water network models often involve `epanet` or `wntr` libraries. Be aware of domain-specific terminology (nodes, links, junctions, tanks). -3. **API Layer** (`app/api/v1/`): - - **Network Elements**: Separate endpoint modules for junctions, reservoirs, tanks, pipes, pumps, valves - - **Components**: Curves, patterns, controls, options, quality, visuals - - **Network Features**: Tags, demands, geometry, regions/DMAs - - **Core Services**: Auth, project, simulation, SCADA, data query, snapshots +## Code Style -4. **Database Infrastructure** (`app/infra/db/`): - - **PostgreSQL**: Primary relational database (users, audit logs, project metadata) - - **TimescaleDB**: Time-series extension for historical data - - **InfluxDB**: Optional time-series database for high-frequency SCADA data - - Connection pools initialized in `main.py` lifespan context - - Database instance stored in `app.state.db` for dependency injection - -5. **Domain Layer** (`app/domain/`): - - `models/`: Enums and domain objects (e.g., `UserRole`) - - `schemas/`: Pydantic models for request/response validation - -6. **Algorithms** (`app/algorithms/`): - - `api_ex/`: Analysis algorithms (k-means sensor placement, sensitivity analysis, pipeline health) - - `data_cleaning.py`: Data preprocessing utilities - - `simulations.py`: Simulation helpers - -### Security & Authentication - -- **Authentication**: JWT-based with access tokens (30 min) and refresh tokens (7 days) -- **Authorization**: Role-based access control (RBAC) with 4 roles: - - `VIEWER`: Read-only access - - `USER`: Read-write access - - `OPERATOR`: Modify data - - `ADMIN`: Full permissions -- **Audit Logging**: `AuditMiddleware` automatically logs POST/PUT/DELETE requests -- **Encryption**: Fernet symmetric encryption for sensitive data (`app.core.encryption`) - -Default admin accounts: - -- `admin` / `admin123` -- `tjwater` / `tjwater@123` - -### Key Files - -- `app/main.py`: FastAPI app initialization, lifespan (DB pools), CORS, middleware, router mounting -- `app/api/v1/router.py`: Central router aggregating all endpoint modules -- `app/core/config.py`: Settings management using `pydantic-settings` -- `app/auth/dependencies.py`: Auth dependencies (`get_current_active_user`, `get_db`) -- `app/auth/permissions.py`: Permission decorators (`require_role`, `get_current_admin`) -- `.env`: Environment configuration (database credentials, JWT secret, encryption key) - -## Important Conventions - -### Database Connections - -- Database instances are initialized in `main.py` lifespan and stored in `app.state.db` -- Access via dependency injection: - - ```python - from app.auth.dependencies import get_db - - async def endpoint(db = Depends(get_db)): - # Use db connection - ``` - -### Authentication in Endpoints - -Use dependency injection for auth requirements: - -```python -from app.auth.dependencies import get_current_active_user -from app.auth.permissions import require_role, get_current_admin -from app.domain.models.role import UserRole - -# Require any authenticated user -@router.get("/data") -async def get_data(current_user = Depends(get_current_active_user)): - return data - -# Require specific role (USER or higher) -@router.post("/data") -async def create_data(current_user = Depends(require_role(UserRole.USER))): - return result - -# Admin-only access -@router.delete("/data/{id}") -async def delete_data(id: int, current_user = Depends(get_current_admin)): - return result -``` - -### API Routing Structure - -- All v1 APIs are mounted under `/api/v1` prefix via `api_router` -- Legacy routes without version prefix are also mounted for backward compatibility -- Group related endpoints in separate router modules under `app/api/v1/endpoints/` -- Use descriptive tags in `router.py` for OpenAPI documentation grouping - -### Native Module Integration - -- Native modules are pre-compiled for specific platforms -- Always import through `app.native.api` or `app.services.tjnetwork` -- The `tjnetwork` service wraps native APIs with constants like: - - Element types: `JUNCTION`, `RESERVOIR`, `TANK`, `PIPE`, `PUMP`, `VALVE` - - Operations: `API_ADD`, `API_UPDATE`, `API_DELETE` - - `ChangeSet` for batch operations - -### Project Initialization - -- On startup, `main.py` automatically loads project from `project_info.name` if set -- Projects are opened via `open_project(name)` from `tjnetwork` service - -### Audit Logging - -Manual audit logging for critical operations: - -```python -from app.core.audit import log_audit_event, AuditAction - -await log_audit_event( - action=AuditAction.UPDATE, - user_id=current_user.id, - username=current_user.username, - resource_type="resource_name", - resource_id=str(resource_id), - ip_address=request.client.host, - request_data=data -) -``` - -### Environment Configuration - -- Copy `.env.example` to `.env` before first run -- Required environment variables: - - `SECRET_KEY`: JWT signing (generate with `openssl rand -hex 32`) - - `ENCRYPTION_KEY`: Data encryption (generate with Fernet) - - Database credentials for PostgreSQL, TimescaleDB, and optionally InfluxDB - -### Database Migrations - -SQL migration scripts are in `migrations/`: - -- `001_create_users_table.sql`: User authentication tables -- `002_create_audit_logs_table.sql`: Audit logging tables - -Apply with: - -```bash -psql -U postgres -d tjwater -f migrations/001_create_users_table.sql -``` - -## API Documentation - -- Swagger UI: http://localhost:8000/docs -- ReDoc: http://localhost:8000/redoc -- OpenAPI schema: http://localhost:8000/openapi.json - -## Additional Resources - -- `SECURITY_README.md`: Comprehensive security feature documentation -- `DEPLOYMENT.md`: Integration guide for security features -- `readme.md`: Project overview and directory structure (in Chinese) +- Follow standard PEP 8 guidelines. +- No specific linter configuration was found, so default to standard Python formatting. diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md deleted file mode 100644 index f7a2f33..0000000 --- a/DEPLOYMENT.md +++ /dev/null @@ -1,391 +0,0 @@ -# 部署和集成指南 - -本文档说明如何将新的安全功能集成到现有系统中。 - -## 📦 已完成的功能 - -### 1. 数据加密模块 -- ✅ `app/core/encryption.py` - Fernet 对称加密实现 -- ✅ 支持敏感数据加密/解密 -- ✅ 密钥管理和生成工具 - -### 2. 用户认证系统 -- ✅ `app/domain/models/role.py` - 用户角色枚举 (ADMIN/OPERATOR/USER/VIEWER) -- ✅ `app/domain/schemas/user.py` - 用户数据模型和验证 -- ✅ `app/infra/repositories/user_repository.py` - 用户数据访问层 -- ✅ `app/api/v1/endpoints/auth.py` - 注册/登录/刷新Token接口 -- ✅ `app/auth/dependencies.py` - 认证依赖项 -- ✅ `migrations/001_create_users_table.sql` - 用户表迁移脚本 - -### 3. 权限控制系统 -- ✅ `app/auth/permissions.py` - RBAC 权限控制装饰器 -- ✅ `app/api/v1/endpoints/user_management.py` - 用户管理接口示例 -- ✅ 支持基于角色的访问控制 -- ✅ 支持资源所有者检查 - -### 4. 审计日志系统 -- ✅ `app/core/audit.py` - 审计日志核心功能 -- ✅ `app/domain/schemas/audit.py` - 审计日志数据模型 -- ✅ `app/infra/repositories/audit_repository.py` - 审计日志数据访问层 -- ✅ `app/api/v1/endpoints/audit.py` - 审计日志查询接口 -- ✅ `app/infra/audit/middleware.py` - 自动审计中间件 -- ✅ `migrations/002_create_audit_logs_table.sql` - 审计日志表迁移脚本 - -### 5. 文档和测试 -- ✅ `SECURITY_README.md` - 完整的使用文档 -- ✅ `.env.example` - 环境变量配置模板 -- ✅ `tests/test_encryption.py` - 加密功能测试 - ---- - -## 🔧 集成步骤 - -### 步骤 1: 环境配置 - -1. 复制环境变量模板: -```bash -cp .env.example .env -``` - -2. 生成密钥并填写 `.env`: -```bash -# JWT 密钥 -openssl rand -hex 32 - -# 加密密钥 -python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" -``` - -3. 编辑 `.env` 填写所有必需的配置项。 - -### 步骤 2: 数据库迁移 - -执行数据库迁移脚本: - -```bash -# 方法 1: 使用 psql 命令 -psql -U postgres -d tjwater -f migrations/001_create_users_table.sql -psql -U postgres -d tjwater -f migrations/002_create_audit_logs_table.sql - -# 方法 2: 在 psql 交互界面 -psql -U postgres -d tjwater -\i migrations/001_create_users_table.sql -\i migrations/002_create_audit_logs_table.sql -``` - -验证表已创建: - -```sql --- 检查用户表 -SELECT * FROM users; - --- 检查审计日志表 -SELECT * FROM audit_logs; -``` - -### 步骤 3: 更新 main.py - -在 `app/main.py` 中集成新功能: - -```python -from fastapi import FastAPI -from app.core.config import settings -from app.infra.audit.middleware import AuditMiddleware - -app = FastAPI(title=settings.PROJECT_NAME) - -# 1. 添加审计中间件(可选) -app.add_middleware(AuditMiddleware) - -# 2. 注册路由 -from app.api.v1.endpoints import auth, user_management, audit - -app.include_router( - auth.router, - prefix=f"{settings.API_V1_STR}/auth", - tags=["认证"] -) - -app.include_router( - user_management.router, - prefix=f"{settings.API_V1_STR}/users", - tags=["用户管理"] -) - -app.include_router( - audit.router, - prefix=f"{settings.API_V1_STR}/audit", - tags=["审计日志"] -) - -# 3. 确保数据库在启动时初始化 -@app.on_event("startup") -async def startup_event(): - # 初始化数据库连接池 - from app.infra.db.postgresql.database import Database - global db - db = Database() - db.init_pool() - await db.open() - -@app.on_event("shutdown") -async def shutdown_event(): - # 关闭数据库连接 - await db.close() -``` - -### 步骤 4: 保护现有接口 - -#### 方法 1: 为路由添加全局依赖 - -```python -from app.auth.dependencies import get_current_active_user - -# 为整个路由器添加认证 -router = APIRouter(dependencies=[Depends(get_current_active_user)]) -``` - -#### 方法 2: 为单个端点添加依赖 - -```python -from app.auth.permissions import require_role, get_current_admin -from app.domain.models.role import UserRole - -@router.get("/data") -async def get_data( - current_user = Depends(require_role(UserRole.USER)) -): - """需要 USER 及以上角色""" - return {"data": "protected"} - -@router.delete("/data/{id}") -async def delete_data( - id: int, - current_user = Depends(get_current_admin) -): - """仅管理员可访问""" - return {"message": "deleted"} -``` - -### 步骤 5: 添加审计日志 - -#### 自动审计(推荐) - -使用中间件自动记录(已在 main.py 中添加): - -```python -app.add_middleware(AuditMiddleware) -``` - -#### 手动审计 - -在关键业务逻辑中手动记录: - -```python -from app.core.audit import log_audit_event, AuditAction - -@router.post("/important-action") -async def important_action( - data: dict, - request: Request, - current_user = Depends(get_current_active_user) -): - # 执行业务逻辑 - result = do_something(data) - - # 记录审计日志 - await log_audit_event( - action=AuditAction.UPDATE, - user_id=current_user.id, - username=current_user.username, - resource_type="important_resource", - resource_id=str(result.id), - ip_address=request.client.host, - request_data=data - ) - - return result -``` - -### 步骤 6: 更新 auth/dependencies.py - -确保 `get_db()` 函数正确获取数据库实例: - -```python -async def get_db() -> Database: - """获取数据库实例""" - # 方法 1: 从 main.py 导入 - from app.main import db - return db - - # 方法 2: 从 FastAPI app.state 获取 - # from fastapi import Request - # def get_db_from_request(request: Request): - # return request.app.state.db -``` - ---- - -## 🧪 测试 - -### 1. 测试加密功能 - -```bash -python tests/test_encryption.py -``` - -### 2. 测试 API - -启动服务器: - -```bash -uvicorn app.main:app --reload -``` - -访问交互式文档: -- Swagger UI: http://localhost:8000/docs -- ReDoc: http://localhost:8000/redoc - -### 3. 测试登录 - -```bash -curl -X POST "http://localhost:8000/api/v1/auth/login" \ - -H "Content-Type: application/x-www-form-urlencoded" \ - -d "username=admin&password=admin123" -``` - -### 4. 测试受保护接口 - -```bash -TOKEN="your-access-token" -curl -X GET "http://localhost:8000/api/v1/auth/me" \ - -H "Authorization: Bearer $TOKEN" -``` - ---- - -## 🔄 迁移现有接口 - -### 原有硬编码认证 - -**旧代码** (`app/api/v1/endpoints/auth.py`): -```python -AUTH_TOKEN = "567e33c876a2" - -async def verify_token(authorization: str = Header()): - token = authorization.split(" ")[1] - if token != AUTH_TOKEN: - raise HTTPException(status_code=403) -``` - -**新代码** (已更新): -```python -from app.auth.dependencies import get_current_active_user - -@router.get("/protected") -async def protected_route( - current_user = Depends(get_current_active_user) -): - return {"user": current_user.username} -``` - -### 更新其他端点 - -搜索项目中使用旧认证的地方: - -```bash -grep -r "AUTH_TOKEN" app/ -grep -r "verify_token" app/ -``` - -替换为新的依赖注入系统。 - ---- - -## 📋 检查清单 - -部署前检查: - -- [ ] 环境变量已配置(`.env`) -- [ ] 数据库迁移已执行 -- [ ] 默认管理员账号可登录 -- [ ] JWT Token 可正常生成和验证 -- [ ] 权限控制正常工作 -- [ ] 审计日志正常记录 -- [ ] 加密功能测试通过 -- [ ] API 文档可访问 - ---- - -## ⚠️ 注意事项 - -### 1. 向后兼容性 - -保留了简化版登录接口 `/auth/login/simple` 以兼容旧客户端: - -```python -@router.post("/login/simple") -async def login_simple(username: str, password: str): - # 验证并返回 Token - ... -``` - -### 2. 数据库连接 - -确保在 `app/auth/dependencies.py` 中 `get_db()` 函数能正确获取数据库实例。 - -### 3. 密钥安全 - -- ❌ 不要提交 `.env` 文件到版本控制 -- ✅ 在生产环境使用环境变量或密钥管理服务 -- ✅ 定期轮换 JWT 密钥 - -### 4. 性能考虑 - -- 审计中间件会增加每个请求的处理时间(约 5-10ms) -- 对高频接口可考虑异步记录审计日志 -- 定期清理或归档旧的审计日志 - ---- - -## 🐛 故障排查 - -### 问题 1: 导入错误 - -``` -ImportError: cannot import name 'db' from 'app.main' -``` - -**解决**: 确保在 `app/main.py` 中定义了全局 `db` 对象。 - -### 问题 2: 认证失败 - -``` -401 Unauthorized: Could not validate credentials -``` - -**检查**: -1. Token 是否正确设置在 `Authorization: Bearer {token}` header -2. Token 是否过期 -3. SECRET_KEY 是否配置正确 - -### 问题 3: 数据库连接失败 - -``` -psycopg.OperationalError: connection failed -``` - -**检查**: -1. PostgreSQL 是否运行 -2. `.env` 中数据库配置是否正确 -3. 数据库是否存在 - ---- - -## 📞 技术支持 - -详细文档请参考: -- `SECURITY_README.md` - 安全功能使用指南 -- `migrations/` - 数据库迁移脚本 -- `app/domain/schemas/` - 数据模型定义 - diff --git a/DOCUMENTATION_INDEX.md b/DOCUMENTATION_INDEX.md deleted file mode 100644 index fdcde5e..0000000 --- a/DOCUMENTATION_INDEX.md +++ /dev/null @@ -1,269 +0,0 @@ -# TJWater ServerBinary - Documentation Index - -## 📋 Complete Documentation Structure - -### 🆕 **NEW: Secondary Development Documentation** (Recommended Starting Point) - -#### 1. **QUICK_START_GUIDE.md** (7.5 KB, 326 lines) - **Perfect for**: Getting started in 15 minutes - - Quick reference card with copy-paste code - - 7 most common tasks with examples - - Common pitfalls and how to avoid them - - File location reference - - Key imports cheat sheet - - **Read first if**: You're new to the codebase and want quick examples - -#### 2. **SECONDARY_DEVELOPMENT_GUIDE.md** (29 KB, 1,015 lines) - **Perfect for**: Deep understanding of the system - - Complete architecture overview - - Detailed guide for all 7 key aspects - - Implementation patterns with code examples - - Technology stack reference - - Best practices and recommendations - - **Read after**: QUICK_START_GUIDE, or if you need comprehensive understanding - ---- - -### 📖 **Existing Documentation** (Supporting References) - -#### 3. **readme.md** (3.5 KB) - - Project overview - - Main features - - Quick start for running the server - - Directory structure introduction - -#### 4. **SECURITY_README.md** (11 KB) - - Security features overview - - Authentication setup - - Encryption implementation - - Audit logging features - -#### 5. **SECURITY_IMPLEMENTATION_SUMMARY.md** (9 KB) - - Detailed security implementation - - Role-based access control - - Password policies - - Encryption key management - -#### 6. **DEPLOYMENT.md** (8.7 KB) - - Production deployment checklist - - Docker configuration - - Database setup - - Environment configuration - -#### 7. **INTEGRATION_CHECKLIST.md** (8.3 KB) - - System integration steps - - Database initialization - - Service verification - - Health checks - -#### 8. **setup_server.md** (3.1 KB) - - Initial server setup - - Environment variables - - Database configuration - -#### 9. **setup_influxdb.md** (325 B) - - InfluxDB configuration reference - ---- - -## 🎯 Reading Paths by Role - -### For Backend Developers (Adding Features) -1. Start: **QUICK_START_GUIDE.md** (Section 1: Adding API Endpoints) -2. Then: **SECONDARY_DEVELOPMENT_GUIDE.md** (Sections 2-7) -3. Refer: **SECURITY_README.md** (authentication patterns) -4. Deploy: **DEPLOYMENT.md** (when ready for production) - -### For Database/ORM Developers -1. Start: **QUICK_START_GUIDE.md** (Section 2: Database Query Pattern) -2. Then: **SECONDARY_DEVELOPMENT_GUIDE.md** (Section 3: Database Patterns) -3. Refer: Database migration examples in `resources/sql/` - -### For Security/DevOps Engineers -1. Start: **SECURITY_README.md** -2. Then: **SECURITY_IMPLEMENTATION_SUMMARY.md** -3. Deploy: **DEPLOYMENT.md** -4. Reference: **SECONDARY_DEVELOPMENT_GUIDE.md** (Sections 5-6) - -### For QA/Testing Engineers -1. Start: **QUICK_START_GUIDE.md** (Section 7: Testing) -2. Then: **SECONDARY_DEVELOPMENT_GUIDE.md** (Section 7: Testing Setup) -3. Review: `tests/` directory for examples - -### For New Team Members -1. Start: **readme.md** (project overview) -2. Then: **QUICK_START_GUIDE.md** (30-minute overview) -3. Deep Dive: **SECONDARY_DEVELOPMENT_GUIDE.md** (comprehensive reference) -4. Explore: Source code with documentation as reference - ---- - -## 📚 Documentation by Topic - -### API Development -- **QUICK_START_GUIDE.md** § 1: Adding a New API Endpoint -- **SECONDARY_DEVELOPMENT_GUIDE.md** § 2: API Endpoint Addition - -### Authentication & Authorization -- **QUICK_START_GUIDE.md** § 3: Role-Based Access Control -- **SECURITY_README.md**: Complete auth guide -- **SECONDARY_DEVELOPMENT_GUIDE.md** § 5: Auth Mechanisms -- **SECURITY_IMPLEMENTATION_SUMMARY.md**: Implementation details - -### Database & Data Access -- **QUICK_START_GUIDE.md** § 2: Database Query Pattern -- **SECONDARY_DEVELOPMENT_GUIDE.md** § 3: Database Patterns -- Source: `app/infra/repositories/` (examples) - -### Native Code Integration -- **QUICK_START_GUIDE.md** § 4: Call Native Code -- **SECONDARY_DEVELOPMENT_GUIDE.md** § 4: Native Module Integration - -### Configuration Management -- **QUICK_START_GUIDE.md** § 6: Configuration -- **SECONDARY_DEVELOPMENT_GUIDE.md** § 6: Configuration Management -- Reference: `app/core/config.py` - -### Security & Encryption -- **QUICK_START_GUIDE.md** § 5: Encryption & Security -- **SECURITY_README.md**: Complete guide -- **SECONDARY_DEVELOPMENT_GUIDE.md** § 6: Configuration (encryption keys) - -### Testing -- **QUICK_START_GUIDE.md** § 7: Testing -- **SECONDARY_DEVELOPMENT_GUIDE.md** § 7: Testing Setup -- Examples: `tests/` directory - -### Deployment -- **DEPLOYMENT.md**: Complete deployment guide -- **INTEGRATION_CHECKLIST.md**: Integration steps -- **setup_server.md**: Initial setup - ---- - -## 🔍 Quick Reference Table - -| Topic | Quick Start | Comprehensive | Implementation | -|-------|------------|---------------|-----------------| -| **APIs** | § 1 QSG | § 2 SDG | `app/api/v1/` | -| **Database** | § 2 QSG | § 3 SDG | `app/infra/db/` | -| **Native Code** | § 4 QSG | § 4 SDG | `app/native/wndb/` | -| **Auth** | § 3 QSG | § 5 SDG | `app/auth/` | -| **Config** | § 6 QSG | § 6 SDG | `app/core/config.py` | -| **Testing** | § 7 QSG | § 7 SDG | `tests/` | -| **Security** | SECURITY_README.md | SECURITY_IMPL_SUMMARY.md | `app/core/security.py` | -| **Deployment** | setup_server.md | DEPLOYMENT.md | `infra/docker/` | - -**Legend**: QSG = QUICK_START_GUIDE.md, SDG = SECONDARY_DEVELOPMENT_GUIDE.md - ---- - -## 📂 Documentation File Locations - -``` -TJWaterServerBinary/ -├── SECONDARY_DEVELOPMENT_GUIDE.md ← Start here (comprehensive) -├── QUICK_START_GUIDE.md ← Start here (quick) -├── readme.md ← Project overview -├── SECURITY_README.md ← Security features -├── SECURITY_IMPLEMENTATION_SUMMARY.md ← Security details -├── DEPLOYMENT.md ← Production deployment -├── INTEGRATION_CHECKLIST.md ← Integration steps -├── setup_server.md ← Initial setup -├── setup_influxdb.md ← InfluxDB config -└── DOCUMENTATION_INDEX.md ← You are here -``` - ---- - -## 🚀 Getting Started Checklist - -- [ ] Read `readme.md` for project overview -- [ ] Read `QUICK_START_GUIDE.md` for hands-on examples -- [ ] Read `SECONDARY_DEVELOPMENT_GUIDE.md` for deep knowledge -- [ ] Set up environment (`.env` file) -- [ ] Review `app/main.py` (83 lines - very readable) -- [ ] Review `app/api/v1/router.py` (98 lines - all endpoints listed) -- [ ] Pick a simple endpoint to understand -- [ ] Try adding a test endpoint -- [ ] Review security setup (`SECURITY_README.md`) -- [ ] Set up local development environment - ---- - -## 💡 Key Learning Points - -1. **FastAPI Architecture**: See `app/main.py` (83 lines) - clean and simple -2. **Router Pattern**: See `app/api/v1/router.py` (98 lines) - 30+ routers included -3. **Repository Pattern**: See `app/infra/repositories/` - data access layer -4. **Auth Patterns**: See `app/auth/dependencies.py` - JWT validation -5. **Permission Decorators**: See `app/auth/permissions.py` - RBAC -6. **Config Management**: See `app/core/config.py` (82 lines) - Pydantic Settings -7. **Database Pooling**: See `app/infra/db/postgresql/database.py` - async pools -8. **Native Integration**: See `app/native/wndb/__init__.py` - 100+ wrapped functions - ---- - -## 📞 Documentation Maintenance - -These documents are maintained as part of the secondary development guide. - -**Last Updated**: 2024-03-09 - -**Covered Sections**: -- ✅ Project structure and key directories -- ✅ API endpoint addition (router registration) -- ✅ Database interaction patterns (ORMs, migrations) -- ✅ Native module integration -- ✅ Authentication and authorization mechanisms -- ✅ Configuration management -- ✅ Testing setup - ---- - -## 🎓 Recommended Learning Order - -### Week 1: Foundations -1. Project overview (`readme.md`) -2. Quick Start Guide (`QUICK_START_GUIDE.md`) -3. Architecture (`SECONDARY_DEVELOPMENT_GUIDE.md` § 1) - -### Week 2: Core Development -4. API Development (`SECONDARY_DEVELOPMENT_GUIDE.md` § 2) -5. Database Patterns (`SECONDARY_DEVELOPMENT_GUIDE.md` § 3) -6. Native Integration (`SECONDARY_DEVELOPMENT_GUIDE.md` § 4) - -### Week 3: Security & Operations -7. Auth & Permissions (`SECONDARY_DEVELOPMENT_GUIDE.md` § 5) -8. Configuration (`SECONDARY_DEVELOPMENT_GUIDE.md` § 6) -9. Testing (`SECONDARY_DEVELOPMENT_GUIDE.md` § 7) - -### Week 4: Deployment & Maintenance -10. Security Setup (`SECURITY_README.md`) -11. Deployment (`DEPLOYMENT.md`) -12. Integration (`INTEGRATION_CHECKLIST.md`) - ---- - -## ❓ FAQ - -**Q: Where do I start?** -A: If you have 30 minutes: `QUICK_START_GUIDE.md`. If you have 2 hours: `SECONDARY_DEVELOPMENT_GUIDE.md`. - -**Q: How do I add a new API endpoint?** -A: See `QUICK_START_GUIDE.md` § 1 or `SECONDARY_DEVELOPMENT_GUIDE.md` § 2. - -**Q: How do I implement database queries?** -A: See `QUICK_START_GUIDE.md` § 2 or `SECONDARY_DEVELOPMENT_GUIDE.md` § 3. - -**Q: How does authentication work?** -A: See `QUICK_START_GUIDE.md` § 3 or `SECONDARY_DEVELOPMENT_GUIDE.md` § 5. - -**Q: Where is the code?** -A: Key files are referenced in all guides. Start with `app/main.py`, `app/api/v1/router.py`, `app/core/config.py`. - ---- - -*This documentation index helps secondary development teams navigate the comprehensive TJWater ServerBinary codebase efficiently.* diff --git a/INTEGRATION_CHECKLIST.md b/INTEGRATION_CHECKLIST.md deleted file mode 100644 index 28eff2b..0000000 --- a/INTEGRATION_CHECKLIST.md +++ /dev/null @@ -1,322 +0,0 @@ -# API 集成检查清单 - -## ✅ 已完成的集成工作 - -### 1. 路由集成 (app/api/v1/router.py) - -已添加以下路由到 API Router: - -```python -# 新增导入 -from app.api.v1.endpoints import ( - ... - user_management, # 用户管理 - audit, # 审计日志 -) - -# 新增路由 -api_router.include_router(user_management.router, prefix="/users", tags=["User Management"]) -api_router.include_router(audit.router, prefix="/audit", tags=["Audit Logs"]) -``` - -**路由端点**: -- `/api/v1/auth/` - 认证相关(register, login, me, refresh) -- `/api/v1/users/` - 用户管理(CRUD操作,仅管理员) -- `/api/v1/audit/` - 审计日志查询(仅管理员) - -### 2. 主应用配置 (app/main.py) - -#### 2.1 导入更新 -```python -from app.core.config import settings -from app.infra.audit.middleware import AuditMiddleware -``` - -#### 2.2 数据库初始化 -```python -# 在 lifespan 中存储数据库实例到 app.state -app.state.db = pgdb -``` - -#### 2.3 FastAPI 配置 -```python -app = FastAPI( - lifespan=lifespan, - title=settings.PROJECT_NAME, - description="TJWater Server - 供水管网智能管理系统", - version="1.0.0", - docs_url="/docs", - redoc_url="/redoc", -) -``` - -#### 2.4 审计中间件(可选) -```python -# 取消注释以启用审计日志 -# app.add_middleware(AuditMiddleware) -``` - -### 3. 依赖项更新 (app/auth/dependencies.py) - -更新 `get_db()` 函数从 Request 对象获取数据库: - -```python -async def get_db(request: Request) -> Database: - """从 app.state 获取数据库实例""" - if not hasattr(request.app.state, "db"): - raise HTTPException( - status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail="Database not initialized" - ) - return request.app.state.db -``` - -### 4. 审计日志更新 - -- `app/api/v1/endpoints/audit.py` - 使用正确的数据库依赖 -- `app/core/audit.py` - 接受可选的 db 参数 - ---- - -## 📋 部署前检查清单 - -### 环境配置 -- [ ] 复制 `.env.example` 为 `.env` -- [ ] 配置 `SECRET_KEY`(JWT密钥) -- [ ] 配置 `ENCRYPTION_KEY`(数据加密密钥) -- [ ] 配置数据库连接信息 - -### 数据库迁移 -- [ ] 执行用户表迁移:`psql -U postgres -d tjwater -f migrations/001_create_users_table.sql` -- [ ] 执行审计日志表迁移:`psql -U postgres -d tjwater -f migrations/002_create_audit_logs_table.sql` -- [ ] 验证表已创建:`\dt` 在 psql 中 - -### 依赖检查 -- [ ] 确认已安装:`cryptography` -- [ ] 确认已安装:`python-jose[cryptography]` -- [ ] 确认已安装:`passlib[bcrypt]` -- [ ] 确认已安装:`email-validator`(用于 Pydantic email 验证) - -### 代码验证 -- [ ] 检查所有文件导入正常 -- [ ] 运行加密功能测试:`python tests/test_encryption.py` -- [ ] 启动服务器:`uvicorn app.main:app --reload` -- [ ] 访问 API 文档:http://localhost:8000/docs - -### API 测试 -- [ ] 测试登录:POST `/api/v1/auth/login` -- [ ] 测试获取当前用户:GET `/api/v1/auth/me` -- [ ] 测试用户列表(需管理员):GET `/api/v1/users/` -- [ ] 测试审计日志(需管理员):GET `/api/v1/audit/logs` - ---- - -## 🔧 快速测试命令 - -### 1. 生成密钥 -```bash -# JWT 密钥 -openssl rand -hex 32 - -# 加密密钥 -python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" -``` - -### 2. 执行迁移 -```bash -cd /home/zhifu/TJWaterServer/TJWaterServerBinary -psql -U postgres -d tjwater -f migrations/001_create_users_table.sql -psql -U postgres -d tjwater -f migrations/002_create_audit_logs_table.sql -``` - -### 3. 测试加密 -```bash -python tests/test_encryption.py -``` - -### 4. 启动服务器 -```bash -uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 -``` - -### 5. 测试登录 API -```bash -# 使用默认管理员账号 -curl -X POST "http://localhost:8000/api/v1/auth/login" \ - -H "Content-Type: application/x-www-form-urlencoded" \ - -d "username=admin&password=admin123" - -# 或使用迁移的账号 -curl -X POST "http://localhost:8000/api/v1/auth/login" \ - -H "Content-Type: application/x-www-form-urlencoded" \ - -d "username=tjwater&password=tjwater@123" -``` - -### 6. 测试受保护接口 -```bash -# 保存 Token -TOKEN="<从登录响应中获取的 access_token>" - -# 获取当前用户信息 -curl -X GET "http://localhost:8000/api/v1/auth/me" \ - -H "Authorization: Bearer $TOKEN" - -# 获取用户列表(需管理员权限) -curl -X GET "http://localhost:8000/api/v1/users/" \ - -H "Authorization: Bearer $TOKEN" - -# 查询审计日志(需管理员权限) -curl -X GET "http://localhost:8000/api/v1/audit/logs" \ - -H "Authorization: Bearer $TOKEN" -``` - ---- - -## 📚 API 端点总览 - -### 认证接口 (`/api/v1/auth`) - -| 方法 | 端点 | 描述 | 权限 | -|------|------|------|------| -| POST | `/register` | 用户注册 | 公开 | -| POST | `/login` | OAuth2 登录 | 公开 | -| POST | `/login/simple` | 简化登录(兼容旧版) | 公开 | -| GET | `/me` | 获取当前用户信息 | 认证用户 | -| POST | `/refresh` | 刷新 Token | 认证用户 | - -### 用户管理 (`/api/v1/users`) - -| 方法 | 端点 | 描述 | 权限 | -|------|------|------|------| -| GET | `/` | 获取用户列表 | 管理员 | -| GET | `/{id}` | 获取用户详情 | 所有者/管理员 | -| PUT | `/{id}` | 更新用户信息 | 所有者/管理员 | -| DELETE | `/{id}` | 删除用户 | 管理员 | -| POST | `/{id}/activate` | 激活用户 | 管理员 | -| POST | `/{id}/deactivate` | 停用用户 | 管理员 | - -### 审计日志 (`/api/v1/audit`) - -| 方法 | 端点 | 描述 | 权限 | -|------|------|------|------| -| GET | `/logs` | 查询审计日志 | 管理员 | -| GET | `/logs/count` | 获取日志总数 | 管理员 | -| GET | `/logs/my` | 查看我的操作记录 | 认证用户 | - ---- - -## ⚠️ 注意事项 - -### 1. 审计中间件 -审计中间件默认是**禁用**的。如需启用,在 `app/main.py` 中取消注释: - -```python -app.add_middleware(AuditMiddleware) -``` - -**注意**:启用后会自动记录所有 POST/PUT/DELETE 请求,可能增加数据库负载。 - -### 2. 向后兼容 -保留了原有的简化登录接口 `/auth/login/simple`,可以直接使用查询参数: - -```bash -POST /api/v1/auth/login/simple?username=admin&password=admin123 -``` - -### 3. 数据库连接 -确保数据库实例在应用启动时正确初始化并存储到 `app.state.db`。 - -### 4. 权限控制示例 -为现有接口添加权限控制: - -```python -from app.auth.permissions import require_role, get_current_admin -from app.domain.models.role import UserRole - -# 需要管理员权限 -@router.delete("/resource/{id}") -async def delete_resource( - id: int, - current_user = Depends(get_current_admin) -): - ... - -# 需要操作员以上权限 -@router.post("/resource") -async def create_resource( - data: dict, - current_user = Depends(require_role(UserRole.OPERATOR)) -): - ... -``` - ---- - -## 🚀 完整启动流程 - -```bash -# 1. 进入项目目录 -cd /home/zhifu/TJWaterServer/TJWaterServerBinary - -# 2. 配置环境变量(如果还没有) -cp .env.example .env -# 编辑 .env 填写必要的配置 - -# 3. 执行数据库迁移(如果还没有) -psql -U postgres -d tjwater < migrations/001_create_users_table.sql -psql -U postgres -d tjwater < migrations/002_create_audit_logs_table.sql - -# 4. 测试加密功能 -python tests/test_encryption.py - -# 5. 启动服务器 -uvicorn app.main:app --reload - -# 6. 访问 API 文档 -# 浏览器打开: http://localhost:8000/docs -``` - ---- - -## 📞 故障排查 - -### 问题 1: 导入错误 -``` -ModuleNotFoundError: No module named 'jose' -``` -**解决**: 安装依赖 `pip install python-jose[cryptography]` - -### 问题 2: 数据库未初始化 -``` -503 Service Unavailable: Database not initialized -``` -**解决**: 检查 `main.py` 中的 lifespan 函数是否正确设置 `app.state.db` - -### 问题 3: Token 验证失败 -``` -401 Unauthorized: Could not validate credentials -``` -**解决**: -1. 检查 SECRET_KEY 是否配置正确 -2. 确认 Token 格式:`Authorization: Bearer {token}` -3. 检查 Token 是否过期 - -### 问题 4: 表不存在 -``` -relation "users" does not exist -``` -**解决**: 执行数据库迁移脚本 - ---- - -## 📖 相关文档 - -- **使用指南**: `SECURITY_README.md` -- **部署指南**: `DEPLOYMENT.md` -- **实施总结**: `SECURITY_IMPLEMENTATION_SUMMARY.md` -- **自动设置**: `setup_security.sh` - ---- - -**最后更新**: 2026-02-02 -**状态**: ✅ API 已完全集成 diff --git a/QUICK_START_GUIDE.md b/QUICK_START_GUIDE.md deleted file mode 100644 index e5956ea..0000000 --- a/QUICK_START_GUIDE.md +++ /dev/null @@ -1,326 +0,0 @@ -# TJWater ServerBinary - Quick Reference for Secondary Development - -## 1️⃣ Adding a New API Endpoint (30 seconds) - -### File: `app/api/v1/endpoints/my_feature.py` -```python -from fastapi import APIRouter, Depends -from app.auth.dependencies import get_current_active_user -from app.domain.schemas.user import UserInDB - -router = APIRouter() - -@router.get("/list") -async def list_items(user: UserInDB = Depends(get_current_active_user)): - return {"items": []} - -@router.post("/create") -async def create_item(data: dict, user: UserInDB = Depends(get_current_active_user)): - return {"status": "created"} -``` - -### File: `app/api/v1/router.py` (Add 2 lines) -```python -from app.api.v1.endpoints import my_feature - -api_router.include_router(my_feature.router, prefix="/items", tags=["Items"]) -``` - -**Done!** Endpoint available at `POST /api/v1/items/create` - ---- - -## 2️⃣ Database Query Pattern - -### Using Repository -```python -from app.infra.repositories.user_repository import UserRepository -from app.auth.dependencies import get_user_repository - -@router.get("/user/{user_id}") -async def get_user(user_id: int, user_repo: UserRepository = Depends(get_user_repository)): - user = await user_repo.get_user_by_id(user_id) - return user -``` - -### Direct Query (if no repository exists) -```python -async with db.get_connection() as conn: - async with conn.cursor() as cur: - await cur.execute("SELECT * FROM users WHERE id = %s", (user_id,)) - row = await cur.fetchone() - return dict(row) if row else None -``` - ---- - -## 3️⃣ Role-Based Access Control - -```python -from app.auth.permissions import require_admin, require_role -from app.domain.models.role import UserRole - -# Admin only -@router.delete("/users/{user_id}") -async def delete_user(user_id: int, admin: UserInDB = Depends(require_admin)): - pass - -# Operator or higher -@router.post("/projects/") -async def create_project(user: UserInDB = Depends(require_role(UserRole.OPERATOR))): - pass - -# Custom role check -def require_viewer(): - return require_role(UserRole.VIEWER) - -@router.get("/reports") -async def get_reports(user: UserInDB = Depends(require_viewer)): - pass -``` - ---- - -## 4️⃣ Call Native (Binary) Code - -```python -from app.native.wndb import get_all_junctions, add_junction, set_junction - -# Read network elements -junctions = get_all_junctions() - -# Create -add_junction({"id": "J1", "x": 0.0, "y": 0.0, "demand": 100.0}) - -# Update -set_junction("J1", {"demand": 150.0}) - -# Get constants -from app.native.wndb import PIPE_STATUS_OPEN, OPTION_UNITS_LPS -``` - ---- - -## 5️⃣ Encryption & Security - -### Encrypt Sensitive Data -```python -from app.core.encryption import get_encryptor - -encryptor = get_encryptor() - -encrypted = encryptor.encrypt("secret_password") -decrypted = encryptor.decrypt(encrypted) -``` - -### Verify Password -```python -from app.core.security import verify_password, get_password_hash - -# When creating user -hashed = get_password_hash(user.password) - -# When checking login -if verify_password(form_data.password, stored_hash): - # Correct password - pass -``` - ---- - -## 6️⃣ Configuration - -### In `.env` file -```bash -SECRET_KEY=your-secret-key -ENCRYPTION_KEY=your-fernet-key -DB_HOST=localhost -DB_PORT=5432 -``` - -### Use in Code -```python -from app.core.config import settings - -db_url = settings.SQLALCHEMY_DATABASE_URI -token_minutes = settings.ACCESS_TOKEN_EXPIRE_MINUTES -``` - ---- - -## 7️⃣ Testing - -```python -# tests/unit/test_my_feature.py -import pytest - -def test_my_function(): - result = my_function() - assert result == expected - -# Run tests -pytest tests/ -v -pytest tests/unit/test_my_feature.py::test_my_function -v -``` - ---- - -## 🗺️ Directory Quick Map - -| Path | What | Use For | -|------|------|---------| -| `app/api/v1/endpoints/` | API routes | Add new endpoints | -| `app/auth/` | Auth logic | Login, permissions | -| `app/domain/` | Models/Schemas | Data structures | -| `app/infra/db/` | DB access | Queries, repositories | -| `app/services/` | Business logic | Complex operations | -| `app/native/wndb/` | Binary functions | Network simulation | -| `app/core/` | Core utilities | Config, security, encryption | -| `tests/` | Tests | Unit & integration tests | - ---- - -## 🔑 Key Imports - -```python -# Authentication -from app.auth.dependencies import get_current_active_user, get_user_repository -from app.auth.permissions import require_admin, require_role - -# Database -from app.infra.db.postgresql.database import db, get_database_instance -from app.infra.repositories.user_repository import UserRepository - -# Schemas & Models -from app.domain.schemas.user import UserInDB, UserCreate, Token -from app.domain.models.role import UserRole - -# Security -from app.core.security import create_access_token, verify_password, get_password_hash -from app.core.encryption import get_encryptor - -# Config -from app.core.config import settings - -# Native API -from app.native.wndb import get_all_junctions, add_junction, open_project -``` - ---- - -## 🚀 Common Tasks - -### Register New User -```python -from app.infra.repositories.user_repository import UserRepository -from app.domain.schemas.user import UserCreate -from app.domain.models.role import UserRole - -user_data = UserCreate( - username="john", - email="john@example.com", - password="securepass", - role=UserRole.USER -) -new_user = await user_repo.create_user(user_data) -``` - -### Query Database -```python -async with db.get_connection() as conn: - async with conn.cursor() as cur: - await cur.execute("SELECT * FROM users LIMIT 10") - rows = await cur.fetchall() - return [dict(r) for r in rows] -``` - -### Run Simulation -```python -from app.services.simulation import run_simulation - -result = await run_simulation( - project_name="szh", - duration=3600, - time_step=60 -) -``` - -### Audit Operation -```python -from app.core.audit import log_audit_event, AuditAction - -await log_audit_event( - action=AuditAction.CREATE, - resource_type="pipe", - resource_id="P1", - actor_id=user.id, - details={"diameter": 100, "material": "PVC"} -) -``` - ---- - -## ⚠️ Common Gotchas - -1. **Always use `Depends()`** for injecting repositories, users - ```python - # ✅ Right - async def endpoint(user: UserInDB = Depends(get_current_active_user)): - - # ❌ Wrong - async def endpoint(user: UserInDB): - ``` - -2. **Use parametrized queries** to prevent SQL injection - ```python - # ✅ Right - await cur.execute("SELECT * FROM users WHERE id = %s", (user_id,)) - - # ❌ Wrong - await cur.execute(f"SELECT * FROM users WHERE id = {user_id}") - ``` - -3. **Async/await** required for database operations - ```python - # ✅ Right - user = await user_repo.get_user_by_id(1) - - # ❌ Wrong - user = user_repo.get_user_by_id(1) # Missing await - ``` - -4. **Role hierarchy** for permission checks - ```python - # All levels include higher permissions - VIEWER (1) < USER (2) < OPERATOR (3) < ADMIN (4) - ``` - ---- - -## 📞 File Locations Reference - -- **Main app entry**: `app/main.py` (83 lines) -- **Central router**: `app/api/v1/router.py` (98 lines) -- **Config**: `app/core/config.py` (82 lines) -- **Auth dependencies**: `app/auth/dependencies.py` -- **Permissions**: `app/auth/permissions.py` -- **Database**: `app/infra/db/postgresql/database.py` -- **Repositories**: `app/infra/repositories/` -- **Schemas**: `app/domain/schemas/` -- **Models**: `app/domain/models/` - ---- - -## 📚 Full Documentation - -See **SECONDARY_DEVELOPMENT_GUIDE.md** for comprehensive guide on: -- Architecture overview -- Detailed endpoint creation -- Database patterns -- Native module integration -- Testing setup -- Deployment - ---- - -*Generated for TJWater ServerBinary secondary development team* diff --git a/SECONDARY_DEVELOPMENT_GUIDE.md b/SECONDARY_DEVELOPMENT_GUIDE.md deleted file mode 100644 index 641f07f..0000000 --- a/SECONDARY_DEVELOPMENT_GUIDE.md +++ /dev/null @@ -1,1015 +0,0 @@ -# TJWater ServerBinary - Secondary Development Documentation Guide - -## Executive Summary - -TJWaterServerBinary is a **FastAPI-based water distribution network management system** with integrated EPANET simulation, SCADA data management, and comprehensive security architecture. This guide identifies key components and patterns essential for secondary development. - ---- - -## 1. Project Structure & Key Directories - -### Overall Architecture -``` -TJWaterServerBinary/ -├── app/ -│ ├── main.py # FastAPI application entry + lifecycle management -│ ├── api/v1/ # API routes and endpoints -│ ├── algorithms/ # Core algorithms (simulation, leakage detection, etc.) -│ ├── auth/ # Authentication logic and dependencies -│ ├── core/ # Core configuration, security, encryption -│ ├── domain/ # Domain models and Pydantic schemas -│ ├── infra/ # Infrastructure layer (DB, cache, audit) -│ ├── services/ # Business logic services -│ ├── native/ # Native module integration (binary/compiled code) -│ └── utils/ # Utility functions -├── infra/docker/ # Docker and deployment configs -├── resources/sql/ # SQL initialization scripts -├── tests/ # Unit and integration tests -└── requirements.txt # Python dependencies -``` - -### Key Directory Details - -| Directory | Purpose | Key Files | -|-----------|---------|-----------| -| **api/v1** | REST API endpoints organized by domain | `router.py` (centralized registration), `endpoints/` (individual controllers) | -| **domain** | Data models and schemas | `models/role.py`, `schemas/user.py`, `schemas/audit.py` | -| **infra** | Database access, caching, audit | `db/postgresql/`, `db/timescaledb/`, `cache/`, `audit/` | -| **auth** | JWT/OAuth2 validation, permissions | `dependencies.py`, `permissions.py`, `keycloak_dependencies.py` | -| **core** | Security, encryption, config | `config.py`, `security.py`, `encryption.py`, `audit.py` | -| **native** | Python-to-binary integration | `api/` module wrapping compiled code | -| **services** | Business logic & orchestration | `tjnetwork.py` (project management), `simulation.py`, etc. | - ---- - -## 2. API Endpoint Addition (Router Registration) - -### How to Add New API Endpoints - -#### Step 1: Create Endpoint File -Create a new file in `app/api/v1/endpoints/` with your endpoint handlers: - -```python -# app/api/v1/endpoints/my_feature.py -from fastapi import APIRouter, Depends, HTTPException, status -from app.auth.dependencies import get_current_active_user -from app.domain.schemas.user import UserInDB -from app.infra.repositories.my_repository import MyRepository -from app.auth.dependencies import get_user_repository - -router = APIRouter() - -@router.get("/my-feature/") -async def get_my_feature(user: UserInDB = Depends(get_current_active_user)): - """Get feature data""" - return {"feature": "data"} - -@router.post("/my-feature/") -async def create_my_feature( - data: dict, - user: UserInDB = Depends(get_current_active_user), -): - """Create new feature""" - return {"status": "created"} -``` - -#### Step 2: Register Router in Central Router -Edit `app/api/v1/router.py` to include your new router: - -```python -# app/api/v1/router.py -from app.api.v1.endpoints import my_feature # Import your endpoint module - -api_router = APIRouter() - -# Add your router -api_router.include_router( - my_feature.router, - prefix="/my-feature", # Optional: URL prefix - tags=["My Feature"] # For OpenAPI documentation -) -``` - -#### Step 3: Authentication & Authorization -- **No Auth Required**: Endpoint is public -- **Authenticated Users**: Use `Depends(get_current_active_user)` -- **Role-Based Access**: Use `Depends(require_admin)` or `Depends(require_role(UserRole.OPERATOR))` - -```python -from app.auth.permissions import require_admin, require_role -from app.domain.models.role import UserRole - -@router.post("/admin-only/") -async def admin_only(user: UserInDB = Depends(require_admin)): - return {"admin": user.username} -``` - -#### Step 4: Response Models -Use Pydantic schemas for validation: - -```python -from pydantic import BaseModel -from typing import Optional - -class MyFeatureResponse(BaseModel): - id: int - name: str - status: Optional[str] = None - -@router.get("/my-feature/{id}", response_model=MyFeatureResponse) -async def get_feature(id: int): - return MyFeatureResponse(id=id, name="Feature", status="active") -``` - -### Router Registration Pattern -The central router (`app/api/v1/router.py`) uses `include_router()` to compose all endpoints: - -```python -# Current structure (98 lines): -api_router.include_router(auth.router, prefix="/auth", tags=["Auth"]) -api_router.include_router(project.router, tags=["Project"]) -api_router.include_router(simulation.router, tags=["Simulation Control"]) -# ... 30+ more routers -``` - ---- - -## 3. Database Interaction Patterns - -### ORM & Database Strategy -**TJWater uses psycopg (PostgreSQL async driver) directly, NOT SQLAlchemy ORM** - -#### Multiple Database Types -- **PostgreSQL**: Main relational data (users, metadata) -- **TimescaleDB**: Time-series data (SCADA, sensor readings) -- **InfluxDB**: Alternative time-series storage (optional) -- **Metadata DB**: Separate instance (`system_hub` database) - -### Database Layer Architecture - -#### 1. Database Instances (`app/infra/db/postgresql/database.py`) - -```python -class Database: - """Manages async connection pooling""" - - def __init__(self, db_name=None): - self.pool = None - self.db_name = db_name - - def init_pool(self, db_name=None): - """Initialize connection pool""" - self.pool = psycopg_pool.AsyncConnectionPool(...) - - async def get_connection(self) -> AsyncGenerator: - """Yield connection from pool""" - async with self.pool.connection() as conn: - yield conn - -# Global instances -db = Database() # Default PostgreSQL -_database_instances = {} # Per-project caches -``` - -#### 2. Repository Pattern (`app/infra/repositories/`) - -```python -class UserRepository: - """Data access layer for users""" - - def __init__(self, db: Database): - self.db = db - - async def create_user(self, user: UserCreate) -> Optional[UserInDB]: - query = """ - INSERT INTO users (username, email, hashed_password, role) - VALUES (%(username)s, %(email)s, %(hashed_password)s, %(role)s) - RETURNING id, username, email, role, created_at - """ - async with self.db.get_connection() as conn: - async with conn.cursor() as cur: - await cur.execute(query, { - 'username': user.username, - 'email': user.email, - 'hashed_password': get_password_hash(user.password), - 'role': user.role.value - }) - row = await cur.fetchone() - return UserInDB(**row) if row else None -``` - -#### 3. Query Execution Pattern - -```python -# Reading data -async with db.get_connection() as conn: - async with conn.cursor() as cur: - await cur.execute("SELECT * FROM users WHERE id = %s", (user_id,)) - row = await cur.fetchone() # Returns dict_row - -# Writing data -async with db.get_connection() as conn: - async with conn.cursor() as cur: - await cur.execute( - "UPDATE users SET email = %s WHERE id = %s", - (new_email, user_id) - ) - # conn auto-commits (if autocommit=True in pool config) -``` - -### Database Configuration - -Via `app/core/config.py` and `.env`: - -```python -# Main PostgreSQL (users, metadata) -DB_HOST = "localhost" -DB_PORT = "5432" -DB_NAME = "tjwater" -DB_USER = "postgres" -DB_PASSWORD = "password" - -# TimescaleDB (time-series) -TIMESCALEDB_DB_HOST = "localhost" -TIMESCALEDB_DB_PORT = "5433" -TIMESCALEDB_DB_NAME = "szh" - -# Metadata DB (system info) -METADATA_DB_NAME = "system_hub" -``` - -### Dynamic Multi-Database Support - -Project-specific databases are managed dynamically: - -```python -# app/infra/db/dynamic_manager.py -async def get_database_instance(db_name: Optional[str] = None) -> Database: - """Get or create DB instance for project""" - if not db_name: - return db # Default instance - - if db_name not in _database_instances: - instance = Database(db_name=db_name) - instance.init_pool() - await instance.open() - _database_instances[db_name] = instance - - return _database_instances[db_name] -``` - -### Migrations & Schema Creation - -- **Location**: `resources/sql/` contains initialization scripts -- **Naming**: Numbered order (e.g., `002_create_audit_logs_table.sql`) -- **Approach**: SQL scripts are manually executed; no Alembic/Flyway framework -- **Example**: `resources/sql/002_create_audit_logs_table.sql` - ---- - -## 4. Native Module Integration - -### Architecture: Python ↔ Binary Code - -TJWater integrates compiled C/Go binaries for water network simulation: - -``` -Python (FastAPI) - ↓ -app/native/wndb/ - ├── project.py (list, create, delete, open projects) - ├── s2_junctions.py (CRUD for junctions) - ├── s5_pipes.py (CRUD for pipes) - └── [40+ schema modules] (network elements) - ↓ -app/native/api_encap/ (Low-level binary wrappers) - └── api.so / api.dll (Compiled binary library) -``` - -### How Python Calls Native Code - -#### 1. Native API Initialization -```python -# app/native/wndb/__init__.py -from app.native.api_encap.api import ( - ChangeSet, # Change tracking - API_ADD, API_UPDATE, API_DELETE, # Operations - list_project, create_project, open_project, close_project, - # ... 100+ functions -) -``` - -#### 2. Example: Project Management -```python -# app/services/tjnetwork.py -from app.native.wndb import list_project, open_project, close_project - -def list_project() -> list[str]: - """List all project databases""" - # Calls into compiled binary to enumerate DB names - return api.list_project() - -def open_project(name: str) -> None: - """Open project and load into memory""" - # Binary loads .inp file or DB data - api.open_project(name) -``` - -#### 3. ChangeSet Tracking -```python -# For tracking network modifications -class ChangeSet: - """Tracks ADD/UPDATE/DELETE operations on network elements""" - def __init__(self): - self.adds = [] - self.updates = [] - self.deletes = [] - -# Usage in services -def update_junction(name: str, demand: float): - change = api.set_junction(name, {"demand": demand}) - # Returns ChangeSet for auditing/undo-redo -``` - -#### 4. Network CRUD Operations -```python -# All operations follow this pattern: -from app.native.wndb import get_all_junctions, add_junction, set_junction - -# Read -junctions = get_all_junctions() # Returns list of dicts - -# Create -add_junction({"id": "J1", "x": 0.0, "y": 0.0, "demand": 100.0}) - -# Update -set_junction("J1", {"demand": 150.0}) - -# Delete -delete_junction("J1") -``` - -### Data Flow Example: Simulation -``` -FastAPI Request (POST /simulation/run) - ↓ -app/api/v1/endpoints/simulation.py - ↓ -app/services/simulation.py (business logic) - ↓ -app/native/wndb/ (calls binary functions) - ├── open_project("szh") - ├── set_option("QUALITY", "CHEMICAL") - ├── run_simulation() - └── get_result() - ↓ -TimescaleDB/InfluxDB (store results) - ↓ -Response to client -``` - -### Python Module Constants -Native module exports constants for enumerations: - -```python -from app.native.wndb import ( - OPTION_UNITS_LPS, # Flow units - OPTION_PRESSURE_KPA, # Pressure units - OPTION_QUALITY_CHEMICAL, # Quality type - PIPE_STATUS_OPEN, # Pipe status - SCADA_DEVICE_TYPE_PRESSURE, -) -``` - ---- - -## 5. Authentication & Authorization Mechanisms - -### Architecture: JWT + OAuth2 + Role-Based Access Control (RBAC) - -### 1. Authentication Flow - -#### User Registration -```python -# app/api/v1/endpoints/auth.py -@router.post("/register", response_model=UserResponse) -async def register(user_data: UserCreate): - # 1. Hash password - hashed = get_password_hash(user_data.password) - - # 2. Store in DB via repository - user = await user_repo.create_user({ - 'username': user_data.username, - 'email': user_data.email, - 'hashed_password': hashed, - 'role': 'USER' - }) - return UserResponse.model_validate(user) -``` - -#### User Login & Token Generation -```python -@router.post("/login", response_model=Token) -async def login(form_data: OAuth2PasswordRequestForm = Depends()): - # 1. Verify credentials - user = await user_repo.get_user_by_username(form_data.username) - if not verify_password(form_data.password, user.hashed_password): - raise HTTPException(status_code=401, detail="Invalid credentials") - - # 2. Generate JWT tokens - access_token = create_access_token(subject=user.username) - refresh_token = create_refresh_token(subject=user.username) - - return Token( - access_token=access_token, - refresh_token=refresh_token, - token_type="bearer", - expires_in=settings.ACCESS_TOKEN_EXPIRE_MINUTES * 60 - ) -``` - -### 2. JWT Token Configuration -```python -# app/core/config.py -SECRET_KEY: str = "your-secret-key" # Change in production -ALGORITHM: str = "HS256" -ACCESS_TOKEN_EXPIRE_MINUTES: int = 30 -REFRESH_TOKEN_EXPIRE_DAYS: int = 7 -``` - -### 3. Token Validation & Current User -```python -# app/auth/dependencies.py -oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/api/v1/auth/login") - -async def get_current_user(token: str = Depends(oauth2_scheme)) -> UserInDB: - """Validate JWT token and extract user""" - try: - payload = jwt.decode(token, settings.SECRET_KEY, algorithms=[settings.ALGORITHM]) - username: str = payload.get("sub") - token_type: str = payload.get("type", "access") - - if username is None or token_type != "access": - raise HTTPException(status_code=401, detail="Invalid token") - - # Fetch user from DB - user = await user_repo.get_user_by_username(username) - if user is None: - raise HTTPException(status_code=401, detail="User not found") - - return user - except JWTError: - raise HTTPException(status_code=401, detail="Invalid token") -``` - -### 4. Role-Based Access Control (RBAC) - -#### User Roles Enum -```python -# app/domain/models/role.py -class UserRole(str, Enum): - ADMIN = "ADMIN" # Full permissions - OPERATOR = "OPERATOR" # Modify data - USER = "USER" # Read/write - VIEWER = "VIEWER" # Read-only - -# Hierarchy -get_hierarchy() = { - VIEWER: 1, - USER: 2, - OPERATOR: 3, - ADMIN: 4, -} -``` - -#### Permission Decorators -```python -# app/auth/permissions.py - -def require_admin(current_user: UserInDB = Depends(get_current_active_user)) -> UserInDB: - """Restrict to admin users""" - if current_user.role != UserRole.ADMIN: - raise HTTPException(status_code=403, detail="Admin access required") - return current_user - -def require_role(role: UserRole): - """Factory for role-based permission checks""" - async def permission_checker( - current_user: UserInDB = Depends(get_current_active_user) - ) -> UserInDB: - if not UserRole(current_user.role).has_permission(role): - raise HTTPException(status_code=403, detail=f"Role {role} required") - return current_user - return permission_checker - -def require_operator(current_user: UserInDB = Depends(get_current_active_user)) -> UserInDB: - return current_user if require_role(UserRole.OPERATOR) else None -``` - -#### Using Permissions in Endpoints -```python -# Require admin -@router.delete("/users/{user_id}") -async def delete_user( - user_id: int, - admin: UserInDB = Depends(require_admin) -): - await user_repo.delete_user(user_id) - return {"status": "deleted"} - -# Require operator or higher -@router.post("/projects/") -async def create_project( - data: dict, - operator: UserInDB = Depends(require_operator) -): - return {"project": "created"} -``` - -### 5. Optional Keycloak Integration -```python -# app/auth/keycloak_dependencies.py -# Alternative: Validate tokens from external Keycloak server - -KEYCLOAK_PUBLIC_KEY: str = "" # From .env -KEYCLOAK_ALGORITHM: str = "RS256" - -# Similar JWT validation but with Keycloak's public key -``` - -### 6. Token Schema -```python -# app/domain/schemas/user.py -class Token(BaseModel): - access_token: str - refresh_token: Optional[str] = None - token_type: str = "bearer" - expires_in: int # Seconds - -class UserInDB(BaseModel): - id: int - username: str - email: str - role: str # "ADMIN", "USER", etc. - is_active: bool - is_superuser: bool -``` - ---- - -## 6. Configuration Management - -### Configuration Hierarchy -``` -Environment Variables (.env file) - ↓ -app/core/config.py (Pydantic Settings) - ↓ -Injected via Depends() in endpoints/services - ↓ -Runtime usage -``` - -### Config File: `app/core/config.py` -Uses Pydantic v2 `BaseSettings` with `.env` support: - -```python -from pydantic_settings import BaseSettings - -class Settings(BaseSettings): - # App - PROJECT_NAME: str = "TJWater Server" - API_V1_STR: str = "/api/v1" - - # Security - SECRET_KEY: str = "your-secret" - ALGORITHM: str = "HS256" - ACCESS_TOKEN_EXPIRE_MINUTES: int = 30 - - # Encryption (Fernet symmetric) - ENCRYPTION_KEY: str = "" # Required from .env - DATABASE_ENCRYPTION_KEY: str = "" - - # PostgreSQL - DB_NAME: str = "tjwater" - DB_HOST: str = "localhost" - DB_PORT: str = "5432" - DB_USER: str = "postgres" - DB_PASSWORD: str = "password" - - # TimescaleDB - TIMESCALEDB_DB_NAME: str = "tjwater" - TIMESCALEDB_DB_HOST: str = "localhost" - TIMESCALEDB_DB_PORT: str = "5433" - - # Metadata DB - METADATA_DB_NAME: str = "system_hub" - METADATA_DB_HOST: str = "localhost" - METADATA_DB_PORT: str = "5432" - - # Cache sizing - PROJECT_PG_CACHE_SIZE: int = 50 - PROJECT_TS_CACHE_SIZE: int = 50 - - # Connection pooling - PROJECT_PG_POOL_SIZE: int = 5 - PROJECT_TS_POOL_MIN_SIZE: int = 1 - PROJECT_TS_POOL_MAX_SIZE: int = 10 - - # InfluxDB (optional) - INFLUXDB_URL: str = "http://localhost:8086" - INFLUXDB_TOKEN: str = "token" - - @property - def SQLALCHEMY_DATABASE_URI(self) -> str: - return f"postgresql://{self.DB_USER}:{self.DB_PASSWORD}@{self.DB_HOST}:{self.DB_PORT}/{self.DB_NAME}" - - model_config = SettingsConfigDict( - env_file=".env", - extra="ignore", - ) - -settings = Settings() -``` - -### Environment File: `.env.example` -```bash -# Security -SECRET_KEY=your-secret-key-change-in-production -ENCRYPTION_KEY= -DATABASE_ENCRYPTION_KEY= - -# PostgreSQL -DB_HOST=localhost -DB_PORT=5432 -DB_NAME=tjwater -DB_USER=postgres -DB_PASSWORD=password - -# TimescaleDB -TIMESCALEDB_DB_NAME=szh -TIMESCALEDB_DB_HOST=localhost -TIMESCALEDB_DB_PORT=5433 -TIMESCALEDB_DB_USER=tjwater -TIMESCALEDB_DB_PASSWORD=Tjwater@123456 - -# Metadata DB -METADATA_DB_NAME=system_hub -METADATA_DB_HOST=localhost - -# Cache/Pool -PROJECT_PG_CACHE_SIZE=50 -PROJECT_TS_CACHE_SIZE=50 -``` - -### Using Configuration in Code -```python -from app.core.config import settings - -# Direct access -db_url = settings.SQLALCHEMY_DATABASE_URI -secret = settings.SECRET_KEY - -# In FastAPI lifespan -@asynccontextmanager -async def lifespan(app: FastAPI): - # Initialize based on settings - db.init_pool(settings.DB_NAME) - yield - await db.close() -``` - -### Encryption Configuration -```python -# app/core/encryption.py -from app.core.config import settings - -class Encryptor: - def __init__(self, key: Optional[bytes] = None): - if key is None: - key_str = settings.ENCRYPTION_KEY - if not key_str: - raise ValueError("ENCRYPTION_KEY not configured") - key = key_str.encode() - self.fernet = Fernet(key) - - def encrypt(self, data: str) -> str: - return self.fernet.encrypt(data.encode()).decode() - - def decrypt(self, data: str) -> str: - return self.fernet.decrypt(data.encode()).decode() - - @staticmethod - def generate_key() -> str: - """Generate new encryption key""" - return Fernet.generate_key().decode() -``` - ---- - -## 7. Testing Setup - -### Test Structure -``` -tests/ -├── conftest.py # Pytest configuration & fixtures -├── api/ # API integration tests -│ ├── test_api_integration.py -│ └── test_leakage_endpoints.py -├── unit/ # Unit tests -│ ├── test_burst_location_service.py -│ ├── test_metadata_repository_dsn_decrypt.py -│ └── test_pipeline_health_analyzer.py -└── auth/ # Auth tests - └── test_encryption.py -``` - -### Configuration: `tests/conftest.py` -```python -import pytest -import sys -import os - -# Add project root to path -sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) - -def run_this_test(test_file): - """Run a single test file""" - test_name = os.path.splitext(os.path.basename(test_file))[0] - pytest.main([test_file, "-v"]) -``` - -### Testing Tools -```python -# requirements.txt includes: -pytest==8.3.5 # Test runner -# httpx (via FastAPI) for async HTTP client -``` - -### Example: API Integration Test -```python -# tests/api/test_api_integration.py -import pytest - -@pytest.mark.parametrize( - "module_name, desc", - [ - ("app.core.encryption", "Encryption"), - ("app.auth.permissions", "Permissions"), - ("app.api.v1.endpoints.auth", "Auth endpoints"), - ], -) -def test_module_imports(module_name, desc): - """Verify critical modules can be imported""" - try: - __import__(module_name) - except ImportError as e: - pytest.fail(f"Cannot import {desc}: {e}") - -def test_router_configuration(): - """Verify router is properly configured""" - from app.api.v1 import router - api_router = router.api_router - routes = [r.path for r in api_router.routes if hasattr(r, "path")] - assert len(routes) > 0 -``` - -### Example: Encryption Test -```python -# tests/auth/test_encryption.py -from app.core.encryption import Encryptor - -def test_encrypt_decrypt(): - """Test encryption roundtrip""" - encryptor = Encryptor.generate_key() - enc = Encryptor(encryptor) - - plaintext = "sensitive_data" - encrypted = enc.encrypt(plaintext) - decrypted = enc.decrypt(encrypted) - - assert decrypted == plaintext -``` - -### Running Tests -```bash -# Run all tests -pytest tests/ -v - -# Run specific test file -pytest tests/api/test_api_integration.py -v - -# Run specific test -pytest tests/auth/test_encryption.py::test_encrypt_decrypt -v -``` - ---- - -## 8. Audit & Security Features - -### Audit Middleware -Automatically logs all critical operations: - -```python -# app/infra/audit/middleware.py -class AuditMiddleware(BaseHTTPMiddleware): - AUDIT_METHODS = ["POST", "PUT", "DELETE", "PATCH"] - AUDIT_TAGS = ["Audit", "Users", "Project", "Junctions", "Pipes", ...] - - async def dispatch(self, request: Request, call_next): - # 1. Capture request body (for writes) - # 2. Execute request - # 3. Log to audit DB if matches criteria - # 4. Return response -``` - -### Audit Logging -```python -# app/core/audit.py -async def log_audit_event( - action: AuditAction, # "CREATE", "UPDATE", "DELETE", "LOGIN" - resource_type: str, # "user", "project", "pipe" - resource_id: str, - actor_id: int, # User ID - details: dict = None -): - """Log operation to audit table""" - # Persists to audit_logs table via AuditRepository -``` - -### Audit Schema -```python -# app/domain/schemas/audit.py -class AuditLog(BaseModel): - id: int - timestamp: datetime - action: str - resource_type: str - resource_id: str - actor_id: int - details: Optional[dict] = None -``` - ---- - -## 9. Key Dependencies & Tech Stack - -### Core Framework -``` -FastAPI==0.128.0 # Web framework -uvicorn==0.34.0 # ASGI server -Pydantic==2.10.6 # Data validation -pydantic-settings==2.12.0 # Configuration management -``` - -### Database -``` -psycopg==3.2.5 # PostgreSQL async driver -psycopg-pool==3.3.0 # Connection pooling -GeoAlchemy2==0.17.1 # GIS support -SQLAlchemy==2.0.41 # ORM (optional) -``` - -### Security & Auth -``` -PyJWT==2.10.1 # JWT handling -python-jose==3.5.0 # Token validation -passlib==1.7.4 # Password hashing -cryptography==46.0.3 # Encryption (Fernet) -Authlib==1.6.6 # OAuth2 support -``` - -### Data Science / Simulation -``` -wntr==1.3.2 # Water network toolkit (EPANET) -numpy==1.26.2 # Numerical computing -pandas==2.2.3 # Data frames -scipy==1.15.2 # Scientific computing -scikit-learn==1.6.1 # ML algorithms -``` - -### Time-Series & Data Storage -``` -influxdb-client==1.48.0 # InfluxDB client -redis==5.2.1 # Caching & sessions -``` - -### Utilities -``` -python-dotenv==1.2.1 # .env file support -python-multipart==0.0.20 # File upload handling -email-validator==2.3.0 # Email validation -``` - ---- - -## 10. Documentation & Deployment - -### Key Documentation Files -- **SECURITY_README.md**: Complete security implementation guide -- **DEPLOYMENT.md**: Production deployment checklist -- **INTEGRATION_CHECKLIST.md**: System integration steps -- **setup_server.md**: Initial server setup -- **setup_influxdb.md**: InfluxDB configuration - -### Docker Deployment -```yaml -# infra/docker/docker-compose.yml -services: - api: - build: ... - ports: ["8000:8000"] - environment: - - DB_HOST=postgis - - TIMESCALEDB_HOST=timescaledb - - REDIS_HOST=redis - - postgis: - image: postgis/postgis:14-3.5 - - timescaledb: - image: timescale/timescaledb:latest-pg15 - - redis: - image: redis:latest - - influxdb: - image: influxdb:2.7 - - keycloak: - image: keycloak/keycloak:latest - - grafana: - image: grafana/grafana:latest -``` - ---- - -## 11. Recommended Documentation to Create - -### For Secondary Development Team: - -1. **API Development Guide** - - How to add new endpoints (covered in Section 2) - - Common endpoint patterns - - Error handling standards - - Response format conventions - -2. **Database Development Guide** - - Repository pattern usage - - Query building best practices - - Migration procedures - - Multi-database considerations - -3. **Native Module Integration Guide** - - How to add new native functions - - ChangeSet tracking - - Binary library updates - - Debugging native code calls - -4. **Authentication & Authorization** - - Token generation and validation - - Role-based access control implementation - - Permission decorator usage - - Keycloak integration - -5. **Testing & CI/CD** - - Unit test patterns - - Integration test setup - - Test database configuration - - GitHub Actions workflow - -6. **Deployment & DevOps** - - Docker build & deployment - - Kubernetes manifests - - Environment variable management - - Production security checklist - -7. **Troubleshooting Guide** - - Common issues and solutions - - Database connection problems - - Authentication debugging - - Native module errors - ---- - -## Summary Table: Key Components - -| Component | Location | Purpose | Key Technology | -|-----------|----------|---------|-----------------| -| **API Routes** | `app/api/v1/endpoints/` | REST endpoints | FastAPI, Pydantic | -| **Router** | `app/api/v1/router.py` | Central route registration | APIRouter | -| **Auth** | `app/auth/` | JWT/OAuth2 validation | PyJWT, passlib | -| **Database** | `app/infra/db/` | Data persistence | psycopg, async pools | -| **Repository** | `app/infra/repositories/` | Data access layer | psycopg cursor | -| **Domain** | `app/domain/` | Models & schemas | Pydantic, Enum | -| **Services** | `app/services/` | Business logic | Python, native APIs | -| **Native API** | `app/native/wndb/` | Binary integration | ctypes/cffi, .so/.dll | -| **Config** | `app/core/config.py` | Settings management | Pydantic Settings | -| **Security** | `app/core/security.py` | Encryption, hashing | cryptography, passlib | -| **Audit** | `app/infra/audit/` | Operation logging | Middleware, Repository | -| **Tests** | `tests/` | Test suite | pytest | - ---- - -*This guide provides the essential patterns and structures needed for secondary development on TJWaterServerBinary. Refer to individual source files for detailed implementation examples.* diff --git a/SECURITY_IMPLEMENTATION_SUMMARY.md b/SECURITY_IMPLEMENTATION_SUMMARY.md deleted file mode 100644 index 8ea5eac..0000000 --- a/SECURITY_IMPLEMENTATION_SUMMARY.md +++ /dev/null @@ -1,370 +0,0 @@ -# 安全功能实施总结 - -## ✅ 已完成的功能 - -本次实施完成了完整的安全体系,包括数据加密、身份认证、权限管理、审计日志四大模块。 - ---- - -## 📁 新增文件清单 - -### 核心功能模块 - -1. **数据加密** - - `app/core/encryption.py` - Fernet 加密实现 - - `tests/test_encryption.py` - 加密功能测试 - -2. **用户系统** - - `app/domain/models/role.py` - 用户角色枚举 - - `app/domain/schemas/user.py` - 用户数据模型 - - `app/infra/repositories/user_repository.py` - 用户数据访问层 - -3. **认证授权** - - `app/api/v1/endpoints/auth.py` - 认证接口(已重构) - - `app/auth/dependencies.py` - 认证依赖项(已更新) - - `app/auth/permissions.py` - 权限控制装饰器 - - `app/api/v1/endpoints/user_management.py` - 用户管理接口 - -4. **审计日志** - - `app/core/audit.py` - 审计日志核心(已完善) - - `app/domain/schemas/audit.py` - 审计日志数据模型 - - `app/infra/repositories/audit_repository.py` - 审计日志数据访问层 - - `app/api/v1/endpoints/audit.py` - 审计日志查询接口 - - `app/infra/audit/middleware.py` - 自动审计中间件 - -### 数据库迁移 - -5. **迁移脚本** - - `migrations/001_create_users_table.sql` - 用户表 - - `migrations/002_create_audit_logs_table.sql` - 审计日志表 - -### 配置和文档 - -6. **配置文件** - - `.env.example` - 环境变量模板 - - `app/core/config.py` - 配置文件(已更新) - - `app/core/security.py` - 安全工具(已增强) - -7. **文档** - - `SECURITY_README.md` - 完整使用指南(79KB+) - - `DEPLOYMENT.md` - 部署和集成指南 - - `SECURITY_IMPLEMENTATION_SUMMARY.md` - 本文件 - -8. **工具** - - `setup_security.sh` - 快速设置脚本 - ---- - -## 🎯 功能特性 - -### 1. 数据加密 -- ✅ 使用 Fernet(AES-128)对称加密 -- ✅ 支持密钥生成和管理 -- ✅ 自动从环境变量读取密钥 -- ✅ 完整的加密/解密 API -- ✅ 单元测试覆盖 - -### 2. 身份认证 -- ✅ 基于 JWT 的 Token 认证 -- ✅ Access Token + Refresh Token 机制 -- ✅ 用户注册/登录接口 -- ✅ 支持用户名或邮箱登录 -- ✅ 密码使用 bcrypt 哈希存储 -- ✅ Token 过期时间可配置 -- ✅ 向后兼容旧接口 - -### 3. 权限管理(RBAC) -- ✅ 4 个预定义角色:ADMIN, OPERATOR, USER, VIEWER -- ✅ 基于角色层级的权限检查 -- ✅ 可复用的权限装饰器 -- ✅ 资源所有者检查 -- ✅ 灵活的依赖注入设计 - -### 4. 审计日志 -- ✅ 自动记录所有关键操作 -- ✅ 记录用户、时间、操作类型、资源等信息 -- ✅ 敏感数据自动脱敏 -- ✅ 支持按多条件查询 -- ✅ 管理员专用查询接口 -- ✅ 用户可查看自己的操作记录 - ---- - -## 📊 技术栈 - -| 组件 | 技术 | 说明 | -|------|------|------| -| 加密 | cryptography.Fernet | 对称加密 | -| 密码哈希 | bcrypt | 密码安全存储 | -| JWT | python-jose | Token 生成和验证 | -| 数据库 | PostgreSQL + psycopg | 异步数据访问 | -| Web框架 | FastAPI | 现代异步框架 | -| 数据验证 | Pydantic | 类型安全的数据模型 | - ---- - -## 🔐 安全特性 - -1. **密码安全** - - bcrypt 哈希(work factor = 12) - - 自动加盐 - - 不可逆加密 - -2. **Token 安全** - - JWT 签名验证 - - 短期 Access Token(30分钟) - - 长期 Refresh Token(7天) - - Token 类型校验 - -3. **数据保护** - - 敏感字段自动脱敏 - - 审计日志不记录密码 - - 加密密钥从环境变量读取 - -4. **访问控制** - - 基于角色的细粒度权限 - - 资源级别的访问控制 - - 自动验证用户激活状态 - ---- - -## 📈 数据库设计 - -### users 表 -``` -用户表 - 存储系统用户 -- id (主键) -- username (唯一) -- email (唯一) -- hashed_password -- role (ADMIN/OPERATOR/USER/VIEWER) -- is_active -- is_superuser -- created_at -- updated_at (自动更新) -``` - -### audit_logs 表 -``` -审计日志表 - 记录所有关键操作 -- id (主键) -- user_id (外键) -- username (冗余字段) -- action (操作类型) -- resource_type (资源类型) -- resource_id (资源ID) -- ip_address -- user_agent -- request_method -- request_path -- request_data (JSONB) -- response_status -- error_message -- timestamp -``` - -**索引优化**: -- users: username, email, role, is_active -- audit_logs: user_id, username, timestamp, action, resource - ---- - -## 🚀 快速开始 - -### 方法 1: 使用自动化脚本 - -```bash -./setup_security.sh -``` - -### 方法 2: 手动设置 - -```bash -# 1. 配置环境变量 -cp .env.example .env -# 编辑 .env 填写密钥和数据库配置 - -# 2. 执行数据库迁移 -psql -U postgres -d tjwater -f migrations/001_create_users_table.sql -psql -U postgres -d tjwater -f migrations/002_create_audit_logs_table.sql - -# 3. 测试 -python tests/test_encryption.py - -# 4. 启动服务 -uvicorn app.main:app --reload -``` - ---- - -## 📋 集成检查清单 - -### 必需步骤 - -- [ ] 复制 `.env.example` 为 `.env` 并配置 -- [ ] 生成 JWT 密钥(SECRET_KEY) -- [ ] 生成加密密钥(ENCRYPTION_KEY) -- [ ] 配置数据库连接信息 -- [ ] 执行用户表迁移脚本 -- [ ] 执行审计日志表迁移脚本 -- [ ] 验证默认管理员可登录 - -### 可选步骤 - -- [ ] 在 main.py 中添加审计中间件 -- [ ] 为现有接口添加权限控制 -- [ ] 注册新的路由(auth, user_management, audit) -- [ ] 替换硬编码的认证逻辑 -- [ ] 配置 Token 过期时间 - ---- - -## 🔄 向后兼容性 - -### 保留的旧接口 - -1. **简化登录**: `/api/v1/auth/login/simple` - - 仍可使用 `username` 和 `password` 参数 - - 返回标准 Token 响应 - -2. **硬编码用户迁移** - - 原有 `tjwater/tjwater@123` 已迁移到数据库 - - 保持相同的用户名和密码 - -### 渐进式迁移 - -可以逐步迁移现有接口: - -1. 新接口直接使用新认证系统 -2. 旧接口保持不变 -3. 逐个替换旧接口的认证逻辑 - ---- - -## 📚 API 端点总览 - -### 认证接口 (`/api/v1/auth/`) - -| 方法 | 路径 | 说明 | 权限 | -|------|------|------|------| -| POST | `/register` | 用户注册 | 公开 | -| POST | `/login` | OAuth2 登录 | 公开 | -| POST | `/login/simple` | 简化登录 | 公开 | -| GET | `/me` | 获取当前用户 | 认证用户 | -| POST | `/refresh` | 刷新Token | 认证用户 | - -### 用户管理 (`/api/v1/users/`) - -| 方法 | 路径 | 说明 | 权限 | -|------|------|------|------| -| GET | `/` | 用户列表 | 管理员 | -| GET | `/{id}` | 用户详情 | 所有者/管理员 | -| PUT | `/{id}` | 更新用户 | 所有者/管理员 | -| DELETE | `/{id}` | 删除用户 | 管理员 | -| POST | `/{id}/activate` | 激活用户 | 管理员 | -| POST | `/{id}/deactivate` | 停用用户 | 管理员 | - -### 审计日志 (`/api/v1/audit/`) - -| 方法 | 路径 | 说明 | 权限 | -|------|------|------|------| -| GET | `/logs` | 查询审计日志 | 管理员 | -| GET | `/logs/count` | 日志总数 | 管理员 | -| GET | `/logs/my` | 我的操作记录 | 认证用户 | - ---- - -## 🎓 使用示例 - -### Python 示例 - -```python -import requests - -# 登录 -resp = requests.post("http://localhost:8000/api/v1/auth/login", - data={"username": "admin", "password": "admin123"}) -token = resp.json()["access_token"] - -# 访问受保护接口 -headers = {"Authorization": f"Bearer {token}"} -resp = requests.get("http://localhost:8000/api/v1/auth/me", headers=headers) -print(resp.json()) -``` - -### cURL 示例 - -```bash -# 登录 -TOKEN=$(curl -s -X POST "http://localhost:8000/api/v1/auth/login" \ - -d "username=admin&password=admin123" | jq -r .access_token) - -# 查询审计日志 -curl -H "Authorization: Bearer $TOKEN" \ - "http://localhost:8000/api/v1/audit/logs?action=LOGIN" -``` - ---- - -## 🐛 常见问题 - -### Q: 如何修改默认管理员密码? - -A: 登录后通过 PUT `/api/v1/users/{id}` 接口修改,或直接更新数据库。 - -### Q: 如何添加新用户? - -A: 使用 POST `/api/v1/auth/register` 接口,或由管理员在用户管理界面创建。 - -### Q: 审计日志可以删除吗? - -A: 不建议删除。可以归档到冷存储,保留最近 90 天的数据。 - -### Q: Token 过期了怎么办? - -A: 使用 Refresh Token 调用 `/api/v1/auth/refresh` 接口获取新的 Access Token。 - ---- - -## 📞 技术支持 - -- **完整文档**: `SECURITY_README.md` -- **部署指南**: `DEPLOYMENT.md` -- **测试代码**: `tests/test_encryption.py` -- **迁移脚本**: `migrations/` - ---- - -## 📝 待办事项(可选) - -未来可以扩展的功能: - -- [ ] 邮件验证 -- [ ] 密码重置 -- [ ] 双因素认证(2FA) -- [ ] 单点登录(SSO) -- [ ] Token 黑名单 -- [ ] 会话管理 -- [ ] IP 白名单 -- [ ] 登录频率限制 -- [ ] 密码复杂度策略 -- [ ] 审计日志自动归档 - ---- - -## 🎉 总结 - -本次实施完成了企业级的安全体系,包含: - -✅ 数据加密 - Fernet 对称加密 -✅ 身份认证 - JWT Token + bcrypt 密码哈希 -✅ 权限管理 - 基于角色的访问控制(RBAC) -✅ 审计日志 - 自动追踪所有关键操作 - -所有功能均遵循安全最佳实践,提供完整的文档和测试,可直接投入生产使用。 - ---- - -**实施日期**: 2026-02-02 -**版本**: v1.0.0 -**状态**: ✅ 已完成 diff --git a/SECURITY_README.md b/SECURITY_README.md deleted file mode 100644 index 87f79b6..0000000 --- a/SECURITY_README.md +++ /dev/null @@ -1,499 +0,0 @@ -# 安全功能使用指南 - -TJWater Server 安全体系实施完成,包含:数据加密、身份认证、权限管理、审计日志 - -## 📋 目录 - -1. [快速开始](#快速开始) -2. [数据加密](#数据加密) -3. [身份认证](#身份认证) -4. [权限管理](#权限管理) -5. [审计日志](#审计日志) -6. [数据库迁移](#数据库迁移) -7. [API 使用示例](#api-使用示例) - ---- - -## 🚀 快速开始 - -### 1. 配置环境变量 - -复制 `.env.example` 为 `.env` 并配置: - -```bash -cp .env.example .env -``` - -生成必要的密钥: - -```bash -# 生成 JWT 密钥 -openssl rand -hex 32 - -# 生成加密密钥 -python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" -``` - -编辑 `.env` 文件: - -```env -SECRET_KEY=your-generated-jwt-secret-key -ENCRYPTION_KEY=your-generated-encryption-key -DB_NAME=tjwater -DB_HOST=localhost -DB_PORT=5432 -DB_USER=postgres -DB_PASSWORD=your-db-password -``` - -### 2. 执行数据库迁移 - -```bash -# 连接到 PostgreSQL -psql -U postgres -d tjwater - -# 执行迁移脚本 -\i migrations/001_create_users_table.sql -\i migrations/002_create_audit_logs_table.sql -``` - -或使用命令行: - -```bash -psql -U postgres -d tjwater -f migrations/001_create_users_table.sql -psql -U postgres -d tjwater -f migrations/002_create_audit_logs_table.sql -``` - -### 3. 验证安装 - -默认创建了两个管理员账号: - -- **用户名**: `admin` / **密码**: `admin123` -- **用户名**: `tjwater` / **密码**: `tjwater@123` - ---- - -## 🔐 数据加密 - -### 使用加密器 - -```python -from app.core.encryption import get_encryptor - -encryptor = get_encryptor() - -# 加密敏感数据 -encrypted_data = encryptor.encrypt("sensitive information") - -# 解密 -decrypted_data = encryptor.decrypt(encrypted_data) -``` - -### 生成新密钥 - -```python -from app.core.encryption import Encryptor - -new_key = Encryptor.generate_key() -print(f"New encryption key: {new_key}") -``` - ---- - -## 👤 身份认证 - -### 用户角色 - -系统定义了 4 个角色(权限由低到高): - -| 角色 | 权限说明 | -|------|---------| -| `VIEWER` | 仅查询权限 | -| `USER` | 读写权限 | -| `OPERATOR` | 操作员,可修改数据 | -| `ADMIN` | 管理员,完全权限 | - -### API 接口 - -#### 用户注册 - -```http -POST /api/v1/auth/register -Content-Type: application/json - -{ - "username": "newuser", - "email": "user@example.com", - "password": "password123", - "role": "USER" -} -``` - -#### 用户登录(OAuth2 标准) - -```http -POST /api/v1/auth/login -Content-Type: application/x-www-form-urlencoded - -username=admin&password=admin123 -``` - -响应: - -```json -{ - "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", - "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", - "token_type": "bearer", - "expires_in": 1800 -} -``` - -#### 用户登录(简化版) - -```http -POST /api/v1/auth/login/simple?username=admin&password=admin123 -``` - -#### 获取当前用户信息 - -```http -GET /api/v1/auth/me -Authorization: Bearer {access_token} -``` - -#### 刷新 Token - -```http -POST /api/v1/auth/refresh -Content-Type: application/json - -{ - "refresh_token": "your-refresh-token" -} -``` - ---- - -## 🔑 权限管理 - -### 在 API 中使用权限控制 - -#### 方式 1: 使用预定义依赖 - -```python -from fastapi import APIRouter, Depends -from app.auth.permissions import get_current_admin, get_current_operator -from app.domain.schemas.user import UserInDB - -router = APIRouter() - -@router.post("/admin-only") -async def admin_endpoint( - current_user: UserInDB = Depends(get_current_admin) -): - """仅管理员可访问""" - return {"message": "Admin access granted"} - -@router.post("/operator-only") -async def operator_endpoint( - current_user: UserInDB = Depends(get_current_operator) -): - """操作员及以上可访问""" - return {"message": "Operator access granted"} -``` - -#### 方式 2: 使用 require_role - -```python -from app.auth.permissions import require_role -from app.domain.models.role import UserRole - -@router.get("/viewer-access") -async def viewer_endpoint( - current_user: UserInDB = Depends(require_role(UserRole.VIEWER)) -): - """所有认证用户可访问""" - return {"data": "visible to all"} -``` - -#### 方式 3: 手动检查权限 - -```python -from app.auth.dependencies import get_current_active_user -from app.auth.permissions import check_resource_owner - -@router.put("/users/{user_id}") -async def update_user( - user_id: int, - current_user: UserInDB = Depends(get_current_active_user) -): - """检查是否是资源拥有者或管理员""" - if not check_resource_owner(user_id, current_user): - raise HTTPException(status_code=403, detail="Permission denied") - - # 执行更新操作 - ... -``` - ---- - -## 📝 审计日志 - -### 自动审计 - -使用中间件自动记录关键操作,在 `main.py` 中添加: - -```python -from app.infra.audit.middleware import AuditMiddleware - -app.add_middleware(AuditMiddleware) -``` - -自动记录: -- 所有 POST/PUT/DELETE 请求 -- 登录/登出事件 -- 关键资源访问 - -### 手动记录审计日志 - -```python -from app.core.audit import log_audit_event, AuditAction - -await log_audit_event( - action=AuditAction.UPDATE, - user_id=current_user.id, - username=current_user.username, - resource_type="project", - resource_id="123", - ip_address=request.client.host, - request_data={"field": "value"}, - response_status=200 -) -``` - -### 查询审计日志 - -#### 获取所有审计日志(仅管理员) - -```http -GET /api/v1/audit/logs?skip=0&limit=100 -Authorization: Bearer {admin_token} -``` - -#### 按条件过滤 - -```http -GET /api/v1/audit/logs?user_id=1&action=LOGIN&start_time=2024-01-01T00:00:00 -Authorization: Bearer {admin_token} -``` - -#### 获取我的操作记录 - -```http -GET /api/v1/audit/logs/my -Authorization: Bearer {access_token} -``` - -#### 获取日志总数 - -```http -GET /api/v1/audit/logs/count?action=LOGIN -Authorization: Bearer {admin_token} -``` - ---- - -## 💾 数据库迁移 - -### 用户表结构 - -```sql -CREATE TABLE users ( - id SERIAL PRIMARY KEY, - username VARCHAR(50) UNIQUE NOT NULL, - email VARCHAR(100) UNIQUE NOT NULL, - hashed_password VARCHAR(255) NOT NULL, - role VARCHAR(20) DEFAULT 'USER' NOT NULL, - is_active BOOLEAN DEFAULT TRUE NOT NULL, - is_superuser BOOLEAN DEFAULT FALSE NOT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL -); -``` - -### 审计日志表结构 - -```sql -CREATE TABLE audit_logs ( - id SERIAL PRIMARY KEY, - user_id INTEGER REFERENCES users(id), - username VARCHAR(50), - action VARCHAR(50) NOT NULL, - resource_type VARCHAR(50), - resource_id VARCHAR(100), - ip_address VARCHAR(45), - user_agent TEXT, - request_method VARCHAR(10), - request_path TEXT, - request_data JSONB, - response_status INTEGER, - error_message TEXT, - timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL -); -``` - ---- - -## 🔧 API 使用示例 - -### Python 客户端示例 - -```python -import requests - -BASE_URL = "http://localhost:8000/api/v1" - -# 1. 登录 -response = requests.post( - f"{BASE_URL}/auth/login", - data={"username": "admin", "password": "admin123"} -) -token = response.json()["access_token"] - -# 2. 设置 Authorization Header -headers = {"Authorization": f"Bearer {token}"} - -# 3. 获取当前用户信息 -response = requests.get(f"{BASE_URL}/auth/me", headers=headers) -print(response.json()) - -# 4. 创建新用户(需要管理员权限) -response = requests.post( - f"{BASE_URL}/auth/register", - headers=headers, - json={ - "username": "newuser", - "email": "new@example.com", - "password": "password123", - "role": "USER" - } -) -print(response.json()) - -# 5. 查询审计日志(需要管理员权限) -response = requests.get( - f"{BASE_URL}/audit/logs?action=LOGIN", - headers=headers -) -print(response.json()) -``` - -### cURL 示例 - -```bash -# 登录 -curl -X POST "http://localhost:8000/api/v1/auth/login" \ - -H "Content-Type: application/x-www-form-urlencoded" \ - -d "username=admin&password=admin123" - -# 使用 Token 访问受保护接口 -TOKEN="your-access-token" -curl -X GET "http://localhost:8000/api/v1/auth/me" \ - -H "Authorization: Bearer $TOKEN" - -# 注册新用户 -curl -X POST "http://localhost:8000/api/v1/auth/register" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $TOKEN" \ - -d '{ - "username": "testuser", - "email": "test@example.com", - "password": "password123", - "role": "USER" - }' -``` - ---- - -## 🛡️ 安全最佳实践 - -1. **密钥管理** - - 绝不在代码中硬编码密钥 - - 定期轮换 JWT 密钥 - - 使用强随机密钥 - -2. **密码策略** - - 最小长度 6 个字符(建议 12+) - - 强制密码复杂度(可在注册时添加验证) - - 定期提醒用户更换密码 - -3. **Token 管理** - - Access Token 短期有效(默认 30 分钟) - - Refresh Token 长期有效(默认 7 天) - - 实施 Token 黑名单(可选) - -4. **审计日志** - - 审计日志不可删除 - - 定期归档旧日志 - - 监控异常登录行为 - -5. **权限控制** - - 遵循最小权限原则 - - 定期审查用户权限 - - 记录所有权限变更 - ---- - -## 📚 相关文件 - -- **配置**: `app/core/config.py` -- **加密**: `app/core/encryption.py` -- **安全**: `app/core/security.py` -- **审计**: `app/core/audit.py` -- **认证**: `app/api/v1/endpoints/auth.py` -- **权限**: `app/auth/permissions.py` -- **用户管理**: `app/api/v1/endpoints/user_management.py` -- **审计日志**: `app/api/v1/endpoints/audit.py` -- **迁移脚本**: `migrations/` - ---- - -## ❓ 常见问题 - -### Q: 忘记密码怎么办? - -A: 目前需要管理员通过数据库重置。未来可添加邮件重置功能。 - -```sql --- 重置密码为 "newpassword123" -UPDATE users -SET hashed_password = '$2b$12$...' -- 使用 bcrypt 生成哈希 -WHERE username = 'targetuser'; -``` - -### Q: 如何添加新角色? - -A: 编辑 `app/domain/models/role.py` 中的 `UserRole` 枚举,并更新数据库约束。 - -### Q: 审计日志占用太多空间? - -A: 建议定期归档旧日志到冷存储: - -```sql --- 归档 90 天前的日志 -CREATE TABLE audit_logs_archive AS -SELECT * FROM audit_logs WHERE timestamp < NOW() - INTERVAL '90 days'; - -DELETE FROM audit_logs WHERE timestamp < NOW() - INTERVAL '90 days'; -``` - ---- - -## 📞 技术支持 - -如有问题,请查看: -- 日志文件: `logs/` -- 数据库表结构: `migrations/` -- 单元测试: `tests/` - diff --git a/openapi.json b/openapi.json deleted file mode 100644 index 12c864f..0000000 --- a/openapi.json +++ /dev/null @@ -1,13577 +0,0 @@ -{ - "openapi": "3.0.2", - "info": { - "title": "FastAPI", - "version": "0.1.0" - }, - "paths": { - "/getallextensiondatakeys/": { - "get": { - "summary": "Fastapi Get All Extension Data Keys", - "operationId": "fastapi_get_all_extension_data_keys_getallextensiondatakeys__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getallextensiondata/": { - "get": { - "summary": "Fastapi Get All Extension Data", - "operationId": "fastapi_get_all_extension_data_getallextensiondata__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getextensiondata/": { - "get": { - "summary": "Fastapi Get Extension Data", - "operationId": "fastapi_get_extension_data_getextensiondata__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Key", - "type": "string" - }, - "name": "key", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setextensiondata": { - "post": { - "summary": "Fastapi Set Extension Data", - "operationId": "fastapi_set_extension_data_setextensiondata_post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/listprojects/": { - "get": { - "summary": "Fastapi List Projects", - "operationId": "fastapi_list_projects_listprojects__get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/haveproject/": { - "get": { - "summary": "Fastapi Have Project", - "operationId": "fastapi_have_project_haveproject__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/createproject/": { - "post": { - "summary": "Fastapi Create Project", - "operationId": "fastapi_create_project_createproject__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deleteproject/": { - "post": { - "summary": "Fastapi Delete Project", - "operationId": "fastapi_delete_project_deleteproject__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/isprojectopen/": { - "get": { - "summary": "Fastapi Is Project Open", - "operationId": "fastapi_is_project_open_isprojectopen__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/openproject/": { - "post": { - "summary": "Fastapi Open Project", - "operationId": "fastapi_open_project_openproject__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/closeproject/": { - "post": { - "summary": "Fastapi Close Project", - "operationId": "fastapi_close_project_closeproject__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/copyproject/": { - "post": { - "summary": "Fastapi Copy Project", - "operationId": "fastapi_copy_project_copyproject__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Source", - "type": "string" - }, - "name": "source", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Target", - "type": "string" - }, - "name": "target", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/importinp/": { - "post": { - "summary": "Fastapi Import Inp", - "operationId": "fastapi_import_inp_importinp__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/exportinp/": { - "get": { - "summary": "Fastapi Export Inp", - "operationId": "fastapi_export_inp_exportinp__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Version", - "type": "string" - }, - "name": "version", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/readinp/": { - "post": { - "summary": "Fastapi Read Inp", - "operationId": "fastapi_read_inp_readinp__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Inp", - "type": "string" - }, - "name": "inp", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/dumpinp/": { - "get": { - "summary": "Fastapi Dump Inp", - "operationId": "fastapi_dump_inp_dumpinp__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Inp", - "type": "string" - }, - "name": "inp", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/runproject/": { - "get": { - "summary": "Fastapi Run Project", - "operationId": "fastapi_run_project_runproject__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/runinp/": { - "get": { - "summary": "Fastapi Run Inp", - "operationId": "fastapi_run_inp_runinp__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/dumpoutput/": { - "get": { - "summary": "Fastapi Dump Output", - "operationId": "fastapi_dump_output_dumpoutput__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Output", - "type": "string" - }, - "name": "output", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/isprojectlocked/": { - "get": { - "summary": "Fastapi Is Locked", - "operationId": "fastapi_is_locked_isprojectlocked__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/isprojectlockedbyme/": { - "get": { - "summary": "Fastapi Is Locked By Me", - "operationId": "fastapi_is_locked_by_me_isprojectlockedbyme__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/lockproject/": { - "post": { - "summary": "Fastapi Lock Project", - "operationId": "fastapi_lock_project_lockproject__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/unlockproject/": { - "post": { - "summary": "Fastapi Unlock Project", - "operationId": "fastapi_unlock_project_unlockproject__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getcurrentoperationid/": { - "get": { - "summary": "Fastapi Get Current Operaiton Id", - "operationId": "fastapi_get_current_operaiton_id_getcurrentoperationid__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/undo/": { - "post": { - "summary": "Fastapi Undo", - "operationId": "fastapi_undo_undo__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/redo/": { - "post": { - "summary": "Fastapi Redo", - "operationId": "fastapi_redo_redo__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getsnapshots/": { - "get": { - "summary": "Fastapi List Snapshot", - "operationId": "fastapi_list_snapshot_getsnapshots__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/havesnapshot/": { - "get": { - "summary": "Fastapi Have Snapshot", - "operationId": "fastapi_have_snapshot_havesnapshot__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tag", - "type": "string" - }, - "name": "tag", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/havesnapshotforoperation/": { - "get": { - "summary": "Fastapi Have Snapshot For Operation", - "operationId": "fastapi_have_snapshot_for_operation_havesnapshotforoperation__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Operation", - "type": "integer" - }, - "name": "operation", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/havesnapshotforcurrentoperation/": { - "get": { - "summary": "Fastapi Have Snapshot For Current Operation", - "operationId": "fastapi_have_snapshot_for_current_operation_havesnapshotforcurrentoperation__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/takesnapshotforoperation/": { - "post": { - "summary": "Fastapi Take Snapshot For Operation", - "operationId": "fastapi_take_snapshot_for_operation_takesnapshotforoperation__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Operation", - "type": "integer" - }, - "name": "operation", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tag", - "type": "string" - }, - "name": "tag", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "takenapshotforcurrentoperation": { - "post": { - "summary": "Fastapi Take Snapshot For Current Operation", - "operationId": "fastapi_take_snapshot_for_current_operationtakenapshotforcurrentoperation_post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tag", - "type": "string" - }, - "name": "tag", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/takesnapshot/": { - "post": { - "summary": "Fastapi Take Snapshot", - "operationId": "fastapi_take_snapshot_takesnapshot__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tag", - "type": "string" - }, - "name": "tag", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/picksnapshot/": { - "post": { - "summary": "Fastapi Pick Snapshot", - "operationId": "fastapi_pick_snapshot_picksnapshot__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tag", - "type": "string" - }, - "name": "tag", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Discard", - "type": "boolean", - "default": false - }, - "name": "discard", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/pickoperation/": { - "post": { - "summary": "Fastapi Pick Operation", - "operationId": "fastapi_pick_operation_pickoperation__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Operation", - "type": "integer" - }, - "name": "operation", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Discard", - "type": "boolean", - "default": false - }, - "name": "discard", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/syncwithserver/": { - "get": { - "summary": "Fastapi Sync With Server", - "operationId": "fastapi_sync_with_server_syncwithserver__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Operation", - "type": "integer" - }, - "name": "operation", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/batch/": { - "post": { - "summary": "Fastapi Execute Batch Commands", - "operationId": "fastapi_execute_batch_commands_batch__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/compressedbatch/": { - "post": { - "summary": "Fastapi Execute Compressed Batch Commands", - "operationId": "fastapi_execute_compressed_batch_commands_compressedbatch__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getrestoreoperation/": { - "get": { - "summary": "Fastapi Get Restore Operation", - "operationId": "fastapi_get_restore_operation_getrestoreoperation__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setrestoreoperation/": { - "post": { - "summary": "Fastapi Set Restore Operation", - "operationId": "fastapi_set_restore_operation_setrestoreoperation__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Operation", - "type": "integer" - }, - "name": "operation", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/isnode/": { - "get": { - "summary": "Fastapi Is Node", - "operationId": "fastapi_is_node_isnode__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node", - "type": "string" - }, - "name": "node", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/isjunction/": { - "get": { - "summary": "Fastapi Is Junction", - "operationId": "fastapi_is_junction_isjunction__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node", - "type": "string" - }, - "name": "node", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/isreservoir/": { - "get": { - "summary": "Fastapi Is Reservoir", - "operationId": "fastapi_is_reservoir_isreservoir__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node", - "type": "string" - }, - "name": "node", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/istank/": { - "get": { - "summary": "Fastapi Is Tank", - "operationId": "fastapi_is_tank_istank__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node", - "type": "string" - }, - "name": "node", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/islink/": { - "get": { - "summary": "Fastapi Is Link", - "operationId": "fastapi_is_link_islink__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Link", - "type": "string" - }, - "name": "link", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/ispipe/": { - "get": { - "summary": "Fastapi Is Pipe", - "operationId": "fastapi_is_pipe_ispipe__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Link", - "type": "string" - }, - "name": "link", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/ispump/": { - "get": { - "summary": "Fastapi Is Pump", - "operationId": "fastapi_is_pump_ispump__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Link", - "type": "string" - }, - "name": "link", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/isvalve/": { - "get": { - "summary": "Fastapi Is Valve", - "operationId": "fastapi_is_valve_isvalve__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Link", - "type": "string" - }, - "name": "link", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/iscurve/": { - "get": { - "summary": "Fastapi Is Curve", - "operationId": "fastapi_is_curve_iscurve__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Curve", - "type": "string" - }, - "name": "curve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/ispattern/": { - "get": { - "summary": "Fastapi Is Pattern", - "operationId": "fastapi_is_pattern_ispattern__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pattern", - "type": "string" - }, - "name": "pattern", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getnodes/": { - "get": { - "summary": "Fastapi Get Nodes", - "operationId": "fastapi_get_nodes_getnodes__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getlinks/": { - "get": { - "summary": "Fastapi Get Links", - "operationId": "fastapi_get_links_getlinks__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getcurves/": { - "get": { - "summary": "Fastapi Get Curves", - "operationId": "fastapi_get_curves_getcurves__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpatterns/": { - "get": { - "summary": "Fastapi Get Patterns", - "operationId": "fastapi_get_patterns_getpatterns__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getnodelinks/": { - "get": { - "summary": "Get Node Links", - "operationId": "get_node_links_getnodelinks__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node", - "type": "string" - }, - "name": "node", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettitleschema/": { - "get": { - "summary": "Fast Get Title Schema", - "operationId": "fast_get_title_schema_gettitleschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettitle/": { - "get": { - "summary": "Fast Get Title", - "operationId": "fast_get_title_gettitle__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settitle/": { - "get": { - "summary": "Fastapi Set Title", - "operationId": "fastapi_set_title_settitle__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getjunctionschema": { - "get": { - "summary": "Fast Get Junction Schema", - "operationId": "fast_get_junction_schema_getjunctionschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addjunction/": { - "post": { - "summary": "Fastapi Add Junction", - "operationId": "fastapi_add_junction_addjunction__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "X", - "type": "number" - }, - "name": "x", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Y", - "type": "number" - }, - "name": "y", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Z", - "type": "number" - }, - "name": "z", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletejunction/": { - "post": { - "summary": "Fastapi Delete Junction", - "operationId": "fastapi_delete_junction_deletejunction__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getjunctionelevation/": { - "get": { - "summary": "Fastapi Get Junction Elevation", - "operationId": "fastapi_get_junction_elevation_getjunctionelevation__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getjunctionx/": { - "get": { - "summary": "Fastapi Get Junction X", - "operationId": "fastapi_get_junction_x_getjunctionx__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getjunctiony/": { - "get": { - "summary": "Fastapi Get Junction X", - "operationId": "fastapi_get_junction_x_getjunctiony__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getjunctioncoord/": { - "get": { - "summary": "Fastapi Get Junction Coord", - "operationId": "fastapi_get_junction_coord_getjunctioncoord__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getjunctiondemand/": { - "get": { - "summary": "Fastapi Get Junction Demand", - "operationId": "fastapi_get_junction_demand_getjunctiondemand__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getjunctionpattern/": { - "get": { - "summary": "Fastapi Get Junction Pattern", - "operationId": "fastapi_get_junction_pattern_getjunctionpattern__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setjunctionelevation/": { - "post": { - "summary": "Fastapi Set Junction Elevation", - "operationId": "fastapi_set_junction_elevation_setjunctionelevation__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Elevation", - "type": "number" - }, - "name": "elevation", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setjunctionx/": { - "post": { - "summary": "Fastapi Set Junction X", - "operationId": "fastapi_set_junction_x_setjunctionx__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "X", - "type": "number" - }, - "name": "x", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setjunctiony/": { - "post": { - "summary": "Fastapi Set Junction Y", - "operationId": "fastapi_set_junction_y_setjunctiony__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Y", - "type": "number" - }, - "name": "y", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setjunctioncoord/": { - "post": { - "summary": "Fastapi Set Junction Coord", - "operationId": "fastapi_set_junction_coord_setjunctioncoord__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "X", - "type": "number" - }, - "name": "x", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Y", - "type": "number" - }, - "name": "y", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setjunctiondemand/": { - "post": { - "summary": "Fastapi Set Junction Demand", - "operationId": "fastapi_set_junction_demand_setjunctiondemand__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Demand", - "type": "number" - }, - "name": "demand", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setjunctionpattern/": { - "post": { - "summary": "Fastapi Set Junction Pattern", - "operationId": "fastapi_set_junction_pattern_setjunctionpattern__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pattern", - "type": "string" - }, - "name": "pattern", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getjunctionproperties/": { - "get": { - "summary": "Fastapi Get Junction Properties", - "operationId": "fastapi_get_junction_properties_getjunctionproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setjunctionproperties/": { - "post": { - "summary": "Fastapi Set Junction Properties", - "operationId": "fastapi_set_junction_properties_setjunctionproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getreservoirschema": { - "get": { - "summary": "Fast Get Reservoir Schema", - "operationId": "fast_get_reservoir_schema_getreservoirschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addreservoir/": { - "post": { - "summary": "Fastapi Add Reservoir", - "operationId": "fastapi_add_reservoir_addreservoir__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "X", - "type": "number" - }, - "name": "x", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Y", - "type": "number" - }, - "name": "y", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Head", - "type": "number" - }, - "name": "head", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletereservoir/": { - "post": { - "summary": "Fastapi Delete Reservoir", - "operationId": "fastapi_delete_reservoir_deletereservoir__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getreservoirhead/": { - "get": { - "summary": "Fastapi Get Reservoir Head", - "operationId": "fastapi_get_reservoir_head_getreservoirhead__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getreservoirpattern/": { - "get": { - "summary": "Fastapi Get Reservoir Pattern", - "operationId": "fastapi_get_reservoir_pattern_getreservoirpattern__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getreservoirx/": { - "get": { - "summary": "Fastapi Get Reservoir X", - "operationId": "fastapi_get_reservoir_x_getreservoirx__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getreservoiry/": { - "get": { - "summary": "Fastapi Get Reservoir Y", - "operationId": "fastapi_get_reservoir_y_getreservoiry__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getreservoircoord/": { - "get": { - "summary": "Fastapi Get Reservoir Y", - "operationId": "fastapi_get_reservoir_y_getreservoircoord__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setreservoirhead/": { - "post": { - "summary": "Fastapi Set Reservoir Head", - "operationId": "fastapi_set_reservoir_head_setreservoirhead__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Head", - "type": "number" - }, - "name": "head", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setreservoirpattern/": { - "post": { - "summary": "Fastapi Set Reservoir Pattern", - "operationId": "fastapi_set_reservoir_pattern_setreservoirpattern__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pattern", - "type": "string" - }, - "name": "pattern", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setreservoirx/": { - "post": { - "summary": "Fastapi Set Reservoir Y", - "operationId": "fastapi_set_reservoir_y_setreservoirx__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Y", - "type": "number" - }, - "name": "y", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setreservoircoord/": { - "post": { - "summary": "Fastapi Set Reservoir Y", - "operationId": "fastapi_set_reservoir_y_setreservoircoord__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "X", - "type": "number" - }, - "name": "x", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Y", - "type": "number" - }, - "name": "y", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getreservoirproperties/": { - "get": { - "summary": "Fastapi Get Reservoir Properties", - "operationId": "fastapi_get_reservoir_properties_getreservoirproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setreservoirproperties/": { - "post": { - "summary": "Fastapi Set Reservoir Properties", - "operationId": "fastapi_set_reservoir_properties_setreservoirproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Reservoir", - "type": "string" - }, - "name": "reservoir", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankschema": { - "get": { - "summary": "Fast Get Tank Schema", - "operationId": "fast_get_tank_schema_gettankschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addtank/": { - "post": { - "summary": "Fastapi Add Tank", - "operationId": "fastapi_add_tank_addtank__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "X", - "type": "number" - }, - "name": "x", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Y", - "type": "number" - }, - "name": "y", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Elevation", - "type": "number" - }, - "name": "elevation", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Init Level", - "type": "number", - "default": 0 - }, - "name": "init_level", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Min Level", - "type": "number", - "default": 0 - }, - "name": "min_level", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Max Level", - "type": "number", - "default": 0 - }, - "name": "max_level", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Diameter", - "type": "number", - "default": 0 - }, - "name": "diameter", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Min Vol", - "type": "number", - "default": 0 - }, - "name": "min_vol", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletetank/": { - "post": { - "summary": "Fastapi Delete Tank", - "operationId": "fastapi_delete_tank_deletetank__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankelevation/": { - "get": { - "summary": "Fastapi Get Tank Elevation", - "operationId": "fastapi_get_tank_elevation_gettankelevation__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankinitlevel/": { - "get": { - "summary": "Fastapi Get Tank Init Level", - "operationId": "fastapi_get_tank_init_level_gettankinitlevel__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankminlevel/": { - "get": { - "summary": "Fastapi Get Tank Min Level", - "operationId": "fastapi_get_tank_min_level_gettankminlevel__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankmaxlevel/": { - "get": { - "summary": "Fastapi Get Tank Max Level", - "operationId": "fastapi_get_tank_max_level_gettankmaxlevel__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankdiameter/": { - "get": { - "summary": "Fastapi Get Tank Diameter", - "operationId": "fastapi_get_tank_diameter_gettankdiameter__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankminvol/": { - "get": { - "summary": "Fastapi Get Tank Min Vol", - "operationId": "fastapi_get_tank_min_vol_gettankminvol__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankvolcurve/": { - "get": { - "summary": "Fastapi Get Tank Vol Curve", - "operationId": "fastapi_get_tank_vol_curve_gettankvolcurve__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankoverflow/": { - "get": { - "summary": "Fastapi Get Tank Overflow", - "operationId": "fastapi_get_tank_overflow_gettankoverflow__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankx/": { - "get": { - "summary": "Fastapi Get Tank X", - "operationId": "fastapi_get_tank_x_gettankx__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettanky/": { - "get": { - "summary": "Fastapi Get Tank X", - "operationId": "fastapi_get_tank_x_gettanky__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankcoord/": { - "get": { - "summary": "Fastapi Get Tank Coord", - "operationId": "fastapi_get_tank_coord_gettankcoord__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankelevation/": { - "post": { - "summary": "Fastapi Set Tank Elevation", - "operationId": "fastapi_set_tank_elevation_settankelevation__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Elevation", - "type": "number" - }, - "name": "elevation", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankinitlevel/": { - "post": { - "summary": "Fastapi Set Tank Init Level", - "operationId": "fastapi_set_tank_init_level_settankinitlevel__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Init Level", - "type": "number" - }, - "name": "init_level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankminlevel/": { - "post": { - "summary": "Fastapi Set Tank Min Level", - "operationId": "fastapi_set_tank_min_level_settankminlevel__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Min Level", - "type": "number" - }, - "name": "min_level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankmaxlevel/": { - "post": { - "summary": "Fastapi Set Tank Max Level", - "operationId": "fastapi_set_tank_max_level_settankmaxlevel__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Max Level", - "type": "number" - }, - "name": "max_level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "settankdiameter//": { - "post": { - "summary": "Fastapi Set Tank Diameter", - "operationId": "fastapi_set_tank_diametersettankdiameter___post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Diameter", - "type": "number" - }, - "name": "diameter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankminvol/": { - "post": { - "summary": "Fastapi Set Tank Min Vol", - "operationId": "fastapi_set_tank_min_vol_settankminvol__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Min Vol", - "type": "number" - }, - "name": "min_vol", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankvolcurve/": { - "post": { - "summary": "Fastapi Set Tank Vol Curve", - "operationId": "fastapi_set_tank_vol_curve_settankvolcurve__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Vol Curve", - "type": "string" - }, - "name": "vol_curve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankoverflow/": { - "post": { - "summary": "Fastapi Set Tank Overflow", - "operationId": "fastapi_set_tank_overflow_settankoverflow__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Overflow", - "type": "string" - }, - "name": "overflow", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankx/": { - "post": { - "summary": "Fastapi Set Tank X", - "operationId": "fastapi_set_tank_x_settankx__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "X", - "type": "number" - }, - "name": "x", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settanky/": { - "post": { - "summary": "Fastapi Set Tank Y", - "operationId": "fastapi_set_tank_y_settanky__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Y", - "type": "number" - }, - "name": "y", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankcoord/": { - "post": { - "summary": "Fastapi Set Tank Coord", - "operationId": "fastapi_set_tank_coord_settankcoord__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "X", - "type": "number" - }, - "name": "x", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Y", - "type": "number" - }, - "name": "y", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankproperties/": { - "get": { - "summary": "Fastapi Get Tank Properties", - "operationId": "fastapi_get_tank_properties_gettankproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankproperties/": { - "post": { - "summary": "Fastapi Set Tank Properties", - "operationId": "fastapi_set_tank_properties_settankproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpipeschema": { - "get": { - "summary": "Fastapi Get Pipe Schema", - "operationId": "fastapi_get_pipe_schema_getpipeschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addpipe/": { - "post": { - "summary": "Fastapi Add Pipe", - "operationId": "fastapi_add_pipe_addpipe__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node1", - "type": "string" - }, - "name": "node1", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node2", - "type": "string" - }, - "name": "node2", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Length", - "type": "number", - "default": 0 - }, - "name": "length", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Diameter", - "type": "number", - "default": 0 - }, - "name": "diameter", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Roughness", - "type": "number", - "default": 0 - }, - "name": "roughness", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Minor Loss", - "type": "number", - "default": 0 - }, - "name": "minor_loss", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Status", - "type": "string", - "default": "OPEN" - }, - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletepipe/": { - "post": { - "summary": "Fastapi Delete Pipe", - "operationId": "fastapi_delete_pipe_deletepipe__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpipenode1/": { - "get": { - "summary": "Fastapi Get Pipe Node1", - "operationId": "fastapi_get_pipe_node1_getpipenode1__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpipenode2/": { - "get": { - "summary": "Fastapi Get Pipe Node2", - "operationId": "fastapi_get_pipe_node2_getpipenode2__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpipelength/": { - "get": { - "summary": "Fastapi Get Pipe Length", - "operationId": "fastapi_get_pipe_length_getpipelength__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpipediameter/": { - "get": { - "summary": "Fastapi Get Pipe Diameter", - "operationId": "fastapi_get_pipe_diameter_getpipediameter__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpiperoughness/": { - "get": { - "summary": "Fastapi Get Pipe Roughness", - "operationId": "fastapi_get_pipe_roughness_getpiperoughness__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpipeminorloss/": { - "get": { - "summary": "Fastapi Get Pipe Minor Loss", - "operationId": "fastapi_get_pipe_minor_loss_getpipeminorloss__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpipestatus/": { - "get": { - "summary": "Fastapi Get Pipe Status", - "operationId": "fastapi_get_pipe_status_getpipestatus__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpipenode1/": { - "post": { - "summary": "Fastapi Set Pipe Node1", - "operationId": "fastapi_set_pipe_node1_setpipenode1__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node1", - "type": "string" - }, - "name": "node1", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpipenode2/": { - "post": { - "summary": "Fastapi Set Pipe Node2", - "operationId": "fastapi_set_pipe_node2_setpipenode2__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node2", - "type": "string" - }, - "name": "node2", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpipelength/": { - "post": { - "summary": "Fastapi Set Pipe Length", - "operationId": "fastapi_set_pipe_length_setpipelength__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Length", - "type": "number" - }, - "name": "length", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpipediameter/": { - "post": { - "summary": "Fastapi Set Pipe Diameter", - "operationId": "fastapi_set_pipe_diameter_setpipediameter__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Diameter", - "type": "number" - }, - "name": "diameter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpiperoughness/": { - "post": { - "summary": "Fastapi Set Pipe Roughness", - "operationId": "fastapi_set_pipe_roughness_setpiperoughness__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Roughness", - "type": "number" - }, - "name": "roughness", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpipeminorloss/": { - "post": { - "summary": "Fastapi Set Pipe Minor Loss", - "operationId": "fastapi_set_pipe_minor_loss_setpipeminorloss__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Minor Loss", - "type": "number" - }, - "name": "minor_loss", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpipestatus/": { - "post": { - "summary": "Fastapi Set Pipe Status", - "operationId": "fastapi_set_pipe_status_setpipestatus__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Status", - "type": "string" - }, - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpipeproperties/": { - "get": { - "summary": "Fastapi Get Pipe Properties", - "operationId": "fastapi_get_pipe_properties_getpipeproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpipeproperties/": { - "post": { - "summary": "Fastapi Set Pipe Properties", - "operationId": "fastapi_set_pipe_properties_setpipeproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpumpschema": { - "get": { - "summary": "Fastapi Get Pump Schema", - "operationId": "fastapi_get_pump_schema_getpumpschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addpump/": { - "post": { - "summary": "Fastapi Add Pump", - "operationId": "fastapi_add_pump_addpump__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pump", - "type": "string" - }, - "name": "pump", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node1", - "type": "string" - }, - "name": "node1", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node2", - "type": "string" - }, - "name": "node2", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Power", - "type": "number", - "default": 0.0 - }, - "name": "power", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletepump/": { - "post": { - "summary": "Fastapi Delete Pump", - "operationId": "fastapi_delete_pump_deletepump__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pump", - "type": "string" - }, - "name": "pump", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpumpnode1/": { - "get": { - "summary": "Fastapi Get Pump Node1", - "operationId": "fastapi_get_pump_node1_getpumpnode1__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pump", - "type": "string" - }, - "name": "pump", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpumpnode2/": { - "get": { - "summary": "Fastapi Get Pump Node2", - "operationId": "fastapi_get_pump_node2_getpumpnode2__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pump", - "type": "string" - }, - "name": "pump", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpumpnode1/": { - "post": { - "summary": "Fastapi Set Pump Node1", - "operationId": "fastapi_set_pump_node1_setpumpnode1__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pump", - "type": "string" - }, - "name": "pump", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node1", - "type": "string" - }, - "name": "node1", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpumpnode2/": { - "post": { - "summary": "Fastapi Set Pump Node2", - "operationId": "fastapi_set_pump_node2_setpumpnode2__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pump", - "type": "string" - }, - "name": "pump", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node2", - "type": "string" - }, - "name": "node2", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpumpproperties/": { - "get": { - "summary": "Fastapi Get Pump Properties", - "operationId": "fastapi_get_pump_properties_getpumpproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pump", - "type": "string" - }, - "name": "pump", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpumpproperties/": { - "post": { - "summary": "Fastapi Set Pump Properties", - "operationId": "fastapi_set_pump_properties_setpumpproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pump", - "type": "string" - }, - "name": "pump", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvalveschema": { - "get": { - "summary": "Fastapi Get Valve Schema", - "operationId": "fastapi_get_valve_schema_getvalveschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addvalve/": { - "post": { - "summary": "Fastapi Add Valve", - "operationId": "fastapi_add_valve_addvalve__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node1", - "type": "string" - }, - "name": "node1", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node2", - "type": "string" - }, - "name": "node2", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Diameter", - "type": "number", - "default": 0 - }, - "name": "diameter", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "V Type", - "type": "string", - "default": "PRV" - }, - "name": "v_type", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Setting", - "type": "number", - "default": 0 - }, - "name": "setting", - "in": "query" - }, - { - "required": false, - "schema": { - "title": "Minor Loss", - "type": "number", - "default": 0 - }, - "name": "minor_loss", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletevalve/": { - "post": { - "summary": "Fastapi Delete Valve", - "operationId": "fastapi_delete_valve_deletevalve__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvalvenode1/": { - "get": { - "summary": "Fastapi Get Valve Node1", - "operationId": "fastapi_get_valve_node1_getvalvenode1__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvalvenode2/": { - "get": { - "summary": "Fastapi Get Valve Node2", - "operationId": "fastapi_get_valve_node2_getvalvenode2__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvalvediameter/": { - "get": { - "summary": "Fastapi Get Valve Diameter", - "operationId": "fastapi_get_valve_diameter_getvalvediameter__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvalvetype/": { - "get": { - "summary": "Fastapi Get Valve Type", - "operationId": "fastapi_get_valve_type_getvalvetype__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvalvesetting/": { - "get": { - "summary": "Fastapi Get Valve Setting", - "operationId": "fastapi_get_valve_setting_getvalvesetting__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvalveminorloss/": { - "get": { - "summary": "Fastapi Get Valve Minor Loss", - "operationId": "fastapi_get_valve_minor_loss_getvalveminorloss__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setvalvenode1/": { - "post": { - "summary": "Fastapi Set Valve Node1", - "operationId": "fastapi_set_valve_node1_setvalvenode1__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node1", - "type": "string" - }, - "name": "node1", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setvalvenode2/": { - "post": { - "summary": "Fastapi Set Valve Node2", - "operationId": "fastapi_set_valve_node2_setvalvenode2__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node2", - "type": "string" - }, - "name": "node2", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setvalvenodediameter/": { - "post": { - "summary": "Fastapi Set Valve Diameter", - "operationId": "fastapi_set_valve_diameter_setvalvenodediameter__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Diameter", - "type": "number" - }, - "name": "diameter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setvalvetype/": { - "post": { - "summary": "Fastapi Set Valve Type", - "operationId": "fastapi_set_valve_type_setvalvetype__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Type", - "type": "string" - }, - "name": "type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setvalvesetting/": { - "post": { - "summary": "Fastapi Set Valve Setting", - "operationId": "fastapi_set_valve_setting_setvalvesetting__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Setting", - "type": "number" - }, - "name": "setting", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvalveproperties/": { - "get": { - "summary": "Fastapi Get Valve Properties", - "operationId": "fastapi_get_valve_properties_getvalveproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setvalveproperties/": { - "post": { - "summary": "Fastapi Set Valve Properties", - "operationId": "fastapi_set_valve_properties_setvalveproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Valve", - "type": "string" - }, - "name": "valve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletenode/": { - "post": { - "summary": "Fastapi Delete Node", - "operationId": "fastapi_delete_node_deletenode__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node", - "type": "string" - }, - "name": "node", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletelink/": { - "post": { - "summary": "Fastapi Delete Link", - "operationId": "fastapi_delete_link_deletelink__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Link", - "type": "string" - }, - "name": "link", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettagschema/": { - "get": { - "summary": "Fastapi Get Tag Schema", - "operationId": "fastapi_get_tag_schema_gettagschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettag/": { - "get": { - "summary": "Fastapi Get Tag", - "operationId": "fastapi_get_tag_gettag__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "T Type", - "type": "string" - }, - "name": "t_type", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Id", - "type": "string" - }, - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettags/": { - "get": { - "summary": "Fastapi Get Tags", - "operationId": "fastapi_get_tags_gettags__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settag/": { - "post": { - "summary": "Fastapi Set Tag", - "operationId": "fastapi_set_tag_settag__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getdemandschema": { - "get": { - "summary": "Fastapi Get Demand Schema", - "operationId": "fastapi_get_demand_schema_getdemandschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getdemandproperties/": { - "get": { - "summary": "Fastapi Get Demand Properties", - "operationId": "fastapi_get_demand_properties_getdemandproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setdemandproperties/": { - "post": { - "summary": "Fastapi Set Demand Properties", - "operationId": "fastapi_set_demand_properties_setdemandproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getstatusschema": { - "get": { - "summary": "Fastapi Get Status Schema", - "operationId": "fastapi_get_status_schema_getstatusschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getstatus/": { - "get": { - "summary": "Fastapi Get Status", - "operationId": "fastapi_get_status_getstatus__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Link", - "type": "string" - }, - "name": "link", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setstatus/": { - "post": { - "summary": "Fastapi Set Status Properties", - "operationId": "fastapi_set_status_properties_setstatus__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Link", - "type": "string" - }, - "name": "link", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpatternschema": { - "get": { - "summary": "Fastapi Get Pattern Schema", - "operationId": "fastapi_get_pattern_schema_getpatternschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addpattern/": { - "post": { - "summary": "Fastapi Add Pattern", - "operationId": "fastapi_add_pattern_addpattern__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pattern", - "type": "string" - }, - "name": "pattern", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletepattern/": { - "post": { - "summary": "Fastapi Delete Pattern", - "operationId": "fastapi_delete_pattern_deletepattern__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pattern", - "type": "string" - }, - "name": "pattern", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpatternproperties/": { - "get": { - "summary": "Fastapi Get Pattern Properties", - "operationId": "fastapi_get_pattern_properties_getpatternproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pattern", - "type": "string" - }, - "name": "pattern", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpatternproperties/": { - "post": { - "summary": "Fastapi Set Pattern Properties", - "operationId": "fastapi_set_pattern_properties_setpatternproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pattern", - "type": "string" - }, - "name": "pattern", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getcurveschema": { - "get": { - "summary": "Fastapi Get Curve Schema", - "operationId": "fastapi_get_curve_schema_getcurveschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addcurve/": { - "post": { - "summary": "Fastapi Add Curve", - "operationId": "fastapi_add_curve_addcurve__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Curve", - "type": "string" - }, - "name": "curve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletecurve/": { - "post": { - "summary": "Fastapi Delete Curve", - "operationId": "fastapi_delete_curve_deletecurve__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Curve", - "type": "string" - }, - "name": "curve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getcurveproperties/": { - "get": { - "summary": "Fastapi Get Curve Properties", - "operationId": "fastapi_get_curve_properties_getcurveproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Curve", - "type": "string" - }, - "name": "curve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setcurveproperties/": { - "post": { - "summary": "Fastapi Set Curve Properties", - "operationId": "fastapi_set_curve_properties_setcurveproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Curve", - "type": "string" - }, - "name": "curve", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getcontrolschema/": { - "get": { - "summary": "Fastapi Get Control Schema", - "operationId": "fastapi_get_control_schema_getcontrolschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getcontrolproperties/": { - "get": { - "summary": "Fastapi Get Control Properties", - "operationId": "fastapi_get_control_properties_getcontrolproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setcontrolproperties/": { - "post": { - "summary": "Fastapi Set Control Properties", - "operationId": "fastapi_set_control_properties_setcontrolproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getruleschema/": { - "get": { - "summary": "Fastapi Get Rule Schema", - "operationId": "fastapi_get_rule_schema_getruleschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getruleproperties/": { - "get": { - "summary": "Fastapi Get Rule Properties", - "operationId": "fastapi_get_rule_properties_getruleproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setruleproperties/": { - "post": { - "summary": "Fastapi Set Rule Properties", - "operationId": "fastapi_set_rule_properties_setruleproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getenergyschema/": { - "get": { - "summary": "Fastapi Get Energy Schema", - "operationId": "fastapi_get_energy_schema_getenergyschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getenergyproperties/": { - "get": { - "summary": "Fastapi Get Energy Properties", - "operationId": "fastapi_get_energy_properties_getenergyproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setenergyproperties/": { - "post": { - "summary": "Fastapi Set Energy Properties", - "operationId": "fastapi_set_energy_properties_setenergyproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpumpenergyschema/": { - "get": { - "summary": "Fastapi Get Pump Energy Schema", - "operationId": "fastapi_get_pump_energy_schema_getpumpenergyschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpumpenergyproperties//": { - "get": { - "summary": "Fastapi Get Pump Energy Proeprties", - "operationId": "fastapi_get_pump_energy_proeprties_getpumpenergyproperties___get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pump", - "type": "string" - }, - "name": "pump", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpumpenergyproperties//": { - "get": { - "summary": "Fastapi Set Pump Energy Properties", - "operationId": "fastapi_set_pump_energy_properties_setpumpenergyproperties___get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pump", - "type": "string" - }, - "name": "pump", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getemitterschema": { - "get": { - "summary": "Fastapi Get Emitter Schema", - "operationId": "fastapi_get_emitter_schema_getemitterschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getemitterproperties/": { - "get": { - "summary": "Fastapi Get Emitter Properties", - "operationId": "fastapi_get_emitter_properties_getemitterproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setemitterproperties/": { - "post": { - "summary": "Fastapi Set Emitter Properties", - "operationId": "fastapi_set_emitter_properties_setemitterproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Junction", - "type": "string" - }, - "name": "junction", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getqualityschema/": { - "get": { - "summary": "Fastapi Get Quality Schema", - "operationId": "fastapi_get_quality_schema_getqualityschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getqualityproperties/": { - "get": { - "summary": "Fastapi Get Quality Properties", - "operationId": "fastapi_get_quality_properties_getqualityproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node", - "type": "string" - }, - "name": "node", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setqualityproperties/": { - "post": { - "summary": "Fastapi Set Quality Properties", - "operationId": "fastapi_set_quality_properties_setqualityproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getsourcechema/": { - "get": { - "summary": "Fastapi Get Source Schema", - "operationId": "fastapi_get_source_schema_getsourcechema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getsource/": { - "get": { - "summary": "Fastapi Get Source", - "operationId": "fastapi_get_source_getsource__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node", - "type": "string" - }, - "name": "node", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setsource/": { - "post": { - "summary": "Fastapi Set Source", - "operationId": "fastapi_set_source_setsource__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addsource/": { - "post": { - "summary": "Fastapi Add Source", - "operationId": "fastapi_add_source_addsource__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletesource/": { - "post": { - "summary": "Fastapi Delete Source", - "operationId": "fastapi_delete_source_deletesource__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node", - "type": "string" - }, - "name": "node", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getreactionschema/": { - "get": { - "summary": "Fastapi Get Reaction Schema", - "operationId": "fastapi_get_reaction_schema_getreactionschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getreaction/": { - "get": { - "summary": "Fastapi Get Reaction", - "operationId": "fastapi_get_reaction_getreaction__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setreaction/": { - "post": { - "summary": "Fastapi Set Reaction", - "operationId": "fastapi_set_reaction_setreaction__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpipereactionschema/": { - "get": { - "summary": "Fastapi Get Pipe Reaction Schema", - "operationId": "fastapi_get_pipe_reaction_schema_getpipereactionschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getpipereaction/": { - "get": { - "summary": "Fastapi Get Pipe Reaction", - "operationId": "fastapi_get_pipe_reaction_getpipereaction__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Pipe", - "type": "string" - }, - "name": "pipe", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setpipereaction/": { - "post": { - "summary": "Fastapi Set Pipe Reaction", - "operationId": "fastapi_set_pipe_reaction_setpipereaction__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankreactionschema/": { - "get": { - "summary": "Fastapi Get Tank Reaction Schema", - "operationId": "fastapi_get_tank_reaction_schema_gettankreactionschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettankreaction/": { - "get": { - "summary": "Fastapi Get Tank Reaction", - "operationId": "fastapi_get_tank_reaction_gettankreaction__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settankreaction/": { - "post": { - "summary": "Fastapi Set Tank Reaction", - "operationId": "fastapi_set_tank_reaction_settankreaction__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getmixingschema/": { - "get": { - "summary": "Fastapi Get Mixing Schema", - "operationId": "fastapi_get_mixing_schema_getmixingschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getmixing/": { - "get": { - "summary": "Fastapi Get Mixing", - "operationId": "fastapi_get_mixing_getmixing__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Tank", - "type": "string" - }, - "name": "tank", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setmixing/": { - "post": { - "summary": "Fastapi Set Mixing", - "operationId": "fastapi_set_mixing_setmixing__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addmixing/": { - "post": { - "summary": "Fastapi Add Mixing", - "operationId": "fastapi_add_mixing_addmixing__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletemixing/": { - "post": { - "summary": "Fastapi Delete Mixing", - "operationId": "fastapi_delete_mixing_deletemixing__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettimeschema": { - "get": { - "summary": "Fastapi Get Time Schema", - "operationId": "fastapi_get_time_schema_gettimeschema_get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/gettimeproperties/": { - "get": { - "summary": "Fastapi Get Time Properties", - "operationId": "fastapi_get_time_properties_gettimeproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/settimeproperties/": { - "post": { - "summary": "Fastapi Set Time Properties", - "operationId": "fastapi_set_time_properties_settimeproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getoptionschema/": { - "get": { - "summary": "Fastapi Get Option Schema", - "operationId": "fastapi_get_option_schema_getoptionschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getoptionproperties/": { - "get": { - "summary": "Fastapi Get Option Properties", - "operationId": "fastapi_get_option_properties_getoptionproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setoptionproperties/": { - "post": { - "summary": "Fastapi Set Option Properties", - "operationId": "fastapi_set_option_properties_setoptionproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getnodecoord/": { - "get": { - "summary": "Fastapi Get Node Coord", - "operationId": "fastapi_get_node_coord_getnodecoord__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Node", - "type": "string" - }, - "name": "node", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getnetworkcoords/": { - "get": { - "summary": "Fastapi Get Network Coords", - "operationId": "fastapi_get_network_coords_getnetworkcoords__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getmajornodecoords/": { - "get": { - "summary": "Fastapi Get Major Node Coords", - "operationId": "fastapi_get_major_node_coords_getmajornodecoords__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Diameter", - "type": "integer" - }, - "name": "diameter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getnetworklinknodes/": { - "get": { - "summary": "Fastapi Get Network Link Nodes", - "operationId": "fastapi_get_network_link_nodes_getnetworklinknodes__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getmajorpipenodes/": { - "get": { - "summary": "Fastapi Get Major Pipe Nodes", - "operationId": "fastapi_get_major_pipe_nodes_getmajorpipenodes__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Diameter", - "type": "integer" - }, - "name": "diameter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvertexschema/": { - "get": { - "summary": "Fastapi Get Vertex Schema", - "operationId": "fastapi_get_vertex_schema_getvertexschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvertexproperties/": { - "get": { - "summary": "Fastapi Get Vertex Properties", - "operationId": "fastapi_get_vertex_properties_getvertexproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Link", - "type": "string" - }, - "name": "link", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setvertexproperties/": { - "post": { - "summary": "Fastapi Set Vertex Properties", - "operationId": "fastapi_set_vertex_properties_setvertexproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addvertex/": { - "post": { - "summary": "Fastapi Add Vertex", - "operationId": "fastapi_add_vertex_addvertex__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletevertex/": { - "post": { - "summary": "Fastapi Delete Vertex", - "operationId": "fastapi_delete_vertex_deletevertex__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getallvertexlinks/": { - "get": { - "summary": "Fastapi Get All Vertex Links", - "operationId": "fastapi_get_all_vertex_links_getallvertexlinks__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getallvertices/": { - "get": { - "summary": "Fastapi Get All Vertices", - "operationId": "fastapi_get_all_vertices_getallvertices__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getlabelschema/": { - "get": { - "summary": "Fastapi Get Label Schema", - "operationId": "fastapi_get_label_schema_getlabelschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getlabelproperties/": { - "get": { - "summary": "Fastapi Get Label Properties", - "operationId": "fastapi_get_label_properties_getlabelproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "X", - "type": "number" - }, - "name": "x", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Y", - "type": "number" - }, - "name": "y", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setlabelproperties/": { - "post": { - "summary": "Fastapi Set Label Properties", - "operationId": "fastapi_set_label_properties_setlabelproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addlabel/": { - "post": { - "summary": "Fastapi Add Label", - "operationId": "fastapi_add_label_addlabel__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletelabel/": { - "post": { - "summary": "Fastapi Delete Label", - "operationId": "fastapi_delete_label_deletelabel__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getbackdropschema/": { - "get": { - "summary": "Fastapi Get Backdrop Schema", - "operationId": "fastapi_get_backdrop_schema_getbackdropschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getbackdropproperties/": { - "get": { - "summary": "Fastapi Get Backdrop Properties", - "operationId": "fastapi_get_backdrop_properties_getbackdropproperties__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setbackdropproperties/": { - "post": { - "summary": "Fastapi Set Backdrop Properties", - "operationId": "fastapi_set_backdrop_properties_setbackdropproperties__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getscadadeviceschema/": { - "get": { - "summary": "Fastapi Get Scada Device Schema", - "operationId": "fastapi_get_scada_device_schema_getscadadeviceschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getscadadevice/": { - "get": { - "summary": "Fastapi Get Scada Device", - "operationId": "fastapi_get_scada_device_getscadadevice__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Id", - "type": "string" - }, - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setscadadevice/": { - "post": { - "summary": "Fastapi Set Scada Device", - "operationId": "fastapi_set_scada_device_setscadadevice__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addscadadevice/": { - "post": { - "summary": "Fastapi Add Scada Device", - "operationId": "fastapi_add_scada_device_addscadadevice__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletescadadevice/": { - "post": { - "summary": "Fastapi Delete Scada Device", - "operationId": "fastapi_delete_scada_device_deletescadadevice__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/cleanscadadevice/": { - "post": { - "summary": "Fastapi Clean Scada Device", - "operationId": "fastapi_clean_scada_device_cleanscadadevice__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getallscadadeviceids/": { - "get": { - "summary": "Fastapi Get All Scada Device Ids", - "operationId": "fastapi_get_all_scada_device_ids_getallscadadeviceids__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getallscadadevices/": { - "get": { - "summary": "Fastapi Get All Scada Devices", - "operationId": "fastapi_get_all_scada_devices_getallscadadevices__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getscadadevicedataschema/": { - "get": { - "summary": "Fastapi Get Scada Device Data Schema", - "operationId": "fastapi_get_scada_device_data_schema_getscadadevicedataschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getscadadevicedata/": { - "get": { - "summary": "Fastapi Get Scada Device Data", - "operationId": "fastapi_get_scada_device_data_getscadadevicedata__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Id", - "type": "string" - }, - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setscadadevicedata/": { - "post": { - "summary": "Fastapi Set Scada Device Data", - "operationId": "fastapi_set_scada_device_data_setscadadevicedata__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addscadadevicedata/": { - "post": { - "summary": "Fastapi Add Scada Device Data", - "operationId": "fastapi_add_scada_device_data_addscadadevicedata__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletescadadevicedata/": { - "post": { - "summary": "Fastapi Delete Scada Device Data", - "operationId": "fastapi_delete_scada_device_data_deletescadadevicedata__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/cleanscadadevicedata/": { - "post": { - "summary": "Fastapi Clean Scada Device Data", - "operationId": "fastapi_clean_scada_device_data_cleanscadadevicedata__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getscadaelementschema/": { - "get": { - "summary": "Fastapi Get Scada Element Schema", - "operationId": "fastapi_get_scada_element_schema_getscadaelementschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getscadaelements/": { - "get": { - "summary": "Fastapi Get Scada Elements", - "operationId": "fastapi_get_scada_elements_getscadaelements__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getscadaelement/": { - "get": { - "summary": "Fastapi Get Scada Element", - "operationId": "fastapi_get_scada_element_getscadaelement__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Id", - "type": "string" - }, - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setscadaelement/": { - "post": { - "summary": "Fastapi Set Scada Element", - "operationId": "fastapi_set_scada_element_setscadaelement__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addscadaelement/": { - "post": { - "summary": "Fastapi Add Scada Element", - "operationId": "fastapi_add_scada_element_addscadaelement__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletescadaelement/": { - "post": { - "summary": "Fastapi Delete Scada Element", - "operationId": "fastapi_delete_scada_element_deletescadaelement__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/cleanscadaelement/": { - "post": { - "summary": "Fastapi Clean Scada Element", - "operationId": "fastapi_clean_scada_element_cleanscadaelement__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getregionschema/": { - "get": { - "summary": "Fastapi Get Region Schema", - "operationId": "fastapi_get_region_schema_getregionschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getregion/": { - "get": { - "summary": "Fastapi Get Region", - "operationId": "fastapi_get_region_getregion__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Id", - "type": "string" - }, - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setregion/": { - "post": { - "summary": "Fastapi Set Region", - "operationId": "fastapi_set_region_setregion__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addregion/": { - "post": { - "summary": "Fastapi Add Region", - "operationId": "fastapi_add_region_addregion__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deleteregion/": { - "post": { - "summary": "Fastapi Delete Region", - "operationId": "fastapi_delete_region_deleteregion__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/calculatedistrictmeteringareafornodes/": { - "get": { - "summary": "Fastapi Calculate District Metering Area For Nodes", - "operationId": "fastapi_calculate_district_metering_area_for_nodes_calculatedistrictmeteringareafornodes__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/calculatedistrictmeteringareaforregion/": { - "get": { - "summary": "Fastapi Calculate District Metering Area For Region", - "operationId": "fastapi_calculate_district_metering_area_for_region_calculatedistrictmeteringareaforregion__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/calculatedistrictmeteringareafornetwork/": { - "get": { - "summary": "Fastapi Calculate District Metering Area For Network", - "operationId": "fastapi_calculate_district_metering_area_for_network_calculatedistrictmeteringareafornetwork__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getdistrictmeteringareaschema/": { - "get": { - "summary": "Fastapi Get District Metering Area Schema", - "operationId": "fastapi_get_district_metering_area_schema_getdistrictmeteringareaschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getdistrictmeteringarea/": { - "get": { - "summary": "Fastapi Get District Metering Area", - "operationId": "fastapi_get_district_metering_area_getdistrictmeteringarea__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Id", - "type": "string" - }, - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setdistrictmeteringarea/": { - "post": { - "summary": "Fastapi Set District Metering Area", - "operationId": "fastapi_set_district_metering_area_setdistrictmeteringarea__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/adddistrictmeteringarea/": { - "post": { - "summary": "Fastapi Add District Metering Area", - "operationId": "fastapi_add_district_metering_area_adddistrictmeteringarea__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletedistrictmeteringarea/": { - "post": { - "summary": "Fastapi Delete District Metering Area", - "operationId": "fastapi_delete_district_metering_area_deletedistrictmeteringarea__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getalldistrictmeteringareaids/": { - "get": { - "summary": "Fastapi Get All District Metering Area Ids", - "operationId": "fastapi_get_all_district_metering_area_ids_getalldistrictmeteringareaids__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getalldistrictmeteringareas/": { - "get": { - "summary": "Getalldistrictmeteringareas", - "operationId": "getalldistrictmeteringareas_getalldistrictmeteringareas__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/generatedistrictmeteringarea/": { - "post": { - "summary": "Fastapi Generate District Metering Area", - "operationId": "fastapi_generate_district_metering_area_generatedistrictmeteringarea__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Part Count", - "type": "integer" - }, - "name": "part_count", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Part Type", - "type": "integer" - }, - "name": "part_type", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Inflate Delta", - "type": "number" - }, - "name": "inflate_delta", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/generatesubdistrictmeteringarea/": { - "post": { - "summary": "Fastapi Generate Sub District Metering Area", - "operationId": "fastapi_generate_sub_district_metering_area_generatesubdistrictmeteringarea__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Dma", - "type": "string" - }, - "name": "dma", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Part Count", - "type": "integer" - }, - "name": "part_count", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Part Type", - "type": "integer" - }, - "name": "part_type", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Inflate Delta", - "type": "number" - }, - "name": "inflate_delta", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/calculateservicearea/": { - "get": { - "summary": "Fastapi Calculate Service Area", - "operationId": "fastapi_calculate_service_area_calculateservicearea__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Time Index", - "type": "integer" - }, - "name": "time_index", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getserviceareaschema/": { - "get": { - "summary": "Fastapi Get Service Area Schema", - "operationId": "fastapi_get_service_area_schema_getserviceareaschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getservicearea/": { - "get": { - "summary": "Fastapi Get Service Area", - "operationId": "fastapi_get_service_area_getservicearea__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Id", - "type": "string" - }, - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setservicearea/": { - "post": { - "summary": "Fastapi Set Service Area", - "operationId": "fastapi_set_service_area_setservicearea__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addservicearea/": { - "post": { - "summary": "Fastapi Add Service Area", - "operationId": "fastapi_add_service_area_addservicearea__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deleteservicearea/": { - "post": { - "summary": "Fastapi Delete Service Area", - "operationId": "fastapi_delete_service_area_deleteservicearea__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getallserviceareas/": { - "get": { - "summary": "Fastapi Get All Service Areas", - "operationId": "fastapi_get_all_service_areas_getallserviceareas__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/generateservicearea/": { - "post": { - "summary": "Fastapi Generate Service Area", - "operationId": "fastapi_generate_service_area_generateservicearea__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Inflate Delta", - "type": "number" - }, - "name": "inflate_delta", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/calculatevirtualdistrict/": { - "get": { - "summary": "Fastapi Calculate Virtual District", - "operationId": "fastapi_calculate_virtual_district_calculatevirtualdistrict__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "Centers", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvirtualdistrictschema/": { - "get": { - "summary": "Fastapi Get Virtual District Schema", - "operationId": "fastapi_get_virtual_district_schema_getvirtualdistrictschema__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getvirtualdistrict/": { - "get": { - "summary": "Fastapi Get Virtual District", - "operationId": "fastapi_get_virtual_district_getvirtualdistrict__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Id", - "type": "string" - }, - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/setvirtualdistrict/": { - "post": { - "summary": "Fastapi Set Virtual District", - "operationId": "fastapi_set_virtual_district_setvirtualdistrict__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/addvirtualdistrict/": { - "post": { - "summary": "Fastapi Add Virtual District", - "operationId": "fastapi_add_virtual_district_addvirtualdistrict__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/deletevirtualdistrict/": { - "post": { - "summary": "Fastapi Delete Virtual District", - "operationId": "fastapi_delete_virtual_district_deletevirtualdistrict__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/getallvirtualdistrict/": { - "get": { - "summary": "Fastapi Get All Virtual District", - "operationId": "fastapi_get_all_virtual_district_getallvirtualdistrict__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/generatevirtualdistrict/": { - "post": { - "summary": "Fastapi Generate Virtual District", - "operationId": "fastapi_generate_virtual_district_generatevirtualdistrict__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Inflate Delta", - "type": "number" - }, - "name": "inflate_delta", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/calculatedemandtonodes/": { - "get": { - "summary": "Fastapi Calculate Demand To Nodes", - "operationId": "fastapi_calculate_demand_to_nodes_calculatedemandtonodes__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/calculatedemandtoregion/": { - "get": { - "summary": "Fastapi Calculate Demand To Region", - "operationId": "fastapi_calculate_demand_to_region_calculatedemandtoregion__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/calculatedemandtonetwork/": { - "get": { - "summary": "Fastapi Calculate Demand To Network", - "operationId": "fastapi_calculate_demand_to_network_calculatedemandtonetwork__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Network", - "type": "string" - }, - "name": "network", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Demand", - "type": "number" - }, - "name": "demand", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/uploadinp/": { - "post": { - "summary": "Upload Inp", - "operationId": "upload_inp_uploadinp__post", - "parameters": [ - { - "required": true, - "schema": { - "title": "Afile", - "type": "string", - "format": "binary" - }, - "name": "afile", - "in": "query" - }, - { - "required": true, - "schema": { - "title": "Name", - "type": "string" - }, - "name": "name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/downloadinp/": { - "get": { - "summary": "Download Inp", - "operationId": "download_inp_downloadinp__get", - "parameters": [ - { - "required": true, - "schema": { - "title": "Name", - "type": "string" - }, - "name": "name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/convertv3tov2/": { - "get": { - "summary": "Fastapi Convert V3 To V2", - "operationId": "fastapi_convert_v3_to_v2_convertv3tov2__get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/getjson/": { - "get": { - "summary": "Get Json", - "operationId": "get_json_getjson__get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/getrealtimedata/": { - "get": { - "summary": "Get Realtimedata", - "operationId": "get_realtimedata_getrealtimedata__get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/getsimulationresult/": { - "get": { - "summary": "Get Simulationresult", - "operationId": "get_simulationresult_getsimulationresult__get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - } - }, - "components": { - "schemas": { - "HTTPValidationError": { - "title": "HTTPValidationError", - "type": "object", - "properties": { - "detail": { - "title": "Detail", - "type": "array", - "items": { - "$ref": "#/components/schemas/ValidationError" - } - } - } - }, - "ValidationError": { - "title": "ValidationError", - "required": [ - "loc", - "msg", - "type" - ], - "type": "object", - "properties": { - "loc": { - "title": "Location", - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - } - }, - "msg": { - "title": "Message", - "type": "string" - }, - "type": { - "title": "Error Type", - "type": "string" - } - } - } - } - } -} \ No newline at end of file diff --git a/readme.md b/readme.md deleted file mode 100644 index 5036a06..0000000 --- a/readme.md +++ /dev/null @@ -1,97 +0,0 @@ -# TJWater Server (FastAPI) - -基于 FastAPI 和高性能数据库构建的水务业务服务端系统,提供管网模拟计算、SCADA 数据集成、网络元素管理、项目管理以及完整的安全认证体系。 - -## 🌟 主要功能 - -- **管网模拟**:集成 EPANET 引擎,支持水力模拟、水质模拟及爆管分析。 -- **SCADA 集成**:实时数据采集、存储与历史数据查询(支持 InfluxDB/TimescaleDB)。 -- **资产管理**:管网 GIS 数据管理,支持 GeoJSON 格式及拓扑分析。 -- **项目管理**:支持多项目环境切换、数据隔离与版本控制。 -- **安全体系**: - - **身份认证**:基于 OAuth2 与 JWT 的用户认证与授权。 - - **权限控制**:基于角色的访问控制 (RBAC)。 - - **数据加密**:敏感数据落盘加密存储。 - - **审计日志**:关键操作的全链路审计记录。 - -## 📚 文档资源 - -更多详细指南请参阅以下文档: - -- [SECURITY_README.md](./SECURITY_README.md) - 安全功能使用指南(认证、加密、审计) -- [DEPLOYMENT.md](./DEPLOYMENT.md) - 部署与集成指南 -- [INTEGRATION_CHECKLIST.md](./INTEGRATION_CHECKLIST.md) - 系统集成检查清单 - -## 🏗️ 目录结构 - -``` -TJWaterServerBinary/ -├── app/ -│ ├── main.py # FastAPI 应用入口(Lifespan, Middleware) -│ ├── api/v1/ # API 接口路由与端点定义 -│ ├── algorithms/ # 核心算法模块(模拟、清洗、泄漏识别等) -│ ├── auth/ # 认证相关逻辑与依赖 -│ ├── core/ # 核心配置、安全与工具类 -│ ├── domain/ # 领域模型与 Schema 定义 -│ ├── infra/ # 基础设施层 -│ │ ├── audit/ # 审计日志模块 -│ │ ├── cache/ # 缓存与 Redis 客户端 -│ │ └── db/ # 数据库访问层 (PostgreSQL/TimescaleDB/InfluxDB) -│ ├── services/ # 业务逻辑服务层 -│ └── utils/ # 通用工具函数 -├── resource/ # 静态资源与模型文件 -├── scripts/ # 运维与启动脚本 -├── tests/ # 单元与集成测试 -├── requirements.txt # Python 依赖列表 -└── readme.md # 项目说明文档 -``` - -## 🚀 快速开始 - -### 1. 环境要求 - -- Python 3.10+ -- PostgreSQL (TimescaleDB 扩展) -- Redis -- InfluxDB (可选,用于时序数据) - -### 2. 安装依赖 - -建议使用虚拟环境进行安装: - -```bash -# 创建虚拟环境 -python -m venv venv -source venv/bin/activate # Linux/macOS -# venv\Scripts\activate # Windows - -# 安装依赖 -pip install -r requirements.txt -``` - -### 3. 配置环境 - -请确保正确配置了环境变量或 `.env` 文件,主要包括数据库连接串、Redis 配置及密钥等。参考 `app/core/config.py` 中的配置项。 - -### 4. 启动服务 - -使用提供的启动脚本运行服务: - -```bash -python scripts/run_server.py -``` - -- **默认地址**: `http://0.0.0.0:8000` -- **API 文档**: `http://0.0.0.0:8000/docs` 或 `http://0.0.0.0:8000/redoc` -- **OpenAPI**: `http://0.0.0.0:8000/openapi.json` - -## 🛠️ 常用脚本 - -- `scripts/run_server.py`: 启动 FastAPI 服务 -- `scripts/create_project.py`: 创建新项目环境 -- `scripts/setup_security.sh`: 初始化安全配置 - -## 📝 开发规范 - -- 代码遵循 PEP 8 规范 -- 提交代码前请运行测试:`pytest` diff --git a/setup_security.sh b/scripts/setup_security.sh similarity index 100% rename from setup_security.sh rename to scripts/setup_security.sh diff --git a/setup_influxdb.md b/setup_influxdb.md deleted file mode 100644 index e4d6929..0000000 --- a/setup_influxdb.md +++ /dev/null @@ -1,14 +0,0 @@ -Setup instructions for WMH's work - -1. import scada_info.csv - run python online_Analysis.py - -2. import history_pattern_flow.csv - run python online_Analysis.py - Should manually change code - -3. run create_template.py - -4. run influxdb_api.py - 在InfluxDB数据库中创建好我们需要的bucket - create buckets \ No newline at end of file diff --git a/setup_server.md b/setup_server.md deleted file mode 100644 index 23bd4e1..0000000 --- a/setup_server.md +++ /dev/null @@ -1,90 +0,0 @@ -搭建服务器 - -1. `git clone https://e.coding.net/tjwater/tjwatercloud/TJWaterServer.git` -2. 控制台进入 `TJWaterServer` -3. 运行 `python install.py` 准备Python环境 -3.1 Python 3.12 需要手动的安装(拷贝) PyMetis 库 -4. 解压 `pg14.zip` 到上一层文件夹 -5. 控制台进入 `../pg14/bin` -5.1 将pg14/bin 加到系统PATH中,这步一定需要做,CopyProjectEx里需要这个 -6. 执行 `initdb -D ../data -E UTF-8` 创建数据库 -7. 执行 `pg_ctl -D ../data -l logfile start` 启动数据库服务 - - `pg_ctl -D ../data -l logfile stop` 关闭数据库服务 -8. 进入 `TJWaterServer`,执行 `python create_template.py` 创建模板 -9. 执行 `python online_Analysis.py` -10. 执行 `python influxdb_api.py` -11. 搭建FastAPI环境... -12. 进入 `TJWaterServer`,执行 `startserber.bat` - -NOTE: - 版本问题 - pip uninstall scipy numpy -y - pip install numpy==1.26.2 scipy==1.15.2 - -pg 信息 - 腾讯Windows服务器 - Host: localhost (默认) - Port: 5432 (默认) - User: 就是Windows的用户名,这台机器也就是 Administrator - Password: 密码为空 - -redis 信息 - - 1. 进到redis安装目录 - 2. 执行 redis-server.exe - - - -influx db 信息 - 1. 运行 influxd.exe - 2. 打开网页看下列的信息 http://localhost:8086 - - # influxdb数据库连接信息 - influx_url = "http://localhost:8086" # 替换为你的InfluxDB实例地址 - influx_token = "Vq8F5tzxqmjH6JYPBP5xqwo6nJbzRqCnahlcoMVyZGMPm3H92swD08VX-5lTH1laN_JG1x7EZ80WOQoycanmBw==" # 替换为你的InfluxDB Token - influx_org_name = "TJWATERORG" # 替换为你的Organization名称 - influx_client = InfluxDBClient(url=influx_url, token=influx_token, org=influx_org_name) - - -UserName tjwater -Password Tjwater@123456 -Organizatio TJWATEORG -Bucket TJWATERBUCKET - -API Token : LsqvuqtBqtBv44z_CWh5bWfn9hs1QKcYu5kWahF_cdF6JyqtwuUxU5CK7HWP7BOtP5_2f5mjx76qXyuPLOHWdw== - -influx config create --config-name onboarding ` - --host-url "http://localhost:8086" ` - --org "TJWATERORG" ` - --token "LsqvuqtBqtBv44z_CWh5bWfn9hs1QKcYu5kWahF_cdF6JyqtwuUxU5CK7HWP7BOtP5_2f5mjx76qXyuPLOHWdw==" - --active - - -Setup instructions for WMH's work - -1. import scada_info.csv - run python online_Analysis.py - -2. import history_pattern_flow.csv - run python online_Analysis.py - Should manually change code - -3. run create_template.py - -4. run influxdb_api.py - 在InfluxDB数据库中创建好我们需要的bucket - create buckets - -5. run online_Analysis.py - 有几个步骤 - (1)创建用户名密码 - (2)network_update 从 inp 文件创建 szh这个project - (3)upload_shp_to_pg - (4)submit_risk_probability_result - (5)pressure_sensor_placement_sensitivity - -6. In times table, all time values should be the format "hh:mm::ss" - -NOTES: - 1. SCADA设备的时候,单位要转换,现在模拟算出来的单位是L/s,SCADA数据是m3/h,L/s要乘3.6才是m3/h - 2. 之前的SCADA压力应该转过了,SCADA数据的单位是MPa,要乘以100才是m \ No newline at end of file