diff --git a/client/http/interface.go b/client/http/interface.go index c7bfc37958d6..06beba85a450 100644 --- a/client/http/interface.go +++ b/client/http/interface.go @@ -91,7 +91,7 @@ type Client interface { GetMinResolvedTSByStoresIDs(context.Context, []uint64) (uint64, map[uint64]uint64, error) GetPDVersion(context.Context) (string, error) /* Micro Service interfaces */ - GetMicroServiceMembers(context.Context, string) ([]string, error) + GetMicroServiceMembers(context.Context, string) ([]MicroServiceMember, error) GetMicroServicePrimary(context.Context, string) (string, error) DeleteOperators(context.Context) error @@ -856,8 +856,8 @@ func (c *client) GetMinResolvedTSByStoresIDs(ctx context.Context, storeIDs []uin } // GetMicroServiceMembers gets the members of the microservice. -func (c *client) GetMicroServiceMembers(ctx context.Context, service string) ([]string, error) { - var members []string +func (c *client) GetMicroServiceMembers(ctx context.Context, service string) ([]MicroServiceMember, error) { + var members []MicroServiceMember err := c.request(ctx, newRequestInfo(). WithName(getMicroServiceMembersName). WithURI(MicroServiceMembers(service)). diff --git a/client/http/types.go b/client/http/types.go index aaf7e1c00275..56ad0427f126 100644 --- a/client/http/types.go +++ b/client/http/types.go @@ -592,3 +592,12 @@ type MembersInfo struct { Leader *pdpb.Member `json:"leader,omitempty"` EtcdLeader *pdpb.Member `json:"etcd_leader,omitempty"` } + +// MicroServiceMember is the member info of a micro service. +type MicroServiceMember struct { + ServiceAddr string `json:"service-addr"` + Version string `json:"version"` + GitHash string `json:"git-hash"` + DeployPath string `json:"deploy-path"` + StartTimestamp int64 `json:"start-timestamp"` +}