private bool CheckForUploadsSuccessful(List <string> uploadArns) { var uploads = new List <Upload>(); foreach (string arn in uploadArns) { uploads.Add(DFClient.GetUpload(arn).Upload); } bool finished = true; foreach (var upload in uploads) { Log.LogMessage("Upload '{0}' has status '{1}'.", upload.Name, upload.Status); if (upload.Status == UploadStatus.FAILED) { throw new Exception(string.Format("Upload '{0}' failed with message '{1}'.", upload.Name, upload.Message)); } if (upload.Status != UploadStatus.SUCCEEDED) { finished = false; } } Log.LogMessage(finished ? "All uploads have finished." : "Upload(s) still in progress."); return(finished); }
public void DeviceFarmGetUpload() { #region to-get-information-about-a-specific-upload-1471025996221 var client = new AmazonDeviceFarmClient(); var response = client.GetUpload(new GetUploadRequest { Arn = "arn:aws:devicefarm:us-west-2:123456789101:upload:EXAMPLE-GUID-123-456" // You can get the test ARN by using the list-uploads CLI command. }); Upload upload = response.Upload; #endregion }
private UploadStatus GetUploadStatus(string arn) { GetUploadResponse response; UploadStatus status; do { response = client.GetUpload(arn); status = response.Upload.Status; Thread.Sleep(1000); }while (status != UploadStatus.FAILED && status != UploadStatus.SUCCEEDED); return(status); }