Skip to content

Commit

Permalink
.rest updates and unify create to return id
Browse files Browse the repository at this point in the history
  • Loading branch information
JEMeyer committed Jul 29, 2024
1 parent 3fc9b57 commit 98eddb9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions scripts/http/assignments.rest
Original file line number Diff line number Diff line change
@@ -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/<ID>
GET {{maestroHost}}/api/assignments/<ID>

### Create a new assignment
POST {{baseMaestroUrl}}:{{maestroPort}}/api/assignments
POST {{maestroHost}}/api/assignments
Content-Type: application/json

{
Expand All @@ -16,13 +16,13 @@ Content-Type: application/json
}

### Delete an assignment
DELETE {{baseMaestroUrl}}:{{maestroPort}}/api/assignments/<ID>
DELETE {{maestroHost}}/api/assignments/<ID>

### Deploy all assignments
POST {{baseMaestroUrl}}:{{maestroPort}}/api/assignments/deployAll
POST {{maestroHost}}/api/assignments/deployAll

### Update an assignment
PUT {{baseMaestroUrl}}:{{maestroPort}}/api/assignments/<ID>
PUT {{maestroHost}}/api/assignments/<ID>
Content-Type: application/json

{
Expand Down
10 changes: 5 additions & 5 deletions scripts/http/computers.rest
Original file line number Diff line number Diff line change
@@ -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/<ID>
GET {{maestroHost}}/api/computers/<ID>

### Create a new computer
POST {{baseMaestroUrl}}:{{maestroPort}}/api/computers
POST {{maestroHost}}/api/computers
Content-Type: application/json

{
Expand All @@ -14,10 +14,10 @@ Content-Type: application/json
}

### Delete an computer
DELETE {{baseMaestroUrl}}:{{maestroPort}}/api/computers/<ID>
DELETE {{maestroHost}}/api/computers/<ID>

### Update an computer
PUT {{baseMaestroUrl}}:{{maestroPort}}/api/computers/1
PUT {{maestroHost}}/api/computers/1
Content-Type: application/json

{
Expand Down
10 changes: 5 additions & 5 deletions scripts/http/gpus.rest
Original file line number Diff line number Diff line change
@@ -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/<ID>
GET {{maestroHost}}/api/gpus/<ID>

### Create a new gpu
POST {{baseMaestroUrl}}:{{maestroPort}}/api/gpus
POST {{maestroHost}}/api/gpus
Content-Type: application/json

{
Expand All @@ -16,10 +16,10 @@ Content-Type: application/json
}

### Delete a gpu
DELETE {{baseMaestroUrl}}:{{maestroPort}}/api/gpus/<ID>
DELETE {{maestroHost}}/api/gpus/<ID>

### Update a gpu
PUT {{baseMaestroUrl}}:{{maestroPort}}/api/assignments/<ID>
PUT {{maestroHost}}/api/assignments/<ID>
Content-Type: application/json

{
Expand Down
8 changes: 4 additions & 4 deletions scripts/http/models.rest
Original file line number Diff line number Diff line change
@@ -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/<NAME>?type=<TYPE>
GET {{maestroHost}}/api/models/<NAME>?type=<TYPE>

### Create a new model
POST {{baseMaestroUrl}}:{{maestroPort}}/api/models
POST {{maestroHost}}/api/models
Content-Type: application/json

{
Expand All @@ -16,4 +16,4 @@ Content-Type: application/json
}

### Delete a model
DELETE {{baseMaestroUrl}}:{{maestroPort}}/api/models/<NAME>?type=<TYPE>
DELETE {{maestroHost}}/api/models/<NAME>?type=<TYPE>
2 changes: 1 addition & 1 deletion src/controllers/assignments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 98eddb9

Please sign in to comment.