summaryrefslogtreecommitdiff
path: root/opendc/api/v1/specifications/cpus/endpoint.py
blob: 5c8562557006ae5f967b3b850f75eeaa3b4d6a2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from opendc.models.cpu import CPU
from opendc.util.rest import Response

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

    # Get the CPUs

    cpus = CPU.query()

    # Return the CPUs

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