Container for the parameters to the GetTraceSummaries operation. Retrieves IDs and metadata for traces available for a specified time frame using an optional filter. To get the full traces, pass the trace IDs to BatchGetTraces.
Inheritance: AmazonXRayRequest
示例#1
0
 private Amazon.XRay.Model.GetTraceSummariesResponse CallAWSServiceOperation(IAmazonXRay client, Amazon.XRay.Model.GetTraceSummariesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS X-Ray", "GetTraceSummaries");
     try
     {
         #if DESKTOP
         return(client.GetTraceSummaries(request));
         #elif CORECLR
         return(client.GetTraceSummariesAsync(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;
     }
 }
示例#2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;

            #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
            var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent;
            #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute

            // create request and set iteration invariants
            var request = new Amazon.XRay.Model.GetTraceSummariesRequest();

            if (cmdletContext.EndTime != null)
            {
                request.EndTime = cmdletContext.EndTime.Value;
            }
            if (cmdletContext.FilterExpression != null)
            {
                request.FilterExpression = cmdletContext.FilterExpression;
            }
            if (cmdletContext.Sampling != null)
            {
                request.Sampling = cmdletContext.Sampling.Value;
            }

            // populate SamplingStrategy
            var requestSamplingStrategyIsNull = true;
            request.SamplingStrategy = new Amazon.XRay.Model.SamplingStrategy();
            Amazon.XRay.SamplingStrategyName requestSamplingStrategy_samplingStrategy_Name = null;
            if (cmdletContext.SamplingStrategy_Name != null)
            {
                requestSamplingStrategy_samplingStrategy_Name = cmdletContext.SamplingStrategy_Name;
            }
            if (requestSamplingStrategy_samplingStrategy_Name != null)
            {
                request.SamplingStrategy.Name = requestSamplingStrategy_samplingStrategy_Name;
                requestSamplingStrategyIsNull = false;
            }
            System.Double?requestSamplingStrategy_samplingStrategy_Value = null;
            if (cmdletContext.SamplingStrategy_Value != null)
            {
                requestSamplingStrategy_samplingStrategy_Value = cmdletContext.SamplingStrategy_Value.Value;
            }
            if (requestSamplingStrategy_samplingStrategy_Value != null)
            {
                request.SamplingStrategy.Value = requestSamplingStrategy_samplingStrategy_Value.Value;
                requestSamplingStrategyIsNull  = false;
            }
            // determine if request.SamplingStrategy should be set to null
            if (requestSamplingStrategyIsNull)
            {
                request.SamplingStrategy = null;
            }
            if (cmdletContext.StartTime != null)
            {
                request.StartTime = cmdletContext.StartTime.Value;
            }
            if (cmdletContext.TimeRangeType != null)
            {
                request.TimeRangeType = cmdletContext.TimeRangeType;
            }

            // Initialize loop variant and commence piping
            var _nextToken             = cmdletContext.NextToken;
            var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken));

            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);
            do
            {
                request.NextToken = _nextToken;

                CmdletOutput output;

                try
                {
                    var response = CallAWSServiceOperation(client, request);

                    object pipelineOutput = null;
                    if (!useParameterSelect)
                    {
                        pipelineOutput = cmdletContext.Select(response, this);
                    }
                    output = new CmdletOutput
                    {
                        PipelineOutput  = pipelineOutput,
                        ServiceResponse = response
                    };

                    _nextToken = response.NextToken;
                }
                catch (Exception e)
                {
                    output = new CmdletOutput {
                        ErrorResponse = e
                    };
                }

                ProcessOutput(output);
            } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken));

            if (useParameterSelect)
            {
                WriteObject(cmdletContext.Select(null, this));
            }


            return(null);
        }
