public static void InvokeDescribeJobFlows() { NameValueCollection appConfig = ConfigurationManager.AppSettings; // Print the number of Amazon SimpleDB domains. IAmazonElasticMapReduce emr = AWSClientFactory.CreateAmazonElasticMapReduceClient(RegionEndpoint.USWest2); try { DescribeJobFlowsResponse emrResponse = emr.DescribeJobFlows(new DescribeJobFlowsRequest()); int numFlows = 0; numFlows = emrResponse.JobFlows.Count; Console.WriteLine("You have " + numFlows + " Amazon Elastic MapReduce job flow(s)."); } catch (AmazonElasticMapReduceException ex) { if (ex.ErrorCode.Equals("OptInRequired")) { Console.WriteLine("You are not signed for Amazon Elastic MapReduce."); Console.WriteLine("You can sign up at http://aws.amazon.com/elasticmapreduce."); } else { Console.WriteLine("Caught Exception: " + ex.Message); Console.WriteLine("Response Status Code: " + ex.StatusCode); Console.WriteLine("Error Code: " + ex.ErrorCode); Console.WriteLine("Error Type: " + ex.ErrorType); Console.WriteLine("Request ID: " + ex.RequestId); } } Console.WriteLine(); }
private Amazon.ElasticMapReduce.Model.DescribeJobFlowsResponse CallAWSServiceOperation(IAmazonElasticMapReduce client, Amazon.ElasticMapReduce.Model.DescribeJobFlowsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic MapReduce", "DescribeJobFlows"); try { #if DESKTOP return(client.DescribeJobFlows(request)); #elif CORECLR return(client.DescribeJobFlowsAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }