fix: [2.5] add describeIndex timestamp for restful interface (#42105)

issue: https://github.com/milvus-io/milvus/issues/41431
pr: #42104

Signed-off-by: xianliang.li <xianliang.li@zilliz.com>
This commit is contained in:
foxspy 2025-05-28 12:00:29 +08:00 committed by GitHub
parent 49684a2439
commit 6ac85e5cfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -2240,10 +2240,13 @@ func (h *HandlersV2) listIndexes(ctx context.Context, c *gin.Context, anyReq any
func (h *HandlersV2) describeIndex(ctx context.Context, c *gin.Context, anyReq any, dbName string) (interface{}, error) {
collectionGetter, _ := anyReq.(requestutil.CollectionNameGetter)
indexGetter, _ := anyReq.(IndexNameGetter)
timeGetter, _ := anyReq.(TimestampGetter)
req := &milvuspb.DescribeIndexRequest{
DbName: dbName,
CollectionName: collectionGetter.GetCollectionName(),
IndexName: indexGetter.GetIndexName(),
Timestamp: timeGetter.GetTimestamp(),
}
c.Set(ContextRequest, req)

View File

@ -352,7 +352,9 @@ type OptionsGetter interface {
type JobIDGetter interface {
GetJobID() string
}
type TimestampGetter interface {
GetTimestamp() uint64
}
type PasswordReq struct {
UserName string `json:"userName" binding:"required"`
Password string `json:"password" binding:"required"`
@ -422,6 +424,7 @@ type IndexReq struct {
DbName string `json:"dbName"`
CollectionName string `json:"collectionName" binding:"required"`
IndexName string `json:"indexName" binding:"required"`
Timestamp uint64 `json:"timestamp"`
}
func (req *IndexReq) GetDbName() string { return req.DbName }
@ -433,6 +436,10 @@ func (req *IndexReq) GetIndexName() string {
return req.IndexName
}
func (req *IndexReq) GetTimestamp() uint64 {
return req.Timestamp
}
type IndexReqWithProperties struct {
DbName string `json:"dbName"`
CollectionName string `json:"collectionName" binding:"required"`