From 3f21737673b95cd85ecf63c2833861bd7fc064b1 Mon Sep 17 00:00:00 2001 From: tzwang Date: Fri, 23 Aug 2024 16:55:32 +0800 Subject: [PATCH] added getRunningInstanceByModel api Former-commit-id: 9660ea240592d8c646ecf99804e147cfbad02a75 --- desc/inference/inference.api | 8 ++++++++ desc/pcm.api | 3 +++ internal/handler/routes.go | 5 +++++ internal/types/types.go | 9 +++++++++ 4 files changed, 25 insertions(+) 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"` +}