mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-02 01:06:41 +08:00
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:
parent
49684a2439
commit
6ac85e5cfe
@ -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)
|
||||
|
||||
|
||||
@ -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"`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user