public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.EC2.Model.DeleteRouteRequest(); if (cmdletContext.DestinationCidrBlock != null) { request.DestinationCidrBlock = cmdletContext.DestinationCidrBlock; } if (cmdletContext.DestinationIpv6CidrBlock != null) { request.DestinationIpv6CidrBlock = cmdletContext.DestinationIpv6CidrBlock; } if (cmdletContext.DestinationPrefixListId != null) { request.DestinationPrefixListId = cmdletContext.DestinationPrefixListId; } if (cmdletContext.RouteTableId != null) { request.RouteTableId = cmdletContext.RouteTableId; } 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 DeleteRoute operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteRoute 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<DeleteRouteResponse> DeleteRouteAsync(DeleteRouteRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteRouteRequestMarshaller(); var unmarshaller = DeleteRouteResponseUnmarshaller.Instance; return InvokeAsync<DeleteRouteRequest,DeleteRouteResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Deletes the specified route from the specified route table. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteRoute service method.</param> /// /// <returns>The response from the DeleteRoute service method, as returned by EC2.</returns> public DeleteRouteResponse DeleteRoute(DeleteRouteRequest request) { var marshaller = new DeleteRouteRequestMarshaller(); var unmarshaller = DeleteRouteResponseUnmarshaller.Instance; return Invoke<DeleteRouteRequest,DeleteRouteResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DeleteRoute operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteRoute 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 EndDeleteRoute /// operation.</returns> public IAsyncResult BeginDeleteRoute(DeleteRouteRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteRouteRequestMarshaller(); var unmarshaller = DeleteRouteResponseUnmarshaller.Instance; return BeginInvoke<DeleteRouteRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeDeleteRoute(DeleteRouteRequest deleteRouteRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteRouteRequestMarshaller().Marshall(deleteRouteRequest); var unmarshaller = DeleteRouteResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteRoute operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.DeleteRoute"/> /// </summary> /// /// <param name="deleteRouteRequest">Container for the necessary parameters to execute the DeleteRoute operation on AmazonEC2.</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> public IAsyncResult BeginDeleteRoute(DeleteRouteRequest deleteRouteRequest, AsyncCallback callback, object state) { return invokeDeleteRoute(deleteRouteRequest, callback, state, false); }
/// <summary> /// <para>Deletes the specified route from the specified route table.</para> /// </summary> /// /// <param name="deleteRouteRequest">Container for the necessary parameters to execute the DeleteRoute service method on AmazonEC2.</param> /// public DeleteRouteResponse DeleteRoute(DeleteRouteRequest deleteRouteRequest) { IAsyncResult asyncResult = invokeDeleteRoute(deleteRouteRequest, null, null, true); return EndDeleteRoute(asyncResult); }
private Amazon.EC2.Model.DeleteRouteResponse CallAWSServiceOperation(IAmazonEC2 client, Amazon.EC2.Model.DeleteRouteRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic Compute Cloud (EC2)", "DeleteRoute"); try { #if DESKTOP return(client.DeleteRoute(request)); #elif CORECLR return(client.DeleteRouteAsync(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; } }
/// <summary> /// <para>Deletes the specified route from the specified route table.</para> /// </summary> /// /// <param name="deleteRouteRequest">Container for the necessary parameters to execute the DeleteRoute service method on AmazonEC2.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<DeleteRouteResponse> DeleteRouteAsync(DeleteRouteRequest deleteRouteRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteRouteRequestMarshaller(); var unmarshaller = DeleteRouteResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteRouteRequest, DeleteRouteResponse>(deleteRouteRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal DeleteRouteResponse DeleteRoute(DeleteRouteRequest request) { var task = DeleteRouteAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the DeleteRoute operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.DeleteRoute"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteRoute 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<DeleteRouteResponse> DeleteRouteAsync(DeleteRouteRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteRouteRequestMarshaller(); var unmarshaller = DeleteRouteResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteRouteRequest, DeleteRouteResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para> Deletes a route from a route table in a VPC. For more information about route tables, go to <a href="http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route Tables</a> in the Amazon Virtual Private /// Cloud User Guide. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteRoute service method on AmazonEC2.</param> public DeleteRouteResponse DeleteRoute(DeleteRouteRequest request) { var task = DeleteRouteAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }