public DtoApiBoolResponse CreateTaskBootFiles(DtoTaskBootFile bootFile) { return(new DtoApiBoolResponse() { Value = new TaskBootMenu().CreatePxeBootFiles(bootFile.Computer, bootFile.ImageProfile) }); }
public bool RunAllServers(EntityComputer computer, EntityImageProfile imageProfile) { _uow = new UnitOfWork(); var comServers = new Workflows.GetCompTftpServers().Run(computer.Id); if (comServers == null) { log.Error("Could Not Determine Tftp Com Servers For Computer: " + computer.Name); return(false); } if (comServers.Count == 0) { log.Error("Could Not Determine Tftp Com Servers For Computer: " + computer.Name); return(false); } var intercomKey = ServiceSetting.GetSettingValue(SettingStrings.IntercomKeyEncrypted); var decryptedKey = new EncryptionServices().DecryptText(intercomKey); var NoErrors = true; var dtoTaskBootFile = new DtoTaskBootFile(); dtoTaskBootFile.Computer = computer; dtoTaskBootFile.ImageProfile = imageProfile; foreach (var com in comServers) { if (!new APICall().ClientComServerApi.CreateTaskBootFiles(com.Url, "", decryptedKey, dtoTaskBootFile)) { NoErrors = false; } } return(NoErrors); }
public bool CreateTaskBootFiles(string url, string serverName, string interComKey, DtoTaskBootFile bootFile) { Request.Method = Method.POST; Request.Resource = "Imaging/CreateTaskBootFiles"; Request.AddJsonBody(bootFile); var responseData = new ApiRequest(new Uri(url)).ExecuteHMACInterCom <DtoApiBoolResponse>(Request, serverName, interComKey); return(responseData != null && responseData.Value); }