Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opensearchapi: Added new struct fields introduced by opensearch 2.12 #482

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Bumps `github.com/aws/aws-sdk-go` from 1.48.13 to 1.50.21
- Bumps `github.com/aws/aws-sdk-go-v2/config` from 1.25.11 to 1.27.0
### Added
- Added new struct fields introduced by opensearch 2.12 ([#482](https://github.com/opensearch-project/opensearch-go/pull/482))
### Changed
- Changed field opensearch_version of type NodesInfoPlugin to json.RawMessage as opensearch 3.0.0 uses an array instead of string ([#482](https://github.com/opensearch-project/opensearch-go/pull/482))
### Deprecated
### Removed
### Fixed
Expand Down Expand Up @@ -142,4 +144,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
[2.1.0]: https://github.com/opensearch-project/opensearch-go/compare/v2.0.1...v2.1.0
[2.0.1]: https://github.com/opensearch-project/opensearch-go/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/opensearch-project/opensearch-go/compare/v1.1.0...v2.0.0
[1.0.0]: https://github.com/opensearch-project/opensearch-go/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/opensearch-project/opensearch-go/compare/v1.0.0...v1.1.0
262 changes: 135 additions & 127 deletions opensearchapi/api_cat-indices.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions opensearchapi/api_cat-nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ type CatNodesItemResp struct {
SearchQueryCurrent int `json:"search.query_current,string"`
SearchQueryTime string `json:"search.query_time"`
SearchQueryTotal int `json:"search.query_total,string"`
SearchConcurrentQueryCurrent int `json:"search.concurrent_query_current,string"`
SearchConcurrentQueryTime string `json:"search.concurrent_query_time"`
SearchConcurrentQueryTotal int `json:"search.concurrent_query_total,string"`
SearchConcurrentAvgSliceCount string `json:"search.concurrent_avg_slice_count"`
SearchScrollCurrent int `json:"search.scroll_current,string"`
SearchScrollTime string `json:"search.scroll_time"`
SearchScrollTotal int `json:"search.scroll_total,string"`
Expand Down
153 changes: 79 additions & 74 deletions opensearchapi/api_cat-shards.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,80 +47,85 @@ type CatShardsResp struct {

// CatShardResp represents one index of the CatShardsResp
type CatShardResp struct {
Index string `json:"index"`
Shard int `json:"shard,string"`
Prirep string `json:"prirep"`
State string `json:"state"`
Docs *string `json:"docs"`
Store *string `json:"store"`
IP *string `json:"ip"`
ID *string `json:"id"`
Node *string `json:"node"`
SyncID *string `json:"sync_id"`
UnassignedReason *string `json:"unassigned.reason"`
UnassignedAt *string `json:"unassigned.at"`
UnassignedFor *string `json:"unassigned.for"`
UnassignedDetails *string `json:"unassigned.details"`
RecoverysourceType *string `json:"recoverysource.type"`
CompletionSize *string `json:"completion.size"`
FielddataMemorySize *string `json:"fielddata.memory_size"`
FielddataEvictions *int `json:"fielddata.evictions,string"`
QueryCacheMemorySize *string `json:"query_cache.memory_size"`
QueryCacheEvictions *int `json:"query_cache.evictions,string"`
FlushTotal *int `json:"flush.total,string"`
FlushTotalTime *string `json:"flush.total_time"`
GetCurrent *int `json:"get.current,string"`
GetTime *string `json:"get.time"`
GetTotal *int `json:"get.total,string"`
GetExistsTime *string `json:"get.exists_time"`
GetExistsTotal *int `json:"get.exists_total,string"`
GetMissingTime *string `json:"get.missing_time"`
GetMissingTotal *int `json:"get.missing_total,string"`
IndexingDeleteCurrent *int `json:"indexing.delete_current,string"`
IndexingDeleteTime *string `json:"indexing.delete_time"`
IndexingDeleteTotal *string `json:"indexing.delete_total"`
IndexingIndexCurrent *int `json:"indexing.index_current,string"`
IndexingIndexTime *string `json:"indexing.index_time"`
IndexingIndexTotal *int `json:"indexing.index_total,string"`
IndexingIndexFailed *int `json:"indexing.index_failed,string"`
MergesCurrent *int `json:"merges.current,string"`
MergesCurrentDocs *int `json:"merges.current_docs,string"`
MergesCurrentSize *string `json:"merges.current_size"`
MergesTotal *int `json:"merges.total,string"`
MergesTotalDocs *int `json:"merges.total_docs,string"`
MergesTotalSize *string `json:"merges.total_size"`
MergesTotalTime *string `json:"merges.total_time"`
RefreshTotal *int `json:"refresh.total,string"`
RefreshTime *string `json:"refresh.time"`
RefreshExternalTotal *int `json:"refresh.external_total,string"`
RefreshExternalTime *string `json:"refresh.external_time"`
RefreshListeners *int `json:"refresh.listeners,string"`
SearchFetchCurrent *int `json:"search.fetch_current,string"`
SearchFetchTime *string `json:"search.fetch_time"`
SearchFetchTotal *int `json:"search.fetch_total,string"`
SearchOpenContexts *int `json:"search.open_contexts,string"`
SearchQueryCurrent *int `json:"search.query_current,string"`
SearchQueryTime *string `json:"search.query_time"`
SearchQueryTotal *int `json:"search.query_total,string"`
SearchScrollCurrent *int `json:"search.scroll_current,string"`
SearchScrollTime *string `json:"search.scroll_time"`
SearchScrollTotal *int `json:"search.scroll_total,string"`
SearchPointInTimeCurrent *int `json:"search.point_in_time_current,string"`
SearchPointInTimeTime *string `json:"search.point_in_time_time"`
SearchPointInTimeTotal *int `json:"search.point_in_time_total,string"`
SegmentsCount *int `json:"segments.count,string"`
SegmentsMemory *string `json:"segments.memory"`
SegmentsIndexWriterMemory *string `json:"segments.index_writer_memory"`
SegmentsVersionMapMemory *string `json:"segments.version_map_memory"`
SegmentsFixedBitsetMemory *string `json:"segments.fixed_bitset_memory"`
SeqNoMax *int `json:"seq_no.max,string"`
SeqNoLocalCheckpoint *int `json:"seq_no.local_checkpoint,string"`
SeqNoGlobalCheckpoint *int `json:"seq_no.global_checkpoint,string"`
WarmerCurrent *int `json:"warmer.current,string"`
WarmerTotal *int `json:"warmer.total,string"`
WarmerTotalTime *string `json:"warmer.total_time"`
PathData *string `json:"path.data"`
PathState *string `json:"path.state"`
Index string `json:"index"`
Shard int `json:"shard,string"`
Prirep string `json:"prirep"`
State string `json:"state"`
Docs *string `json:"docs"`
Store *string `json:"store"`
IP *string `json:"ip"`
ID *string `json:"id"`
Node *string `json:"node"`
SyncID *string `json:"sync_id"`
UnassignedReason *string `json:"unassigned.reason"`
UnassignedAt *string `json:"unassigned.at"`
UnassignedFor *string `json:"unassigned.for"`
UnassignedDetails *string `json:"unassigned.details"`
RecoverysourceType *string `json:"recoverysource.type"`
CompletionSize *string `json:"completion.size"`
FielddataMemorySize *string `json:"fielddata.memory_size"`
FielddataEvictions *int `json:"fielddata.evictions,string"`
QueryCacheMemorySize *string `json:"query_cache.memory_size"`
QueryCacheEvictions *int `json:"query_cache.evictions,string"`
FlushTotal *int `json:"flush.total,string"`
FlushTotalTime *string `json:"flush.total_time"`
GetCurrent *int `json:"get.current,string"`
GetTime *string `json:"get.time"`
GetTotal *int `json:"get.total,string"`
GetExistsTime *string `json:"get.exists_time"`
GetExistsTotal *int `json:"get.exists_total,string"`
GetMissingTime *string `json:"get.missing_time"`
GetMissingTotal *int `json:"get.missing_total,string"`
IndexingDeleteCurrent *int `json:"indexing.delete_current,string"`
IndexingDeleteTime *string `json:"indexing.delete_time"`
IndexingDeleteTotal *string `json:"indexing.delete_total"`
IndexingIndexCurrent *int `json:"indexing.index_current,string"`
IndexingIndexTime *string `json:"indexing.index_time"`
IndexingIndexTotal *int `json:"indexing.index_total,string"`
IndexingIndexFailed *int `json:"indexing.index_failed,string"`
MergesCurrent *int `json:"merges.current,string"`
MergesCurrentDocs *int `json:"merges.current_docs,string"`
MergesCurrentSize *string `json:"merges.current_size"`
MergesTotal *int `json:"merges.total,string"`
MergesTotalDocs *int `json:"merges.total_docs,string"`
MergesTotalSize *string `json:"merges.total_size"`
MergesTotalTime *string `json:"merges.total_time"`
RefreshTotal *int `json:"refresh.total,string"`
RefreshTime *string `json:"refresh.time"`
RefreshExternalTotal *int `json:"refresh.external_total,string"`
RefreshExternalTime *string `json:"refresh.external_time"`
RefreshListeners *int `json:"refresh.listeners,string"`
SearchFetchCurrent *int `json:"search.fetch_current,string"`
SearchFetchTime *string `json:"search.fetch_time"`
SearchFetchTotal *int `json:"search.fetch_total,string"`
SearchOpenContexts *int `json:"search.open_contexts,string"`
SearchQueryCurrent *int `json:"search.query_current,string"`
SearchQueryTime *string `json:"search.query_time"`
SearchQueryTotal *int `json:"search.query_total,string"`
SearchConcurrentQueryCurrent *int `json:"search.concurrent_query_current,string"`
SearchConcurrentQueryTime *string `json:"search.concurrent_query_time"`
SearchConcurrentQueryTotal *int `json:"search.concurrent_query_total,string"`
SearchConcurrentAvgSliceCount *string `json:"search.concurrent_avg_slice_count"`
SearchScrollCurrent *int `json:"search.scroll_current,string"`
SearchScrollTime *string `json:"search.scroll_time"`
SearchScrollTotal *int `json:"search.scroll_total,string"`
SearchPointInTimeCurrent *int `json:"search.point_in_time_current,string"`
SearchPointInTimeTime *string `json:"search.point_in_time_time"`
SearchPointInTimeTotal *int `json:"search.point_in_time_total,string"`
SegmentsCount *int `json:"segments.count,string"`
SegmentsMemory *string `json:"segments.memory"`
SegmentsIndexWriterMemory *string `json:"segments.index_writer_memory"`
SegmentsVersionMapMemory *string `json:"segments.version_map_memory"`
SegmentsFixedBitsetMemory *string `json:"segments.fixed_bitset_memory"`
SeqNoMax *int `json:"seq_no.max,string"`
SeqNoLocalCheckpoint *int `json:"seq_no.local_checkpoint,string"`
SeqNoGlobalCheckpoint *int `json:"seq_no.global_checkpoint,string"`
WarmerCurrent *int `json:"warmer.current,string"`
WarmerTotal *int `json:"warmer.total,string"`
WarmerTotalTime *string `json:"warmer.total_time"`
PathData *string `json:"path.data"`
PathState *string `json:"path.state"`
DocsDeleted *int `json:"docs.deleted,string"`
}

// Inspect returns the Inspect type containing the raw *opensearch.Reponse
Expand Down
3 changes: 3 additions & 0 deletions opensearchapi/api_cluster-stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ type ClusterStatsIndices struct {
} `json:"refresh_size_lag"`
MaxRefreshTimeLagInMillis int `json:"max_refresh_time_lag_in_millis"`
TotalTimeSpentInMillis int `json:"total_time_spent_in_millis"`
Pressure struct {
TotalRejections int `json:"total_rejections"`
} `json:"pressure"`
} `json:"upload"`
Download struct {
TotalDownloadSize struct {
Expand Down
39 changes: 23 additions & 16 deletions opensearchapi/api_indices-stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,26 @@ type IndicesStatsGet struct {

// IndicesStatsSearch is a sub type of IndicesStatsInfo containing stats about index search
type IndicesStatsSearch struct {
OpenContexts int `json:"open_contexts"`
QueryTotal int `json:"query_total"`
QueryTimeInMillis int `json:"query_time_in_millis"`
QueryCurrent int `json:"query_current"`
FetchTotal int `json:"fetch_total"`
FetchTimeInMillis int `json:"fetch_time_in_millis"`
FetchCurrent int `json:"fetch_current"`
ScrollTotal int `json:"scroll_total"`
ScrollTimeInMillis int `json:"scroll_time_in_millis"`
ScrollCurrent int `json:"scroll_current"`
PointInTimeTotal int `json:"point_in_time_total"`
PointInTimeTimeInMillis int `json:"point_in_time_time_in_millis"`
PointInTimeCurrent int `json:"point_in_time_current"`
SuggestTotal int `json:"suggest_total"`
SuggestTimeInMillis int `json:"suggest_time_in_millis"`
SuggestCurrent int `json:"suggest_current"`
OpenContexts int `json:"open_contexts"`
QueryTotal int `json:"query_total"`
QueryTimeInMillis int `json:"query_time_in_millis"`
QueryCurrent int `json:"query_current"`
ConcurrentQueryTotal int `json:"concurrent_query_total"`
ConcurrentQueryTimeInMillis int `json:"concurrent_query_time_in_millis"`
ConcurrentQueryCurrent int `json:"concurrent_query_current"`
ConcurrentAVGSliceCount float32 `json:"concurrent_avg_slice_count"`
FetchTotal int `json:"fetch_total"`
FetchTimeInMillis int `json:"fetch_time_in_millis"`
FetchCurrent int `json:"fetch_current"`
ScrollTotal int `json:"scroll_total"`
ScrollTimeInMillis int `json:"scroll_time_in_millis"`
ScrollCurrent int `json:"scroll_current"`
PointInTimeTotal int `json:"point_in_time_total"`
PointInTimeTimeInMillis int `json:"point_in_time_time_in_millis"`
PointInTimeCurrent int `json:"point_in_time_current"`
SuggestTotal int `json:"suggest_total"`
SuggestTimeInMillis int `json:"suggest_time_in_millis"`
SuggestCurrent int `json:"suggest_current"`
}

// IndicesStatsMerges is a sub type of IndicesStatsInfo containing stats about index merges
Expand Down Expand Up @@ -213,6 +217,9 @@ type IndicesStatsSegments struct {
} `json:"refresh_size_lag"`
MaxRefreshTimeLagInMillis int `json:"max_refresh_time_lag_in_millis"`
TotalTimeSpentInMillis int `json:"total_time_spent_in_millis"`
Pressure struct {
TotalRejections int `json:"total_rejections"`
} `json:"pressure"`
} `json:"upload"`
Download struct {
TotalDownloadSize struct {
Expand Down
18 changes: 9 additions & 9 deletions opensearchapi/api_nodes-info.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ type NodesInfoHTTP struct {

// NodesInfoPlugin is a sub type of NodesInfo containing information about a plugin
type NodesInfoPlugin struct {
Name string `json:"name"`
Version string `json:"version"`
OpensearchVersion string `json:"opensearch_version"`
JavaVersion string `json:"java_version"`
Description string `json:"description"`
Classname string `json:"classname"`
CustomFoldername string `json:"custom_foldername"`
ExtendedPlugins []string `json:"extended_plugins"`
HasNativeController bool `json:"has_native_controller"`
Name string `json:"name"`
Version string `json:"version"`
OpensearchVersion json.RawMessage `json:"opensearch_version"`
JavaVersion string `json:"java_version"`
Description string `json:"description"`
Classname string `json:"classname"`
CustomFoldername string `json:"custom_foldername"`
ExtendedPlugins []string `json:"extended_plugins"`
HasNativeController bool `json:"has_native_controller"`
}

// NodesInfoIngest is a sub type of NodesInfo containing information about ingest processors
Expand Down
Loading
Loading