/// <summary> /// Initiates the asynchronous execution of the AttachVolume operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AttachVolume 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<AttachVolumeResponse> AttachVolumeAsync(AttachVolumeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AttachVolumeRequestMarshaller(); var unmarshaller = AttachVolumeResponseUnmarshaller.Instance; return InvokeAsync<AttachVolumeRequest,AttachVolumeResponse>(request, marshaller, unmarshaller, cancellationToken); }
public void AttachVolumeMarshallTest() { var operation = service_model.FindOperation("AttachVolume"); var request = InstantiateClassGenerator.Execute<AttachVolumeRequest>(); var marshaller = new AttachVolumeRequestMarshaller(); 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 = AttachVolumeResponseUnmarshaller.Instance.Unmarshall(context) as AttachVolumeResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Attaches an EBS volume to a running or stopped instance and exposes it to the instance /// with the specified device name. /// /// /// <para> /// Encrypted EBS volumes may only be attached to instances that support Amazon EBS encryption. /// For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html">Amazon /// EBS Encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// /// <para> /// For a list of supported device names, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html">Attaching /// an EBS Volume to an Instance</a>. Any device names that aren't reserved for instance /// store volumes can be used for EBS volumes. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html">Amazon /// EC2 Instance Store</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// /// <para> /// If a volume has an AWS Marketplace product code: /// </para> /// <ul> <li>The volume can be attached only to a stopped instance.</li> <li>AWS Marketplace /// product codes are copied from the volume to the instance.</li> <li>You must be subscribed /// to the product.</li> <li>The instance type and operating system of the instance must /// support the product. For example, you can't detach a volume from a Windows instance /// and attach it to a Linux instance.</li> </ul> /// <para> /// For an overview of the AWS Marketplace, see <a href="https://aws.amazon.com/marketplace/help/200900000">Introducing /// AWS Marketplace</a>. /// </para> /// /// <para> /// For more information about EBS volumes, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html">Attaching /// Amazon EBS Volumes</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AttachVolume service method.</param> /// /// <returns>The response from the AttachVolume service method, as returned by EC2.</returns> public AttachVolumeResponse AttachVolume(AttachVolumeRequest request) { var marshaller = new AttachVolumeRequestMarshaller(); var unmarshaller = AttachVolumeResponseUnmarshaller.Instance; return Invoke<AttachVolumeRequest,AttachVolumeResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the AttachVolume operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AttachVolume 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 EndAttachVolume /// operation.</returns> public IAsyncResult BeginAttachVolume(AttachVolumeRequest request, AsyncCallback callback, object state) { var marshaller = new AttachVolumeRequestMarshaller(); var unmarshaller = AttachVolumeResponseUnmarshaller.Instance; return BeginInvoke<AttachVolumeRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeAttachVolume(AttachVolumeRequest attachVolumeRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new AttachVolumeRequestMarshaller().Marshall(attachVolumeRequest); var unmarshaller = AttachVolumeResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Attaches an Amazon EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.</para> /// <para>For a list of supported device names, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html">Attaching an Amazon EBS Volume to an Instance</a> . Any device names that aren't reserved for instance store volumes can be used for Amazon /// EBS volumes. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html">Amazon EC2 /// Instance Store</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> .</para> <para>If a volume has an AWS Marketplace product /// code:</para> /// <ul> /// <li>The volume can only be attached as the root device of a stopped instance.</li> /// <li>You must be subscribed to the AWS Marketplace code that is on the volume.</li> /// <li>The configuration (instance type, operating system) of the instance must support that specific AWS Marketplace code. For example, you /// cannot take a volume from a Windows instance and attach it to a Linux instance.</li> /// <li>AWS Marketplace product codes are copied from the volume to the instance.</li> /// /// </ul> /// <para>For an overview of the AWS Marketplace, see <a href="https://aws.amazon.com/marketplace/help/200900000">https://aws.amazon.com/marketplace/help/200900000</a> . For more information about how to use the AWS Marketplace, see <a href="https://aws.amazon.com/marketplace">AWS Marketplace</a> .</para> <para>For more information about Amazon EBS volumes, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html">Attaching Amazon EBS Volumes</a> in the <i>Amazon /// Elastic Compute Cloud User Guide</i> .</para> /// </summary> /// /// <param name="attachVolumeRequest">Container for the necessary parameters to execute the AttachVolume service method on AmazonEC2.</param> /// /// <returns>The response from the AttachVolume 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<AttachVolumeResponse> AttachVolumeAsync(AttachVolumeRequest attachVolumeRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AttachVolumeRequestMarshaller(); var unmarshaller = AttachVolumeResponseUnmarshaller.GetInstance(); return Invoke<IRequest, AttachVolumeRequest, AttachVolumeResponse>(attachVolumeRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the AttachVolume operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.AttachVolume"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AttachVolume 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<AttachVolumeResponse> AttachVolumeAsync(AttachVolumeRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AttachVolumeRequestMarshaller(); var unmarshaller = AttachVolumeResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, AttachVolumeRequest, AttachVolumeResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }