def get()

in backend/training-pipeline/functions/api/model.py [0:0]


def get(event, context):
    scan_resp = model_table.scan(
        FilterExpression=Attr('status').ne('ENDPOINT_DELETED')
    )

    print('====scan_resp===')
    print(json.dumps(scan_resp, indent=2))

    jobs = scan_resp['Items']
    sorted_jobs = sorted(jobs, key=lambda x: x['created'], reverse=True)

    response = create_response_obj(200, {
        'models': sorted_jobs
    })

    return response