mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
enhance: Support new RESTful URL to describe import job (#36753)
Support the new RESTful URL for retrieving/describing import progress: `/v2/vectordb/jobs/import/describe`. Deprecate the old URL: `/v2/vectordb/jobs/import/get_progress`. issue: https://github.com/milvus-io/milvus/issues/36752 --------- Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
7c8b71e26c
commit
0751c508de
@ -43,7 +43,7 @@ const (
|
||||
GrantPrivilegeAction = "grant_privilege"
|
||||
RevokePrivilegeAction = "revoke_privilege"
|
||||
AlterAction = "alter"
|
||||
GetProgressAction = "get_progress"
|
||||
GetProgressAction = "get_progress" // deprecated, keep it for compatibility, use `/v2/vectordb/jobs/import/describe` instead
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -140,6 +140,7 @@ func (h *HandlersV2) RegisterRoutesToV2(router gin.IRouter) {
|
||||
router.POST(ImportJobCategory+ListAction, timeoutMiddleware(wrapperPost(func() any { return &OptionalCollectionNameReq{} }, wrapperTraceLog(h.wrapperCheckDatabase(h.listImportJob)))))
|
||||
router.POST(ImportJobCategory+CreateAction, timeoutMiddleware(wrapperPost(func() any { return &ImportReq{} }, wrapperTraceLog(h.wrapperCheckDatabase(h.createImportJob)))))
|
||||
router.POST(ImportJobCategory+GetProgressAction, timeoutMiddleware(wrapperPost(func() any { return &JobIDReq{} }, wrapperTraceLog(h.wrapperCheckDatabase(h.getImportJobProcess)))))
|
||||
router.POST(ImportJobCategory+DescribeAction, timeoutMiddleware(wrapperPost(func() any { return &JobIDReq{} }, wrapperTraceLog(h.wrapperCheckDatabase(h.getImportJobProcess)))))
|
||||
}
|
||||
|
||||
type (
|
||||
|
@ -1072,7 +1072,7 @@ func TestMethodPost(t *testing.T) {
|
||||
State: internalpb.ImportJobState_Completed,
|
||||
Reason: "",
|
||||
Progress: 100,
|
||||
}, nil).Once()
|
||||
}, nil).Twice()
|
||||
testEngine := initHTTPServerV2(mp, false)
|
||||
queryTestCases := []rawTestCase{}
|
||||
queryTestCases = append(queryTestCases, rawTestCase{
|
||||
@ -1140,6 +1140,9 @@ func TestMethodPost(t *testing.T) {
|
||||
queryTestCases = append(queryTestCases, rawTestCase{
|
||||
path: versionalV2(ImportJobCategory, GetProgressAction),
|
||||
})
|
||||
queryTestCases = append(queryTestCases, rawTestCase{
|
||||
path: versionalV2(ImportJobCategory, DescribeAction),
|
||||
})
|
||||
|
||||
for _, testcase := range queryTestCases {
|
||||
t.Run(testcase.path, func(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user