Documentation
¶
Index ¶
- type Client
- func (c *Client) AllocationExplain() string
- func (c *Client) Bulk(body []string) string
- func (c *Client) Cat(action string) string
- func (c *Client) CatCountIndex(index string) string
- func (c *Client) CatNodeType(nodetype string) []string
- func (c *Client) CatSnapshots(repo string) string
- func (c *Client) ClusterHealth() string
- func (c *Client) ClusterInfo() string
- func (c *Client) ClusterPendingTasks() string
- func (c *Client) ClusterReroute(body string) string
- func (c *Client) ClusterSettings(flatSettings bool) string
- func (c *Client) ClusterState() string
- func (c *Client) ClusterStats() string
- func (c *Client) ClusterUpdateSettings(body string, flatSettings bool) string
- func (c *Client) Count(index string, body string) int
- func (c *Client) CountNodeType(nodetype string) int
- func (c *Client) CountNodes() int
- func (c *Client) DeleteScroll(scrollID string) string
- func (c *Client) DocumentDelete(index string, id string) string
- func (c *Client) DocumentDeleteByQuery(index string, query string) string
- func (c *Client) DocumentGet(index string, id string, source bool, fields string) string
- func (c *Client) DocumentIndex(index string, id string, body string) string
- func (c *Client) DocumentMultiGet(index string, body string, fields string) string
- func (c *Client) DocumentReindex(body string) string
- func (c *Client) DocumentUpdate(index string, id string, body string) string
- func (c *Client) GetTask(taskID string, nodes string) string
- func (c *Client) IndexAliasesGet(i string) string
- func (c *Client) IndexDelete(i string) string
- func (c *Client) IndexGet(i string) string
- func (c *Client) IndexMappingsGet(i string) string
- func (c *Client) IndexSettingsGet(i string) string
- func (c *Client) IndexToggleOpen(s string, i string) string
- func (c *Client) KibanaQuery(command string, body string) string
- func (c *Client) NodeList() string
- func (c *Client) NodeSearchStats() string
- func (c *Client) NodeShow(node string) string
- func (c *Client) NodeStats() string
- func (c *Client) RemoteInfo() string
- func (c *Client) Scroll(scrollID string, scroll string) string
- func (c *Client) Search(index string, body string, options map[string]string) string
- func (c *Client) SnapshotClean(n int, r string)
- func (c *Client) SnapshotDelete(n string, r string) string
- func (c *Client) SnapshotGet(n string, r string) string
- func (c *Client) SnapshotList(r string) string
- func (c *Client) SnapshotRepoRegister(r string, b string) string
- func (c *Client) SnapshotRestore(n string, r string, b string, w bool) string
- func (c *Client) SnapshotStart(n string, r string, b string, w bool, notify bool, s string) string
- func (c *Client) ToggleRouting(setting string, flatSettings bool) string
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Config *Config
}
Client wraps config for making requests to the Elasticsearch cluster
func NewClient ¶
NewClient returns a client that is ready to make requests to the elasticsearch cluster
func (*Client) AllocationExplain ¶ added in v0.1.1
AllocationExplain provides explanations for shard allocations in the cluster
func (*Client) Bulk ¶
Bulk performs a bulk API request Parameters:
- body []string a slice of bulk operations
Example:
var body []string body = append("{'update': {...}}", body) body = append("{'doc': {...}}", body) client.Bulk(body)
func (*Client) CatCountIndex ¶
CatCountIndex count documents for a specific index
func (*Client) CatNodeType ¶
CatNodeType Cat nodes of a certain type
func (*Client) CatSnapshots ¶
CatSnapshots list snapshots in a repo
func (*Client) ClusterHealth ¶
ClusterHealth returns the general health of the cluster
func (*Client) ClusterInfo ¶
ClusterInfo returns general data about your cluster
func (*Client) ClusterPendingTasks ¶
ClusterPendingTasks returns list of cluster level changes that have not been executedut
func (*Client) ClusterReroute ¶
ClusterReroute explicitly executes a cluster reroute allocation command
func (*Client) ClusterSettings ¶
ClusterSettings returns current cluster level settings
func (*Client) ClusterState ¶
ClusterState returns the general health of the cluster
func (*Client) ClusterStats ¶
ClusterStats Get some sweet sweet stats about your cluster
func (*Client) ClusterUpdateSettings ¶
ClusterUpdateSettings allows updating cluster wide settings
func (*Client) CountNodeType ¶
CountNodeType Cat nodes of a certain type
func (*Client) DeleteScroll ¶
DeleteScroll clears the scroll context when you no longer need it
func (*Client) DocumentDelete ¶
DocumentDelete deletes a document
func (*Client) DocumentDeleteByQuery ¶
DocumentDeleteByQuery performs a query then deletes the results
func (*Client) DocumentGet ¶
DocumentGet get json document
func (*Client) DocumentIndex ¶
DocumentIndex indexes a document
func (*Client) DocumentMultiGet ¶
DocumentMultiGet allows to get multiple documents Annoyngly the mget api requires a GET request AND a request body so we need to call directly against the request instead of using the `get` wrapper
func (*Client) DocumentReindex ¶
DocumentReindex copies documents from one index to another !!! Reindex does not attempt to set up the destination index. It does not copy the settings of the source index. You should set up the destination index prior to running a _reindex action, including setting up mappings, shard counts, replicas, etc.
func (*Client) DocumentUpdate ¶
DocumentUpdate performs update operation on a document
func (*Client) GetTask ¶
GetTask retrieves currently executing tasks on a node Args
- taskID string id of the task to get
- nodes string comma separated list of nodes to query
func (*Client) IndexAliasesGet ¶ added in v0.1.3
IndexAliasesGet filters information about an index to only include the specific alias features Args:
- i string comma seperated list of indices to retrieve, or _all
func (*Client) IndexDelete ¶
IndexDelete deletes an index Use with caution Args:
- i string the name of the index to delete
func (*Client) IndexGet ¶ added in v0.1.3
IndexGet retrieves information about one or more indexes Args:
- i string comma seperated list of indices to retrieve, or _all
func (*Client) IndexMappingsGet ¶ added in v0.1.3
IndexMappingsGet filters information about an index to only include the specific alias features Args:
- i string comma seperated list of indices to retrieve, or _all
func (*Client) IndexSettingsGet ¶ added in v0.1.3
IndexSettingsGet filters information about an index to only include the specific settings features Args:
- i string comma seperated list of indices to retrieve, or _all
func (*Client) IndexToggleOpen ¶
IndexToggleOpen can toggle the open/close status of an index Args:
- s string the state of the index (open, close)
- i string the name of the index to open/close
func (*Client) KibanaQuery ¶
KibanaQuery allows for running kibana-like commands it takes in a command string [METHOD] [ENDPOINT] and a json body and returns the results from ES
func (*Client) NodeSearchStats ¶
NodeSearchStats returns search stats for a node
func (*Client) RemoteInfo ¶
RemoteInfo returns info on remote clusters
func (*Client) SnapshotClean ¶
SnapshotClean deletes all but a certain number of snapshots Args:
- n string number of snapshots to keep
- r string repository in which the snapshots are located
func (*Client) SnapshotDelete ¶
SnapshotDelete deletes a given snapshot Args:
- n string name of the snapshot
- r string repository in which the snapshot is located
func (*Client) SnapshotGet ¶
SnapshotGet returns details on a specific snapshot Args:
- n string name of the snapshot
- r string repository in which the snapshot is located
func (*Client) SnapshotList ¶
SnapshotList lists all snapshots in a repo Args:
- r string repository name
func (*Client) SnapshotRepoRegister ¶
SnapshotRepoRegister register a new repository for snapshots Args:
- r string repository in which the snapshots are located
- b string request body
func (*Client) SnapshotRestore ¶
SnapshotRestore kicks off a restore for a snapshot Args:
- n string name of the snapshot
- r string repository in which the snapshot is located
- b string snapshot request body
- w bool whether or not to wait for completion
func (*Client) SnapshotStart ¶
SnapshotStart starts a snapshot with the given name in the given repo. Waits for completion if w and sends a notification if notify to slack webhook s Args:
- n string name of the snapshot
- r string repository in which the snapshot is located
- b string snapshot request body
- w bool whether or not to wait for completion
- notify bool whether or not to send notification once snapshot is finished
- s string slack webhook to send the notification to