From 1fd18dc78ed61fe91c44bf24c122dd213b52c834 Mon Sep 17 00:00:00 2001 From: hugodorea Date: Fri, 12 Aug 2022 10:27:26 -0700 Subject: [PATCH] changes shard field from string to *int in ClusterAllocationExplainRequest struct --- es.go | 2 +- es_test.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/es.go b/es.go index bfcbb61..e218189 100644 --- a/es.go +++ b/es.go @@ -1582,7 +1582,7 @@ type ClusterAllocationExplainRequest struct { Primary bool `json:"primary,omitempty"` // Specifies the ID of the shard that you would like an explanation for. - Shard string `json:"shard,omitempty"` + Shard *int `json:"shard,omitempty"` } // ClusterAllocationExplain provides an explanation for a shard’s current allocation. diff --git a/es_test.go b/es_test.go index 5026c32..ac146fc 100644 --- a/es_test.go +++ b/es_test.go @@ -2103,6 +2103,7 @@ func TestGetNodesHotThreads(t *testing.T) { } func TestClusterAllocationExplain(t *testing.T) { + shardID := 0 tests := []struct { name string request *ClusterAllocationExplainRequest @@ -2138,9 +2139,9 @@ func TestClusterAllocationExplain(t *testing.T) { { name: "with shard set", request: &ClusterAllocationExplainRequest{ - Shard: "test-shard", + Shard: &shardID, }, - expectedBody: `{"shard":"test-shard"}`, + expectedBody: `{"shard":0}`, }, { name: "with pretty output",