Container for the parameters to the TerminateEnvironment operation. Terminates the specified environment.
Inheritance: AmazonElasticBeanstalkRequest
コード例 #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ElasticBeanstalk.Model.TerminateEnvironmentRequest();

            if (cmdletContext.EnvironmentId != null)
            {
                request.EnvironmentId = cmdletContext.EnvironmentId;
            }
            if (cmdletContext.EnvironmentName != null)
            {
                request.EnvironmentName = cmdletContext.EnvironmentName;
            }
            if (cmdletContext.ForceTerminate != null)
            {
                request.ForceTerminate = cmdletContext.ForceTerminate.Value;
            }
            if (cmdletContext.TerminateResource != null)
            {
                request.TerminateResources = cmdletContext.TerminateResource.Value;
            }

            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);
        }
コード例 #2
0
 /// <summary>
 /// Initiates the asynchronous execution of the TerminateEnvironment operation.
 /// <seealso cref="Amazon.ElasticBeanstalk.AmazonElasticBeanstalk.TerminateEnvironment"/>
 /// </summary>
 /// 
 /// <param name="terminateEnvironmentRequest">Container for the necessary parameters to execute the TerminateEnvironment 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>
 /// 
 /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking
 ///         EndTerminateEnvironment operation.</returns>
 public IAsyncResult BeginTerminateEnvironment(TerminateEnvironmentRequest terminateEnvironmentRequest, AsyncCallback callback, object state)
 {
     return invokeTerminateEnvironment(terminateEnvironmentRequest, callback, state, false);
 }
