public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.EC2.Model.MoveAddressToVpcRequest(); if (cmdletContext.PublicIp != null) { request.PublicIp = cmdletContext.PublicIp; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Initiates the asynchronous execution of the MoveAddressToVpc operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the MoveAddressToVpc 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<MoveAddressToVpcResponse> MoveAddressToVpcAsync(MoveAddressToVpcRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new MoveAddressToVpcRequestMarshaller(); var unmarshaller = MoveAddressToVpcResponseUnmarshaller.Instance; return InvokeAsync<MoveAddressToVpcRequest,MoveAddressToVpcResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Moves an Elastic IP address from the EC2-Classic platform to the EC2-VPC platform. /// The Elastic IP address must be allocated to your account, and it must not be associated /// with an instance. After the Elastic IP address is moved, it is no longer available /// for use in the EC2-Classic platform, unless you move it back using the <a>RestoreAddressToClassic</a> /// request. You cannot move an Elastic IP address that's allocated for use in the EC2-VPC /// platform to the EC2-Classic platform. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MoveAddressToVpc service method.</param> /// /// <returns>The response from the MoveAddressToVpc service method, as returned by EC2.</returns> public MoveAddressToVpcResponse MoveAddressToVpc(MoveAddressToVpcRequest request) { var marshaller = new MoveAddressToVpcRequestMarshaller(); var unmarshaller = MoveAddressToVpcResponseUnmarshaller.Instance; return Invoke<MoveAddressToVpcRequest,MoveAddressToVpcResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the MoveAddressToVpc operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the MoveAddressToVpc 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 EndMoveAddressToVpc /// operation.</returns> public IAsyncResult BeginMoveAddressToVpc(MoveAddressToVpcRequest request, AsyncCallback callback, object state) { var marshaller = new MoveAddressToVpcRequestMarshaller(); var unmarshaller = MoveAddressToVpcResponseUnmarshaller.Instance; return BeginInvoke<MoveAddressToVpcRequest>(request, marshaller, unmarshaller, callback, state); }
private Amazon.EC2.Model.MoveAddressToVpcResponse CallAWSServiceOperation(IAmazonEC2 client, Amazon.EC2.Model.MoveAddressToVpcRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic Compute Cloud (EC2)", "MoveAddressToVpc"); try { #if DESKTOP return(client.MoveAddressToVpc(request)); #elif CORECLR return(client.MoveAddressToVpcAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }