mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
fix: add describeIndex timestamp for restful interface (#42104)
issue: #41431 Signed-off-by: xianliang.li <xianliang.li@zilliz.com>
This commit is contained in:
parent
e6da4a64b5
commit
9af6c16ea0
@ -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)
|
||||
|
||||
|
||||
@ -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"`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user