/// <summary> /// Initiates the asynchronous execution of the TerminateInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateInstances 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<TerminateInstancesResponse> TerminateInstancesAsync(TerminateInstancesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new TerminateInstancesRequestMarshaller(); var unmarshaller = TerminateInstancesResponseUnmarshaller.Instance; return InvokeAsync<TerminateInstancesRequest,TerminateInstancesResponse>(request, marshaller, unmarshaller, cancellationToken); }
public void TerminateInstancesMarshallTest() { var operation = service_model.FindOperation("TerminateInstances"); var request = InstantiateClassGenerator.Execute<TerminateInstancesRequest>(); var marshaller = new TerminateInstancesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation); validator.Validate(); var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(); UnmarshallerContext context = new EC2UnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, new WebResponseData()); var response = TerminateInstancesResponseUnmarshaller.Instance.Unmarshall(context) as TerminateInstancesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Shuts down one or more instances. This operation is idempotent; if you terminate an /// instance more than once, each call succeeds. /// /// /// <para> /// Terminated instances remain visible after termination (for approximately one hour). /// </para> /// /// <para> /// By default, Amazon EC2 deletes all EBS volumes that were attached when the instance /// launched. Volumes attached after instance launch continue running. /// </para> /// /// <para> /// You can stop, start, and terminate EBS-backed instances. You can only terminate instance /// store-backed instances. What happens to an instance differs if you stop it or terminate /// it. For example, when you stop an instance, the root device and any other devices /// attached to the instance persist. When you terminate an instance, the root device /// and any other devices attached during the instance launch are automatically deleted. /// For more information about the differences between stopping and terminating instances, /// see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html">Instance /// Lifecycle</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// /// <para> /// For more information about troubleshooting, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html">Troubleshooting /// Terminating Your Instance</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the TerminateInstances service method.</param> /// /// <returns>The response from the TerminateInstances service method, as returned by EC2.</returns> public TerminateInstancesResponse TerminateInstances(TerminateInstancesRequest request) { var marshaller = new TerminateInstancesRequestMarshaller(); var unmarshaller = TerminateInstancesResponseUnmarshaller.Instance; return Invoke<TerminateInstancesRequest,TerminateInstancesResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the TerminateInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateInstances operation on AmazonEC2Client.</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 EndTerminateInstances /// operation.</returns> public IAsyncResult BeginTerminateInstances(TerminateInstancesRequest request, AsyncCallback callback, object state) { var marshaller = new TerminateInstancesRequestMarshaller(); var unmarshaller = TerminateInstancesResponseUnmarshaller.Instance; return BeginInvoke<TerminateInstancesRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeTerminateInstances(TerminateInstancesRequest terminateInstancesRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new TerminateInstancesRequestMarshaller().Marshall(terminateInstancesRequest); var unmarshaller = TerminateInstancesResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Shuts down one or more instances. This operation is idempotent; if you terminate an instance more than once, each call /// succeeds.</para> <para>Terminated instances remain visible after termination (for approximately one hour).</para> <para>By default, Amazon /// EC2 deletes all Amazon EBS volumes that were attached when the instance launched. Volumes attached after instance launch continue /// running.</para> <para>You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What /// happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices /// attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch /// are automatically deleted. For more information about the differences between stopping and terminating instances, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html">Instance Lifecycle</a> in the <i>Amazon Elastic /// Compute Cloud User Guide</i> .</para> /// </summary> /// /// <param name="terminateInstancesRequest">Container for the necessary parameters to execute the TerminateInstances service method on /// AmazonEC2.</param> /// /// <returns>The response from the TerminateInstances service method, as returned by AmazonEC2.</returns> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<TerminateInstancesResponse> TerminateInstancesAsync(TerminateInstancesRequest terminateInstancesRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new TerminateInstancesRequestMarshaller(); var unmarshaller = TerminateInstancesResponseUnmarshaller.GetInstance(); return Invoke<IRequest, TerminateInstancesRequest, TerminateInstancesResponse>(terminateInstancesRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the TerminateInstances operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.TerminateInstances"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateInstances 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 async Task<TerminateInstancesResponse> TerminateInstancesAsync(TerminateInstancesRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new TerminateInstancesRequestMarshaller(); var unmarshaller = TerminateInstancesResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, TerminateInstancesRequest, TerminateInstancesResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }