34
API.md
34
API.md
@@ -102,7 +102,7 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
Note: When plaintext is provided, it is automatically indexed in Elasticsearch for future lookups.
|
||||
Note: When plaintext is provided, it is automatically stored in Redis for future lookups.
|
||||
|
||||
#### Error Responses
|
||||
|
||||
@@ -113,7 +113,7 @@ Note: When plaintext is provided, it is automatically indexed in Elasticsearch f
|
||||
}
|
||||
```
|
||||
|
||||
**500 Internal Server Error** - Server or Elasticsearch error:
|
||||
**500 Internal Server Error** - Server or Redis error:
|
||||
```json
|
||||
{
|
||||
"error": "Internal server error",
|
||||
@@ -127,7 +127,7 @@ Note: When plaintext is provided, it is automatically indexed in Elasticsearch f
|
||||
|
||||
**Endpoint**: `GET /api/health`
|
||||
|
||||
**Description**: Check the health of the application and Elasticsearch connection.
|
||||
**Description**: Check the health of the application and Redis connection.
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -139,31 +139,27 @@ No parameters required.
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"elasticsearch": {
|
||||
"cluster": "elasticsearch",
|
||||
"status": "green"
|
||||
"redis": {
|
||||
"version": "7.2.4",
|
||||
"connected": true,
|
||||
"memoryUsed": "1.5M"
|
||||
},
|
||||
"index": {
|
||||
"exists": true,
|
||||
"name": "hasher",
|
||||
"stats": {
|
||||
"documentCount": 1542,
|
||||
"indexSize": 524288
|
||||
}
|
||||
"stats": {
|
||||
"count": 1542,
|
||||
"size": 524288
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Elasticsearch cluster status values**:
|
||||
- `green`: All primary and replica shards are active
|
||||
- `yellow`: All primary shards are active, but not all replicas
|
||||
- `red`: Some primary shards are not active
|
||||
**Redis connection status**:
|
||||
- `connected: true`: Redis is connected and responding
|
||||
- `connected: false`: Redis connection failed
|
||||
|
||||
**Error** (503 Service Unavailable):
|
||||
```json
|
||||
{
|
||||
"status": "error",
|
||||
"error": "Connection refused to Elasticsearch"
|
||||
"error": "Connection refused to Redis"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -252,7 +248,7 @@ The API accepts requests from any origin by default. For production deployment,
|
||||
## Notes
|
||||
|
||||
- All timestamps are in ISO 8601 format
|
||||
- The API automatically creates the Elasticsearch index if it doesn't exist
|
||||
- The API automatically creates Redis keys as needed
|
||||
- Plaintext searches are automatically indexed for future lookups
|
||||
- Searches are case-insensitive
|
||||
- Hashes must be valid hexadecimal strings
|
||||
|
||||
Referencia en una nueva incidencia
Block a user