-
-
Notifications
You must be signed in to change notification settings - Fork 0
API Endpoints
Norm Brandinger edited this page Nov 20, 2025
·
1 revision
- FastAPI Endpoints (Code-First)
- FastAPI Endpoints (API-First)
- Common Endpoints
- Database CRUD Endpoints
- Redis Cluster Endpoints
- RabbitMQ Messaging Endpoints
Base URL: http://localhost:8000
-
GET /health- Health check -
GET /metrics- Prometheus metrics -
GET /docs- Swagger UI -
GET /redoc- ReDoc documentation -
GET /openapi.json- OpenAPI schema
-
POST /api/v1/postgres/users- Create user -
GET /api/v1/postgres/users- List users -
GET /api/v1/postgres/users/{id}- Get user -
PUT /api/v1/postgres/users/{id}- Update user -
DELETE /api/v1/postgres/users/{id}- Delete user
-
POST /api/v1/mysql/products- Create product -
GET /api/v1/mysql/products- List products -
GET /api/v1/mysql/products/{id}- Get product -
PUT /api/v1/mysql/products/{id}- Update product -
DELETE /api/v1/mysql/products/{id}- Delete product
-
POST /api/v1/mongodb/documents- Create document -
GET /api/v1/mongodb/documents- List documents -
GET /api/v1/mongodb/documents/{id}- Get document -
PUT /api/v1/mongodb/documents/{id}- Update document -
DELETE /api/v1/mongodb/documents/{id}- Delete document
-
POST /api/v1/redis/set- Set key-value -
GET /api/v1/redis/get/{key}- Get value -
DELETE /api/v1/redis/delete/{key}- Delete key -
GET /redis-cluster/info- Cluster info -
GET /redis-cluster/nodes- Node status -
GET /redis-cluster/slots- Slot distribution
-
POST /api/v1/rabbitmq/publish- Publish message -
GET /api/v1/rabbitmq/consume- Consume message -
GET /api/v1/rabbitmq/queue-stats- Queue statistics
Base URL: http://localhost:8001
Same endpoints as code-first implementation, following OpenAPI spec defined in openapi.yaml.
All reference applications implement:
# Health check
curl http://localhost:8000/health
# Response: {"status": "healthy", "version": "1.0.0"}
# Metrics (Prometheus format)
curl http://localhost:8000/metrics
# Response: Prometheus metrics
# API documentation
open http://localhost:8000/docscurl -X POST http://localhost:8000/api/v1/postgres/users \
-H "Content-Type: application/json" \
-d '{
"username": "john_doe",
"email": "john@example.com",
"full_name": "John Doe"
}'
# Response:
{
"id": 1,
"username": "john_doe",
"email": "john@example.com",
"full_name": "John Doe",
"created_at": "2024-01-15T10:30:00Z"
}curl http://localhost:8000/api/v1/postgres/users
# Response:
{
"users": [
{
"id": 1,
"username": "john_doe",
"email": "john@example.com"
}
],
"total": 1
}curl http://localhost:8000/api/v1/postgres/users/1
# Response:
{
"id": 1,
"username": "john_doe",
"email": "john@example.com",
"full_name": "John Doe",
"created_at": "2024-01-15T10:30:00Z"
}curl -X PUT http://localhost:8000/api/v1/postgres/users/1 \
-H "Content-Type: application/json" \
-d '{
"email": "john.doe@example.com",
"full_name": "John A. Doe"
}'curl -X DELETE http://localhost:8000/api/v1/postgres/users/1
# Response:
{
"message": "User deleted successfully"
}curl -X POST http://localhost:8000/api/v1/redis/set \
-H "Content-Type: application/json" \
-d '{
"key": "user:1000",
"value": "John Doe",
"ttl": 3600
}'
# Response:
{
"success": true,
"key": "user:1000",
"node": "172.20.0.16:6379"
}curl http://localhost:8000/api/v1/redis/get/user:1000
# Response:
{
"key": "user:1000",
"value": "John Doe",
"ttl": 3542
}curl http://localhost:8000/redis-cluster/info
# Response:
{
"cluster_state": "ok",
"cluster_slots_assigned": 16384,
"cluster_known_nodes": 3,
"cluster_size": 3
}curl http://localhost:8000/redis-cluster/nodes
# Response:
{
"nodes": [
{
"id": "a1b2c3...",
"ip": "172.20.0.13",
"port": 6379,
"role": "master",
"slots": "0-5460",
"slot_count": 5461
},
...
]
}curl -X POST http://localhost:8000/api/v1/rabbitmq/publish \
-H "Content-Type: application/json" \
-d '{
"queue": "tasks",
"message": {
"task": "process_order",
"order_id": 12345
}
}'
# Response:
{
"success": true,
"queue": "tasks",
"message_id": "abc123"
}curl http://localhost:8000/api/v1/rabbitmq/consume?queue=tasks
# Response:
{
"message": {
"task": "process_order",
"order_id": 12345
},
"delivery_tag": 1
}curl http://localhost:8000/api/v1/rabbitmq/queue-stats?queue=tasks
# Response:
{
"queue": "tasks",
"messages": 10,
"consumers": 2,
"message_rate": 5.2
}- Service-Configuration - API configuration
- Health-Monitoring - Health endpoints
- Redis-Cluster - Redis cluster details