/// <summary> /// Initiates the asynchronous execution of the CreateImage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateImage 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<CreateImageResponse> CreateImageAsync(CreateImageRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateImageRequestMarshaller(); var unmarshaller = CreateImageResponseUnmarshaller.Instance; return InvokeAsync<CreateImageRequest,CreateImageResponse>(request, marshaller, unmarshaller, cancellationToken); }
public void CreateImageMarshallTest() { var operation = service_model.FindOperation("CreateImage"); var request = InstantiateClassGenerator.Execute<CreateImageRequest>(); var marshaller = new CreateImageRequestMarshaller(); 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 = CreateImageResponseUnmarshaller.Instance.Unmarshall(context) as CreateImageResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either /// running or stopped. /// /// /// <para> /// If you customized your instance with instance store volumes or EBS volumes in addition /// to the root device volume, the new AMI contains block device mapping information for /// those volumes. When you launch an instance from this new AMI, the instance automatically /// launches with those additional volumes. /// </para> /// /// <para> /// For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html">Creating /// Amazon EBS-Backed Linux AMIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateImage service method.</param> /// /// <returns>The response from the CreateImage service method, as returned by EC2.</returns> public CreateImageResponse CreateImage(CreateImageRequest request) { var marshaller = new CreateImageRequestMarshaller(); var unmarshaller = CreateImageResponseUnmarshaller.Instance; return Invoke<CreateImageRequest,CreateImageResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CreateImage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateImage 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 EndCreateImage /// operation.</returns> public IAsyncResult BeginCreateImage(CreateImageRequest request, AsyncCallback callback, object state) { var marshaller = new CreateImageRequestMarshaller(); var unmarshaller = CreateImageResponseUnmarshaller.Instance; return BeginInvoke<CreateImageRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeCreateImage(CreateImageRequest createImageRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateImageRequestMarshaller().Marshall(createImageRequest); var unmarshaller = CreateImageResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.</para> <para>If you customized /// your instance with instance store volumes or EBS volumes in addition to the root device volume, the new AMI contains block device mapping /// information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional /// volumes.</para> <para>For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html">Creating Amazon EBS-Backed Linux AMIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> .</para> /// </summary> /// /// <param name="createImageRequest">Container for the necessary parameters to execute the CreateImage service method on AmazonEC2.</param> /// /// <returns>The response from the CreateImage 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<CreateImageResponse> CreateImageAsync(CreateImageRequest createImageRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateImageRequestMarshaller(); var unmarshaller = CreateImageResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateImageRequest, CreateImageResponse>(createImageRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the CreateImage operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.CreateImage"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateImage 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<CreateImageResponse> CreateImageAsync(CreateImageRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateImageRequestMarshaller(); var unmarshaller = CreateImageResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateImageRequest, CreateImageResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }