public static void UploadLogToSftp(string usr, string pwd, string bugnum, string location) { IUploadRecord upload_rec = new GammaServiceLib.UploadRecord() { Usr = usr, Passwd = pwd, Target = bugnum, Source = location }; var tx_mgr = GammaClientTXManagerFactory.GetGammaClientTXManager(); foreach (var m in from machine in NodeNetManagerFactory.GetSimpleNetworkManager().Machines where machine.Alive == NodeState.Online && machine.IsSelected select machine) { tx_mgr.StartQAToolsTransaction(m, GammaTXQATools.UPLOAD, upload_rec); } }
private Task <string> StartTransactions(IGammaClientTransaction trx, IMachineInfo machine, GammaTXQATools tool, object qatoolArgs = null) { trx.TransactionStarted(); Task <string> task; switch (tool) { case GammaTXQATools.GETLOG: if (qatoolArgs != null) { bool tmp = (bool)qatoolArgs; task = GammaProxyFactory.GetQAToolsProxy(machine).GetLogAsync(tmp); } else { throw new Exception("Unexpected error when try to get operation option."); } break; case GammaTXQATools.CLEARLOG: task = GammaProxyFactory.GetQAToolsProxy(machine).ClearLogAsync(); break; case GammaTXQATools.UPLOAD: if (qatoolArgs != null) { GammaServiceLib.UploadRecord tmp = qatoolArgs as GammaServiceLib.UploadRecord; task = GammaProxyFactory.GetQAToolsProxy(machine).UploadLogAsync(tmp); } else { throw new Exception("Unexpected error when try to get upload information."); } break; default: task = GenerateCompletedTask(TX_RESULT_SUC); break; } BindCmdTaskWithTranscation(task, trx); return(task); }