added getRunningInstanceByModel api

Former-commit-id: 9660ea240592d8c646ecf99804e147cfbad02a75
This commit is contained in:
tzwang 2024-08-23 16:55:32 +08:00
parent 4f7314a2cd
commit 3f21737673
4 changed files with 25 additions and 0 deletions

View File

@ -144,4 +144,12 @@ type (
GetDeployTasksResp { GetDeployTasksResp {
PageResult PageResult
} }
GetRunningInstanceReq {
ModelType string `path:"modelType"`
ModelName string `path:"modelName"`
}
GetRunningInstanceResp {
List interface{} `json:"list,omitempty"`
}
) )

View File

@ -968,6 +968,9 @@ service pcm {
@handler GetDeployTasks @handler GetDeployTasks
get /inference/getDeployTasks (GetDeployTasksReq) returns (GetDeployTasksResp) get /inference/getDeployTasks (GetDeployTasksReq) returns (GetDeployTasksResp)
@handler GetRunningInstanceByModel
get /inference/getInstanceByModel (GetRunningInstanceReq) returns (GetRunningInstanceResp)
} }
@server( @server(

View File

@ -1228,6 +1228,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/inference/getDeployTasks", Path: "/inference/getDeployTasks",
Handler: inference.GetDeployTasksHandler(serverCtx), Handler: inference.GetDeployTasksHandler(serverCtx),
}, },
{
Method: http.MethodGet,
Path: "/inference/getInstanceByModel",
Handler: inference.GetRunningInstanceByModelHandler(serverCtx),
},
}, },
rest.WithPrefix("/pcm/v1"), rest.WithPrefix("/pcm/v1"),
) )

View File

@ -6034,3 +6034,12 @@ type GetDeployTasksReq struct {
type GetDeployTasksResp struct { type GetDeployTasksResp struct {
PageResult PageResult
} }
type GetRunningInstanceReq struct {
ModelType string `path:"modelType"`
ModelName string `path:"modelName"`
}
type GetRunningInstanceResp struct {
List interface{} `json:"list,omitempty"`
}