public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElasticLoadBalancing.Model.AttachLoadBalancerToSubnetsRequest(); if (cmdletContext.LoadBalancerName != null) { request.LoadBalancerName = cmdletContext.LoadBalancerName; } if (cmdletContext.Subnet != null) { request.Subnets = cmdletContext.Subnet; } 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); }
/// <summary> /// Initiates the asynchronous execution of the AttachLoadBalancerToSubnets operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AttachLoadBalancerToSubnets 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<AttachLoadBalancerToSubnetsResponse> AttachLoadBalancerToSubnetsAsync(AttachLoadBalancerToSubnetsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AttachLoadBalancerToSubnetsRequestMarshaller(); var unmarshaller = AttachLoadBalancerToSubnetsResponseUnmarshaller.Instance; return InvokeAsync<AttachLoadBalancerToSubnetsRequest,AttachLoadBalancerToSubnetsResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal AttachLoadBalancerToSubnetsResponse AttachLoadBalancerToSubnets(AttachLoadBalancerToSubnetsRequest request) { var marshaller = new AttachLoadBalancerToSubnetsRequestMarshaller(); var unmarshaller = AttachLoadBalancerToSubnetsResponseUnmarshaller.Instance; return Invoke<AttachLoadBalancerToSubnetsRequest,AttachLoadBalancerToSubnetsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the AttachLoadBalancerToSubnets operation. /// <seealso cref="Amazon.ElasticLoadBalancing.AmazonElasticLoadBalancing.AttachLoadBalancerToSubnets"/> /// </summary> /// /// <param name="attachLoadBalancerToSubnetsRequest">Container for the necessary parameters to execute the AttachLoadBalancerToSubnets operation /// on AmazonElasticLoadBalancing.</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 /// EndAttachLoadBalancerToSubnets operation.</returns> public IAsyncResult BeginAttachLoadBalancerToSubnets(AttachLoadBalancerToSubnetsRequest attachLoadBalancerToSubnetsRequest, AsyncCallback callback, object state) { return invokeAttachLoadBalancerToSubnets(attachLoadBalancerToSubnetsRequest, callback, state, false); }
/// <summary> /// <para> Adds one or more subnets to the set of configured subnets in the VPC for the LoadBalancer. </para> <para> The Loadbalancers evenly /// distribute requests across all of the registered subnets. </para> /// </summary> /// /// <param name="attachLoadBalancerToSubnetsRequest">Container for the necessary parameters to execute the AttachLoadBalancerToSubnets service /// method on AmazonElasticLoadBalancing.</param> /// /// <returns>The response from the AttachLoadBalancerToSubnets service method, as returned by AmazonElasticLoadBalancing.</returns> /// /// <exception cref="InvalidSubnetException"/> /// <exception cref="SubnetNotFoundException"/> /// <exception cref="LoadBalancerNotFoundException"/> /// <exception cref="InvalidConfigurationRequestException"/> public AttachLoadBalancerToSubnetsResponse AttachLoadBalancerToSubnets(AttachLoadBalancerToSubnetsRequest attachLoadBalancerToSubnetsRequest) { IAsyncResult asyncResult = invokeAttachLoadBalancerToSubnets(attachLoadBalancerToSubnetsRequest, null, null, true); return EndAttachLoadBalancerToSubnets(asyncResult); }
IAsyncResult invokeAttachLoadBalancerToSubnets(AttachLoadBalancerToSubnetsRequest attachLoadBalancerToSubnetsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new AttachLoadBalancerToSubnetsRequestMarshaller().Marshall(attachLoadBalancerToSubnetsRequest); var unmarshaller = AttachLoadBalancerToSubnetsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Adds one or more subnets to the set of configured subnets in the Amazon Virtual Private Cloud (Amazon VPC) for the load balancer. /// </para> <para> The load balancers evenly distribute requests across all of the registered subnets. For more information, see <a href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/UserScenariosForVPC.html">Deploy Elastic Load Balancing in /// Amazon VPC</a> in the <i>Elastic Load Balancing Developer Guide</i> . /// </para> /// </summary> /// /// <param name="attachLoadBalancerToSubnetsRequest">Container for the necessary parameters to execute the AttachLoadBalancerToSubnets service /// method on AmazonElasticLoadBalancing.</param> /// /// <returns>The response from the AttachLoadBalancerToSubnets service method, as returned by AmazonElasticLoadBalancing.</returns> /// /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.InvalidSubnetException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.InvalidConfigurationRequestException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.LoadBalancerNotFoundException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.SubnetNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<AttachLoadBalancerToSubnetsResponse> AttachLoadBalancerToSubnetsAsync(AttachLoadBalancerToSubnetsRequest attachLoadBalancerToSubnetsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AttachLoadBalancerToSubnetsRequestMarshaller(); var unmarshaller = AttachLoadBalancerToSubnetsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, AttachLoadBalancerToSubnetsRequest, AttachLoadBalancerToSubnetsResponse>(attachLoadBalancerToSubnetsRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal AttachLoadBalancerToSubnetsResponse AttachLoadBalancerToSubnets(AttachLoadBalancerToSubnetsRequest request) { var task = AttachLoadBalancerToSubnetsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.ElasticLoadBalancing.Model.AttachLoadBalancerToSubnetsResponse CallAWSServiceOperation(IAmazonElasticLoadBalancing client, Amazon.ElasticLoadBalancing.Model.AttachLoadBalancerToSubnetsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Load Balancing", "AttachLoadBalancerToSubnets"); try { #if DESKTOP return(client.AttachLoadBalancerToSubnets(request)); #elif CORECLR return(client.AttachLoadBalancerToSubnetsAsync(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 AttachLoadBalancerToSubnets operation. /// <seealso cref="Amazon.ElasticLoadBalancing.IAmazonElasticLoadBalancing.AttachLoadBalancerToSubnets"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AttachLoadBalancerToSubnets 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<AttachLoadBalancerToSubnetsResponse> AttachLoadBalancerToSubnetsAsync(AttachLoadBalancerToSubnetsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AttachLoadBalancerToSubnetsRequestMarshaller(); var unmarshaller = AttachLoadBalancerToSubnetsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, AttachLoadBalancerToSubnetsRequest, AttachLoadBalancerToSubnetsResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Adds one or more subnets to the set of configured subnets in the Amazon Virtual Private Cloud (Amazon VPC) for the load balancer. /// </para> <para> The load balancers evenly distribute requests across all of the registered subnets. For more information, see <a href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/UserScenariosForVPC.html">Deploy Elastic Load Balancing in /// Amazon VPC</a> in the <i>Elastic Load Balancing Developer Guide</i> . /// </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AttachLoadBalancerToSubnets service /// method on AmazonElasticLoadBalancing.</param> /// /// <returns>The response from the AttachLoadBalancerToSubnets service method, as returned by AmazonElasticLoadBalancing.</returns> /// /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.InvalidSubnetException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.InvalidConfigurationRequestException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.LoadBalancerNotFoundException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.SubnetNotFoundException" /> public AttachLoadBalancerToSubnetsResponse AttachLoadBalancerToSubnets(AttachLoadBalancerToSubnetsRequest request) { var task = AttachLoadBalancerToSubnetsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeAttachLoadBalancerToSubnets(AttachLoadBalancerToSubnetsRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new AttachLoadBalancerToSubnetsRequestMarshaller(); var unmarshaller = AttachLoadBalancerToSubnetsResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the AttachLoadBalancerToSubnets operation. /// <seealso cref="Amazon.ElasticLoadBalancing.IAmazonElasticLoadBalancing"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AttachLoadBalancerToSubnets operation on AmazonElasticLoadBalancingClient.</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 EndAttachLoadBalancerToSubnets /// operation.</returns> public IAsyncResult BeginAttachLoadBalancerToSubnets(AttachLoadBalancerToSubnetsRequest request, AsyncCallback callback, object state) { var marshaller = new AttachLoadBalancerToSubnetsRequestMarshaller(); var unmarshaller = AttachLoadBalancerToSubnetsResponseUnmarshaller.Instance; return BeginInvoke<AttachLoadBalancerToSubnetsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Adds one or more subnets to the set of configured subnets in the VPC for the LoadBalancer. </para> <para> The Loadbalancers evenly /// distribute requests across all of the registered subnets. </para> /// </summary> /// /// <param name="attachLoadBalancerToSubnetsRequest">Container for the necessary parameters to execute the AttachLoadBalancerToSubnets service /// method on AmazonElasticLoadBalancing.</param> /// /// <returns>The response from the AttachLoadBalancerToSubnets service method, as returned by AmazonElasticLoadBalancing.</returns> /// /// <exception cref="SubnetNotFoundException"/> /// <exception cref="LoadBalancerNotFoundException"/> /// <exception cref="InvalidConfigurationRequestException"/> public AttachLoadBalancerToSubnetsResponse AttachLoadBalancerToSubnets(AttachLoadBalancerToSubnetsRequest attachLoadBalancerToSubnetsRequest) { IRequest<AttachLoadBalancerToSubnetsRequest> request = new AttachLoadBalancerToSubnetsRequestMarshaller().Marshall(attachLoadBalancerToSubnetsRequest); AttachLoadBalancerToSubnetsResponse response = Invoke<AttachLoadBalancerToSubnetsRequest, AttachLoadBalancerToSubnetsResponse> (request, this.signer, AttachLoadBalancerToSubnetsResponseUnmarshaller.GetInstance()); return response; }