Skip to content

Commit 1d54a3f

Browse files
committed
docs: Add API route names
Signed-off-by: Phoevos Kalemkeris <[email protected]>
1 parent c595e78 commit 1d54a3f

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

cogstack_model_gateway/gateway/routers/models.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@
100100
router = APIRouter()
101101

102102

103-
@router.get("/models/", response_model=list[dict], tags=["models"])
103+
@router.get(
104+
"/models/",
105+
response_model=list[dict],
106+
tags=["models"],
107+
name="List running CogStack Model Serve instances with metadata from the tracking server",
108+
)
104109
async def get_models(
105110
config: Annotated[Config, Depends(get_config)],
106111
verbose: Annotated[
@@ -120,7 +125,12 @@ async def get_models(
120125
return models
121126

122127

123-
@router.get("/models/{model_name}/info", response_model=dict, tags=["models"])
128+
@router.get(
129+
"/models/{model_name}/info",
130+
response_model=dict,
131+
tags=["models"],
132+
name="Get information about a running CogStack Model Serve instance",
133+
)
124134
async def get_model_info(model_name: str):
125135
"""Get information about a running model server through its `/info` API."""
126136
# FIXME: Enable SSL verification when certificates are properly set up
@@ -139,7 +149,12 @@ async def get_model_info(model_name: str):
139149
return response.json()
140150

141151

142-
@router.post("/models/{model_name}", response_model=dict, tags=["models"])
152+
@router.post(
153+
"/models/{model_name}",
154+
response_model=dict,
155+
tags=["models"],
156+
name="Deploy a CogStack Model Serve instance with a given model URI or tracking ID",
157+
)
143158
async def deploy_model(
144159
config: Annotated[Config, Depends(get_config)],
145160
model_name: Annotated[str, Depends(validate_model_name)],
@@ -215,7 +230,12 @@ async def deploy_model(
215230
}
216231

217232

218-
@router.post("/models/{model_name}/tasks/{task}", response_model=dict, tags=["models"])
233+
@router.post(
234+
"/models/{model_name}/tasks/{task}",
235+
response_model=dict,
236+
tags=["models"],
237+
name="Schedule a task for execution on a running CogStack Model Serve instance",
238+
)
219239
async def execute_task(
220240
model_name: str,
221241
task: str,

cogstack_model_gateway/gateway/routers/tasks.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@
1111
router = APIRouter()
1212

1313

14-
@router.get("/tasks/", tags=["tasks"])
14+
@router.get(
15+
"/tasks/",
16+
tags=["tasks"],
17+
name="List all tasks created through the CogStack Model Gateway",
18+
)
1519
async def get_tasks():
1620
"""List all tasks (not implemented)."""
1721
# FIXME: Implement authn/authz
1822
raise HTTPException(status_code=403, detail="Only admins can list tasks")
1923

2024

21-
@router.get("/tasks/{task_uuid}", tags=["tasks"])
25+
@router.get(
26+
"/tasks/{task_uuid}",
27+
tags=["tasks"],
28+
name="Get a task created through the CogStack Model Gateway by its UUID",
29+
)
2230
async def get_task_by_uuid(
2331
task_uuid: str,
2432
config: Annotated[Config, Depends(get_config)],

0 commit comments

Comments
 (0)