Web Server Specifications and API
Hello,
Is there an up to date version of this page? https://www.bensoftware.com/securityspy/web-server-spec.html
Most of the methods described here have been expanded, and I'm guessing there are new methods not documented. The ++getfile method isn't documented at all, but referenced by ++download and expected to be used by consumers. I'm writing a full-featured Golang library for the SecuritySpy API; having accurate docs will certainly speed up the process.
Thanks!
Is there an up to date version of this page? https://www.bensoftware.com/securityspy/web-server-spec.html
Most of the methods described here have been expanded, and I'm guessing there are new methods not documented. The ++getfile method isn't documented at all, but referenced by ++download and expected to be used by consumers. I'm writing a full-featured Golang library for the SecuritySpy API; having accurate docs will certainly speed up the process.
Thanks!
Comments
$ curl -is "127.0.0.1:8000/++eventStream/"
HTTP/1.1 200 OK
Server: BBVS/4.0
Cache-Control: max-age=0, must-revalidate
Pragma: no-cache
Keep-Alive: timeout=20, max=100
Connection: Keep-Alive
SS-UUID: C03L1333F8J3AkXIZS1O
Content-Type: text/plain
EDIT: A local timestamp as one of the output fields that includes the time zone would probably be best. Then it's easy to identify the server's time as skewed.
As for ++eventStream - curl won't render this properly, as it will be waiting for the end of the data, which never comes. You'll have to use an alternative method where you have access to the data as it comes in. Lines are terminated by CR (Ox13) rather than LF (0x10).
We can add both the time zone and current time in ++systemInfo in the next update.
curl -sN "127.0.0.1:8000/++eventStream/" | tr '\r' '\n'
I also put together a simple CLI tool that prints out camera info, or event stream data. Find it here: https://github.com/davidnewhall/SecSpyCLI - I'll add some docs on how to use it soon, but the tech savvy can probably figure it out pretty quick. If anyone has other use cases for a CLI tool, please let me know through a github issue request.
One thing I'm noticing...
If I use -c files -a CAMNAME:# the list of files returned shows 0MB for the size (all JPG images in this case). I assume it's rounding down to 0MB because the files are all around 432 KB.
https://bensoftware.com/forum/discussion/2818/motionimage-recording-action-handoff-movieimage-to-script#Item_4
If SecuritySpy included notifications in the event stream that indicated the start and completion of a motion recording, ie, 'Started motion recording ' event and 'Finished motion recording ', then I guess I could monitor the event stream for those messages, parse for the filename, then hand it off to my logic for further processing.
Would be cool if the event stream could provide structured data, ie json.