Container for the parameters to the DescribeTrails operation.

Retrieves the settings for some or all trails associated with an account. Returns a list of Trail structures in JSON format.

상속: AmazonCloudTrailRequest
예제 #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CloudTrail.Model.DescribeTrailsRequest();

            if (cmdletContext.IncludeShadowTrail != null)
            {
                request.IncludeShadowTrails = cmdletContext.IncludeShadowTrail.Value;
            }
            if (cmdletContext.TrailNameList != null)
            {
                request.TrailNameList = cmdletContext.TrailNameList;
            }

            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);
        }
예제 #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeTrails operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeTrails operation on AmazonCloudTrailClient.</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 EndDescribeTrails
        ///         operation.</returns>
        public IAsyncResult BeginDescribeTrails(DescribeTrailsRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DescribeTrailsRequestMarshaller();
            var unmarshaller = DescribeTrailsResponseUnmarshaller.Instance;

            return BeginInvoke<DescribeTrailsRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
예제 #3
0
        /// <summary>
        /// Retrieves settings for the trail associated with the current region for your account.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeTrails service method.</param>
        /// 
        /// <returns>The response from the DescribeTrails service method, as returned by CloudTrail.</returns>
        /// <exception cref="Amazon.CloudTrail.Model.OperationNotPermittedException">
        /// This exception is thrown when the requested operation is not permitted.
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.UnsupportedOperationException">
        /// This exception is thrown when the requested operation is not supported. For example,
        /// this exception will occur if an attempt is made to tag a trail and tagging is not
        /// supported in the current region.
        /// </exception>
        public DescribeTrailsResponse DescribeTrails(DescribeTrailsRequest request)
        {
            var marshaller = new DescribeTrailsRequestMarshaller();
            var unmarshaller = DescribeTrailsResponseUnmarshaller.Instance;

            return Invoke<DescribeTrailsRequest,DescribeTrailsResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeTrails operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeTrails 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<DescribeTrailsResponse> DescribeTrailsAsync(DescribeTrailsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeTrailsRequestMarshaller();
            var unmarshaller = DescribeTrailsResponseUnmarshaller.Instance;

            return InvokeAsync<DescribeTrailsRequest,DescribeTrailsResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
 IAsyncResult invokeDescribeTrails(DescribeTrailsRequest describeTrailsRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new DescribeTrailsRequestMarshaller().Marshall(describeTrailsRequest);
     var unmarshaller = DescribeTrailsResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// Initiates the asynchronous execution of the DescribeTrails operation.
 /// <seealso cref="Amazon.CloudTrail.IAmazonCloudTrail.DescribeTrails"/>
 /// </summary>
 /// 
 /// <param name="describeTrailsRequest">Container for the necessary parameters to execute the DescribeTrails operation on
 ///          AmazonCloudTrail.</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 EndDescribeTrails
 ///         operation.</returns>
 public IAsyncResult BeginDescribeTrails(DescribeTrailsRequest describeTrailsRequest, AsyncCallback callback, object state)
 {
     return invokeDescribeTrails(describeTrailsRequest, callback, state, false);
 }
 /// <summary>
 /// <para>Retrieves the settings for some or all trails associated with an account. </para>
 /// </summary>
 /// 
 /// <param name="describeTrailsRequest">Container for the necessary parameters to execute the DescribeTrails service method on
 ///          AmazonCloudTrail.</param>
 /// 
 /// <returns>The response from the DescribeTrails service method, as returned by AmazonCloudTrail.</returns>
 /// 
 public DescribeTrailsResponse DescribeTrails(DescribeTrailsRequest describeTrailsRequest)
 {
     IAsyncResult asyncResult = invokeDescribeTrails(describeTrailsRequest, null, null, true);
     return EndDescribeTrails(asyncResult);
 }
예제 #8
0
        /// <summary>
        /// <para>Retrieves the settings for some or all trails associated with an account. Returns a list of Trail structures in JSON format.</para>
        /// </summary>
        /// 
        /// <param name="describeTrailsRequest">Container for the necessary parameters to execute the DescribeTrails service method on
        /// AmazonCloudTrail.</param>
        /// 
        /// <returns>The response from the DescribeTrails service method, as returned by AmazonCloudTrail.</returns>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<DescribeTrailsResponse> DescribeTrailsAsync(DescribeTrailsRequest describeTrailsRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeTrailsRequestMarshaller();
            var unmarshaller = DescribeTrailsResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, DescribeTrailsRequest, DescribeTrailsResponse>(describeTrailsRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
예제 #9
0
		internal DescribeTrailsResponse DescribeTrails(DescribeTrailsRequest request)
        {
            var task = DescribeTrailsAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
예제 #10
0
        /// <summary>
        /// <para>Retrieves the settings for some or all trails associated with an account. </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeTrails service method on
        /// AmazonCloudTrail.</param>
        /// 
        /// <returns>The response from the DescribeTrails service method, as returned by AmazonCloudTrail.</returns>
		public DescribeTrailsResponse DescribeTrails(DescribeTrailsRequest request)
        {
            var task = DescribeTrailsAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeTrails operation.
        /// <seealso cref="Amazon.CloudTrail.IAmazonCloudTrail.DescribeTrails"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeTrails 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<DescribeTrailsResponse> DescribeTrailsAsync(DescribeTrailsRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeTrailsRequestMarshaller();
            var unmarshaller = DescribeTrailsResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, DescribeTrailsRequest, DescribeTrailsResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
예제 #12
0
 private Amazon.CloudTrail.Model.DescribeTrailsResponse CallAWSServiceOperation(IAmazonCloudTrail client, Amazon.CloudTrail.Model.DescribeTrailsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CloudTrail", "DescribeTrails");
     try
     {
         #if DESKTOP
         return(client.DescribeTrails(request));
         #elif CORECLR
         return(client.DescribeTrailsAsync(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;
     }
 }