Skip to content

Commit 00e24f7

Browse files
committed
opensearchapi: add new fields for opensearch 3.0
Signed-off-by: Jakob Hahn <[email protected]>
1 parent 217f78a commit 00e24f7

File tree

6 files changed

+38
-26
lines changed

6 files changed

+38
-26
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
77
### Dependencies
88

99
### Added
10+
- Adds new fields for Opensearch 3.0 ([#702](https://github.com/opensearch-project/opensearch-go/pull/702))
1011

1112
### Changed
1213
- Test against Opensearch 3.0 ([#702](https://github.com/opensearch-project/opensearch-go/pull/702))
@@ -35,6 +36,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
3536
### Changed
3637
- Bump golang version to 1.22 ([#691](https://github.com/opensearch-project/opensearch-go/pull/691))
3738
- Change ChangeCatRecoveryItemResp Byte fields from int to string ([#691](https://github.com/opensearch-project/opensearch-go/pull/691))
39+
3840
### Deprecated
3941

4042
### Removed

opensearchapi/api_cluster-state.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ type ClusterStateMetaDataStream struct {
194194
type ClusterStateRoutingIndex struct {
195195
State string `json:"state"`
196196
Primary bool `json:"primary"`
197+
SearchOnly bool `json:"searchOnly"`
197198
Node *string `json:"node"`
198199
RelocatingNode *string `json:"relocating_node"`
199200
Shard int `json:"shard"`

opensearchapi/api_cluster-stats.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ type ClusterStatsNodes struct {
194194
Master int `json:"master"`
195195
RemoteClusterClient int `json:"remote_cluster_client"`
196196
Search int `json:"search"`
197+
Warm int `json:"warm"`
197198
} `json:"count"`
198199
Versions []string `json:"versions"`
199200
Os struct {

opensearchapi/api_nodes-info.go

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,29 @@ func (r NodesInfoResp) Inspect() Inspect {
7171

7272
// NodesInfo is a sub type of NodesInfoResp containing information about nodes and their stats
7373
type NodesInfo struct {
74-
Name string `json:"name"`
75-
TransportAddress string `json:"transport_address"`
76-
Host string `json:"host"`
77-
IP string `json:"ip"`
78-
Version string `json:"version"`
79-
BuildType string `json:"build_type"`
80-
BuildHash string `json:"build_hash"`
81-
TotalIndexingBuffer int64 `json:"total_indexing_buffer"`
82-
Roles []string `json:"roles"`
83-
Attributes map[string]string `json:"attributes"`
84-
Settings json.RawMessage `json:"settings"` // Won't parse as it may contain fields that we can't know
85-
OS NodesInfoOS `json:"os"`
86-
Process NodesInfoProcess `json:"process"`
87-
JVM NodesInfoJVM `json:"jvm"`
88-
ThreadPool map[string]NodesInfoThreadPool `json:"thread_pool"`
89-
Transport NodesInfoTransport `json:"transport"`
90-
HTTP NodesInfoHTTP `json:"http"`
91-
Plugins []NodesInfoPlugin `json:"plugins"`
92-
Modules []NodesInfoPlugin `json:"modules"`
93-
Ingest NodesInfoIngest `json:"ingest"`
94-
Aggregations map[string]NodesInfoAgg `json:"aggregations"`
95-
SearchPipelines NodesInfoSearchPipelines `json:"search_pipelines"`
74+
Name string `json:"name"`
75+
TransportAddress string `json:"transport_address"`
76+
Host string `json:"host"`
77+
IP string `json:"ip"`
78+
Version string `json:"version"`
79+
BuildType string `json:"build_type"`
80+
BuildHash string `json:"build_hash"`
81+
TotalIndexingBuffer int64 `json:"total_indexing_buffer"`
82+
TotalIndexingBufferInBytes int64 `json:"total_indexing_buffer_in_bytes"`
83+
Roles []string `json:"roles"`
84+
Attributes map[string]string `json:"attributes"`
85+
Settings json.RawMessage `json:"settings"` // Won't parse as it may contain fields that we can't know
86+
OS NodesInfoOS `json:"os"`
87+
Process NodesInfoProcess `json:"process"`
88+
JVM NodesInfoJVM `json:"jvm"`
89+
ThreadPool map[string]NodesInfoThreadPool `json:"thread_pool"`
90+
Transport NodesInfoTransport `json:"transport"`
91+
HTTP NodesInfoHTTP `json:"http"`
92+
Plugins []NodesInfoPlugin `json:"plugins"`
93+
Modules []NodesInfoPlugin `json:"modules"`
94+
Ingest NodesInfoIngest `json:"ingest"`
95+
Aggregations map[string]NodesInfoAgg `json:"aggregations"`
96+
SearchPipelines NodesInfoSearchPipelines `json:"search_pipelines"`
9697
}
9798

9899
// NodesInfoOS is a sub type of NodesInfo containing information about the Operating System

opensearchapi/api_nodes-stats.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ type NodesStatsSearchBackpressure struct {
624624
CancellationCount int `json:"cancellation_count"`
625625
CancellationLimitReachedCount int `json:"cancellation_limit_reached_count"`
626626
} `json:"cancellation_stats"`
627+
CompletionCount int `json:"completion_count"`
627628
} `json:"search_task"`
628629
SearchShardTask struct {
629630
ResourceTrackerStats struct {
@@ -640,6 +641,7 @@ type NodesStatsSearchBackpressure struct {
640641
CancellationCount int `json:"cancellation_count"`
641642
CancellationLimitReachedCount int `json:"cancellation_limit_reached_count"`
642643
} `json:"cancellation_stats"`
644+
CompletionCount int `json:"completion_count"`
643645
} `json:"search_shard_task"`
644646
Mode string `json:"mode"`
645647
}
@@ -678,10 +680,14 @@ type NodesStatsSearchPipeline struct {
678680

679681
// NodesStatsTaskCancellation is a sub type of NodesStats containing stats about canceled tasks
680682
type NodesStatsTaskCancellation struct {
681-
SearchShardTask struct {
682-
CurrentCountPostCancel int `json:"current_count_post_cancel"`
683-
TotalCountPostCancel int `json:"total_count_post_cancel"`
684-
} `json:"search_shard_task"`
683+
SearchTask NodesStatsTaskCancellationValues `json:"search_task"`
684+
SearchShardTask NodesStatsTaskCancellationValues `json:"search_shard_task"`
685+
}
686+
687+
// NodesStatsTaskCancellationValues is a sub type of NodesStatsTaskCancellation
688+
type NodesStatsTaskCancellationValues struct {
689+
CurrentCountPostCancel int `json:"current_count_post_cancel"`
690+
TotalCountPostCancel int `json:"total_count_post_cancel"`
685691
}
686692

687693
// NodesStatsIndicesSearchRequest is a sub type of NodesStatsIndices containing stats about search requests

opensearchapi/api_search_shards.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ type SearchShardsResp struct {
7272
Shards [][]struct {
7373
State string `json:"state"`
7474
Primary bool `json:"primary"`
75+
SearchOnly bool `json:"searchOnly"`
7576
Node string `json:"node"`
7677
RelocatingNode *string `json:"relocating_node"`
7778
Shard int `json:"shard"`

0 commit comments

Comments
 (0)