Endpoints in Eden-MDBS are managed connections to external databases, services, and APIs. They provide a unified interface for interacting with various data sources while handling connection pooling, authentication, monitoring, and access control.
Endpoints are connection abstractions that:
| Type | Description |
|---|---|
| Postgres | PostgreSQL relational database |
| MySQL | MySQL/MariaDB relational database |
| Mongo | MongoDB document database |
| Redis | Key-value store and caching |
| Cassandra | Distributed NoSQL database |
| ClickHouse | Columnar analytical database |
| Mssql | Microsoft SQL Server |
| Oracle | Oracle database |
| Type | Description |
|---|---|
| Pinecone | Vector similarity search |
| Type | Description |
|---|---|
| Http | RESTful API endpoints |
| Llm | Large Language Model integrations |
curl http://{host}:8000/api/v1/endpoints \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"id": "main_postgres",
"kind": "Postgres",
"config": {
"write_conn": {
"url": "postgresql://user:password@host:5432/database"
}
}
}'curl http://{host}:8000/api/v1/endpoints \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"id": "cache",
"kind": "Redis",
"config": {
"write_conn": {
"url": "redis://host:6379"
}
}
}'curl http://{host}:8000/api/v1/endpoints \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"id": "documents",
"kind": "Mongo",
"config": {
"write_conn": {
"url": "mongodb://user:password@host:27017/database"
}
}
}'curl http://{host}:8000/api/v1/endpoints \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"id": "external_api",
"kind": "Http",
"config": {
"base_url": "https://api.example.com",
"headers": {
"Authorization": "Bearer api_key",
"Content-Type": "application/json"
}
}
}'{
"status": "success",
"data": {
"id": "main_postgres",
"uuid": "550e8400-e29b-41d4-a716-446655440000"
}
}curl http://{host}:8000/api/v1/endpoints/main_postgres/read \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"query": "SELECT * FROM users WHERE status = $1 LIMIT $2",
"params": ["active", 10]
}'Response:
{
"status": "success",
"data": {
"rows": [
{
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"status": "active"
}
],
"row_count": 1
}
}curl http://{host}:8000/api/v1/endpoints/main_postgres/write \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"query": "INSERT INTO users (name, email, status) VALUES ($1, $2, $3) RETURNING id",
"params": ["Alice", "alice@example.com", "active"]
}'Response:
{
"status": "success",
"data": {
"rows": [{ "id": 3 }],
"rows_affected": 1
}
}curl http://{host}:8000/api/v1/endpoints/main_postgres/transaction \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"operations": [
{
"query": "UPDATE accounts SET balance = balance - $1 WHERE id = $2",
"params": [100.00, 1]
},
{
"query": "UPDATE accounts SET balance = balance + $1 WHERE id = $2",
"params": [100.00, 2]
},
{
"query": "INSERT INTO transactions (from_account, to_account, amount) VALUES ($1, $2, $3)",
"params": [1, 2, 100.00]
}
]
}'curl http://{host}:8000/api/v1/endpoints/documents/read \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"collection": "products",
"operation": "find",
"filter": {
"category": "electronics",
"price": {"$lt": 1000}
},
"options": {
"limit": 20,
"sort": {"price": 1}
}
}'# SET operation
curl http://{host}:8000/api/v1/endpoints/cache/write \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"command": "SET",
"args": ["user:123", "{\"name\": \"John\"}"]
}'
# GET operation
curl http://{host}:8000/api/v1/endpoints/cache/read \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"command": "GET",
"args": ["user:123"]
}'curl http://{host}:8000/api/v1/endpoints/main_postgres \
-H "Authorization: Bearer $TOKEN"Response:
{
"status": "success",
"data": {
"id": "main_postgres",
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"kind": "Postgres",
"config": {
"host": "localhost",
"port": 5432,
"database": "myapp"
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}Note: Sensitive credentials like passwords are not returned in GET responses.
curl http://{host}:8000/api/v1/endpoints \
-H "Authorization: Bearer $TOKEN"curl http://{host}:8000/api/v1/endpoints/main_postgres \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X PATCH \
-d '{
"config": {
"pool_size": 20,
"connection_timeout": 45
}
}'curl http://{host}:8000/api/v1/endpoints/main_postgres \
-H "Authorization: Bearer $TOKEN" \
-X DELETEResponse:
{
"status": "success",
"data": {
"id": "main_postgres",
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"kind": "Postgres",
"modified_objects": {
"objects": {
"deleted_from_cache": ["endpoint_cache_uuid"],
"deleted_from_postgres": ["endpoint_postgres_uuid"]
}
}
}
}Endpoints integrate with Eden's RBAC system:
| Access Level | Permissions |
|---|---|
| Admin | Create, update, delete endpoints; full data access |
| Write | Read and write data operations |
| Read | Read-only data access |
curl http://{host}:8000/api/v1/iam/rbac/endpoints/subjects \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"subjects": [
["user@company.com", "Read"],
["admin@company.com", "Admin"]
]
}'{
"error": "Connection timeout",
"details": "Failed to connect to database within 30 seconds",
"suggestion": "Check network connectivity and database availability"
}{
"error": "SQL syntax error",
"details": "Syntax error at or near 'SELCT'"
}{
"error": "Access denied",
"details": "User does not have Write access to endpoint",
"access_level": "Read",
"required_level": "Write"
}{
"error": "Connection pool exhausted",
"details": "All connections in use",
"suggestion": "Increase pool_size or optimize query performance"
}