Container for the parameters to the GetTrailStatus operation. Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.
Inheritance: AmazonCloudTrailRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CloudTrail.Model.GetTrailStatusRequest();

            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }

            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);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetTrailStatus operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetTrailStatus 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 EndGetTrailStatus
        ///         operation.</returns>
        public IAsyncResult BeginGetTrailStatus(GetTrailStatusRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new GetTrailStatusRequestMarshaller();
            var unmarshaller = GetTrailStatusResponseUnmarshaller.Instance;

            return BeginInvoke<GetTrailStatusRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns a JSON-formatted list of information about the specified trail. Fields include
        /// information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop
        /// logging times for each trail. This operation returns trail status from a single region.
        /// To return trail status from all regions, you must call the operation on each region.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the GetTrailStatus service method.</param>
        /// 
        /// <returns>The response from the GetTrailStatus service method, as returned by CloudTrail.</returns>
        /// <exception cref="Amazon.CloudTrail.Model.InvalidTrailNameException">
        /// This exception is thrown when the provided trail name is not valid. Trail names must
        /// meet the following requirements:
        /// 
        ///  <ul> <li>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
        /// (_), or dashes (-)</li> <li>Start with a letter or number, and end with a letter or
        /// number</li> <li>Be between 3 and 128 characters</li> <li>Have no adjacent periods,
        /// underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code>
        /// are invalid.</li> <li>Not be in IP address format (for example, 192.168.5.4)</li>
        /// </ul>
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.TrailNotFoundException">
        /// This exception is thrown when the trail with the given name is not found.
        /// </exception>
        public GetTrailStatusResponse GetTrailStatus(GetTrailStatusRequest request)
        {
            var marshaller = new GetTrailStatusRequestMarshaller();
            var unmarshaller = GetTrailStatusResponseUnmarshaller.Instance;

            return Invoke<GetTrailStatusRequest,GetTrailStatusResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the GetTrailStatus operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetTrailStatus 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<GetTrailStatusResponse> GetTrailStatusAsync(GetTrailStatusRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetTrailStatusRequestMarshaller();
            var unmarshaller = GetTrailStatusResponseUnmarshaller.Instance;

            return InvokeAsync<GetTrailStatusRequest,GetTrailStatusResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
 IAsyncResult invokeGetTrailStatus(GetTrailStatusRequest getTrailStatusRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new GetTrailStatusRequestMarshaller().Marshall(getTrailStatusRequest);
     var unmarshaller = GetTrailStatusResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// Initiates the asynchronous execution of the GetTrailStatus operation.
 /// <seealso cref="Amazon.CloudTrail.IAmazonCloudTrail.GetTrailStatus"/>
 /// </summary>
 /// 
 /// <param name="getTrailStatusRequest">Container for the necessary parameters to execute the GetTrailStatus 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 EndGetTrailStatus
 ///         operation.</returns>
 public IAsyncResult BeginGetTrailStatus(GetTrailStatusRequest getTrailStatusRequest, AsyncCallback callback, object state)
 {
     return invokeGetTrailStatus(getTrailStatusRequest, callback, state, false);
 }
 /// <summary>
 /// <para>Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and
 /// Amazon S3 errors, and start and stop logging times for each trail. </para>
 /// </summary>
 /// 
 /// <param name="getTrailStatusRequest">Container for the necessary parameters to execute the GetTrailStatus service method on
 ///          AmazonCloudTrail.</param>
 /// 
 /// <returns>The response from the GetTrailStatus service method, as returned by AmazonCloudTrail.</returns>
 /// 
 /// <exception cref="InvalidTrailNameException"/>
 /// <exception cref="TrailNotFoundException"/>
 public GetTrailStatusResponse GetTrailStatus(GetTrailStatusRequest getTrailStatusRequest)
 {
     IAsyncResult asyncResult = invokeGetTrailStatus(getTrailStatusRequest, null, null, true);
     return EndGetTrailStatus(asyncResult);
 }
Exemplo n.º 8
0
        /// <summary>
        /// <para>Returns a JSON-formatted list of information about the specified trail. Fields include information such as delivery errors, Amazon SNS
        /// and Amazon S3 errors, and times that logging started and stopped for each trail.</para>
        /// </summary>
        /// 
        /// <param name="getTrailStatusRequest">Container for the necessary parameters to execute the GetTrailStatus service method on
        /// AmazonCloudTrail.</param>
        /// 
        /// <returns>The response from the GetTrailStatus service method, as returned by AmazonCloudTrail.</returns>
        /// 
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidTrailNameException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.TrailNotFoundException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<GetTrailStatusResponse> GetTrailStatusAsync(GetTrailStatusRequest getTrailStatusRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetTrailStatusRequestMarshaller();
            var unmarshaller = GetTrailStatusResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, GetTrailStatusRequest, GetTrailStatusResponse>(getTrailStatusRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
Exemplo n.º 9
0
		internal GetTrailStatusResponse GetTrailStatus(GetTrailStatusRequest request)
        {
            var task = GetTrailStatusAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// <para>Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and
        /// Amazon S3 errors, and start and stop logging times for each trail. </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetTrailStatus service method on
        /// AmazonCloudTrail.</param>
        /// 
        /// <returns>The response from the GetTrailStatus service method, as returned by AmazonCloudTrail.</returns>
        /// 
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidTrailNameException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.TrailNotFoundException" />
		public GetTrailStatusResponse GetTrailStatus(GetTrailStatusRequest request)
        {
            var task = GetTrailStatusAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the GetTrailStatus operation.
        /// <seealso cref="Amazon.CloudTrail.IAmazonCloudTrail.GetTrailStatus"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetTrailStatus 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<GetTrailStatusResponse> GetTrailStatusAsync(GetTrailStatusRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetTrailStatusRequestMarshaller();
            var unmarshaller = GetTrailStatusResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, GetTrailStatusRequest, GetTrailStatusResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
 private Amazon.CloudTrail.Model.GetTrailStatusResponse CallAWSServiceOperation(IAmazonCloudTrail client, Amazon.CloudTrail.Model.GetTrailStatusRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CloudTrail", "GetTrailStatus");
     try
     {
         #if DESKTOP
         return(client.GetTrailStatus(request));
         #elif CORECLR
         return(client.GetTrailStatusAsync(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;
     }
 }