public void Execute(SkynetClient client) { try { var result = client.Send(new Core.Contracts.Packages.GetPackageInfo(PackageName), TimeSpan.FromSeconds(10)); Console.WriteLine("Pacakge Name: \t {0}", result.PackageName); Console.WriteLine(); Console.WriteLine("Location: \t {0}", result.Location); Console.WriteLine(); Console.WriteLine("Files: \t"); foreach (var item in result.Files.OrderBy(x => x)) { Console.WriteLine(" \t \t " + item); } Console.WriteLine(); if (result.Metadata != null && result.Metadata.Any()) { Console.WriteLine("Metadata: \t"); var table = new Table(); foreach (var item in result.Metadata) { table.AddRow(item.Key, item.Value); //Console.WriteLine("{0}: \t {1}", item.Key, item.Value); } Console.WriteLine(table.Output()); Console.WriteLine(); } } catch (TimeoutException ex) { log.Error("Operation timeout after 10 seconds."); } }
public void Execute(SkynetClient client) { try { var result = client.Send(new Core.Contracts.Packages.GetAllPackages(), TimeSpan.FromSeconds(10)); Console.WriteLine("{0} \t {1}", "Name", "Executable"); foreach (var item in result.Packages) { Console.WriteLine("{0} \t {1}", item.Name, item.Location); } } catch (TimeoutException ex) { log.Error("Operation timeout after 10 seconds."); } }
public void Execute(SkynetClient client) { try { var result = client.Send(new Core.Contracts.Packages.GetAllPackages(), TimeSpan.FromSeconds(10)); var table = new Table(); table.AddRow("Package Name", "Package Location"); foreach (var item in result.Packages.OrderBy(x => x.Name)) { table.AddRow(item.Name, item.Location); } Console.Write(table.Output()); Console.WriteLine(); } catch (TimeoutException ex) { log.Error("Operation timeout after 10 seconds."); } }
public void Execute(SkynetClient client) { try { var result = client.Send(new GetAllProcesses(), TimeSpan.FromSeconds(10)); var table = new Table(); table.AddRow("Package Name", "Name", "Process Id", "Last Heartbeat", "Status"); foreach (var item in result.Packages.OrderBy(x => x.PackageName)) { var status = item.Extied ? "Dead" : "Live"; status = item.Extied == false && item.Responding == false ? "Not responding" : status; table.AddRow(item.PackageName, item.Name, item.ProcessId, TimeAgo(item.LastHeartbeat), status); } Console.Write(table.Output()); Console.WriteLine(); } catch (TimeoutException ex) { log.Error("Operation timeout after 10 seconds."); } }
public void Execute(SkynetClient client) { client.Send(new Core.Contracts.Processes.RedirectOutput(Client)); }
public void Execute(SkynetClient client) { client.Send(new Core.Contracts.Packages.RegisterPackage(PackageLocation, PackageName)); }
public void Execute(SkynetClient client) { client.Send(new Shutdown(ProcessName)); }
public void Execute(SkynetClient client) { client.Send(new Core.Contracts.Processes.Run(PackageName, ProcessName)); }