summaryrefslogtreecommitdiff
path: root/opendc/api/v1/specifications/cpus/endpoint.py
blob: 5cdbb9ecddad7b94e5c6ef2796c0c919c598e410 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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]
    )