/// <summary> /// Initiates the asynchronous execution of the CreateLoadBalancer operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancer operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<CreateLoadBalancerResponse> CreateLoadBalancerAsync(CreateLoadBalancerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateLoadBalancerRequestMarshaller(); var unmarshaller = CreateLoadBalancerResponseUnmarshaller.Instance; return InvokeAsync<CreateLoadBalancerRequest,CreateLoadBalancerResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Creates an Application Load Balancer. /// /// /// <para> /// To create listeners for your load balancer, use <a>CreateListener</a>. You can add /// security groups, subnets, and tags when you create your load balancer, or you can /// add them later using <a>SetSecurityGroups</a>, <a>SetSubnets</a>, and <a>AddTags</a>. /// </para> /// /// <para> /// To describe your current load balancers, see <a>DescribeLoadBalancers</a>. When you /// are finished with a load balancer, you can delete it using <a>DeleteLoadBalancer</a>. /// </para> /// /// <para> /// You can create up to 20 load balancers per region per account. You can request an /// increase for the number of load balancers for your account. For more information, /// see <a href="http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html">Limits /// for Your Application Load Balancer</a> in the <i>Application Load Balancers Guide</i>. /// </para> /// /// <para> /// For more information, see <a href="http://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html">Application /// Load Balancers</a> in the <i>Application Load Balancers Guide</i>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancer service method.</param> /// /// <returns>The response from the CreateLoadBalancer service method, as returned by ElasticLoadBalancingV2.</returns> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.DuplicateLoadBalancerNameException"> /// A load balancer with the specified name already exists for this account. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.DuplicateTagKeysException"> /// A tag key was specified more than once. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.InvalidConfigurationRequestException"> /// The requested configuration is not valid. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.InvalidSchemeException"> /// The requested scheme is not valid. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.InvalidSecurityGroupException"> /// The specified security group does not exist. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.InvalidSubnetException"> /// The specified subnet is out of available addresses. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.SubnetNotFoundException"> /// The specified subnet does not exist. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.TooManyLoadBalancersException"> /// You've reached the limit on the number of load balancers for your AWS account. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.TooManyTagsException"> /// You've reached the limit on the number of tags per load balancer. /// </exception> public CreateLoadBalancerResponse CreateLoadBalancer(CreateLoadBalancerRequest request) { var marshaller = new CreateLoadBalancerRequestMarshaller(); var unmarshaller = CreateLoadBalancerResponseUnmarshaller.Instance; return Invoke<CreateLoadBalancerRequest,CreateLoadBalancerResponse>(request, marshaller, unmarshaller); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElasticLoadBalancingV2.Model.CreateLoadBalancerRequest(); if (cmdletContext.CustomerOwnedIpv4Pool != null) { request.CustomerOwnedIpv4Pool = cmdletContext.CustomerOwnedIpv4Pool; } if (cmdletContext.IpAddressType != null) { request.IpAddressType = cmdletContext.IpAddressType; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.Scheme != null) { request.Scheme = cmdletContext.Scheme; } if (cmdletContext.SecurityGroup != null) { request.SecurityGroups = cmdletContext.SecurityGroup; } if (cmdletContext.SubnetMapping != null) { request.SubnetMappings = cmdletContext.SubnetMapping; } if (cmdletContext.Subnet != null) { request.Subnets = cmdletContext.Subnet; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.Type != null) { request.Type = cmdletContext.Type; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
private Amazon.ElasticLoadBalancingV2.Model.CreateLoadBalancerResponse CallAWSServiceOperation(IAmazonElasticLoadBalancingV2 client, Amazon.ElasticLoadBalancingV2.Model.CreateLoadBalancerRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Load Balancing V2", "CreateLoadBalancer"); try { #if DESKTOP return(client.CreateLoadBalancer(request)); #elif CORECLR return(client.CreateLoadBalancerAsync(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; } }
/// <summary> /// Initiates the asynchronous execution of the CreateLoadBalancer operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancer operation on AmazonElasticLoadBalancingV2Client.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateLoadBalancer /// operation.</returns> public IAsyncResult BeginCreateLoadBalancer(CreateLoadBalancerRequest request, AsyncCallback callback, object state) { var marshaller = new CreateLoadBalancerRequestMarshaller(); var unmarshaller = CreateLoadBalancerResponseUnmarshaller.Instance; return BeginInvoke<CreateLoadBalancerRequest>(request, marshaller, unmarshaller, callback, state); }