コード例 #3
0
 IAsyncResult invokeTerminateEnvironment(TerminateEnvironmentRequest terminateEnvironmentRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new TerminateEnvironmentRequestMarshaller().Marshall(terminateEnvironmentRequest);
     var unmarshaller = TerminateEnvironmentResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
コード例 #4
0
 /// <summary>
 /// <para> Terminates the specified environment. </para>
 /// </summary>
 /// 
 /// <param name="terminateEnvironmentRequest">Container for the necessary parameters to execute the TerminateEnvironment service method on
 ///          AmazonElasticBeanstalk.</param>
 /// 
 /// <returns>The response from the TerminateEnvironment service method, as returned by AmazonElasticBeanstalk.</returns>
 /// 
 public TerminateEnvironmentResponse TerminateEnvironment(TerminateEnvironmentRequest terminateEnvironmentRequest)
 {
     IAsyncResult asyncResult = invokeTerminateEnvironment(terminateEnvironmentRequest, null, null, true);
     return EndTerminateEnvironment(asyncResult);
 }
コード例 #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the TerminateEnvironment operation.
        /// <seealso cref="Amazon.ElasticBeanstalk.IAmazonElasticBeanstalk"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the TerminateEnvironment 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<TerminateEnvironmentResponse> TerminateEnvironmentAsync(TerminateEnvironmentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new TerminateEnvironmentRequestMarshaller();
            var unmarshaller = TerminateEnvironmentResponseUnmarshaller.Instance;

            return InvokeAsync<TerminateEnvironmentRequest,TerminateEnvironmentResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #6
0
        internal TerminateEnvironmentResponse TerminateEnvironment(TerminateEnvironmentRequest request)
        {
            var marshaller = new TerminateEnvironmentRequestMarshaller();
            var unmarshaller = TerminateEnvironmentResponseUnmarshaller.Instance;

            return Invoke<TerminateEnvironmentRequest,TerminateEnvironmentResponse>(request, marshaller, unmarshaller);
        }
コード例 #7
0
 private Amazon.ElasticBeanstalk.Model.TerminateEnvironmentResponse CallAWSServiceOperation(IAmazonElasticBeanstalk client, Amazon.ElasticBeanstalk.Model.TerminateEnvironmentRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elastic Beanstalk", "TerminateEnvironment");
     try
     {
         #if DESKTOP
         return(client.TerminateEnvironment(request));
         #elif CORECLR
         return(client.TerminateEnvironmentAsync(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;
     }
 }
コード例 #8
0
        /// <summary>
        /// <para> Terminates the specified environment. </para>
        /// </summary>
        /// 
        /// <param name="terminateEnvironmentRequest">Container for the necessary parameters to execute the TerminateEnvironment service method on
        /// AmazonElasticBeanstalk.</param>
        /// 
        /// <returns>The response from the TerminateEnvironment service method, as returned by AmazonElasticBeanstalk.</returns>
        /// 
        /// <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<TerminateEnvironmentResponse> TerminateEnvironmentAsync(TerminateEnvironmentRequest terminateEnvironmentRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new TerminateEnvironmentRequestMarshaller();
            var unmarshaller = TerminateEnvironmentResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, TerminateEnvironmentRequest, TerminateEnvironmentResponse>(terminateEnvironmentRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
コード例 #9
0
  /// <summary>
  /// <para> Terminates the specified environment. </para>
  /// </summary>
  /// 
  /// <param name="terminateEnvironmentRequest">Container for the necessary parameters to execute the TerminateEnvironment service method on
  ///           AmazonElasticBeanstalk.</param>
  /// 
  /// <returns>The response from the TerminateEnvironment service method, as returned by AmazonElasticBeanstalk.</returns>
  /// 
 public TerminateEnvironmentResponse TerminateEnvironment(TerminateEnvironmentRequest terminateEnvironmentRequest) 
 {           
     IRequest<TerminateEnvironmentRequest> request = new TerminateEnvironmentRequestMarshaller().Marshall(terminateEnvironmentRequest);
     TerminateEnvironmentResponse response = Invoke<TerminateEnvironmentRequest, TerminateEnvironmentResponse> (request, this.signer, TerminateEnvironmentResponseUnmarshaller.GetInstance());
     return response;
 }
コード例 #10
0
		internal TerminateEnvironmentResponse TerminateEnvironment(TerminateEnvironmentRequest request)
        {
            var task = TerminateEnvironmentAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
コード例 #11
0
        /// <summary>
        /// Initiates the asynchronous execution of the TerminateEnvironment operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the TerminateEnvironment 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 EndTerminateEnvironment
        ///         operation.</returns>
        public IAsyncResult BeginTerminateEnvironment(TerminateEnvironmentRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new TerminateEnvironmentRequestMarshaller();
            var unmarshaller = TerminateEnvironmentResponseUnmarshaller.Instance;

            return BeginInvoke<TerminateEnvironmentRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
コード例 #12
0
        IAsyncResult invokeTerminateEnvironment(TerminateEnvironmentRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new TerminateEnvironmentRequestMarshaller();
            var unmarshaller = TerminateEnvironmentResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
コード例 #13
0
        /// <summary>
        /// <para> Terminates the specified environment. </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the TerminateEnvironment service method on
        /// AmazonElasticBeanstalk.</param>
        /// 
        /// <returns>The response from the TerminateEnvironment service method, as returned by AmazonElasticBeanstalk.</returns>
        /// 
        /// <exception cref="T:Amazon.ElasticBeanstalk.Model.InsufficientPrivilegesException" />
		public TerminateEnvironmentResponse TerminateEnvironment(TerminateEnvironmentRequest request)
        {
            var task = TerminateEnvironmentAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
コード例 #14
0
        /// <summary>
        /// <para> Terminates the specified environment. </para>
        /// </summary>
        /// 
        /// <param name="terminateEnvironmentRequest">Container for the necessary parameters to execute the TerminateEnvironment service method on
        /// AmazonElasticBeanstalk.</param>
        /// 
        /// <returns>The response from the TerminateEnvironment service method, as returned by AmazonElasticBeanstalk.</returns>
        /// 
        /// <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<TerminateEnvironmentResponse> TerminateEnvironmentAsync(TerminateEnvironmentRequest terminateEnvironmentRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new TerminateEnvironmentRequestMarshaller();
            var unmarshaller = TerminateEnvironmentResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, TerminateEnvironmentRequest, TerminateEnvironmentResponse>(terminateEnvironmentRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }