public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.EC2.Model.DeleteRouteTableRequest(); 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 DeleteRouteTable operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteRouteTable 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<DeleteRouteTableResponse> DeleteRouteTableAsync(DeleteRouteTableRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteRouteTableRequestMarshaller(); var unmarshaller = DeleteRouteTableResponseUnmarshaller.Instance; return InvokeAsync<DeleteRouteTableRequest,DeleteRouteTableResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Deletes the specified route table. You must disassociate the route table from any /// subnets before you can delete it. You can't delete the main route table. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteRouteTable service method.</param> /// /// <returns>The response from the DeleteRouteTable service method, as returned by EC2.</returns> public DeleteRouteTableResponse DeleteRouteTable(DeleteRouteTableRequest request) { var marshaller = new DeleteRouteTableRequestMarshaller(); var unmarshaller = DeleteRouteTableResponseUnmarshaller.Instance; return Invoke<DeleteRouteTableRequest,DeleteRouteTableResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DeleteRouteTable operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteRouteTable 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 EndDeleteRouteTable /// operation.</returns> public IAsyncResult BeginDeleteRouteTable(DeleteRouteTableRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteRouteTableRequestMarshaller(); var unmarshaller = DeleteRouteTableResponseUnmarshaller.Instance; return BeginInvoke<DeleteRouteTableRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeDeleteRouteTable(DeleteRouteTableRequest deleteRouteTableRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteRouteTableRequestMarshaller().Marshall(deleteRouteTableRequest); var unmarshaller = DeleteRouteTableResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteRouteTable operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.DeleteRouteTable"/> /// </summary> /// /// <param name="deleteRouteTableRequest">Container for the necessary parameters to execute the DeleteRouteTable 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 BeginDeleteRouteTable(DeleteRouteTableRequest deleteRouteTableRequest, AsyncCallback callback, object state) { return invokeDeleteRouteTable(deleteRouteTableRequest, callback, state, false); }
/// <summary> /// <para>Deletes the specified route table. You must disassociate the route table from any subnets before you can delete it. You can't delete /// the main route table.</para> /// </summary> /// /// <param name="deleteRouteTableRequest">Container for the necessary parameters to execute the DeleteRouteTable service method on /// AmazonEC2.</param> /// public DeleteRouteTableResponse DeleteRouteTable(DeleteRouteTableRequest deleteRouteTableRequest) { IAsyncResult asyncResult = invokeDeleteRouteTable(deleteRouteTableRequest, null, null, true); return EndDeleteRouteTable(asyncResult); }
/// <summary> /// <para>Deletes the specified route table. You must disassociate the route table from any subnets before you can delete it. You can't delete /// the main route table.</para> /// </summary> /// /// <param name="deleteRouteTableRequest">Container for the necessary parameters to execute the DeleteRouteTable 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<DeleteRouteTableResponse> DeleteRouteTableAsync(DeleteRouteTableRequest deleteRouteTableRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteRouteTableRequestMarshaller(); var unmarshaller = DeleteRouteTableResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteRouteTableRequest, DeleteRouteTableResponse>(deleteRouteTableRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal DeleteRouteTableResponse DeleteRouteTable(DeleteRouteTableRequest request) { var task = DeleteRouteTableAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the DeleteRouteTable operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.DeleteRouteTable"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteRouteTable 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<DeleteRouteTableResponse> DeleteRouteTableAsync(DeleteRouteTableRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteRouteTableRequestMarshaller(); var unmarshaller = DeleteRouteTableResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteRouteTableRequest, DeleteRouteTableResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para> Deletes a route table from a VPC. The route table must not be associated with a subnet. You can't delete the main route table. 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 DeleteRouteTable service method on /// AmazonEC2.</param> public DeleteRouteTableResponse DeleteRouteTable(DeleteRouteTableRequest request) { var task = DeleteRouteTableAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.EC2.Model.DeleteRouteTableResponse CallAWSServiceOperation(IAmazonEC2 client, Amazon.EC2.Model.DeleteRouteTableRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic Compute Cloud (EC2)", "DeleteRouteTable"); try { #if DESKTOP return(client.DeleteRouteTable(request)); #elif CORECLR return(client.DeleteRouteTableAsync(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; } }