def schema_handler(request):
    '''
    Handle schema request from UI.
    '''
    logging.debug("schema_handler: enter")
    req = request.GET.get('payload', '')
    action = request.GET.get('action', '')
    logging.debug('Recieved schema Request (%s)' % action)

    if not request.user.is_authenticated():
        logging.error('User must be logged in !!')
        return HttpResponse(Response.error(action, 'Unauthorized'))
    if action == 'get-schema':
        return get_schema(request, req)
    elif action == 'get-all-schema':
        return get_schema(request, req, all=True)
    elif action == 'download-schema':
        return download_schema(request, req)
    elif action == 'add-schema':
        return add_schema(request, req)
dataset/ETHPy150Open CiscoDevNet/yang-explorer/server/explorer/views.py/schema_handler/original