Esempio n. 1
0
 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.");
     }
 }
Esempio n. 2
0
 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.");
     }
 }
Esempio n. 3
0
 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.");
     }
 }
Esempio n. 4
0
 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.");
     }
 }
Esempio n. 5
0
        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.");
            }
        }
Esempio n. 6
0
 public void Execute(SkynetClient client)
 {
     client.Send(new Core.Contracts.Processes.RedirectOutput(Client));
 }
Esempio n. 7
0
 public void Execute(SkynetClient client)
 {
     client.Send(new Core.Contracts.Packages.RegisterPackage(PackageLocation, PackageName));
 }
Esempio n. 8
0
 public void Execute(SkynetClient client)
 {
     client.Send(new Core.Contracts.Processes.RedirectOutput(Client));
 }
Esempio n. 9
0
 public void Execute(SkynetClient client)
 {
     client.Send(new Core.Contracts.Packages.RegisterPackage(PackageLocation, PackageName));
 }
Esempio n. 10
0
 public void Execute(SkynetClient client)
 {
     client.Send(new Shutdown(ProcessName));
 }
Esempio n. 11
0
File: Run.cs Progetto: Elders/Skynet
 public void Execute(SkynetClient client)
 {
     client.Send(new Core.Contracts.Processes.Run(PackageName, ProcessName));
 }
Esempio n. 12
0
File: Run.cs Progetto: Elders/Skynet
 public void Execute(SkynetClient client)
 {
     client.Send(new Core.Contracts.Processes.Run(PackageName, ProcessName));
 }