/// <summary> /// Initiates the asynchronous execution of the RequestSpotInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RequestSpotInstances 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<RequestSpotInstancesResponse> RequestSpotInstancesAsync(RequestSpotInstancesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RequestSpotInstancesRequestMarshaller(); var unmarshaller = RequestSpotInstancesResponseUnmarshaller.Instance; return InvokeAsync<RequestSpotInstancesRequest,RequestSpotInstancesResponse>(request, marshaller, unmarshaller, cancellationToken); }
public void RequestSpotInstancesMarshallTest() { var operation = service_model.FindOperation("RequestSpotInstances"); var request = InstantiateClassGenerator.Execute<RequestSpotInstancesRequest>(); var marshaller = new RequestSpotInstancesRequestMarshaller(); 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 = RequestSpotInstancesResponseUnmarshaller.Instance.Unmarshall(context) as RequestSpotInstancesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Creates a Spot Instance request. Spot Instances are instances that Amazon EC2 launches /// when the bid price that you specify exceeds the current Spot Price. Amazon EC2 periodically /// sets the Spot Price based on available Spot Instance capacity and current Spot Instance /// requests. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html">Spot /// Instance Requests</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RequestSpotInstances service method.</param> /// /// <returns>The response from the RequestSpotInstances service method, as returned by EC2.</returns> public RequestSpotInstancesResponse RequestSpotInstances(RequestSpotInstancesRequest request) { var marshaller = new RequestSpotInstancesRequestMarshaller(); var unmarshaller = RequestSpotInstancesResponseUnmarshaller.Instance; return Invoke<RequestSpotInstancesRequest,RequestSpotInstancesResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the RequestSpotInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RequestSpotInstances 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 EndRequestSpotInstances /// operation.</returns> public IAsyncResult BeginRequestSpotInstances(RequestSpotInstancesRequest request, AsyncCallback callback, object state) { var marshaller = new RequestSpotInstancesRequestMarshaller(); var unmarshaller = RequestSpotInstancesResponseUnmarshaller.Instance; return BeginInvoke<RequestSpotInstancesRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeRequestSpotInstances(RequestSpotInstancesRequest requestSpotInstancesRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new RequestSpotInstancesRequestMarshaller().Marshall(requestSpotInstancesRequest); var unmarshaller = RequestSpotInstancesResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Creates a Spot Instance request. Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that you /// specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current /// Spot Instance requests. For more information about Spot Instances, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html">Spot Instances</a> in the <i>Amazon Elastic Compute /// Cloud User Guide</i> .</para> /// </summary> /// /// <param name="requestSpotInstancesRequest">Container for the necessary parameters to execute the RequestSpotInstances service method on /// AmazonEC2.</param> /// /// <returns>The response from the RequestSpotInstances 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<RequestSpotInstancesResponse> RequestSpotInstancesAsync(RequestSpotInstancesRequest requestSpotInstancesRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RequestSpotInstancesRequestMarshaller(); var unmarshaller = RequestSpotInstancesResponseUnmarshaller.GetInstance(); return Invoke<IRequest, RequestSpotInstancesRequest, RequestSpotInstancesResponse>(requestSpotInstancesRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the RequestSpotInstances operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.RequestSpotInstances"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RequestSpotInstances 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<RequestSpotInstancesResponse> RequestSpotInstancesAsync(RequestSpotInstancesRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RequestSpotInstancesRequestMarshaller(); var unmarshaller = RequestSpotInstancesResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, RequestSpotInstancesRequest, RequestSpotInstancesResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }