RestAPI.py 1.2 KB

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