Esempio n. 1
0
func (shell *Shell) Ping(args string) {
	service := elastic.NewPingService(shell.client)
	result, _, err := service.Do()
	if err == nil {
		json, err := util.JsonString(result)
		if err == nil {
			util.LogInfo(json)
		} else {
			util.LogError(err.Error())
		}
	} else {
		util.LogError(err.Error())
	}
}
Esempio n. 2
0
func (shell *Shell) Nodes(args string) {
	service := elastic.NewNodesInfoService(shell.client)
	response, err := service.Do()
	if err == nil {
		json, err := util.JsonString(response)
		if err == nil {
			util.LogInfo(json)
		} else {
			util.LogError(err.Error())
		}
	} else {
		util.LogError(err.Error())
	}
}