public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerPolicyRequest(); if (cmdletContext.LoadBalancerName != null) { request.LoadBalancerName = cmdletContext.LoadBalancerName; } if (cmdletContext.PolicyAttribute != null) { request.PolicyAttributes = cmdletContext.PolicyAttribute; } if (cmdletContext.PolicyName != null) { request.PolicyName = cmdletContext.PolicyName; } if (cmdletContext.PolicyTypeName != null) { request.PolicyTypeName = cmdletContext.PolicyTypeName; } 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 CreateLoadBalancerPolicy operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancerPolicy 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<CreateLoadBalancerPolicyResponse> CreateLoadBalancerPolicyAsync(CreateLoadBalancerPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateLoadBalancerPolicyRequestMarshaller(); var unmarshaller = CreateLoadBalancerPolicyResponseUnmarshaller.Instance; return InvokeAsync<CreateLoadBalancerPolicyRequest,CreateLoadBalancerPolicyResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal CreateLoadBalancerPolicyResponse CreateLoadBalancerPolicy(CreateLoadBalancerPolicyRequest request) { var marshaller = new CreateLoadBalancerPolicyRequestMarshaller(); var unmarshaller = CreateLoadBalancerPolicyResponseUnmarshaller.Instance; return Invoke<CreateLoadBalancerPolicyRequest,CreateLoadBalancerPolicyResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> Creates a new policy that contains the necessary attributes depending on the policy type. Policies are settings that are saved for /// your Elastic LoadBalancer and that can be applied to the front-end listener, or the back-end application server, depending on your policy /// type. </para> /// </summary> /// /// <param name="createLoadBalancerPolicyRequest">Container for the necessary parameters to execute the CreateLoadBalancerPolicy service method /// on AmazonElasticLoadBalancing.</param> /// /// <returns>The response from the CreateLoadBalancerPolicy service method, as returned by AmazonElasticLoadBalancing.</returns> /// /// <exception cref="PolicyTypeNotFoundException"/> /// <exception cref="TooManyPoliciesException"/> /// <exception cref="DuplicatePolicyNameException"/> /// <exception cref="LoadBalancerNotFoundException"/> /// <exception cref="InvalidConfigurationRequestException"/> public CreateLoadBalancerPolicyResponse CreateLoadBalancerPolicy(CreateLoadBalancerPolicyRequest createLoadBalancerPolicyRequest) { IAsyncResult asyncResult = invokeCreateLoadBalancerPolicy(createLoadBalancerPolicyRequest, null, null, true); return EndCreateLoadBalancerPolicy(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the CreateLoadBalancerPolicy operation. /// <seealso cref="Amazon.ElasticLoadBalancing.AmazonElasticLoadBalancing.CreateLoadBalancerPolicy"/> /// </summary> /// /// <param name="createLoadBalancerPolicyRequest">Container for the necessary parameters to execute the CreateLoadBalancerPolicy 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 /// EndCreateLoadBalancerPolicy operation.</returns> public IAsyncResult BeginCreateLoadBalancerPolicy(CreateLoadBalancerPolicyRequest createLoadBalancerPolicyRequest, AsyncCallback callback, object state) { return invokeCreateLoadBalancerPolicy(createLoadBalancerPolicyRequest, callback, state, false); }
IAsyncResult invokeCreateLoadBalancerPolicy(CreateLoadBalancerPolicyRequest createLoadBalancerPolicyRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateLoadBalancerPolicyRequestMarshaller().Marshall(createLoadBalancerPolicyRequest); var unmarshaller = CreateLoadBalancerPolicyResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Creates a new policy that contains the necessary attributes depending on the policy type. Policies are settings that are saved for /// your load balancer and that can be applied to the front-end listener, or the back-end application server, depending on your policy type. /// </para> /// </summary> /// /// <param name="createLoadBalancerPolicyRequest">Container for the necessary parameters to execute the CreateLoadBalancerPolicy service method /// on AmazonElasticLoadBalancing.</param> /// /// <returns>The response from the CreateLoadBalancerPolicy service method, as returned by AmazonElasticLoadBalancing.</returns> /// /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.PolicyTypeNotFoundException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.InvalidConfigurationRequestException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.DuplicatePolicyNameException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.TooManyPoliciesException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.LoadBalancerNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<CreateLoadBalancerPolicyResponse> CreateLoadBalancerPolicyAsync(CreateLoadBalancerPolicyRequest createLoadBalancerPolicyRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateLoadBalancerPolicyRequestMarshaller(); var unmarshaller = CreateLoadBalancerPolicyResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateLoadBalancerPolicyRequest, CreateLoadBalancerPolicyResponse>(createLoadBalancerPolicyRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal CreateLoadBalancerPolicyResponse CreateLoadBalancerPolicy(CreateLoadBalancerPolicyRequest request) { var task = CreateLoadBalancerPolicyAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the CreateLoadBalancerPolicy operation. /// <seealso cref="Amazon.ElasticLoadBalancing.IAmazonElasticLoadBalancing.CreateLoadBalancerPolicy"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancerPolicy 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<CreateLoadBalancerPolicyResponse> CreateLoadBalancerPolicyAsync(CreateLoadBalancerPolicyRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateLoadBalancerPolicyRequestMarshaller(); var unmarshaller = CreateLoadBalancerPolicyResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateLoadBalancerPolicyRequest, CreateLoadBalancerPolicyResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Creates a new policy that contains the necessary attributes depending on the policy type. Policies are settings that are saved for /// your load balancer and that can be applied to the front-end listener, or the back-end application server, depending on your policy type. /// </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancerPolicy service method /// on AmazonElasticLoadBalancing.</param> /// /// <returns>The response from the CreateLoadBalancerPolicy service method, as returned by AmazonElasticLoadBalancing.</returns> /// /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.PolicyTypeNotFoundException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.InvalidConfigurationRequestException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.DuplicatePolicyNameException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.TooManyPoliciesException" /> /// <exception cref="T:Amazon.ElasticLoadBalancing.Model.LoadBalancerNotFoundException" /> public CreateLoadBalancerPolicyResponse CreateLoadBalancerPolicy(CreateLoadBalancerPolicyRequest request) { var task = CreateLoadBalancerPolicyAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeCreateLoadBalancerPolicy(CreateLoadBalancerPolicyRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new CreateLoadBalancerPolicyRequestMarshaller(); var unmarshaller = CreateLoadBalancerPolicyResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the CreateLoadBalancerPolicy operation. /// <seealso cref="Amazon.ElasticLoadBalancing.IAmazonElasticLoadBalancing"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancerPolicy 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 EndCreateLoadBalancerPolicy /// operation.</returns> public IAsyncResult BeginCreateLoadBalancerPolicy(CreateLoadBalancerPolicyRequest request, AsyncCallback callback, object state) { var marshaller = new CreateLoadBalancerPolicyRequestMarshaller(); var unmarshaller = CreateLoadBalancerPolicyResponseUnmarshaller.Instance; return BeginInvoke<CreateLoadBalancerPolicyRequest>(request, marshaller, unmarshaller, callback, state); }
private Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerPolicyResponse CallAWSServiceOperation(IAmazonElasticLoadBalancing client, Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerPolicyRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Load Balancing", "CreateLoadBalancerPolicy"); try { #if DESKTOP return(client.CreateLoadBalancerPolicy(request)); #elif CORECLR return(client.CreateLoadBalancerPolicyAsync(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> /// <para> Creates a new policy that contains the necessary attributes depending on the policy type. Policies are settings that are saved for /// your Elastic LoadBalancer and that can be applied to the front-end listener, or the back-end application server, depending on your policy /// type. </para> /// </summary> /// /// <param name="createLoadBalancerPolicyRequest">Container for the necessary parameters to execute the CreateLoadBalancerPolicy service method /// on AmazonElasticLoadBalancing.</param> /// /// <returns>The response from the CreateLoadBalancerPolicy service method, as returned by AmazonElasticLoadBalancing.</returns> /// /// <exception cref="PolicyTypeNotFoundException"/> /// <exception cref="TooManyPoliciesException"/> /// <exception cref="DuplicatePolicyNameException"/> /// <exception cref="LoadBalancerNotFoundException"/> /// <exception cref="InvalidConfigurationRequestException"/> public CreateLoadBalancerPolicyResponse CreateLoadBalancerPolicy(CreateLoadBalancerPolicyRequest createLoadBalancerPolicyRequest) { IRequest<CreateLoadBalancerPolicyRequest> request = new CreateLoadBalancerPolicyRequestMarshaller().Marshall(createLoadBalancerPolicyRequest); CreateLoadBalancerPolicyResponse response = Invoke<CreateLoadBalancerPolicyRequest, CreateLoadBalancerPolicyResponse> (request, this.signer, CreateLoadBalancerPolicyResponseUnmarshaller.GetInstance()); return response; }