Skip to content
This repository has been archived by the owner on Mar 14, 2020. It is now read-only.

Update Cambase API calls #117

Open
curtishall opened this issue Dec 9, 2015 · 3 comments
Open

Update Cambase API calls #117

curtishall opened this issue Dec 9, 2015 · 3 comments

Comments

@curtishall
Copy link
Member

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
Copy link

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
Copy link

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
Copy link

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".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants