summaryrefslogtreecommitdiff
path: root/opendc/api/v2/specifications/gpus/endpoint.py
blob: 24beb8733a0356d4dc67ab90d09aa32d16a5eb84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from opendc.models.gpu import GPU
from opendc.util.rest import Response


def GET(request):
    """Get a list of the specifications of all GPUs."""

    # Get the GPUs

    gpus = GPU.query()

    # Return the GPUs

    return Response(200, 'Successfully retrieved GPUs.', [x.to_JSON() for x in gpus])