| @@ -543,7 +543,7 @@ paths: | |||||
| /reslevis/alerts/{id}: | /reslevis/alerts/{id}: | ||||
| get: | get: | ||||
| summary: Get alert by ID (or tracker ID depending on usage) | |||||
| summary: Get alert by ID | |||||
| operationId: getAlertById | operationId: getAlertById | ||||
| tags: [Alerts] | tags: [Alerts] | ||||
| parameters: | parameters: | ||||
| @@ -560,6 +560,32 @@ paths: | |||||
| '500': | '500': | ||||
| $ref: '#/components/responses/InternalError' | $ref: '#/components/responses/InternalError' | ||||
| patch: | |||||
| summary: Update alert status | |||||
| operationId: updateAlertStatus | |||||
| tags: [Alerts] | |||||
| parameters: | |||||
| - $ref: '#/components/parameters/PathId' | |||||
| requestBody: | |||||
| required: true | |||||
| content: | |||||
| application/json: | |||||
| schema: | |||||
| $ref: '#/components/schemas/AlertStatusUpdate' | |||||
| responses: | |||||
| '200': | |||||
| description: Alert status updated | |||||
| content: | |||||
| application/json: | |||||
| schema: | |||||
| $ref: '#/components/schemas/StatusUpdated' | |||||
| '400': | |||||
| $ref: '#/components/responses/BadRequest' | |||||
| '404': | |||||
| $ref: '#/components/responses/NotFound' | |||||
| '500': | |||||
| $ref: '#/components/responses/InternalError' | |||||
| delete: | delete: | ||||
| summary: Delete alert by ID | summary: Delete alert by ID | ||||
| operationId: deleteAlert | operationId: deleteAlert | ||||
| @@ -576,6 +602,23 @@ paths: | |||||
| '500': | '500': | ||||
| $ref: '#/components/responses/InternalError' | $ref: '#/components/responses/InternalError' | ||||
| # --- Aggregated health (location, decoder, bridge, kafka, database) --- | |||||
| /reslevis/health: | |||||
| get: | |||||
| summary: Aggregated health status | |||||
| description: Returns health from location, decoder, bridge services plus server-checked Kafka and database status. | |||||
| operationId: getAggregatedHealth | |||||
| tags: [Health] | |||||
| responses: | |||||
| '200': | |||||
| description: Aggregated health (location, decoder, bridge, kafka, database) | |||||
| content: | |||||
| application/json: | |||||
| schema: | |||||
| $ref: '#/components/schemas/AggregatedHealth' | |||||
| '500': | |||||
| $ref: '#/components/responses/InternalError' | |||||
| # --- Tracks --- | # --- Tracks --- | ||||
| /reslevis/getTracks/{id}: | /reslevis/getTracks/{id}: | ||||
| get: | get: | ||||
| @@ -801,7 +844,60 @@ components: | |||||
| id: { type: string } | id: { type: string } | ||||
| tracker_id: { type: string } | tracker_id: { type: string } | ||||
| type: { type: string } | type: { type: string } | ||||
| value: { type: string } | |||||
| status: { type: string } | |||||
| timestamp: { type: string, format: date-time } | |||||
| AlertStatusUpdate: | |||||
| type: object | |||||
| required: [status] | |||||
| properties: | |||||
| status: | |||||
| type: string | |||||
| description: New status (e.g. resolved, acknowledged) | |||||
| ServiceStatus: | |||||
| type: object | |||||
| description: Health of an external service (e.g. Kafka, database) | |||||
| properties: | |||||
| status: | |||||
| type: string | |||||
| enum: [up, down, unknown] | |||||
| message: | |||||
| type: string | |||||
| description: Error detail when status is down | |||||
| BaseHealth: | |||||
| type: object | |||||
| properties: | |||||
| uptime: { type: string, description: Duration string } | |||||
| activeReaders: { type: array, items: { type: string } } | |||||
| activeWriters: { type: array, items: { type: string } } | |||||
| activeBeacons: { type: array, items: { type: string } } | |||||
| LocationHealth: | |||||
| allOf: | |||||
| - $ref: '#/components/schemas/BaseHealth' | |||||
| - type: object | |||||
| properties: | |||||
| activeSettings: { type: array, items: { type: object } } | |||||
| DecoderHealth: | |||||
| allOf: | |||||
| - $ref: '#/components/schemas/BaseHealth' | |||||
| BridgeHealth: | |||||
| allOf: | |||||
| - $ref: '#/components/schemas/BaseHealth' | |||||
| AggregatedHealth: | |||||
| type: object | |||||
| description: Health from location, decoder, bridge (via Kafka) plus server-checked Kafka and database | |||||
| properties: | |||||
| location: { $ref: '#/components/schemas/LocationHealth' } | |||||
| decoder: { $ref: '#/components/schemas/DecoderHealth' } | |||||
| bridge: { $ref: '#/components/schemas/BridgeHealth' } | |||||
| kafka: { $ref: '#/components/schemas/ServiceStatus' } | |||||
| database: { $ref: '#/components/schemas/ServiceStatus' } | |||||
| Track: | Track: | ||||
| type: object | type: object | ||||