public static void Main()
        {
            var client = new ElasticClient(new ConnectionSettings(new Uri(Environment.GetEnvironmentVariable("ES_LIGHT_URL"))));

            Configuration.Initialize("newdeveloper");
            LightService.Discover();
            _lights = new LightCollection();

            var health = client.Health(HealthLevel.Cluster);

            string status = health.Status;

            Color esColor = Color.FromName(status);

            if (status == "green")
            {
                esColor = Color.DarkGreen;
            }

            if (health.RelocatingShards > 0)
            {
                esColor = Color.Purple;
            }

            SetAllLights(esColor);
        }
示例#2
0
 public void DiscoverNewLights()
 {
     Configuration.Initialize("36e02089265925772f085fcd3884ec9b");
     LightService.Discover();
 }