Documentation ¶
Overview ¶
Package es implements additional services that are missing from https://github.com/olivere/elastic .
Index ¶
- type CatShardsResponse
- type CatShardsResponseRow
- type CatShardsService
- func (s *CatShardsService) Bytes(bytes string) *CatShardsService
- func (s *CatShardsService) Columns(columns ...string) *CatShardsService
- func (s *CatShardsService) Do(ctx context.Context) (CatShardsResponse, error)
- func (s *CatShardsService) Index(index string) *CatShardsService
- func (s *CatShardsService) Local(local bool) *CatShardsService
- func (s *CatShardsService) MasterTimeout(masterTimeout string) *CatShardsService
- func (s *CatShardsService) Pretty(pretty bool) *CatShardsService
- func (s *CatShardsService) Sort(fields ...string) *CatShardsService
- type ClusterDeleteVotingConfigExclusion
- type ClusterDeleteVotingConfigExclusionResponse
- type ClusterGetSettingsResponse
- type ClusterGetSettingsService
- func (s *ClusterGetSettingsService) Defaults(include bool) *ClusterGetSettingsService
- func (s *ClusterGetSettingsService) Do(ctx context.Context) (*ClusterGetSettingsResponse, error)
- func (s *ClusterGetSettingsService) FilterPath(filterPath ...string) *ClusterGetSettingsService
- func (s *ClusterGetSettingsService) Human(human bool) *ClusterGetSettingsService
- func (s *ClusterGetSettingsService) Pretty(pretty bool) *ClusterGetSettingsService
- func (s *ClusterGetSettingsService) Validate() error
- type ClusterPostVotingConfigExclusion
- func (s *ClusterPostVotingConfigExclusion) Do(ctx context.Context) (*ClusterPostVotingConfigExclusionResponse, error)
- func (s *ClusterPostVotingConfigExclusion) Node(node string) *ClusterPostVotingConfigExclusion
- func (s *ClusterPostVotingConfigExclusion) Timeout(timeout string) *ClusterPostVotingConfigExclusion
- func (s *ClusterPostVotingConfigExclusion) Validate() error
- type ClusterPostVotingConfigExclusionResponse
- type ClusterPutSettingsResponse
- type ClusterPutSettingsService
- func (s *ClusterPutSettingsService) BodyJSON(body interface{}) *ClusterPutSettingsService
- func (s *ClusterPutSettingsService) BodyString(body string) *ClusterPutSettingsService
- func (s *ClusterPutSettingsService) Do(ctx context.Context) (*ClusterPutSettingsResponse, error)
- func (s *ClusterPutSettingsService) FlatSettings(flatSettings bool) *ClusterPutSettingsService
- func (s *ClusterPutSettingsService) MasterTimeout(masterTimeout string) *ClusterPutSettingsService
- func (s *ClusterPutSettingsService) Persistent(setting string, value interface{}) *ClusterPutSettingsService
- func (s *ClusterPutSettingsService) Pretty(pretty bool) *ClusterPutSettingsService
- func (s *ClusterPutSettingsService) Transient(setting string, value interface{}) *ClusterPutSettingsService
- func (s *ClusterPutSettingsService) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CatShardsResponse ¶
type CatShardsResponse []CatShardsResponseRow
CatShardsResponse is the outcome of CatShardsService.Do.
type CatShardsResponseRow ¶
type CatShardsResponseRow struct { CompletionSize string `json:"completion.size"` // size of completion Docs int `json:"docs,string"` // number of docs in shard FieldDataEvictions string `json:"fielddata.evictions"` // fielddata evictions FieldDataMemorySize string `json:"fielddata.memory_size"` // used fielddata cache FlushTotal int `json:"flush.total,string"` // number of flushes FlushTotalTime string `json:"flush.total_time"` // time spent in flush GetCurrent int `json:"get.current,string"` // number of current get ops GetExistsTime string `json:"get.exists_time"` // time spent in successful gets GetExistsTotal int `json:"get.exists_total,string"` // number of successful gets GetMissingTime string `json:"get.missing_time"` // time spent in failed gets GetMissingTotal int `json:"get.missing_total,string"` // number of failed gets GetTime string `json:"get.time"` // time spent in get GetTotal int `json:"get.total,string"` // number of get ops ID string `json:"id"` // unique id of node where it lives Index string `json:"index"` // index name IndexingDeleteCurrent int `json:"indexing.delete_current,string"` // number of current deletions IndexingDeleteTotal int `json:"indexing.delete_total,string"` // number of delete ops IndexingDeleteTime string `json:"indexing.delete_time"` // time spent in deletions IndexingIndexCurrent int `json:"indexing.index_current,string"` // number of current indexing ops IndexingIndexFailed int `json:"indexing.index_failed,string"` // number of failed indexing ops IndexingIndexTime string `json:"indexing.index_time"` // time spent in indexing IndexingIndexTotal int `json:"indexing.index_total,string"` // number of indexing ops IP string `json:"ip"` // ip of node where it lives MergesCurrent int `json:"merges.current,string"` // number of current merges MergesCurrentDocs int `json:"merges.current_docs,string"` // number of current merging docs MergesCurrentSize string `json:"merges.current_size"` // size of current merges MergesTotal int `json:"merges.total,string"` // number of completed merge ops MergesTotalDocs int `json:"merges.total_docs,string"` // docs merged MergesTotalSize string `json:"merges.total_size"` // size merged MergesTotalTime string `json:"merges.total_time"` // time spent in merges Node string `json:"node"` // name of node where it lives PrimaryOrReplica string `json:"prirep"` // primary ("p") or replica ("r") QueryCacheEvictions int `json:"query_cache.evictions,string"` // query cache evictions QueryCacheMemorySize string `json:"query_cache.memory_size"` // used query cache RecoverySourceType string `json:"recoverysource.type"` // recovery source type RefreshListeners int `json:"refresh.listeners,string"` // number of pending refresh listeners RefreshTime string `json:"refresh.time"` // time spent in refreshes RefreshTotal int `json:"refresh.total,string"` // total refreshes SearchFetchCurrent int `json:"search.fetch_current,string"` // current fetch phase ops SearchFetchTime string `json:"search.fetch_time"` // time spent in fetch phase SearchFetchTotal int `json:"search.fetch_total,string"` // total fetch ops SearchOpenContexts int `json:"search.open_contexts,string"` // open search contexts SearchQueryCurrent int `json:"search.query_current,string"` // current query phase ops SearchQueryTime string `json:"search.query_time"` // time spent in query phase SearchQueryTotal int `json:"search.query_total,string"` // total query phase ops SearchScrollCurrent int `json:"search.scroll_current,string"` // open scroll contexts SearchScrollTime string `json:"search.scroll_time"` // time scroll contexts held open SearchScrollTotal int `json:"search.scroll_total,string"` // completed scroll contexts SegmentsCount int `json:"segments.count,string"` // number of segments SegmentsFixedBitsetMemory string `json:"segments.fixed_bitset_memory"` // memory used by fixed bit sets for nested object field types and type filters for types referred in _parent fields SegmentsIndexWriterMemory string `json:"segments.index_writer_memory"` // memory used by index writer SegmentsMemory string `json:"segments.memory"` // memory used by segments SegmentsVersionMapMemory string `json:"segments.version_map_memory"` // memory used by version map SequenceNumberGlobalCheckpoint string `json:"seq_no.global_checkpoint"` // global checkpoint SequenceNumberLocalCheckpoint string `json:"seq_no.local_checkpoint"` // local checkpoint SequenceNumberMax string `json:"seq_no.max"` // max sequence number Shard string `json:"shard"` // shard name State string `json:"state"` // shard state Store string `json:"store"` // store size of shard (how much disk it uses) SyncID string `json:"sync_id"` // sync id UnassignedAt string `json:"unassigned.at"` // time shard became unassigned (UTC) UnassignedDeatils string `json:"unassigned.details"` // additional details as to why the shard became unassigned UnassignedFor string `json:"unassigned.for"` // time has been unassigned UnassignedReason string `json:"unassigned.reason"` // reason shard is unassigned (https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-shards.html#reason-unassigned) WarmerCurrent int `json:"warmer.current,string"` // current warmer ops WarmerTotal int `json:"warmer.total,string"` // total warmer ops WarmerTotalTime string `json:"warmer.total_time"` // time spent in warmers }
CatShardsResponseRow specifies the data returned for one shard of a CatShardsResponse. Notice that not all of these fields might be filled; that depends on the number of columns chose in the request (see CatShardsService.Columns).
type CatShardsService ¶
type CatShardsService struct {
// contains filtered or unexported fields
}
CatShardsService returns the list of shards plus some additional information about them.
See https://www.elastic.co/guide/en/elasticsearch/reference/7.0/cat-shards.html for details.
func NewCatShardsService ¶
func NewCatShardsService(client *elastic.Client) *CatShardsService
NewCatShardsService creates a new CatShardsService.
func (*CatShardsService) Bytes ¶
func (s *CatShardsService) Bytes(bytes string) *CatShardsService
Bytes represents the unit in which to display byte values. Valid values are: "b", "k", "m", or "g".
func (*CatShardsService) Columns ¶
func (s *CatShardsService) Columns(columns ...string) *CatShardsService
Columns to return in the response. To get a list of all possible columns to return, run the following command in your terminal:
Example:
curl 'http://localhost:9200/_cat/shards?help'
Please use the long names for columns (i.e. `completion.size`) for JSON unmarshalling to work correctly. You can use Columns("*") to return all possible columns. That might take a little longer than the default set of columns.
func (*CatShardsService) Do ¶
func (s *CatShardsService) Do(ctx context.Context) (CatShardsResponse, error)
Do executes the operation.
func (*CatShardsService) Index ¶
func (s *CatShardsService) Index(index string) *CatShardsService
Index limits the response to shards of this index pattern (by default all indices are returned).
func (*CatShardsService) Local ¶
func (s *CatShardsService) Local(local bool) *CatShardsService
Local indicates to return local information, i.e. do not retrieve the state from master node (default: false).
func (*CatShardsService) MasterTimeout ¶
func (s *CatShardsService) MasterTimeout(masterTimeout string) *CatShardsService
MasterTimeout is the explicit operation timeout for connection to master node.
func (*CatShardsService) Pretty ¶
func (s *CatShardsService) Pretty(pretty bool) *CatShardsService
Pretty indicates that the JSON response be indented and human readable.
func (*CatShardsService) Sort ¶
func (s *CatShardsService) Sort(fields ...string) *CatShardsService
Sort is a list of fields to sort by.
type ClusterDeleteVotingConfigExclusion ¶
type ClusterDeleteVotingConfigExclusion struct {
// contains filtered or unexported fields
}
ClusterDeleteVotingConfigExclusion removes all voting configuration exclusions, allowing any node to return to the voting configuration in the future.
See: https://www.elastic.co/guide/en/elasticsearch/reference/7.0/voting-config-exclusions.html
func NewClusterDeleteVotingConfigExclusion ¶
func NewClusterDeleteVotingConfigExclusion(c *elastic.Client) *ClusterDeleteVotingConfigExclusion
NewClusterDeleteVotingConfigExclusion returns a new ClusterDeleteVotingConfigExclusion.
func (*ClusterDeleteVotingConfigExclusion) Do ¶
func (s *ClusterDeleteVotingConfigExclusion) Do(ctx context.Context) (*ClusterDeleteVotingConfigExclusionResponse, error)
Do executes the operation.
func (*ClusterDeleteVotingConfigExclusion) Validate ¶
func (s *ClusterDeleteVotingConfigExclusion) Validate() error
Validate checks if the operation is valid.
func (*ClusterDeleteVotingConfigExclusion) Wait ¶
func (s *ClusterDeleteVotingConfigExclusion) Wait(wait bool) *ClusterDeleteVotingConfigExclusion
Wait (if true) for all the nodes with voting configuration exclusions to be removed from the cluster, and then remove the exclusions.
type ClusterDeleteVotingConfigExclusionResponse ¶
type ClusterDeleteVotingConfigExclusionResponse struct{}
ClusterDeleteVotingConfigExclusionResponse represents the response from ClusterDeleteVotingConfigExclusion.
type ClusterGetSettingsResponse ¶
type ClusterGetSettingsResponse struct { Persistent *gjson.Result Transient *gjson.Result Defaults *gjson.Result }
ClusterGetSettingsResponse represents the response from the Elasticsearch `GET /_cluster/settings` API.
type ClusterGetSettingsService ¶
type ClusterGetSettingsService struct {
// contains filtered or unexported fields
}
ClusterGetSettingsService gets the settings of an Elasticsearch cluster. I can't believe github.com/olivere/elastic doesn't have this but aparently not.
func NewClusterGetSettingsService ¶
func NewClusterGetSettingsService(client *elastic.Client) *ClusterGetSettingsService
NewClusterGetSettingsService returns a new ClusterGetSettingsService.
func (*ClusterGetSettingsService) Defaults ¶
func (s *ClusterGetSettingsService) Defaults(include bool) *ClusterGetSettingsService
Defaults indicates if Elasticsearch should include default settings values in the response.
func (*ClusterGetSettingsService) Do ¶
func (s *ClusterGetSettingsService) Do(ctx context.Context) (*ClusterGetSettingsResponse, error)
Do executes the operation.
func (*ClusterGetSettingsService) FilterPath ¶
func (s *ClusterGetSettingsService) FilterPath(filterPath ...string) *ClusterGetSettingsService
FilterPath allows reducing the response, a mechanism known as response filtering and described here: https://www.elastic.co/guide/en/elasticsearch/reference/7.0/common-options.html#common-options-response-filtering.
func (*ClusterGetSettingsService) Human ¶
func (s *ClusterGetSettingsService) Human(human bool) *ClusterGetSettingsService
Human indicates whether to return version and creation date values in human-readable format (default: false).
func (*ClusterGetSettingsService) Pretty ¶
func (s *ClusterGetSettingsService) Pretty(pretty bool) *ClusterGetSettingsService
Pretty enables the caller to indent the JSON output.
func (*ClusterGetSettingsService) Validate ¶
func (s *ClusterGetSettingsService) Validate() error
Validate checks if the operation is valid. Just cargo-culting from elastic here.
type ClusterPostVotingConfigExclusion ¶
type ClusterPostVotingConfigExclusion struct {
// contains filtered or unexported fields
}
ClusterPostVotingConfigExclusion removes all voting configuration exclusions, allowing any node to return to the voting configuration in the future.
See: https://www.elastic.co/guide/en/elasticsearch/reference/7.0/voting-config-exclusions.html
func NewClusterPostVotingConfigExclusion ¶
func NewClusterPostVotingConfigExclusion(c *elastic.Client) *ClusterPostVotingConfigExclusion
NewClusterPostVotingConfigExclusion returns a new ClusterPostVotingConfigExclusion.
func (*ClusterPostVotingConfigExclusion) Do ¶
func (s *ClusterPostVotingConfigExclusion) Do(ctx context.Context) (*ClusterPostVotingConfigExclusionResponse, error)
Do executes the operation.
func (*ClusterPostVotingConfigExclusion) Node ¶
func (s *ClusterPostVotingConfigExclusion) Node(node string) *ClusterPostVotingConfigExclusion
Node sets the node(s) that should be excluded from voting configuration.
func (*ClusterPostVotingConfigExclusion) Timeout ¶
func (s *ClusterPostVotingConfigExclusion) Timeout(timeout string) *ClusterPostVotingConfigExclusion
Timeout sets how long to wait for the system to auto-reconfigure the node out of the voting configuration. The default is 30 seconds.
func (*ClusterPostVotingConfigExclusion) Validate ¶
func (s *ClusterPostVotingConfigExclusion) Validate() error
Validate checks if the operation is valid.
type ClusterPostVotingConfigExclusionResponse ¶
type ClusterPostVotingConfigExclusionResponse struct{}
ClusterPostVotingConfigExclusionResponse represents the response from ClusterPostVotingConfigExclusion.
type ClusterPutSettingsResponse ¶
type ClusterPutSettingsResponse struct { // Persistent hold the Elasticsearch settings that persist between cluster restarts. Persistent *gjson.Result // Transient hold the Elasticsearch settings that do not persist between cluster restarts. Transient *gjson.Result }
ClusterPutSettingsResponse represents the response from the Elasticsearch `PUT /_cluster/settings` API. It contains the new values of the changed settings.
type ClusterPutSettingsService ¶
type ClusterPutSettingsService struct {
// contains filtered or unexported fields
}
ClusterPutSettingsService updates the settings of an Elasticsearch cluster. I can't believe github.com/olivere/elastic doesn't have this but aparently not.
func NewClusterPutSettingsService ¶
func NewClusterPutSettingsService(client *elastic.Client) *ClusterPutSettingsService
NewClusterPutSettingsService returns a new ClusterPutSettingsService.
func (*ClusterPutSettingsService) BodyJSON ¶
func (s *ClusterPutSettingsService) BodyJSON(body interface{}) *ClusterPutSettingsService
BodyJSON is documented as: The index settings to be updated.
func (*ClusterPutSettingsService) BodyString ¶
func (s *ClusterPutSettingsService) BodyString(body string) *ClusterPutSettingsService
BodyString is documented as: The index settings to be updated.
func (*ClusterPutSettingsService) Do ¶
func (s *ClusterPutSettingsService) Do(ctx context.Context) (*ClusterPutSettingsResponse, error)
Do executes the operation.
func (*ClusterPutSettingsService) FlatSettings ¶
func (s *ClusterPutSettingsService) FlatSettings(flatSettings bool) *ClusterPutSettingsService
FlatSettings indicates whether to return settings in flat format (default: false).
func (*ClusterPutSettingsService) MasterTimeout ¶
func (s *ClusterPutSettingsService) MasterTimeout(masterTimeout string) *ClusterPutSettingsService
MasterTimeout is the timeout for connection to master.
func (*ClusterPutSettingsService) Persistent ¶
func (s *ClusterPutSettingsService) Persistent(setting string, value interface{}) *ClusterPutSettingsService
Persistent adds a persistent settings to the request.
func (*ClusterPutSettingsService) Pretty ¶
func (s *ClusterPutSettingsService) Pretty(pretty bool) *ClusterPutSettingsService
Pretty indicates that the JSON response be indented and human readable.
func (*ClusterPutSettingsService) Transient ¶
func (s *ClusterPutSettingsService) Transient(setting string, value interface{}) *ClusterPutSettingsService
Transient adds a transient settings to the request.
func (*ClusterPutSettingsService) Validate ¶
func (s *ClusterPutSettingsService) Validate() error
Validate checks if the operation is valid.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package health implements Elasticsearch healthchecks (using https://github.com/heptiolabs/healthcheck) to check the liveness and readiness of an Elasticsearch node.
|
Package health implements Elasticsearch healthchecks (using https://github.com/heptiolabs/healthcheck) to check the liveness and readiness of an Elasticsearch node. |