def login(self):
        """
        Login
        :return:
        """
        uri = 'API/Auth/Login'
        if self._token:
            json_data = {'token': self._token, 'domain': self._domain}
        else:
            json_data = {'username': self._username, 'password': self._password, 'domain': self._domain}
        result = self.__rest_client.request_put(uri, json_data)
        self.__rest_client.session.headers.update(authorization="Basic {0}".format(result.replace('"', '')))