Change to PUT and include response in docs

This commit is contained in:
Nick Mowen 2023-05-02 06:19:01 -06:00
parent 062983bee9
commit c65b149483
2 changed files with 17 additions and 2 deletions

View File

@ -300,6 +300,8 @@ Get PTZ info for the camera.
Create a manual API with a given `label` (ex: doorbell press) to capture a specific event besides an object being detected. Create a manual API with a given `label` (ex: doorbell press) to capture a specific event besides an object being detected.
**Optional Body:**
```json ```json
{ {
"subLabel": "some_string", // add sub label to event "subLabel": "some_string", // add sub label to event
@ -308,6 +310,19 @@ Create a manual API with a given `label` (ex: doorbell press) to capture a speci
} }
``` ```
### `POST /api/events/<event_id>/end` **Success Response:**
```json
[
{
"event_id": "1682970645.13116-1ug7ns",
"message": "Successfully created event.",
"success": true
},
200
]
```
### `PUT /api/events/<event_id>/end`
End a specific manual event without a predetermined length. End a specific manual event without a predetermined length.

View File

@ -885,7 +885,7 @@ def create_event(camera_name, label):
) )
@bp.route("/events/<event_id>/end", methods=["POST"]) @bp.route("/events/<event_id>/end", methods=["PUT"])
def end_event(event_id): def end_event(event_id):
try: try:
current_app.external_processor.finish_manual_event(event_id) current_app.external_processor.finish_manual_event(event_id)