예제 #1
0
        private HealthResponse _Health(string path, HealthParams healthParams)
        {
            path += "?level=";
            path += (healthParams.CheckLevel ?? HealthLevel.Cluster).ToString().ToLower();

            if (!healthParams.Timeout.IsNullOrEmpty())
            {
                path += "&timeout=" + healthParams.Timeout;
            }
            if (healthParams.WaitForMinNodes.HasValue)
            {
                path += "&wait_for_nodes=" + healthParams.WaitForMinNodes;
            }
            if (healthParams.WaitForStatus.HasValue)
            {
                path += "&wait_for_status=" + healthParams.WaitForStatus.Value.ToString().ToLower();
            }
            if (healthParams.WaitForRelocatingShards.HasValue)
            {
                path += "&wait_for_relocating_shards=" + healthParams.WaitForRelocatingShards;
            }

            var status = this.Connection.GetSync(path);
            var r      = this.ToParsedResponse <HealthResponse>(status);

            return(r);
        }
예제 #2
0
        private HealthResponse _Health(string path, HealthParams healthParams)
        {
            path += "?level=";
            path += (healthParams.CheckLevel ?? HealthLevel.Cluster).ToString().ToLower();

            if (!healthParams.Timeout.IsNullOrEmpty())
                path += "&timeout=" + healthParams.Timeout;
            if (healthParams.WaitForMinNodes.HasValue)
                path += "&wait_for_nodes=" + healthParams.WaitForMinNodes;
            if (healthParams.WaitForStatus.HasValue)
                path += "&wait_for_status=" + healthParams.WaitForStatus.Value.ToString().ToLower();
            if (healthParams.WaitForRelocatingShards.HasValue)
                path += "&wait_for_relocating_shards=" + healthParams.WaitForRelocatingShards;

            var status = this.Connection.GetSync(path);
            var r = this.Deserialize<HealthResponse>(status);
            return r;
        }
예제 #3
0
        /// <summary>
        /// Gets the health status of the cluster according to the healthparams passed, for the specified indexes.
        /// </summary>
        /// <param name="healthParams"></param>
        /// <returns></returns>
        public IHealthResponse Health(IEnumerable <string> indices, HealthParams healthParams)
        {
            var path = this.PathResolver.CreateClusterPath(indices, "health");

            return(this._Health(path, healthParams));
        }
예제 #4
0
        /// <summary>
        /// Gets the health status of the cluster according to the healthparams passed.
        /// </summary>
        /// <param name="healthParams"></param>
        /// <returns></returns>
        public IHealthResponse Health(HealthParams healthParams)
        {
            var path = this.PathResolver.CreateClusterPath("health");

            return(this._Health(path, healthParams));
        }
예제 #5
0
 /// <summary>
 /// Gets the health status of the cluster according to the healthparams passed, for the specified indexes.
 /// </summary>
 /// <param name="healthParams"></param>
 /// <returns></returns>
 public IHealthResponse Health(IEnumerable<string> indices, HealthParams healthParams)
 {
     var path = this.PathResolver.CreateClusterPath(indices, "health");
     return this._Health(path, healthParams);
 }
예제 #6
0
 /// <summary>
 /// Gets the health status of the cluster according to the healthparams passed.
 /// </summary>
 /// <param name="healthParams"></param>
 /// <returns></returns>
 public IHealthResponse Health(HealthParams healthParams)
 {
     var path = this.PathResolver.CreateClusterPath("health");
     return this._Health(path, healthParams);
 }