diff --git a/desc/inference/inference.api b/desc/inference/inference.api index c46054d3..a77c0e98 100644 --- a/desc/inference/inference.api +++ b/desc/inference/inference.api @@ -144,4 +144,12 @@ type ( GetDeployTasksResp { PageResult } + + GetRunningInstanceReq { + ModelType string `path:"modelType"` + ModelName string `path:"modelName"` + } + GetRunningInstanceResp { + List interface{} `json:"list,omitempty"` + } ) diff --git a/desc/pcm.api b/desc/pcm.api index 5a956664..6eacc710 100644 --- a/desc/pcm.api +++ b/desc/pcm.api @@ -968,6 +968,9 @@ service pcm { @handler GetDeployTasks get /inference/getDeployTasks (GetDeployTasksReq) returns (GetDeployTasksResp) + + @handler GetRunningInstanceByModel + get /inference/getInstanceByModel (GetRunningInstanceReq) returns (GetRunningInstanceResp) } @server( diff --git a/internal/handler/routes.go b/internal/handler/routes.go index c735cd3a..c317a876 100644 --- a/internal/handler/routes.go +++ b/internal/handler/routes.go @@ -1228,6 +1228,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/inference/getDeployTasks", Handler: inference.GetDeployTasksHandler(serverCtx), }, + { + Method: http.MethodGet, + Path: "/inference/getInstanceByModel", + Handler: inference.GetRunningInstanceByModelHandler(serverCtx), + }, }, rest.WithPrefix("/pcm/v1"), ) diff --git a/internal/types/types.go b/internal/types/types.go index 73949414..fcfe999e 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -6034,3 +6034,12 @@ type GetDeployTasksReq struct { type GetDeployTasksResp struct { PageResult } + +type GetRunningInstanceReq struct { + ModelType string `path:"modelType"` + ModelName string `path:"modelName"` +} + +type GetRunningInstanceResp struct { + List interface{} `json:"list,omitempty"` +}