// GET api/usmt public List <USMTComputer> Get() { USMTList list = USMTList.Instance(); List <Program> programs = list.GetPrograms(); List <USMTComputer> comps = programs.Select(n => new USMTComputer { IPAddress = ((USMT)n)._computer.IPAddress, NewIPAddress = ((USMT)n)._computer.NewIPAddress, User = ((USMT)n)._computer.USMTGID, Status = ((USMT)n).GetStatus() }).ToList(); return(comps); }
// POST api/usmt public void Post([FromBody] Computer value) { USMTList list = USMTList.Instance(); USMT USMT; if (!value.AttachUSMT) { USMT = new USMT(value, USMTMethod.Full); } else { USMT = new USMT(value, USMTMethod.Attach); } list.AddProgram(value.NewIPAddress, USMT); list.StartProgram(value.NewIPAddress); }