Displays all connections in this region.
If a connection ID is provided, it will only return this particular connection.
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.DirectConnect.Model.DescribeConnectionsRequest(); if (cmdletContext.ConnectionId != null) { request.ConnectionId = cmdletContext.ConnectionId; } 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 DescribeConnections operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConnections operation on AmazonDirectConnectClient.</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 EndDescribeConnections /// operation.</returns> public IAsyncResult BeginDescribeConnections(DescribeConnectionsRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeConnectionsRequestMarshaller(); var unmarshaller = DescribeConnectionsResponseUnmarshaller.Instance; return BeginInvoke<DescribeConnectionsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Displays all connections in this region. /// /// /// <para> /// If a connection ID is provided, the call returns only that particular connection. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeConnections service method.</param> /// /// <returns>The response from the DescribeConnections service method, as returned by DirectConnect.</returns> /// <exception cref="Amazon.DirectConnect.Model.DirectConnectClientException"> /// The API was called with invalid parameters. The error message will contain additional /// details about the cause. /// </exception> /// <exception cref="Amazon.DirectConnect.Model.DirectConnectServerException"> /// A server-side error occurred during the API call. The error message will contain additional /// details about the cause. /// </exception> public DescribeConnectionsResponse DescribeConnections(DescribeConnectionsRequest request) { var marshaller = new DescribeConnectionsRequestMarshaller(); var unmarshaller = DescribeConnectionsResponseUnmarshaller.Instance; return Invoke<DescribeConnectionsRequest,DescribeConnectionsResponse>(request, marshaller, unmarshaller); }
IAsyncResult invokeDescribeConnections(DescribeConnectionsRequest describeConnectionsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DescribeConnectionsRequestMarshaller().Marshall(describeConnectionsRequest); var unmarshaller = DescribeConnectionsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Displays all connections in this region.</para> <para>If a connection ID is provided, it will only return this particular /// connection.</para> /// </summary> /// /// <param name="describeConnectionsRequest">Container for the necessary parameters to execute the DescribeConnections service method on /// AmazonDirectConnect.</param> /// /// <returns>The response from the DescribeConnections service method, as returned by AmazonDirectConnect.</returns> /// /// <exception cref="DirectConnectServerException"/> /// <exception cref="DirectConnectClientException"/> public DescribeConnectionsResponse DescribeConnections(DescribeConnectionsRequest describeConnectionsRequest) { IAsyncResult asyncResult = invokeDescribeConnections(describeConnectionsRequest, null, null, true); return EndDescribeConnections(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DescribeConnections operation. /// <seealso cref="Amazon.DirectConnect.AmazonDirectConnect.DescribeConnections"/> /// </summary> /// /// <param name="describeConnectionsRequest">Container for the necessary parameters to execute the DescribeConnections operation on /// AmazonDirectConnect.</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 /// EndDescribeConnections operation.</returns> public IAsyncResult BeginDescribeConnections(DescribeConnectionsRequest describeConnectionsRequest, AsyncCallback callback, object state) { return invokeDescribeConnections(describeConnectionsRequest, callback, state, false); }
/// <summary> /// Initiates the asynchronous execution of the DescribeConnections operation. /// <seealso cref="Amazon.DirectConnect.IAmazonDirectConnect.DescribeConnections"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConnections 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<DescribeConnectionsResponse> DescribeConnectionsAsync(DescribeConnectionsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeConnectionsRequestMarshaller(); var unmarshaller = DescribeConnectionsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DescribeConnectionsRequest, DescribeConnectionsResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>Displays all connections in this region.</para> <para>If a connection ID is provided, it will only return this particular /// connection.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConnections service method on /// AmazonDirectConnect.</param> /// /// <returns>The response from the DescribeConnections service method, as returned by AmazonDirectConnect.</returns> /// /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectServerException" /> /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectClientException" /> public DescribeConnectionsResponse DescribeConnections(DescribeConnectionsRequest request) { var task = DescribeConnectionsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para>Displays all connections in this region.</para> <para>If a connection ID is provided, it will only return this particular /// connection.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConnections service method on /// AmazonDirectConnect.</param> /// /// <returns>The response from the DescribeConnections service method, as returned by AmazonDirectConnect.</returns> /// /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectServerException" /> /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectClientException" /> public DescribeConnectionsResponse DescribeConnections(DescribeConnectionsRequest request) { var task = DescribeConnectionsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the DescribeConnections operation. /// <seealso cref="Amazon.DirectConnect.IAmazonDirectConnect"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConnections 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<DescribeConnectionsResponse> DescribeConnectionsAsync(DescribeConnectionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeConnectionsRequestMarshaller(); var unmarshaller = DescribeConnectionsResponseUnmarshaller.Instance; return InvokeAsync<DescribeConnectionsRequest,DescribeConnectionsResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DescribeConnections operation. /// <seealso cref="Amazon.DirectConnect.IAmazonDirectConnect.DescribeConnections"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConnections 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<DescribeConnectionsResponse> DescribeConnectionsAsync(DescribeConnectionsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeConnectionsRequestMarshaller(); var unmarshaller = DescribeConnectionsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DescribeConnectionsRequest, DescribeConnectionsResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
private Amazon.DirectConnect.Model.DescribeConnectionsResponse CallAWSServiceOperation(IAmazonDirectConnect client, Amazon.DirectConnect.Model.DescribeConnectionsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Direct Connect", "DescribeConnections"); try { #if DESKTOP return(client.DescribeConnections(request)); #elif CORECLR return(client.DescribeConnectionsAsync(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; } }