RestAPI.py 1.1 KB

1234567891011121314151617181920212223
  1. class RestAPI(object):
  2. def __init__(self, password_protected=None, login=None, password=None, active=None, port=None):
  3. """
  4. :param password_protected: If true, the rest api will ask for an authentication
  5. :param login: login used if auth is activated
  6. :param password: password used if auth is activated
  7. :param active: specify if the rest api is loaded on start with Kalliope
  8. """
  9. self.password_protected = password_protected
  10. self.login = login
  11. self.password = password
  12. self.active = active
  13. self.port = port
  14. def __str__(self):
  15. return "%s: RestAPI: password_protected: %s, login: %s, " \
  16. "password: %s, active: %s, port: %s" % (self.__class__.__name__,
  17. self.password_protected,
  18. self.login,
  19. self.password,
  20. self.active,
  21. self.port)