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
|
description: Successful Response
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema: { }
|
schema:
|
||||||
|
$ref: '#/components/schemas/ReviewSummaryResponse'
|
||||||
'422':
|
'422':
|
||||||
description: Validation Error
|
description: Validation Error
|
||||||
content:
|
content:
|
||||||
@ -2368,14 +2369,14 @@ paths:
|
|||||||
required: false
|
required: false
|
||||||
schema:
|
schema:
|
||||||
type: number
|
type: number
|
||||||
default: 1728577904.036181
|
default: 1728580419.15206
|
||||||
title: After
|
title: After
|
||||||
- name: before
|
- name: before
|
||||||
in: query
|
in: query
|
||||||
required: false
|
required: false
|
||||||
schema:
|
schema:
|
||||||
type: number
|
type: number
|
||||||
default: 1728581504.0362
|
default: 1728584019.152614
|
||||||
title: Before
|
title: Before
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
@ -3186,6 +3187,40 @@ components:
|
|||||||
required:
|
required:
|
||||||
- password
|
- password
|
||||||
title: AppPutPasswordBody
|
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:
|
EventsCreateBody:
|
||||||
properties:
|
properties:
|
||||||
source_type:
|
source_type:
|
||||||
@ -3280,6 +3315,35 @@ components:
|
|||||||
title: Detail
|
title: Detail
|
||||||
type: object
|
type: object
|
||||||
title: HTTPValidationError
|
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:
|
RegenerateDescriptionEnum:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
@ -3323,6 +3387,20 @@ components:
|
|||||||
- thumb_path
|
- thumb_path
|
||||||
- data
|
- data
|
||||||
title: ReviewSegmentResponse
|
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:
|
SeverityEnum:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
|
|||||||
@ -17,7 +17,10 @@ from frigate.api.defs.review_query_parameters import (
|
|||||||
ReviewQueryParams,
|
ReviewQueryParams,
|
||||||
ReviewSummaryQueryParams,
|
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.api.defs.tags import Tags
|
||||||
from frigate.models import Recordings, ReviewSegment
|
from frigate.models import Recordings, ReviewSegment
|
||||||
from frigate.util.builtin import get_tz_modifiers
|
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])
|
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()):
|
def review_summary(params: ReviewSummaryQueryParams = Depends()):
|
||||||
hour_modifier, minute_modifier, seconds_offset = get_tz_modifiers(params.timezone)
|
hour_modifier, minute_modifier, seconds_offset = get_tz_modifiers(params.timezone)
|
||||||
day_ago = (datetime.datetime.now() - datetime.timedelta(hours=24)).timestamp()
|
day_ago = (datetime.datetime.now() - datetime.timedelta(hours=24)).timestamp()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user