bluecherrydvr / bluecherry-apps-issues

1 stars 0 forks source link

Update Cambase API calls #117

Open curtishall opened 8 years ago

curtishall commented 8 years ago

Cambase.io will be sunsetting soon and evercam.io will be used in its place. The APIs will change slightly, see below:

https://dash.evercam.io/swagger https://api.evercam.io/v1/vendor https://api.evercam.io/v1/vendors?name=hikvision https://api.evercam.io/v1/models/m1011

andrey-utkin commented 8 years ago

We have (a bit excentric) importing script misc/sql/import-cambase-data.php, but after the breaking API changes at cambase.io it requires at last the following find-and-replacing at last to make it fetch data:

:%s/camera/model/g
:%s/manufacturer/vendor/g

I guess some focused work is required to have it in sync with our web interface code, which probably uses old names for this stuff. Searching for "manufacturer" token in www/ code is easy, but it is not for "camera". @Aleksandern could you please take over this, incuding updating misc/sql/cameras_shipped.db file, and testing of switching between "live data source" and "local archive data source"?

Aleksandern commented 8 years ago

I didn't understand about ":%s/camera/model/g" ":%s/manufacturer/vendor/g" and "old names"... I just need to fix "import-cambase-data.php" and the web interface( "live data source"), right?

andrey-utkin commented 8 years ago

cambase.io used words "manufacturer" and "camera" in its API URLs and API reply contents, then it has voluntarily replaced it with "vendor" and "model" within same API version. So our scripts got broken. So yes, basically it's some replacement work, but more important is to ensure consistency of resulting code and to test it.

P. S. "s/find/replace/" is sed syntax, ":" stands for Vim's commands to invoke sed, trailing "g" is a sed flag standing for "replace all entries, not just first one".