/// <summary> /// Initiates the asynchronous execution of the RunInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RunInstances 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<RunInstancesResponse> RunInstancesAsync(RunInstancesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RunInstancesRequestMarshaller(); var unmarshaller = RunInstancesResponseUnmarshaller.Instance; return InvokeAsync<RunInstancesRequest,RunInstancesResponse>(request, marshaller, unmarshaller, cancellationToken); }
public void RunInstancesMarshallTest() { var operation = service_model.FindOperation("RunInstances"); var request = InstantiateClassGenerator.Execute<RunInstancesRequest>(); var marshaller = new RunInstancesRequestMarshaller(); 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 = RunInstancesResponseUnmarshaller.Instance.Unmarshall(context) as RunInstancesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Launches the specified number of instances using an AMI for which you have permissions. /// /// /// <para> /// When you launch an instance, it enters the <code>pending</code> state. After the instance /// is ready for you, it enters the <code>running</code> state. To check the state of /// your instance, call <a>DescribeInstances</a>. /// </para> /// /// <para> /// If you don't specify a security group when launching an instance, Amazon EC2 uses /// the default security group. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html">Security /// Groups</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// /// <para> /// Linux instances have access to the public key of the key pair at boot. You can use /// this key to provide secure access to the instance. Amazon EC2 public images use this /// feature to provide secure access without passwords. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html">Key /// Pairs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// /// <para> /// You can provide optional user data when launching an instance. For more information, /// see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html">Instance /// Metadata</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// /// <para> /// If any of the AMIs have a product code attached for which the user has not subscribed, /// <code>RunInstances</code> fails. /// </para> /// /// <para> /// T2 instance types can only be launched into a VPC. If you do not have a default VPC, /// or if you do not specify a subnet ID in the request, <code>RunInstances</code> fails. /// </para> /// /// <para> /// For more information about troubleshooting, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html">What /// To Do If An Instance Immediately Terminates</a>, and <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html">Troubleshooting /// Connecting to 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 RunInstances service method.</param> /// /// <returns>The response from the RunInstances service method, as returned by EC2.</returns> public RunInstancesResponse RunInstances(RunInstancesRequest request) { var marshaller = new RunInstancesRequestMarshaller(); var unmarshaller = RunInstancesResponseUnmarshaller.Instance; return Invoke<RunInstancesRequest,RunInstancesResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the RunInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RunInstances 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 EndRunInstances /// operation.</returns> public IAsyncResult BeginRunInstances(RunInstancesRequest request, AsyncCallback callback, object state) { var marshaller = new RunInstancesRequestMarshaller(); var unmarshaller = RunInstancesResponseUnmarshaller.Instance; return BeginInvoke<RunInstancesRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeRunInstances(RunInstancesRequest runInstancesRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new RunInstancesRequestMarshaller().Marshall(runInstancesRequest); var unmarshaller = RunInstancesResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Launches the specified number of instances using an AMI for which you have permissions.</para> <para>When you launch an instance, it /// enters the <c>pending</c> state. After the instance is ready for you, it enters the <c>running</c> state. To check the state of your /// instance, call DescribeInstances.</para> <para>If you don't specify a security group when launching an instance, Amazon EC2 uses the default /// security group. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html">Security /// Groups</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> .</para> <para>Linux instances have access to the public key of the key /// pair at boot. You can use this key to provide secure access to the instance. Amazon EC2 public images use this feature to provide secure /// access without passwords. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html">Key /// Pairs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> .</para> <para>You can provide optional user data when launching an /// instance. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html">Instance /// Metadata</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> .</para> <para>If any of the AMIs have a product code attached for which /// the user has not subscribed, <c>RunInstances</c> fails.</para> /// </summary> /// /// <param name="runInstancesRequest">Container for the necessary parameters to execute the RunInstances service method on AmazonEC2.</param> /// /// <returns>The response from the RunInstances 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<RunInstancesResponse> RunInstancesAsync(RunInstancesRequest runInstancesRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RunInstancesRequestMarshaller(); var unmarshaller = RunInstancesResponseUnmarshaller.GetInstance(); return Invoke<IRequest, RunInstancesRequest, RunInstancesResponse>(runInstancesRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the RunInstances operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.RunInstances"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RunInstances 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<RunInstancesResponse> RunInstancesAsync(RunInstancesRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RunInstancesRequestMarshaller(); var unmarshaller = RunInstancesResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, RunInstancesRequest, RunInstancesResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }