コード例 #1
0
 def update_user_glance(glance_key, glance_data, user_id):
     token = tenant.get_token(redis, scopes=['view_group'])
     return post("%s/addon/ui/user/%s" % (tenant.api_base_url, user_id),
                 {"glance": [{
                     "content": glance_data,
                     "key": glance_key
                 }]}, token)
コード例 #2
0
 def update_room_glance(glance_key, glance_data, room_id):
     token = tenant.get_token(redis, scopes=['view_room'])
     return post("%s/addon/ui/room/%s" % (tenant.api_base_url, room_id),
                 {"glance": [{
                     "content": glance_data,
                     "key": glance_key
                 }]}, token)
コード例 #3
0
 def update_global_glance(glance_key, glance_data):
     token = tenant.get_token(redis, scopes=['view_group'])
     return post("%s/addon/ui" % tenant.api_base_url,
                 {"glance": [{
                     "content": glance_data,
                     "key": glance_key
                 }]}, token)
コード例 #4
0
 def send_notification(message):
     token = tenant.get_token()
     base_url = tenant.capabilities_url[0:tenant.capabilities_url.rfind('/')]
     resp = requests.post("%s/room/%s/notification?auth_token=%s" % (base_url, tenant.room_id, token),
                          headers={'content-type': 'application/json'},
                          data=json.dumps({"message": message}), timeout=10)
     # todo: do better
     assert resp.status_code == 204
コード例 #5
0
 def send_notification(message):
     token = tenant.get_token(redis)
     return post(
         "%s/room/%s/notification" % (tenant.api_base_url, tenant.room_id),
         {"message": message}, token)