public static void GetServiceInfo()
		{
			Console.Clear();
			Console.Write("Service ID? => ");
			var id = Console.ReadLine();

			var consulCatalogSender = new ConsulCatalogSender();
			var results = consulCatalogSender.GetServiceInfo(id);

			Console.Clear();
			Console.ForegroundColor = ConsoleColor.Blue;
			Console.WriteLine("Service information for service ID {0}: ", id);
			Console.ResetColor();

			foreach(var item in results)
			{
				Console.WriteLine("\nNode Name: {0}", item.NodeName);
				Console.WriteLine("\tAddress: {0}", item.Address);
				Console.WriteLine("\tServiceId: {0}", item.Id);
				Console.WriteLine("\tService Name: {0}", item.Name);
				Console.WriteLine("\tTags: ");

				foreach (var tag in item.Tags)
				{
					Console.WriteLine("\t\t{0}", tag);
				}

				Console.WriteLine("\tService Address: {0}", item.ServiceAddress);
				Console.WriteLine("\tService Port: {0}", item.Port);
			}
			AnyKey();
		}
Exemplo n.º 2
0
 public ConsulService()
 {
     this.agentSender = new ConsulAgentSender();
     this.catalogSender = new ConsulCatalogSender();
 }