fix: add describeIndex timestamp for restful interface (#42104)

issue: #41431

Signed-off-by: xianliang.li <xianliang.li@zilliz.com>
This commit is contained in:
foxspy 2025-06-11 15:26:38 +08:00 committed by GitHub
parent e6da4a64b5
commit 9af6c16ea0
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

@ -354,7 +354,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"`
@ -424,6 +426,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 }
@ -435,6 +438,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"`