public ViewRuns() { InitializeComponent(); drpproject.DataSource = AWSHelper.GetProjectList(); drpproject.DisplayMember = "Name"; drpproject.ValueMember = "Arn"; }
protected void ApplyVideoAndImageUrl(Citation citation, CitationViolationListItem model, FileService fileService) { if (citation.Attachments.Count > 0) { var citationAttachment = citation.Attachments.OrderByDescending(s => s.CreateUtc).ToList(); foreach (var ca in citationAttachment) { if (ca.Attachment.AttachmentType == CitationAttachmentType.Video) { //Read the file from AWS Bucket model.VideoUrl = fileService.ReadFileUrl(ca.Attachment.Key, AppSettings.AWSAccessKeyID, AppSettings.AWSSecretKey, AppSettings.AmazonS3Bucket); //model.VideoUrl = AWSHelper.GetS3Url(ca.Attachment.Key, _appSettings.AmazonS3Url); model.VideoAttachmentId = ca.Attachment.Id; break; } } if (string.IsNullOrEmpty(model.VideoUrl)) { foreach (var ca in citationAttachment) { if (ca.Attachment.AttachmentType == CitationAttachmentType.Image) { //Read the file from AWS Bucket // model.ImageUrl = _fileService.ReadFileUrl(ca.Attachment.Key, _appSettings.AWSAccessKeyID, _appSettings.AWSSecretKey, _appSettings.AmazonS3Bucket); model.ImageUrl = AWSHelper.GetS3Url(ca.Attachment.Key, AppSettings.AmazonS3Url); break; } } } } }
private void button1_Click(object sender, EventArgs e) { try { string filename = System.IO.Path.GetFileName(openFileDialog1.FileName); if (filename == null) { MessageBox.Show("Please select a valid document."); } else { //we already define our connection globaly. We are just calling the object of connection. var res = AWSHelper.UploadFile(drpproject.SelectedValue.ToString(), filename); if (res != null) { MessageBox.Show("Document uploaded."); } else { MessageBox.Show("Error in uploading."); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { if (txtkey.Text.Trim().Length > 0 && txtsecret.Text.Trim().Length > 0) { AWSHelper.AwsAccessKey = txtkey.Text.Trim(); AWSHelper.AwsSecretKey = txtsecret.Text.Trim(); var client = AWSHelper.GetAmazonDeviceFarmClient(); if (client != null) { try { var response = client.GetAccountSettings(new GetAccountSettingsRequest { }); AccountSettings accountSettings = response.AccountSettings; var result = client.GetAccountSettings(); MainForm form = new MainForm(client); form.Show(); this.Hide(); } catch (Exception ee) { MessageBox.Show("Invalid Credentials. " + ee.Message); } } } else { MessageBox.Show("Please Enter the Required Data"); } }
public void ProcesoProductos() { OBitacora.GuardarLinea($"{ DateTime.Now:yyyy-MM-dd hh:mm:ss}|Productos|Inicio de Proceso"); OBitacora.GuardarLinea($"{ DateTime.Now:yyyy-MM-dd hh:mm:ss}|Productos|Instanciando Helper AWS"); OAwsHelper = new AWSHelper("AKIAIHQ53NFR6EGNA75Q", "MKph/aGOqSBvIT+VtCHpR0NHYgs1DEvmBJY4Opym", "ibushak03-20", "AKIAIHQ53NFR6EGNA75Q"); try { OBitacora.GuardarLinea($"{ DateTime.Now:yyyy-MM-dd hh:mm:ss}|Productos|Obteniendo productos a analizar"); var productos = ProductosAdapter.ObtenerProductos(); OBitacora.GuardarLinea($"{ DateTime.Now:yyyy-MM-dd hh:mm:ss}|Productos|Productos asin en la base actual"); foreach (var item in productos.asins) { OBitacora.GuardarLinea(item.Id); } OBitacora.GuardarLinea($"{ DateTime.Now:yyyy-MM-dd hh:mm:ss}|Productos|Productos upc en la base actual"); foreach (var item in productos.upcs) { OBitacora.GuardarLinea(item.Id); } if (productos.upcs.Any()) { ProcesarUpc(productos.upcs); } if (productos.asins.Any()) { ProcesarAsin(productos.asins); } OBitacora.GuardarLinea($"{ DateTime.Now:yyyy-MM-dd hh:mm:ss}|Productos|Generando Archivo Excel"); var oArchvios = new Archivos(); oArchvios.GenerarProductosActualizados(); OBitacora.GuardarLinea($"{ DateTime.Now:yyyy-MM-dd hh:mm:ss}|Productos|Reportando a NetSuite"); var changeProds = ProductosAdapter.ObtenerProductosTodos().Where(x => x.IsUpdated); var oBuyBox = new BuyBox(); foreach (var item in changeProds) { try { oBuyBox.ReportarNetSuiteInicial(item.BuyBox, item.ASIN); oBuyBox.ReportarNetSuiteComplete(item.ASIN); item.IsUpdated = false; ProductosAdapter.Actualizar(item); } catch (Exception ex) { OBitacora.GuardarLinea($"{DateTime.Now:yyyy-MM-dd hh:mm:ss}|Error|{GetMessageError(ex)}/{ex.StackTrace}"); } } OBitacora.GuardarLinea($"{ DateTime.Now:yyyy-MM-dd hh:mm:ss}|Productos|Fin de Proceso"); } catch (Exception ex) { OBitacora.GuardarLinea($"{DateTime.Now:yyyy-MM-dd hh:mm:ss}|Error|{GetMessageError(ex)}/{ex.StackTrace}"); } }
public void BindDevices(string projectid) { var projectlist = AWSHelper.GetDevices(projectid); dgdevice.DataSource = projectlist; dgdevice.Columns["Cpu"].Visible = false; dgdevice.Columns["Resolution"].Visible = false; dgdevice.Columns["Carrier"].Visible = false; }
public ViewDevices() { InitializeComponent(); drpproject.DataSource = AWSHelper.GetProjectList(); drpproject.DisplayMember = "Name"; drpproject.ValueMember = "Arn"; //var devices = AWSHelper.GetDevices(); //dgdevice.DataSource = devices; }
public DestinationForm() { InitializeComponent(); this.S3RegionBindingSource.DataSource = AWSHelper.GetAllRegions(); this.GlacierRegionBindingSource.DataSource = AWSHelper.GetAllRegions(); // AWSHelper.GetDefaultRegionSystemName() PopulateControls(); this.FormClosing += DestinationForm_FormClosing; }
private void button1_Click(object sender, EventArgs e) { if (txtName.Text.Trim().Length > 0) { var project = AWSHelper.CreateProject(txtName.Text.Trim()); if (project != null) { MessageBox.Show("Project Created Successfully"); } else { MessageBox.Show("Issue In Creating Project"); } } else { MessageBox.Show("Please Enter Project Name"); } }
public void BindList(string projectid) { var projectlist = AWSHelper.GetRuns(projectid); dgRuns.DataSource = projectlist; }
public async Task <CPSCloudResourceEnvironmentSummaryModel> GetEnvironmentSummary(string organization, string project, string service, string environmentName, string feature, CPSAuthCredentialModel authCredential) { CPSCloudResourceEnvironmentSummaryModel summaryEnvironmentModel = new CPSCloudResourceEnvironmentSummaryModel(); try { AmazonCloudFormationClient client = new AmazonCloudFormationClient(authCredential.AccessId, authCredential.AccessSecret, Amazon.RegionEndpoint.GetBySystemName(authCredential.AccessRegion)); string stackName = $"{organization}{project}{service}{environmentName}{feature}".ToLower(); try { var stacksResponse = await client.DescribeStacksAsync(new DescribeStacksRequest() { StackName = stackName }); if (stacksResponse.HttpStatusCode == System.Net.HttpStatusCode.OK) { var stack = stacksResponse.Stacks.FirstOrDefault(); if (stack != null) { summaryEnvironmentModel = new CPSCloudResourceEnvironmentSummaryModel(); summaryEnvironmentModel.Name = environmentName; var statusModel = AWSHelper.GetStatusModel(stack.StackStatus.Value); summaryEnvironmentModel.StatusCode = statusModel.StatusCode; summaryEnvironmentModel.StatusName = statusModel.StatusName; if (stack.Outputs != null) { foreach (var output in stack.Outputs) { string key = output.OutputKey.First().ToString().ToUpper() + output.OutputKey.Substring(1); summaryEnvironmentModel.AddProperty(key, output.OutputValue); } } var resources = await client.DescribeStackResourcesAsync(new DescribeStackResourcesRequest { StackName = stackName }); if (resources != null && resources.StackResources != null && resources.StackResources.Any()) { foreach (var item in resources.StackResources) { if (!string.IsNullOrEmpty(item.ResourceType)) { summaryEnvironmentModel.AddResource(item.ResourceType, item.PhysicalResourceId, item.LogicalResourceId, item.ResourceStatusReason); } } } } else { summaryEnvironmentModel = new CPSCloudResourceEnvironmentSummaryModel(); summaryEnvironmentModel.Name = environmentName; summaryEnvironmentModel.StatusCode = PipelineEnvironmentStatusEnumModel.Pending.ToString(); summaryEnvironmentModel.StatusName = PipelineEnvironmentStatusEnumModel.Pending.GetDescription(); } } } catch (System.Exception ex) { summaryEnvironmentModel = new CPSCloudResourceEnvironmentSummaryModel(); summaryEnvironmentModel.Name = environmentName; summaryEnvironmentModel.StatusCode = PipelineEnvironmentStatusEnumModel.Pending.ToString(); summaryEnvironmentModel.StatusName = PipelineEnvironmentStatusEnumModel.Pending.GetDescription(); } } catch (System.Exception) { } return(summaryEnvironmentModel); }
private void PopulateControls() { try { this.settings = SettingsManager.GetSettings(); // File System ArchivePath.Text = settings.FileSystemDirectory; IsFileSystem.Checked = settings.IsFileSystemEnabled; if (settings.IsFileSystemEnabled) { BrowseDirectory.Enabled = true; } else { BrowseDirectory.Enabled = false; } // S3 Bucket S3BucketName.Text = settings.AWSS3Bucket; IsS3Bucket.Checked = settings.IsS3BucketEnabled; if (settings.AWSS3Region != null) { S3Region.SelectedValue = settings.AWSS3Region.SystemName; } else { S3Region.SelectedValue = AWSHelper.GetDefaultRegionSystemName(); } if (S3BucketName.Text != string.Empty) { ListBucketContents.Enabled = true; } else { ListBucketContents.Enabled = false; } // Glacier GlacierVaultName.Text = settings.AWSGlacierVault; IsGlacier.Checked = settings.IsGlacierEnabled; if (settings.AWSGlacierRegion != null) { GlacierRegion.SelectedValue = settings.AWSGlacierRegion.SystemName; } else { GlacierRegion.SelectedValue = AWSHelper.GetDefaultRegionSystemName(); } if (GlacierVaultName.Text != string.Empty) { ListInventory.Enabled = true; } else { ListInventory.Enabled = false; } _awsAccessKey = settings.AWSAccessKeyID; _awsSecret = settings.AWSSecretAccessKey; } catch (Exception ex) { Program.DisplayError(ex); } }