示例#3
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.XRay.Model.GetTraceSummariesRequest();

            if (cmdletContext.EndTime != null)
            {
                request.EndTime = cmdletContext.EndTime.Value;
            }
            if (cmdletContext.FilterExpression != null)
            {
                request.FilterExpression = cmdletContext.FilterExpression;
            }
            if (cmdletContext.NextToken != null)
            {
                request.NextToken = cmdletContext.NextToken;
            }
            if (cmdletContext.Sampling != null)
            {
                request.Sampling = cmdletContext.Sampling.Value;
            }

            // populate SamplingStrategy
            var requestSamplingStrategyIsNull = true;

            request.SamplingStrategy = new Amazon.XRay.Model.SamplingStrategy();
            Amazon.XRay.SamplingStrategyName requestSamplingStrategy_samplingStrategy_Name = null;
            if (cmdletContext.SamplingStrategy_Name != null)
            {
                requestSamplingStrategy_samplingStrategy_Name = cmdletContext.SamplingStrategy_Name;
            }
            if (requestSamplingStrategy_samplingStrategy_Name != null)
            {
                request.SamplingStrategy.Name = requestSamplingStrategy_samplingStrategy_Name;
                requestSamplingStrategyIsNull = false;
            }
            System.Double?requestSamplingStrategy_samplingStrategy_Value = null;
            if (cmdletContext.SamplingStrategy_Value != null)
            {
                requestSamplingStrategy_samplingStrategy_Value = cmdletContext.SamplingStrategy_Value.Value;
            }
            if (requestSamplingStrategy_samplingStrategy_Value != null)
            {
                request.SamplingStrategy.Value = requestSamplingStrategy_samplingStrategy_Value.Value;
                requestSamplingStrategyIsNull  = false;
            }
            // determine if request.SamplingStrategy should be set to null
            if (requestSamplingStrategyIsNull)
            {
                request.SamplingStrategy = null;
            }
            if (cmdletContext.StartTime != null)
            {
                request.StartTime = cmdletContext.StartTime.Value;
            }
            if (cmdletContext.TimeRangeType != null)
            {
                request.TimeRangeType = cmdletContext.TimeRangeType;
            }

            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);
        }
 internal GetTraceSummariesPaginator(IAmazonXRay client, GetTraceSummariesRequest request)
 {
     this._client  = client;
     this._request = request;
 }
示例#5
0
 /// <summary>
 /// Paginator for GetTraceSummaries operation
 ///</summary>
 public IGetTraceSummariesPaginator GetTraceSummaries(GetTraceSummariesRequest request)
 {
     return(new GetTraceSummariesPaginator(this.client, request));
 }
示例#6
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetTraceSummaries operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetTraceSummaries operation on AmazonXRayClient.</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 EndGetTraceSummaries
        ///         operation.</returns>
        public IAsyncResult BeginGetTraceSummaries(GetTraceSummariesRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new GetTraceSummariesRequestMarshaller();
            var unmarshaller = GetTraceSummariesResponseUnmarshaller.Instance;

            return BeginInvoke<GetTraceSummariesRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
示例#7
0
        /// <summary>
        /// Retrieves IDs and metadata for traces available for a specified time frame using an
        /// optional filter. To get the full traces, pass the trace IDs to <code>BatchGetTraces</code>.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the GetTraceSummaries service method.</param>
        /// 
        /// <returns>The response from the GetTraceSummaries service method, as returned by XRay.</returns>
        /// <exception cref="Amazon.XRay.Model.InvalidRequestException">
        /// The request is missing required parameters or has invalid parameters.
        /// </exception>
        /// <exception cref="Amazon.XRay.Model.ThrottledException">
        /// The request exceeds the maximum number of requests per second.
        /// </exception>
        public GetTraceSummariesResponse GetTraceSummaries(GetTraceSummariesRequest request)
        {
            var marshaller = new GetTraceSummariesRequestMarshaller();
            var unmarshaller = GetTraceSummariesResponseUnmarshaller.Instance;

            return Invoke<GetTraceSummariesRequest,GetTraceSummariesResponse>(request, marshaller, unmarshaller);
        }
示例#8
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetTraceSummaries operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetTraceSummaries 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<GetTraceSummariesResponse> GetTraceSummariesAsync(GetTraceSummariesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetTraceSummariesRequestMarshaller();
            var unmarshaller = GetTraceSummariesResponseUnmarshaller.Instance;

            return InvokeAsync<GetTraceSummariesRequest,GetTraceSummariesResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }