Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment and forces a restart.
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElasticBeanstalk.Model.RebuildEnvironmentRequest(); if (cmdletContext.EnvironmentId != null) { request.EnvironmentId = cmdletContext.EnvironmentId; } if (cmdletContext.EnvironmentName != null) { request.EnvironmentName = cmdletContext.EnvironmentName; } 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 RebuildEnvironment operation. /// <seealso cref="Amazon.ElasticBeanstalk.AmazonElasticBeanstalk.RebuildEnvironment"/> /// </summary> /// /// <param name="rebuildEnvironmentRequest">Container for the necessary parameters to execute the RebuildEnvironment operation on /// AmazonElasticBeanstalk.</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> public IAsyncResult BeginRebuildEnvironment(RebuildEnvironmentRequest rebuildEnvironmentRequest, AsyncCallback callback, object state) { return invokeRebuildEnvironment(rebuildEnvironmentRequest, callback, state, false); }
IAsyncResult invokeRebuildEnvironment(RebuildEnvironmentRequest rebuildEnvironmentRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new RebuildEnvironmentRequestMarshaller().Marshall(rebuildEnvironmentRequest); var unmarshaller = RebuildEnvironmentResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment /// and forces a restart. </para> /// </summary> /// /// <param name="rebuildEnvironmentRequest">Container for the necessary parameters to execute the RebuildEnvironment service method on /// AmazonElasticBeanstalk.</param> /// public RebuildEnvironmentResponse RebuildEnvironment(RebuildEnvironmentRequest rebuildEnvironmentRequest) { IAsyncResult asyncResult = invokeRebuildEnvironment(rebuildEnvironmentRequest, null, null, true); return EndRebuildEnvironment(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the RebuildEnvironment operation. /// <seealso cref="Amazon.ElasticBeanstalk.IAmazonElasticBeanstalk"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RebuildEnvironment 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<RebuildEnvironmentResponse> RebuildEnvironmentAsync(RebuildEnvironmentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RebuildEnvironmentRequestMarshaller(); var unmarshaller = RebuildEnvironmentResponseUnmarshaller.Instance; return InvokeAsync<RebuildEnvironmentRequest,RebuildEnvironmentResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal RebuildEnvironmentResponse RebuildEnvironment(RebuildEnvironmentRequest request) { var marshaller = new RebuildEnvironmentRequestMarshaller(); var unmarshaller = RebuildEnvironmentResponseUnmarshaller.Instance; return Invoke<RebuildEnvironmentRequest,RebuildEnvironmentResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment /// and forces a restart. </para> /// </summary> /// /// <param name="rebuildEnvironmentRequest">Container for the necessary parameters to execute the RebuildEnvironment service method on /// AmazonElasticBeanstalk.</param> /// public RebuildEnvironmentResponse RebuildEnvironment(RebuildEnvironmentRequest rebuildEnvironmentRequest) { IRequest<RebuildEnvironmentRequest> request = new RebuildEnvironmentRequestMarshaller().Marshall(rebuildEnvironmentRequest); RebuildEnvironmentResponse response = Invoke<RebuildEnvironmentRequest, RebuildEnvironmentResponse> (request, this.signer, RebuildEnvironmentResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// <para> Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment /// and forces a restart. </para> /// </summary> /// /// <param name="rebuildEnvironmentRequest">Container for the necessary parameters to execute the RebuildEnvironment service method on /// AmazonElasticBeanstalk.</param> /// /// <exception cref="T:Amazon.ElasticBeanstalk.Model.InsufficientPrivilegesException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<RebuildEnvironmentResponse> RebuildEnvironmentAsync(RebuildEnvironmentRequest rebuildEnvironmentRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RebuildEnvironmentRequestMarshaller(); var unmarshaller = RebuildEnvironmentResponseUnmarshaller.GetInstance(); return Invoke<IRequest, RebuildEnvironmentRequest, RebuildEnvironmentResponse>(rebuildEnvironmentRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal RebuildEnvironmentResponse RebuildEnvironment(RebuildEnvironmentRequest request) { var task = RebuildEnvironmentAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
private Amazon.ElasticBeanstalk.Model.RebuildEnvironmentResponse CallAWSServiceOperation(IAmazonElasticBeanstalk client, Amazon.ElasticBeanstalk.Model.RebuildEnvironmentRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elastic Beanstalk", "RebuildEnvironment"); try { #if DESKTOP return(client.RebuildEnvironment(request)); #elif CORECLR return(client.RebuildEnvironmentAsync(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 RebuildEnvironment operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RebuildEnvironment operation on AmazonElasticBeanstalkClient.</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 EndRebuildEnvironment /// operation.</returns> public IAsyncResult BeginRebuildEnvironment(RebuildEnvironmentRequest request, AsyncCallback callback, object state) { var marshaller = new RebuildEnvironmentRequestMarshaller(); var unmarshaller = RebuildEnvironmentResponseUnmarshaller.Instance; return BeginInvoke<RebuildEnvironmentRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeRebuildEnvironment(RebuildEnvironmentRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new RebuildEnvironmentRequestMarshaller(); var unmarshaller = RebuildEnvironmentResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// <para> Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment /// and forces a restart. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RebuildEnvironment service method on /// AmazonElasticBeanstalk.</param> /// /// <exception cref="T:Amazon.ElasticBeanstalk.Model.InsufficientPrivilegesException" /> public RebuildEnvironmentResponse RebuildEnvironment(RebuildEnvironmentRequest request) { var task = RebuildEnvironmentAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment /// and forces a restart. </para> /// </summary> /// /// <param name="rebuildEnvironmentRequest">Container for the necessary parameters to execute the RebuildEnvironment service method on /// AmazonElasticBeanstalk.</param> /// /// <exception cref="T:Amazon.ElasticBeanstalk.Model.InsufficientPrivilegesException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<RebuildEnvironmentResponse> RebuildEnvironmentAsync(RebuildEnvironmentRequest rebuildEnvironmentRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RebuildEnvironmentRequestMarshaller(); var unmarshaller = RebuildEnvironmentResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, RebuildEnvironmentRequest, RebuildEnvironmentResponse>(rebuildEnvironmentRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }