diff options
| author | leonoverweel <l.overweel@gmail.com> | 2017-01-24 12:05:15 +0100 |
|---|---|---|
| committer | leonoverweel <l.overweel@gmail.com> | 2017-01-24 12:05:15 +0100 |
| commit | 86a50a4f6df9ece982743a3b7ca510846d248909 (patch) | |
| tree | 79edc0478908b7fee9e5dca2088e562c7a62038b /opendc/api/v1/specifications/gpus/endpoint.py | |
Initial commit
Diffstat (limited to 'opendc/api/v1/specifications/gpus/endpoint.py')
| -rw-r--r-- | opendc/api/v1/specifications/gpus/endpoint.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/opendc/api/v1/specifications/gpus/endpoint.py b/opendc/api/v1/specifications/gpus/endpoint.py new file mode 100644 index 00000000..8728d203 --- /dev/null +++ b/opendc/api/v1/specifications/gpus/endpoint.py @@ -0,0 +1,17 @@ +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] + ) |
