Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit d0d3dd7

Browse files
authored
Merge pull request #98 from github/hugodorea/fixes-cluster-allocation-explain-shard-type
changes shard field from string to *int in ClusterAllocationExplainRe…
2 parents 102f5bf + 1fd18dc commit d0d3dd7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

es.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ type ClusterAllocationExplainRequest struct {
15821582
Primary bool `json:"primary,omitempty"`
15831583

15841584
// Specifies the ID of the shard that you would like an explanation for.
1585-
Shard string `json:"shard,omitempty"`
1585+
Shard *int `json:"shard,omitempty"`
15861586
}
15871587

15881588
// ClusterAllocationExplain provides an explanation for a shard’s current allocation.

es_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,6 +2103,7 @@ func TestGetNodesHotThreads(t *testing.T) {
21032103
}
21042104

21052105
func TestClusterAllocationExplain(t *testing.T) {
2106+
shardID := 0
21062107
tests := []struct {
21072108
name string
21082109
request *ClusterAllocationExplainRequest
@@ -2138,9 +2139,9 @@ func TestClusterAllocationExplain(t *testing.T) {
21382139
{
21392140
name: "with shard set",
21402141
request: &ClusterAllocationExplainRequest{
2141-
Shard: "test-shard",
2142+
Shard: &shardID,
21422143
},
2143-
expectedBody: `{"shard":"test-shard"}`,
2144+
expectedBody: `{"shard":0}`,
21442145
},
21452146
{
21462147
name: "with pretty output",

0 commit comments

Comments
 (0)