def lambda_handler()

in source/api/chalicelib/efs_lambda.py [0:0]


def lambda_handler(event, context):
    # get operation type
    try:
        operation_type = event['operation']
    except KeyError:
        raise Exception('Missing required parameter in event: "operation"')
    else:
        if operation_type == 'upload':
            upload_result = upload(event)
            return upload_result
        if operation_type == 'list':
            list_result = list(event)
            return list_result
        if operation_type == 'modify':
            modify(event)
        if operation_type == 'delete':
            delete_result = delete(event)
            return delete_result
        if operation_type == 'make_dir':
            make_dir_result = make_dir(event)
            return make_dir_result
        if operation_type == 'download':
            download_result = download(event)
            return download_result