timboring / sdb

Service Database
0 stars 0 forks source link

Client for API #6

Open ghost opened 7 years ago

ghost commented 7 years ago

Currently, there is a module called client.py, which implements a Client wrapper class around the json API. The idea for this was to make it easy for users to deal with the higher level classes, Machine, Network, Service, rather than dealing directly with json/dictionaries.

With the currently implementation, however, this exposes the underlying SQLAlchemy query interface to the user and allows them to bi-pass the API and talk directly to the database. This is not intended.

Some resources to help thinking more about this issue: https://wynnnetherland.com/journal/what-makes-a-good-api-wrapper/ http://chadfowler.com/2007/09/05/writing-apis-to-wrap-apis.html https://semaphoreci.com/community/tutorials/building-and-testing-an-api-wrapper-in-python