/// <summary> /// Initiates the asynchronous execution of the AssociateAddress operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AssociateAddress 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<AssociateAddressResponse> AssociateAddressAsync(AssociateAddressRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AssociateAddressRequestMarshaller(); var unmarshaller = AssociateAddressResponseUnmarshaller.Instance; return InvokeAsync<AssociateAddressRequest,AssociateAddressResponse>(request, marshaller, unmarshaller, cancellationToken); }
public void AssociateAddressMarshallTest() { var operation = service_model.FindOperation("AssociateAddress"); var request = InstantiateClassGenerator.Execute<AssociateAddressRequest>(); var marshaller = new AssociateAddressRequestMarshaller(); 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 = AssociateAddressResponseUnmarshaller.Instance.Unmarshall(context) as AssociateAddressResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Associates an Elastic IP address with an instance or a network interface. /// /// /// <para> /// An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For /// more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html">Elastic /// IP Addresses</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. /// </para> /// /// <para> /// [EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is already /// associated with a different instance, it is disassociated from that instance and associated /// with the specified instance. /// </para> /// /// <para> /// [VPC in an EC2-Classic account] If you don't specify a private IP address, the Elastic /// IP address is associated with the primary IP address. If the Elastic IP address is /// already associated with a different instance or a network interface, you get an error /// unless you allow reassociation. /// </para> /// /// <para> /// This is an idempotent operation. If you perform the operation more than once, Amazon /// EC2 doesn't return an error. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateAddress service method.</param> /// /// <returns>The response from the AssociateAddress service method, as returned by EC2.</returns> public AssociateAddressResponse AssociateAddress(AssociateAddressRequest request) { var marshaller = new AssociateAddressRequestMarshaller(); var unmarshaller = AssociateAddressResponseUnmarshaller.Instance; return Invoke<AssociateAddressRequest,AssociateAddressResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the AssociateAddress operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AssociateAddress 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 EndAssociateAddress /// operation.</returns> public IAsyncResult BeginAssociateAddress(AssociateAddressRequest request, AsyncCallback callback, object state) { var marshaller = new AssociateAddressRequestMarshaller(); var unmarshaller = AssociateAddressResponseUnmarshaller.Instance; return BeginInvoke<AssociateAddressRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeAssociateAddress(AssociateAddressRequest associateAddressRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new AssociateAddressRequestMarshaller().Marshall(associateAddressRequest); var unmarshaller = AssociateAddressResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Associates an Elastic IP address with an instance or a network interface.</para> <para>An Elastic IP address is for use in either the /// EC2-Classic platform or in a VPC. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html">Elastic IP Addresses</a> in the <i>Amazon Elastic /// Compute Cloud User Guide</i> .</para> <para>[EC2-Classic, default VPC] If the Elastic IP address is already associated with a different /// instance, it is disassociated from that instance and associated with the specified instance.</para> <para>[EC2-VPC] If you don't specify a /// private IP address, the Elastic IP address is associated with the primary IP address. If the Elastic IP address is already associated with a /// different instance or a network interface, you get an error unless you allow reassociation.</para> <para>This is an idempotent operation. If /// you perform the operation more than once, Amazon EC2 doesn't return an error.</para> /// </summary> /// /// <param name="associateAddressRequest">Container for the necessary parameters to execute the AssociateAddress service method on /// AmazonEC2.</param> /// /// <returns>The response from the AssociateAddress 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<AssociateAddressResponse> AssociateAddressAsync(AssociateAddressRequest associateAddressRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AssociateAddressRequestMarshaller(); var unmarshaller = AssociateAddressResponseUnmarshaller.GetInstance(); return Invoke<IRequest, AssociateAddressRequest, AssociateAddressResponse>(associateAddressRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the AssociateAddress operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.AssociateAddress"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AssociateAddress 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<AssociateAddressResponse> AssociateAddressAsync(AssociateAddressRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AssociateAddressRequestMarshaller(); var unmarshaller = AssociateAddressResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, AssociateAddressRequest, AssociateAddressResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }