Skip to content

Commit

Permalink
Merge branch 'master' into fix-typo2
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot[bot] authored Dec 13, 2023
2 parents 3386d23 + 48fabb7 commit 239c131
Show file tree
Hide file tree
Showing 16 changed files with 1,031 additions and 320 deletions.
13 changes: 13 additions & 0 deletions client/http/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const (
store = "/pd/api/v1/store"
Stores = "/pd/api/v1/stores"
StatsRegion = "/pd/api/v1/stats/region"
membersPrefix = "/pd/api/v1/members"
leaderPrefix = "/pd/api/v1/leader"
transferLeader = "/pd/api/v1/leader/transfer"
// Config
Config = "/pd/api/v1/config"
ClusterVersion = "/pd/api/v1/config/cluster-version"
Expand Down Expand Up @@ -124,6 +127,16 @@ func StoreLabelByID(id uint64) string {
return fmt.Sprintf("%s/%d/label", store, id)
}

// LabelByStoreID returns the path of PD HTTP API to set store label.
func LabelByStoreID(storeID int64) string {
return fmt.Sprintf("%s/%d/label", store, storeID)
}

// TransferLeaderByID returns the path of PD HTTP API to transfer leader by ID.
func TransferLeaderByID(leaderID string) string {
return fmt.Sprintf("%s/%s", transferLeader, leaderID)
}

// ConfigWithTTLSeconds returns the config API with the TTL seconds parameter.
func ConfigWithTTLSeconds(ttlSeconds float64) string {
return fmt.Sprintf("%s?ttlSecond=%.0f", Config, ttlSeconds)
Expand Down
Loading

0 comments on commit 239c131

Please sign in to comment.