Provide rabbit names at api level
Status: Beta
Brought to you by:
oaz
The use of serial numbers in the api is not friendly whereas rabbit names would be.
In the longer term we could investigate the possibility of chaining these names across multiple OpenNab installs so that anyone sending an api call to given rabbit name does not have to think about which OpenNab server the rabbit is connected to.
Logged In: YES
user_id=1716509
Originator: NO
I see a potential problem with names:
-How do you avoid collisions between independent servers?
I mean, today I'm happily using opennab.oaz.net as my server, where my serial number 010203040506 is linked to the name sache.
Tomorrow oaz goes out of service and I have to move to opennab.azeau.org. But someone already is using "sache" there for his/her rabbit.
Serial number belongs to the bunny, not to the server, and it's a MAC address (thus worldwide unique) so it's more reliable as a unique identifier in a distributed scenario.
Having said that, I agree they are not friendly (APIs aren't, anyway) and the web interface should hide it. for example, the api_demo could construct HTML forms with selections (instead on input fields). The web users sees and selects a name, whereas the MAC is sent in the HTTP request.
And then maybe additional APIs could exist for remotely consulting the name->MAC database. This would be specially useful for the SOAP interface.
Just my .02€
Logged In: YES
user_id=1121766
Originator: YES
I know there is a name collision issue for such a feature.
As a 1st implementation, I would say that it does not matter : people already have a Violet name for their rabbit. It would probably make sense for them to use the same name. The community is not that large.
If that is not enough, there would still be things like IRC nickname timestamping strategy. Actually, a bunch of interconnected OpenNab servers would have some similarities with an IRC network.
Regarding the API, I don't understand why we would need 2 http requests (name->mac and then api call with mac) where one would do the job (api call with name).
Logged In: YES
user_id=1716509
Originator: NO
I see. Yes, probably name is enough. So you propose moving from:
api.php?sn=010203040506&reboot=yes (for example)
to
api.php?name=sache&reboot.yes
right?
WAMP comes with mysql. Do you plan to use it for the name-MAC database, or you want to have a pure PHP implementation?
I don't know PHP, but might give some help in mysql if you need it. Just tell me.
Logged In: YES
user_id=1724168
Originator: NO
In the implementation I have done, *per server* there is a mapping of bunny to MAC, and the code translates any "serial number" given into a real serial if the given serial is in an alias list. This won't do for chained servers etc (but then again, how sure are we that it will go that way?), but at least it helps me quite a bit, as I've got two tag/tags, and remembering MAC addresses is not my strong point :-)