Setting Archived Variable in Python?

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
MohanDavid
Posts: 4
Joined: Wed Nov 01, 2023 12:20 pm

Setting Archived Variable in Python?

Post by MohanDavid »

How can I set the 'Archived' variable in my custom Python alert module, which sends alerts based on importance, and utilizes a returned JSON, while struggling to find information on archiving events in the passed URL filter?
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Setting Archived Variable in Python?

Post by burger »

The API has the index function, and the search function. See: https://github.com/ZoneMinder/zoneminde ... troller.ph

To do this with index, you would use:

Code: Select all

curl -X POST -d "user=username&pass=password" http://localhost/zm/api/events/index/Archived:1.json
Note that this returns the first page of events, and you have to cycle through the pages per:
https://zoneminder.readthedocs.io/en/st ... all-events

So that is not the right way to do this. Instead use search which will return only the events that are archived:

Code: Select all

curl -X POST -d "user=username&pass=password" http://localhost/zm/api/events/search/Archived:1.json
For more details see:
https://zoneminder.readthedocs.io/en/stable/api.html
https://wiki.zoneminder.com/API
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
Post Reply