Documentation ¶
Overview ¶
Copyright 2013 Matthew Baird Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2013 Matthew Baird Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func ClusterState(filter ClusterStateFilter) (api.ClusterStateResponse, error)
- func Health(indices ...string) (api.ClusterHealthResponse, error)
- func NodesShutdown(delay int, nodes ...string) error
- func Reroute(dryRun bool, commands Commands) (api.ClusterHealthResponse, error)
- type AllocateCommand
- type CPU
- type CancelCommand
- type Cluster
- type ClusterSettingsResponse
- type ClusterStateFilter
- type ClusterStateResponse
- type Commands
- type Http
- type Interface
- type JVM
- type JvmMem
- type MEM
- type MoveCommand
- type Network
- type Node
- type NodeInfo
- type NodeStatsFSDataResponse
- type NodeStatsFSResponse
- type NodeStatsHTTPResponse
- type NodeStatsIndicesDocsResponse
- type NodeStatsIndicesGetResponse
- type NodeStatsIndicesIndexingResponse
- type NodeStatsIndicesResponse
- type NodeStatsIndicesSearchResponse
- type NodeStatsIndicesStoreResponse
- type NodeStatsNetworkResponse
- type NodeStatsNodeResponse
- type NodeStatsOSCPUResponse
- type NodeStatsOSMemResponse
- type NodeStatsOSResponse
- type NodeStatsOSSwapResponse
- type NodeStatsProcessCPUResponse
- type NodeStatsProcessMemResponse
- type NodeStatsProcessResponse
- type NodeStatsReponse
- type NodeStatsTCPResponse
- type NodeStatsThreadPoolPoolResponse
- type NodeStatsTransportResponse
- type OS
- type Path
- type Plugin
- type Process
- type SWAP
- type Settings
- type ThreadPool
- type ThreadPoolConfig
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusterState ¶
func ClusterState(filter ClusterStateFilter) (api.ClusterStateResponse, error)
func Health ¶
func Health(indices ...string) (api.ClusterHealthResponse, error)
The cluster health API allows to get a very simple status on the health of the cluster. see http://www.elasticsearch.org/guide/reference/api/admin-cluster-health.html TODO: implement wait_for_status, timeout, wait_for_relocating_shards, wait_for_nodes TODO: implement level (Can be one of cluster, indices or shards. Controls the details level of the health information returned. Defaults to cluster.)
func NodesShutdown ¶
NodesShutdown allows the caller to shutdown between one and all nodes in the cluster delay is a integer representing number of seconds passing "" or "_all" for the nodes parameter will shut down all nodes see http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-shutdown/
func Reroute ¶
func Reroute(dryRun bool, commands Commands) (api.ClusterHealthResponse, error)
The cluster health API allows to get a very simple status on the health of the cluster. see http://www.elasticsearch.org/guide/reference/api/admin-cluster-health.html information returned. Defaults to cluster.)
Types ¶
type AllocateCommand ¶
type CPU ¶
type CPU struct { Vendor string `json:"vendor,omitempty"` Model string `json:"model,omitempty"` Mhz int `json:"mhz,omitempty"` TotalCores int `json:"total_cores,omitempty"` TotalSockets int `json:"total_sockets,omitempty"` CoresPerSocket int `json:"cores_per_socket,omitempty"` CacheSizeInBytes int `json:"cache_size_in_bytes,omitempty"` }
type CancelCommand ¶
type ClusterSettingsResponse ¶
type ClusterSettingsResponse struct { Transient map[string]int `json:"transient"` Persistent map[string]int `json:"persistent"` }
func UpdateSettings ¶
func UpdateSettings(settingType string, key string, value int) (ClusterSettingsResponse, error)
UpdateSettings allows to update cluster wide specific settings. Defaults to Transient setting Settings updated can either be persistent (applied cross restarts) or transient (will not survive a full cluster restart). http://www.elasticsearch.org/guide/reference/api/admin-cluster-update-settings.html
type ClusterStateFilter ¶
type ClusterStateFilter struct { FilterNodes bool FilterRoutingTable bool FilterMetadata bool FilterBlocks bool FilterIndices []string }
func (ClusterStateFilter) Parameterize ¶
func (f ClusterStateFilter) Parameterize() []string
type ClusterStateResponse ¶
type ClusterStateResponse struct { }
func UpdateSetting ¶
func UpdateSetting(args map[string]interface{}, filter_indices ...string) (ClusterStateResponse, error)
State gets the comprehensive state information for the whole cluster see http://www.elasticsearch.org/guide/reference/api/admin-cluster-state/
type JVM ¶
type JVM struct { Pid int `json:"pid,omitempty"` Version string `json:"version,omitempty"` VMName string `json:"vm_name,omitempty"` VMVersion string `json:"vm_version,omitempty"` VMVendor string `json:"vm_vendor,omitempty"` StartTime int `json:"start_time,omitempty"` Mem *JvmMem `json:"mem,omitempty"` GcCollectors []string `json:"gc_collectors,omitempty"` MemoryPools []string `json:"memory_pools,omitempty"` }
type JvmMem ¶
type JvmMem struct { HeapInitInBytes int `json:"heap_init_in_bytes,omitempty"` HeapMaxInBytes int `json:"heap_max_in_bytes,omitempty"` NonHeapInitInBytes int `json:"non_heap_init_in_bytes,omitempty"` NonHeapMaxInBytes int `json:"non_heap_max_in_bytes,omitempty"` DirectMaxInBytes int `json:"direct_max_in_bytes,omitempty"` }
type MoveCommand ¶
type Node ¶
type Node struct { Name string `json:"name,omitempty"` TransportAddress string `json:"transport_address,omitempty"` Host string `json:"host,omitempty"` Ip string `json:"ip,omitempty"` Version string `json:"version,omitempty"` Build string `json:"build,omitempty"` Hostname string `json:"hostname,omitempty"` HttpAddress string `json:"http_address,omitempty"` Settings *Settings `json:"settings,omitempty"` OS *OS `json:"os,omitempty"` Process *Process `json:"process,omitempty"` JVM *JVM `json:"jvm,omitempty"` ThreadPool *ThreadPool `json:"thread_pool,omitempty"` Network *Network `json:"network,omitempty"` Transport *Transport `json:"transport,omitempty"` Http *Http `json:"http,omitempty"` Plugins []*Plugin `json:"plugins,omitempty"` }
type NodeInfo ¶
type NodeInfo struct { ClusterName string `json:"cluster_name"` Nodes map[string]Node `json:"nodes"` // node name is random string }
func AllNodesInfo ¶
The cluster nodes info API allows to retrieve one or more (or all) of the cluster nodes information. informatino can be one of jvm, process
type NodeStatsFSDataResponse ¶
type NodeStatsFSDataResponse struct { Path string `json:"path"` Mount string `json:"mount"` Device string `json:"dev"` Total int64 `json:"total_in_bytes"` Free int64 `json:"free_in_bytes"` Available int64 `json:"available_in_bytes"` DiskReads int64 `json:"disk_reads"` DiskWrites int64 `json:"disk_writes"` DiskReadSize int64 `json:"disk_read_size_in_bytes"` DiskWriteSize int64 `json:"disk_write_size_in_bytes"` }
type NodeStatsFSResponse ¶
type NodeStatsFSResponse struct { Timestamp int64 `json:"timestamp"` Data map[string]NodeStatsFSDataResponse `json:"data"` }
type NodeStatsHTTPResponse ¶
type NodeStatsIndicesGetResponse ¶
type NodeStatsIndicesGetResponse struct { Total int64 `json:"total"` Time int64 `json:"time_in_millis"` ExistsTotal int64 `json:"exists_total"` ExistsTime int64 `json:"exists_time_in_millis"` MissingTotal int64 `json:"missing_total"` MissingTime int64 `json:"missing_time_in_millis"` Current int64 `json:"current"` }
type NodeStatsIndicesIndexingResponse ¶
type NodeStatsIndicesIndexingResponse struct { IndexTotal int64 `json:"index_total"` IndexTime int64 `json:"index_time_in_millis"` IndexCurrent int64 `json:"index_current"` DeleteTotal int64 `json:"delete_total"` DeleteTime int64 `json:"delete_time_in_millis"` DeleteCurrent int64 `json:"delete_current"` }
type NodeStatsIndicesResponse ¶
type NodeStatsIndicesResponse struct { Docs NodeStatsIndicesDocsResponse Store NodeStatsIndicesStoreResponse Indexing NodeStatsIndicesIndexingResponse Get NodeStatsIndicesGetResponse Search NodeStatsIndicesStoreResponse }
type NodeStatsIndicesSearchResponse ¶
type NodeStatsIndicesSearchResponse struct { OpenContext int64 `json:"open_contexts"` QueryTotal int64 `json:"query_total"` QueryTime int64 `json:"query_time_in_millis"` QueryCurrent int64 `json:"query_current"` FetchTotal int64 `json:"fetch_total"` FetchTime int64 `json:"fetch_time_in_millis"` FetchCurrent int64 `json:"fetch_current"` }
type NodeStatsNetworkResponse ¶
type NodeStatsNetworkResponse struct {
TCP NodeStatsTCPResponse `json:"tcp"`
}
type NodeStatsNodeResponse ¶
type NodeStatsNodeResponse struct { Name string `json:"name"` Timestamp int64 `json:"timestamp"` TransportAddress string `json:"transport_address"` Hostname string `json:"hostname"` Indices NodeStatsIndicesResponse `json:"indices"` OS NodeStatsOSResponse `json:"os"` Network NodeStatsNetworkResponse `json:"network"` ThreadPool map[string]NodeStatsThreadPoolPoolResponse `json:"thread_pool"` }
type NodeStatsOSCPUResponse ¶
type NodeStatsOSMemResponse ¶
type NodeStatsOSResponse ¶
type NodeStatsOSResponse struct { Timestamp int64 `json:"timestamp"` Uptime int64 `json:"uptime_in_millis"` LoadAvg []float64 `json:"load_average"` CPU NodeStatsOSCPUResponse `json:"cpu"` Mem NodeStatsOSMemResponse `json:"mem"` Swap NodeStatsOSSwapResponse `json:"swap"` }
type NodeStatsOSSwapResponse ¶
type NodeStatsProcessResponse ¶
type NodeStatsProcessResponse struct { Timestamp int64 `json:"timestamp"` OpenFD int64 `json:"open_file_descriptors"` CPU NodeStatsProcessCPUResponse `json:"cpu"` Memory NodeStatsProcessMemResponse `json:"mem"` }
type NodeStatsReponse ¶
type NodeStatsReponse struct { ClusterName string `json:"cluster_name"` Nodes map[string]NodeStatsNodeResponse }
type NodeStatsTCPResponse ¶
type NodeStatsTCPResponse struct { ActiveOpens int64 `json:"active_opens"` PassiveOpens int64 `json:"passive_opens"` CurrEstab int64 `json:"curr_estab"` InSegs int64 `json:"in_segs"` OutSegs int64 `json:"out_segs"` RetransSegs int64 `json:"retrans_segs"` EstabResets int64 `json:"estab_resets"` AttemptFails int64 `json:"attempt_fails"` InErrs int64 `json:"in_errs"` OutRsts int64 `json:"out_rsts"` }
type Path ¶
type Path struct { Logs string `json:"logs,omitempty"` // contains filtered or unexported fields }
type ThreadPool ¶
type ThreadPool struct { Generic *ThreadPoolConfig `json:"generic,omitempty"` Index *ThreadPoolConfig `json:"index,omitempty"` Get *ThreadPoolConfig `json:"get,omitempty"` Snapshot *ThreadPoolConfig `json:"snapshot,omitempty"` Merge *ThreadPoolConfig `json:"merge,omitempty"` Suggest *ThreadPoolConfig `json:"suggest,omitempty"` Bulk *ThreadPoolConfig `json:"bulk,omitempty"` Optimize *ThreadPoolConfig `json:"optimize,omitempty"` Warmer *ThreadPoolConfig `json:"warmer,omitempty"` Flush *ThreadPoolConfig `json:"flush,omitempty"` Search *ThreadPoolConfig `json:"search,omitempty"` Percolate *ThreadPoolConfig `json:"percolate,omitempty"` Management *ThreadPoolConfig `json:"management,omitempty"` Refresh *ThreadPoolConfig `json:"refresh,omitempty"` }