/// <summary> /// Initiates the asynchronous execution of the RegisterImage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RegisterImage 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<RegisterImageResponse> RegisterImageAsync(RegisterImageRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RegisterImageRequestMarshaller(); var unmarshaller = RegisterImageResponseUnmarshaller.Instance; return InvokeAsync<RegisterImageRequest,RegisterImageResponse>(request, marshaller, unmarshaller, cancellationToken); }
public void RegisterImageMarshallTest() { var operation = service_model.FindOperation("RegisterImage"); var request = InstantiateClassGenerator.Execute<RegisterImageRequest>(); var marshaller = new RegisterImageRequestMarshaller(); 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 = RegisterImageResponseUnmarshaller.Instance.Unmarshall(context) as RegisterImageResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Registers an AMI. When you're creating an AMI, this is the final step you must complete /// before you can launch an instance from the AMI. For more information about creating /// AMIs, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html">Creating /// Your Own AMIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// /// <note> /// <para> /// For Amazon EBS-backed instances, <a>CreateImage</a> creates and registers the AMI /// in a single request, so you don't have to register the AMI yourself. /// </para> /// </note> /// <para> /// You can also use <code>RegisterImage</code> to create an Amazon EBS-backed AMI from /// a snapshot of a root device volume. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_LaunchingInstanceFromSnapshot.html">Launching /// an Instance from a Snapshot</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// /// <para> /// If needed, you can deregister an AMI at any time. Any modifications you make to an /// AMI backed by an instance store volume invalidates its registration. If you make changes /// to an image, deregister the previous image and register the new image. /// </para> /// <note> /// <para> /// You can't register an image where a secondary (non-root) snapshot has AWS Marketplace /// product codes. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterImage service method.</param> /// /// <returns>The response from the RegisterImage service method, as returned by EC2.</returns> public RegisterImageResponse RegisterImage(RegisterImageRequest request) { var marshaller = new RegisterImageRequestMarshaller(); var unmarshaller = RegisterImageResponseUnmarshaller.Instance; return Invoke<RegisterImageRequest,RegisterImageResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the RegisterImage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RegisterImage 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 EndRegisterImage /// operation.</returns> public IAsyncResult BeginRegisterImage(RegisterImageRequest request, AsyncCallback callback, object state) { var marshaller = new RegisterImageRequestMarshaller(); var unmarshaller = RegisterImageResponseUnmarshaller.Instance; return BeginInvoke<RegisterImageRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeRegisterImage(RegisterImageRequest registerImageRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new RegisterImageRequestMarshaller().Marshall(registerImageRequest); var unmarshaller = RegisterImageResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Registers an AMI. When you're creating an AMI, this is the final step you must complete before you can launch an instance from the /// AMI. For more information about creating AMIs, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html">Creating Your Own AMIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> .</para> <para><b>NOTE:</b> For Amazon EBS-backed /// instances, CreateImage creates and registers the AMI in a single request, so you don't have to register the AMI yourself. </para> <para>You /// can also use <c>RegisterImage</c> to create an Amazon EBS-backed AMI from a snapshot of a root device volume. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_LaunchingInstanceFromSnapshot.html">Launching an Instance from a /// Snapshot</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> .</para> <para>If needed, you can deregister an AMI at any time. Any /// modifications you make to an AMI backed by an instance store volume invalidates its registration. If you make changes to an image, /// deregister the previous image and register the new image.</para> <para><b>NOTE:</b> You can't register an image where a secondary (non-root) /// snapshot has AWS Marketplace product codes. </para> /// </summary> /// /// <param name="registerImageRequest">Container for the necessary parameters to execute the RegisterImage service method on AmazonEC2.</param> /// /// <returns>The response from the RegisterImage 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<RegisterImageResponse> RegisterImageAsync(RegisterImageRequest registerImageRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RegisterImageRequestMarshaller(); var unmarshaller = RegisterImageResponseUnmarshaller.GetInstance(); return Invoke<IRequest, RegisterImageRequest, RegisterImageResponse>(registerImageRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the RegisterImage operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.RegisterImage"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RegisterImage 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<RegisterImageResponse> RegisterImageAsync(RegisterImageRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RegisterImageRequestMarshaller(); var unmarshaller = RegisterImageResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, RegisterImageRequest, RegisterImageResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }