def NewClientLogUrl(client, obj_store, user_id, device_id, request, callback):
 kwargs = {'user_id': user_id, 'device_id': device_id, 'timestamp': request['timestamp'], 'client_log_id': request['client_log_id']}
 if ('content_type' in request):
  kwargs['content_type'] = request['content_type']
 if ('content_md5' in request):
  kwargs['content_md5'] = request['content_md5']
 if ('num_bytes' in request):
  kwargs['max_bytes'] = request['num_bytes']
 logging.info(('GET NEW CLIENT LOG URL: user: %d, device: %d, client log id: %s' % (user_id, device_id, request['client_log_id'])))
 response = {'client_log_put_url': ClientLog.GetPutUrl(**kwargs)}
 callback(response)

def NewClientLogUrl ( client , obj_store , user_id , device_id , request , callback ) : kwargs = { 'user_id' : user_id , 'device_id' : device_id , 'timestamp' : request [ 'timestamp' ] , 'client_log_id' : request [ 'client_log_id' ] } if ( 'content_type' in request ) : kwargs [ 'content_type' ] = request [ 'content_type' ] if ( 'content_md5' in request ) : kwargs [ 'content_md5' ] = request [ 'content_md5' ] if ( 'num_bytes' in request ) : kwargs [ 'max_bytes' ] = request [ 'num_bytes' ] logging . info ( ( 'GET NEW CLIENT LOG URL: user: %d, device: %d, client log id: %s' % ( user_id , device_id , request [ 'client_log_id' ] ) ) ) response = { 'client_log_put_url' : ClientLog . GetPutUrl ( ** kwargs ) } callback ( response )
gets an s3 put url for clients to write mobile device logs .