public void ElasticLoadBalancingV2DescribeLoadBalancers()
        {
            #region elbv2-describe-load-balancers-1

            var response = client.DescribeLoadBalancers(new DescribeLoadBalancersRequest
            {
                LoadBalancerArns = new List <string> {
                    "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
                }
            });

            List <LoadBalancer> loadBalancers = response.LoadBalancers;

            #endregion
        }
Exemple #2
0
        IEnumerable <DescribeLoadBalancersResponse> IPaginator <DescribeLoadBalancersResponse> .Paginate()
        {
            if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
            {
                throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
            }
            var marker = _request.Marker;
            DescribeLoadBalancersResponse response;

            do
            {
                _request.Marker = marker;
                response        = _client.DescribeLoadBalancers(_request);
                marker          = response.NextMarker;
                yield return(response);
            }while (marker != null);
        }
 private Amazon.ElasticLoadBalancingV2.Model.DescribeLoadBalancersResponse CallAWSServiceOperation(IAmazonElasticLoadBalancingV2 client, Amazon.ElasticLoadBalancingV2.Model.DescribeLoadBalancersRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Load Balancing V2", "DescribeLoadBalancers");
     try
     {
         #if DESKTOP
         return(client.DescribeLoadBalancers(request));
         #elif CORECLR
         return(client.DescribeLoadBalancersAsync(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;
     }
 }