From 98eddb9e960312b3d58295145e401a905accc8bd Mon Sep 17 00:00:00 2001 From: Joe Meyer Date: Sun, 28 Jul 2024 21:04:43 -0500 Subject: [PATCH] .rest updates and unify create to return id --- scripts/http/assignments.rest | 12 ++++++------ scripts/http/computers.rest | 10 +++++----- scripts/http/gpus.rest | 10 +++++----- scripts/http/models.rest | 8 ++++---- src/controllers/assignments.ts | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/scripts/http/assignments.rest b/scripts/http/assignments.rest index d45664e..da3450f 100644 --- a/scripts/http/assignments.rest +++ b/scripts/http/assignments.rest @@ -1,11 +1,11 @@ ### Get all assignments -GET {{baseMaestroUrl}}:{{maestroPort}}/api/assignments +GET {{maestroHost}}/api/assignments ### Get assignment by ID -GET {{baseMaestroUrl}}:{{maestroPort}}/api/assignments/ +GET {{maestroHost}}/api/assignments/ ### Create a new assignment -POST {{baseMaestroUrl}}:{{maestroPort}}/api/assignments +POST {{maestroHost}}/api/assignments Content-Type: application/json { @@ -16,13 +16,13 @@ Content-Type: application/json } ### Delete an assignment -DELETE {{baseMaestroUrl}}:{{maestroPort}}/api/assignments/ +DELETE {{maestroHost}}/api/assignments/ ### Deploy all assignments -POST {{baseMaestroUrl}}:{{maestroPort}}/api/assignments/deployAll +POST {{maestroHost}}/api/assignments/deployAll ### Update an assignment -PUT {{baseMaestroUrl}}:{{maestroPort}}/api/assignments/ +PUT {{maestroHost}}/api/assignments/ Content-Type: application/json { diff --git a/scripts/http/computers.rest b/scripts/http/computers.rest index fc40b46..1e14242 100644 --- a/scripts/http/computers.rest +++ b/scripts/http/computers.rest @@ -1,11 +1,11 @@ ### Get all computers -GET {{baseMaestroUrl}}:{{maestroPort}}/api/computers +GET {{maestroHost}}/api/computers ### Get computer by ID -GET {{baseMaestroUrl}}:{{maestroPort}}/api/computers/ +GET {{maestroHost}}/api/computers/ ### Create a new computer -POST {{baseMaestroUrl}}:{{maestroPort}}/api/computers +POST {{maestroHost}}/api/computers Content-Type: application/json { @@ -14,10 +14,10 @@ Content-Type: application/json } ### Delete an computer -DELETE {{baseMaestroUrl}}:{{maestroPort}}/api/computers/ +DELETE {{maestroHost}}/api/computers/ ### Update an computer -PUT {{baseMaestroUrl}}:{{maestroPort}}/api/computers/1 +PUT {{maestroHost}}/api/computers/1 Content-Type: application/json { diff --git a/scripts/http/gpus.rest b/scripts/http/gpus.rest index 7a300c7..2a8e367 100644 --- a/scripts/http/gpus.rest +++ b/scripts/http/gpus.rest @@ -1,11 +1,11 @@ ### Get all gpus -GET {{baseMaestroUrl}}:{{maestroPort}}/api/gpus +GET {{maestroHost}}/api/gpus ### Get gpu by id -GET {{baseMaestroUrl}}:{{maestroPort}}/api/gpus/ +GET {{maestroHost}}/api/gpus/ ### Create a new gpu -POST {{baseMaestroUrl}}:{{maestroPort}}/api/gpus +POST {{maestroHost}}/api/gpus Content-Type: application/json { @@ -16,10 +16,10 @@ Content-Type: application/json } ### Delete a gpu -DELETE {{baseMaestroUrl}}:{{maestroPort}}/api/gpus/ +DELETE {{maestroHost}}/api/gpus/ ### Update a gpu -PUT {{baseMaestroUrl}}:{{maestroPort}}/api/assignments/ +PUT {{maestroHost}}/api/assignments/ Content-Type: application/json { diff --git a/scripts/http/models.rest b/scripts/http/models.rest index f4284a6..9891bbf 100644 --- a/scripts/http/models.rest +++ b/scripts/http/models.rest @@ -1,13 +1,13 @@ ### Get all models -GET {{baseMaestroUrl}}:{{maestroPort}}/api/models +GET {{maestroHost}}/api/models # type param = llm, diffusor, stt, or tts ### Get model by name -GET {{baseMaestroUrl}}:{{maestroPort}}/api/models/?type= +GET {{maestroHost}}/api/models/?type= ### Create a new model -POST {{baseMaestroUrl}}:{{maestroPort}}/api/models +POST {{maestroHost}}/api/models Content-Type: application/json { @@ -16,4 +16,4 @@ Content-Type: application/json } ### Delete a model -DELETE {{baseMaestroUrl}}:{{maestroPort}}/api/models/?type= +DELETE {{maestroHost}}/api/models/?type= diff --git a/src/controllers/assignments.ts b/src/controllers/assignments.ts index 91d5d97..429c1b7 100644 --- a/src/controllers/assignments.ts +++ b/src/controllers/assignments.ts @@ -51,7 +51,7 @@ export const createAssignment = async (req: Request, res: Response) => { AssignmentGpuService.createDBAssignmentGPU(assignmentId, gpuId) ) ); - res.json({ assignmentId }); + res.json({ id: assignmentId }); }; export const deleteAssignment = async (req: Request, res: Response) => {