Documentation
¶
Index ¶
- type AllocationExclude
- type AllocationSettings
- type ClusterRoutingAllocation
- type ClusterRoutingSettings
- type ClusterStateNode
- type DiscoveryZen
- type DiscoveryZenSettings
- type ErrorResponse
- type Health
- type HealthString
- type Hit
- type Hits
- type Info
- type Node
- type NodeStats
- type Nodes
- type NodesStats
- type RemoteCluster
- type RemoteClusters
- type RemoteClustersSettings
- type RoutingAllocationSettings
- type RoutingSettings
- type RoutingTable
- type SearchResults
- type SettingsGroup
- type Shard
- type ShardState
- type ShardType
- type Shards
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllocationExclude ¶
type AllocationExclude struct {
Name string `json:"_name,omitempty"`
}
type AllocationSettings ¶
type AllocationSettings struct {
Cluster ClusterRoutingSettings `json:"cluster,omitempty"`
} // TODO awareness settings
AllocationSettings model a subset of the supported attributes for dynamic Elasticsearch cluster settings.
func (AllocationSettings) IsShardsAllocationEnabled ¶
func (s AllocationSettings) IsShardsAllocationEnabled() bool
type ClusterRoutingAllocation ¶
type ClusterRoutingAllocation struct {
Transient AllocationSettings `json:"transient,omitempty"`
}
ClusterRoutingAllocation models a subset of transient allocation settings for an Elasticsearch cluster.
type ClusterRoutingSettings ¶
type ClusterRoutingSettings struct {
Routing RoutingSettings `json:"routing,omitempty"`
}
type ClusterStateNode ¶
type ClusterStateNode struct {
Name string `json:"name"`
EphemeralID string `json:"ephemeral_id"`
TransportAddress string `json:"transport_address"`
Attributes struct {
MlMachineMemory string `json:"ml.machine_memory"`
MlMaxOpenJobs string `json:"ml.max_open_jobs"`
XpackInstalled string `json:"xpack.installed"`
MlEnabled string `json:"ml.enabled"`
} `json:"attributes"`
}
ClusterStateNode represents an element in the `node` structure in Elasticsearch cluster state.
type DiscoveryZen ¶
type DiscoveryZen struct {
MinimumMasterNodes int `json:"discovery.zen.minimum_master_nodes"`
}
DiscoveryZen set minimum number of master eligible nodes that must be visible to form a cluster.
type DiscoveryZenSettings ¶
type DiscoveryZenSettings struct {
Transient DiscoveryZen `json:"transient"`
Persistent DiscoveryZen `json:"persistent"`
}
DiscoveryZenSettings are cluster settings related to the zen discovery mechanism.
type ErrorResponse ¶
type ErrorResponse struct {
Status int `json:"status"`
Error struct {
CausedBy struct {
Reason string `json:"reason"`
Type string `json:"type"`
} `json:"caused_by"`
Reason string `json:"reason"`
Type string `json:"type"`
RootCause []struct {
Reason string `json:"reason"`
Type string `json:"type"`
} `json:"root_cause"`
} `json:"error"`
}
ErrorResponse is a Elasticsearch error response.
type Health ¶
type Health struct {
ClusterName string `json:"cluster_name"`
Status HealthString `json:"status"`
TimedOut bool `json:"timed_out"`
NumberOfNodes int `json:"number_of_nodes"`
NumberOfDataNodes int `json:"number_of_data_nodes"`
ActivePrimaryShards int `json:"active_primary_shards"`
ActiveShards int `json:"active_shards"`
RelocatingShards int `json:"relocating_shards"`
InitializingShards int `json:"initializing_shards"`
UnassignedShards int `json:"unassigned_shards"`
DelayedUnassignedShards int `json:"delayed_unassigned_shards"`
NumberOfPendingTasks int `json:"number_of_pending_tasks"`
NumberOfInFlightFetch int `json:"number_of_in_flight_fetch"`
TaskMaxWaitingInQueueMillis int `json:"task_max_waiting_in_queue_millis"`
ActiveShardsPercentAsNumber float32 `json:"active_shards_percent_as_number"`
}
Health represents the response from _cluster/health
type HealthString ¶
type HealthString string
Health is the health of the cluster as returned by the health API.
const ( RedHealth HealthString = "red" YellowHealth HealthString = "yellow" GreenHealth HealthString = "green" UnknownHealth HealthString = "unknown" )
Possible traffic light states Elasticsearch health can have.
type Hit ¶
type Hit struct {
Index string `json:"_index"`
Type string `json:"_type"`
ID string `json:"_id"`
Score float64 `json:"_score"`
Source map[string]interface{} `json:"_source"`
}
Hit represents a single search hit.
type Hits ¶
type Hits struct {
Total json.RawMessage // model when needed
Hits []Hit `json:"hits"`
}
Hits are the collections of search hits.
type Info ¶
type Info struct {
ClusterName string `json:"cluster_name"`
ClusterUUID string `json:"cluster_uuid"`
Version struct {
Number string `json:"number"`
} `json:"version"`
}
Info represents the response from /
type Node ¶
type Node struct {
Name string `json:"name"`
Version string `json:"version"`
Roles []string `json:"roles"`
JVM struct {
StartTimeInMillis int64 `json:"start_time_in_millis"`
Mem struct {
HeapMaxInBytes int `json:"heap_max_in_bytes"`
} `json:"mem"`
} `json:"jvm"`
}
Node partially models an Elasticsearch node retrieved from /_nodes
type NodeStats ¶
type NodeStats struct {
Name string `json:"name"`
OS struct {
CGroup struct {
Memory struct {
LimitInBytes string `json:"limit_in_bytes"`
} `json:"memory"`
} `json:"cgroup"`
} `json:"os"`
}
NodeStats partially models an Elasticsearch node retrieved from /_nodes/stats
type NodesStats ¶
NodesStats partially models the response from a request to /_nodes/stats
type RemoteCluster ¶
type RemoteCluster struct {
Seeds []string `json:"seeds"`
}
RemoteClusterSeeds is the set of seeds to use in a remote cluster setting.
type RemoteClusters ¶
type RemoteClusters struct {
RemoteClusters map[string]RemoteCluster `json:"remote,omitempty"`
}
RemoteClusters models the configuration of the remote clusters.
type RemoteClustersSettings ¶
type RemoteClustersSettings struct {
PersistentSettings *SettingsGroup `json:"persistent,omitempty"`
}
RemoteClustersSettings is used to build a request to update remote clusters.
type RoutingAllocationSettings ¶
type RoutingAllocationSettings struct {
Exclude AllocationExclude `json:"exclude,omitempty"`
Enable string `json:"enable,omitempty"`
}
type RoutingSettings ¶
type RoutingSettings struct {
Allocation RoutingAllocationSettings `json:"allocation,omitempty"`
}
type RoutingTable ¶
type SearchResults ¶
type SearchResults struct {
Took int
Hits Hits `json:"hits"`
Shards json.RawMessage // model when needed
Aggs map[string]json.RawMessage // model when needed
}
SearchResults are the results returned from a _search.
type SettingsGroup ¶
type SettingsGroup struct {
Cluster RemoteClusters `json:"cluster,omitempty"`
}
SettingsGroup is a group of persistent settings.
type Shard ¶
type Shard struct {
Index string `json:"index"`
Shard string `json:"shard"`
State ShardState `json:"state"`
NodeName string `json:"node"`
Type ShardType `json:"prirep"`
}
Shard partially models Elasticsearch cluster shard.
func (Shard) IsInitializing ¶
IsInitializing is true if the shard is currently initializing on the node.
func (Shard) IsRelocating ¶
IsRelocating is true if the shard is relocating to another node.
type ShardState ¶
type ShardState string
const ( STARTED ShardState = "STARTED" INITIALIZING ShardState = "INITIALIZING" RELOCATING ShardState = "RELOCATING" UNASSIGNED ShardState = "UNASSIGNED" )
These are possible shard states
type Shards ¶
type Shards []Shard
Shards contains the shards in the Elasticsearch cluster
func (Shards) GetShardsByNode ¶
GetShardsByNode returns shards by node. The result is a map with the name of the nodes as keys and the list of shards on the nodes as values.
func (*Shards) UnmarshalJSON ¶
Strip extra information from the nodeName field eg. "cluster-node-2 -> 10.56.2.33 8DqGuLtrSNyMfE2EfKNDgg" becomes "cluster-node-2" see https://github.com/elastic/cloud-on-k8s/issues/1796