mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 07:35:27 +03:00
Updated documentation for the review/summary endpoint
This commit is contained in:
parent
ce17f0cfe3
commit
eda00efb01
84
docs/static/frigate-api.yaml
vendored
84
docs/static/frigate-api.yaml
vendored
@ -277,7 +277,8 @@ paths:
|
||||
description: Successful Response
|
||||
content:
|
||||
application/json:
|
||||
schema: { }
|
||||
schema:
|
||||
$ref: '#/components/schemas/ReviewSummaryResponse'
|
||||
'422':
|
||||
description: Validation Error
|
||||
content:
|
||||
@ -2368,14 +2369,14 @@ paths:
|
||||
required: false
|
||||
schema:
|
||||
type: number
|
||||
default: 1728577904.036181
|
||||
default: 1728580419.15206
|
||||
title: After
|
||||
- name: before
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: number
|
||||
default: 1728581504.0362
|
||||
default: 1728584019.152614
|
||||
title: Before
|
||||
responses:
|
||||
'200':
|
||||
@ -3186,6 +3187,40 @@ components:
|
||||
required:
|
||||
- password
|
||||
title: AppPutPasswordBody
|
||||
DayReview:
|
||||
properties:
|
||||
day:
|
||||
type: string
|
||||
format: date-time
|
||||
title: Day
|
||||
reviewed_alert:
|
||||
type: integer
|
||||
title: Reviewed Alert
|
||||
reviewed_detection:
|
||||
type: integer
|
||||
title: Reviewed Detection
|
||||
reviewed_motion:
|
||||
type: integer
|
||||
title: Reviewed Motion
|
||||
total_alert:
|
||||
type: integer
|
||||
title: Total Alert
|
||||
total_detection:
|
||||
type: integer
|
||||
title: Total Detection
|
||||
total_motion:
|
||||
type: integer
|
||||
title: Total Motion
|
||||
type: object
|
||||
required:
|
||||
- day
|
||||
- reviewed_alert
|
||||
- reviewed_detection
|
||||
- reviewed_motion
|
||||
- total_alert
|
||||
- total_detection
|
||||
- total_motion
|
||||
title: DayReview
|
||||
EventsCreateBody:
|
||||
properties:
|
||||
source_type:
|
||||
@ -3280,6 +3315,35 @@ components:
|
||||
title: Detail
|
||||
type: object
|
||||
title: HTTPValidationError
|
||||
Last24HoursReview:
|
||||
properties:
|
||||
reviewed_alert:
|
||||
type: integer
|
||||
title: Reviewed Alert
|
||||
reviewed_detection:
|
||||
type: integer
|
||||
title: Reviewed Detection
|
||||
reviewed_motion:
|
||||
type: integer
|
||||
title: Reviewed Motion
|
||||
total_alert:
|
||||
type: integer
|
||||
title: Total Alert
|
||||
total_detection:
|
||||
type: integer
|
||||
title: Total Detection
|
||||
total_motion:
|
||||
type: integer
|
||||
title: Total Motion
|
||||
type: object
|
||||
required:
|
||||
- reviewed_alert
|
||||
- reviewed_detection
|
||||
- reviewed_motion
|
||||
- total_alert
|
||||
- total_detection
|
||||
- total_motion
|
||||
title: Last24HoursReview
|
||||
RegenerateDescriptionEnum:
|
||||
type: string
|
||||
enum:
|
||||
@ -3323,6 +3387,20 @@ components:
|
||||
- thumb_path
|
||||
- data
|
||||
title: ReviewSegmentResponse
|
||||
ReviewSummaryResponse:
|
||||
properties:
|
||||
last24Hours:
|
||||
$ref: '#/components/schemas/Last24HoursReview'
|
||||
root:
|
||||
additionalProperties:
|
||||
$ref: '#/components/schemas/DayReview'
|
||||
type: object
|
||||
title: Root
|
||||
type: object
|
||||
required:
|
||||
- last24Hours
|
||||
- root
|
||||
title: ReviewSummaryResponse
|
||||
SeverityEnum:
|
||||
type: string
|
||||
enum:
|
||||
|
||||
@ -17,7 +17,10 @@ from frigate.api.defs.review_query_parameters import (
|
||||
ReviewQueryParams,
|
||||
ReviewSummaryQueryParams,
|
||||
)
|
||||
from frigate.api.defs.review_responses import ReviewSegmentResponse
|
||||
from frigate.api.defs.review_responses import (
|
||||
ReviewSegmentResponse,
|
||||
ReviewSummaryResponse,
|
||||
)
|
||||
from frigate.api.defs.tags import Tags
|
||||
from frigate.models import Recordings, ReviewSegment
|
||||
from frigate.util.builtin import get_tz_modifiers
|
||||
@ -103,7 +106,7 @@ def review(params: ReviewQueryParams = Depends()):
|
||||
return JSONResponse(content=[r for r in review])
|
||||
|
||||
|
||||
@router.get("/review/summary")
|
||||
@router.get("/review/summary", response_model=ReviewSummaryResponse)
|
||||
def review_summary(params: ReviewSummaryQueryParams = Depends()):
|
||||
hour_modifier, minute_modifier, seconds_offset = get_tz_modifiers(params.timezone)
|
||||
day_ago = (datetime.datetime.now() - datetime.timedelta(hours=24)).timestamp()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user