The REST API (with notes) of ONVIF protocol, with some architecture concessions for simple integration with Nightbot
Under the hood ONVIF protocol is, I think I may say, a SOAP API.
Go definitions is generated by gowsdl tool.
docker build -t onvif-rest-api-go:latest .
Make changes in docker-compose.yml
file according to your needs
docker-compose up -d
Main focus is to provide transparent transition from SOAP to REST. So not many validations implemented.
Should be POST with corresponding JSON body, but Nightbot can't do POST's
GET /v1/:camera/absolute-move?profile-token=xxx&
position-x=***&
position-y=***&
position-zoom=**&
speed-x=***&
speed-y=***&
speed-zoom=***
GET /v1/:camera/get-configurations
GET /v1/:camera/get-presets?profile-token=***
GET /v1/:camera/get-preset-tours?profile-token=***
Should be POST with corresponding JSON body, but Nightbot can't do POST's
GET /v1/:camera/goto-home-position?profile-token=***&
speed-x=***&
speed-y=***&
speed-zoom=***
Should be POST with corresponding JSON body, but Nightbot can't do POST's
GET /v1/:camera/goto-preset?profile-token=***&
preset-token=***&
speed-x=***&
speed-y=***&
speed-zoom=***
Multiple ONVIF endpoint support
To configure multiple endpoint support provide environment variables in format
cam1=https://camera1.host/onvif/device_service
cam2=https://camera2.host/onvif/device_service
prod=https://camera.prod.host/onvif/device_service
After start your cameras will be available at
https://service.host/v1/cam1/***
https://service.host/v1/cam2/***
https://service.host/v1/prod/***
- Response body from ONVIF parsing
- Error descriptions and correct error codes
- HTTP error code transparency
- error on wrong endpoint
- log backend requests
- forward backend http codes