diff options
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] + ) |
