Container for the parameters to the DescribeAffectedEntities operation. Gets a list of entities that have been attached to events, based on the specified filter criteria. Entities can refer to individual customer resources, groups of customer resources, or any other construct, depending on the AWS service. Events that have impact beyond that of the attached entities, or where the extent of impact is unknown, include at least one entity indicating this. If no filter criteria are specified, all entities are returned. Results are sorted by the lastUpdatedTime of the entity, starting with the most recent.
Inheritance: AmazonAWSHealthRequest
コード例 #1
0
 /// <summary>
 /// Paginator for DescribeAffectedEntities operation
 ///</summary>
 public IDescribeAffectedEntitiesPaginator DescribeAffectedEntities(DescribeAffectedEntitiesRequest request)
 {
     return(new DescribeAffectedEntitiesPaginator(this.client, request));
 }
コード例 #2
0
 private Amazon.AWSHealth.Model.DescribeAffectedEntitiesResponse CallAWSServiceOperation(IAmazonAWSHealth client, Amazon.AWSHealth.Model.DescribeAffectedEntitiesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Health", "DescribeAffectedEntities");
     try
     {
         #if DESKTOP
         return(client.DescribeAffectedEntities(request));
         #elif CORECLR
         return(client.DescribeAffectedEntitiesAsync(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;
     }
 }
コード例 #3
0
 internal DescribeAffectedEntitiesPaginator(IAmazonAWSHealth client, DescribeAffectedEntitiesRequest request)
 {
     this._client  = client;
     this._request = request;
 }
コード例 #4
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext      = context as CmdletContext;
            var useParameterSelect = this.Select.StartsWith("^");

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

            // populate Filter
            var requestFilterIsNull = true;

            request.Filter = new Amazon.AWSHealth.Model.EntityFilter();
            List <System.String> requestFilter_filter_EntityArn = null;

            if (cmdletContext.Filter_EntityArn != null)
            {
                requestFilter_filter_EntityArn = cmdletContext.Filter_EntityArn;
            }
            if (requestFilter_filter_EntityArn != null)
            {
                request.Filter.EntityArns = requestFilter_filter_EntityArn;
                requestFilterIsNull       = false;
            }
            List <System.String> requestFilter_filter_EntityValue = null;

            if (cmdletContext.Filter_EntityValue != null)
            {
                requestFilter_filter_EntityValue = cmdletContext.Filter_EntityValue;
            }
            if (requestFilter_filter_EntityValue != null)
            {
                request.Filter.EntityValues = requestFilter_filter_EntityValue;
                requestFilterIsNull         = false;
            }
            List <System.String> requestFilter_filter_EventArn = null;

            if (cmdletContext.Filter_EventArn != null)
            {
                requestFilter_filter_EventArn = cmdletContext.Filter_EventArn;
            }
            if (requestFilter_filter_EventArn != null)
            {
                request.Filter.EventArns = requestFilter_filter_EventArn;
                requestFilterIsNull      = false;
            }
            List <Amazon.AWSHealth.Model.DateTimeRange> requestFilter_filter_LastUpdatedTime = null;

            if (cmdletContext.Filter_LastUpdatedTime != null)
            {
                requestFilter_filter_LastUpdatedTime = cmdletContext.Filter_LastUpdatedTime;
            }
            if (requestFilter_filter_LastUpdatedTime != null)
            {
                request.Filter.LastUpdatedTimes = requestFilter_filter_LastUpdatedTime;
                requestFilterIsNull             = false;
            }
            List <System.String> requestFilter_filter_StatusCode = null;

            if (cmdletContext.Filter_StatusCode != null)
            {
                requestFilter_filter_StatusCode = cmdletContext.Filter_StatusCode;
            }
            if (requestFilter_filter_StatusCode != null)
            {
                request.Filter.StatusCodes = requestFilter_filter_StatusCode;
                requestFilterIsNull        = false;
            }
            List <Dictionary <System.String, System.String> > requestFilter_filter_Tag = null;

            if (cmdletContext.Filter_Tag != null)
            {
                requestFilter_filter_Tag = cmdletContext.Filter_Tag;
            }
            if (requestFilter_filter_Tag != null)
            {
                request.Filter.Tags = requestFilter_filter_Tag;
                requestFilterIsNull = false;
            }
            // determine if request.Filter should be set to null
            if (requestFilterIsNull)
            {
                request.Filter = null;
            }
            if (cmdletContext.Locale != null)
            {
                request.Locale = cmdletContext.Locale;
            }

            // Initialize loop variants and commence piping
            System.String _nextToken      = null;
            int?          _emitLimit      = null;
            int           _retrievedSoFar = 0;

            if (AutoIterationHelpers.HasValue(cmdletContext.NextToken))
            {
                _nextToken = cmdletContext.NextToken;
            }
            if (cmdletContext.MaxResult.HasValue)
            {
                // The service has a maximum page size of 100. If the user has
                // asked for more items than page max, and there is no page size
                // configured, we rely on the service ignoring the set maximum
                // and giving us 100 items back. If a page size is set, that will
                // be used to configure the pagination.
                // We'll make further calls to satisfy the user's request.
                _emitLimit = cmdletContext.MaxResult;
            }
            var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken));

            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            do
            {
                request.NextToken = _nextToken;
                if (_emitLimit.HasValue)
                {
                    int correctPageSize = Math.Min(100, _emitLimit.Value);
                    request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToInt32(correctPageSize);
                }

                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
                    };
                    int _receivedThisCall = response.Entities.Count;

                    _nextToken       = response.NextToken;
                    _retrievedSoFar += _receivedThisCall;
                    if (_emitLimit.HasValue)
                    {
                        _emitLimit -= _receivedThisCall;
                    }
                }
                catch (Exception e)
                {
                    if (_retrievedSoFar == 0 || !_emitLimit.HasValue)
                    {
                        output = new CmdletOutput {
                            ErrorResponse = e
                        };
                    }
                    else
                    {
                        break;
                    }
                }

                ProcessOutput(output);
            } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken) && (!_emitLimit.HasValue || _emitLimit.Value >= 10));


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


            return(null);
        }
コード例 #5
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext      = context as CmdletContext;
            var useParameterSelect = this.Select.StartsWith("^");

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


            // populate Filter
            var requestFilterIsNull = true;

            request.Filter = new Amazon.AWSHealth.Model.EntityFilter();
            List <System.String> requestFilter_filter_EntityArn = null;

            if (cmdletContext.Filter_EntityArn != null)
            {
                requestFilter_filter_EntityArn = cmdletContext.Filter_EntityArn;
            }
            if (requestFilter_filter_EntityArn != null)
            {
                request.Filter.EntityArns = requestFilter_filter_EntityArn;
                requestFilterIsNull       = false;
            }
            List <System.String> requestFilter_filter_EntityValue = null;

            if (cmdletContext.Filter_EntityValue != null)
            {
                requestFilter_filter_EntityValue = cmdletContext.Filter_EntityValue;
            }
            if (requestFilter_filter_EntityValue != null)
            {
                request.Filter.EntityValues = requestFilter_filter_EntityValue;
                requestFilterIsNull         = false;
            }
            List <System.String> requestFilter_filter_EventArn = null;

            if (cmdletContext.Filter_EventArn != null)
            {
                requestFilter_filter_EventArn = cmdletContext.Filter_EventArn;
            }
            if (requestFilter_filter_EventArn != null)
            {
                request.Filter.EventArns = requestFilter_filter_EventArn;
                requestFilterIsNull      = false;
            }
            List <Amazon.AWSHealth.Model.DateTimeRange> requestFilter_filter_LastUpdatedTime = null;

            if (cmdletContext.Filter_LastUpdatedTime != null)
            {
                requestFilter_filter_LastUpdatedTime = cmdletContext.Filter_LastUpdatedTime;
            }
            if (requestFilter_filter_LastUpdatedTime != null)
            {
                request.Filter.LastUpdatedTimes = requestFilter_filter_LastUpdatedTime;
                requestFilterIsNull             = false;
            }
            List <System.String> requestFilter_filter_StatusCode = null;

            if (cmdletContext.Filter_StatusCode != null)
            {
                requestFilter_filter_StatusCode = cmdletContext.Filter_StatusCode;
            }
            if (requestFilter_filter_StatusCode != null)
            {
                request.Filter.StatusCodes = requestFilter_filter_StatusCode;
                requestFilterIsNull        = false;
            }
            List <Dictionary <System.String, System.String> > requestFilter_filter_Tag = null;

            if (cmdletContext.Filter_Tag != null)
            {
                requestFilter_filter_Tag = cmdletContext.Filter_Tag;
            }
            if (requestFilter_filter_Tag != null)
            {
                request.Filter.Tags = requestFilter_filter_Tag;
                requestFilterIsNull = false;
            }
            // determine if request.Filter should be set to null
            if (requestFilterIsNull)
            {
                request.Filter = null;
            }
            if (cmdletContext.Locale != null)
            {
                request.Locale = cmdletContext.Locale;
            }
            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToServiceTypeInt32(cmdletContext.MaxResult.Value);
            }

            // 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);
        }
コード例 #6
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeAffectedEntities operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeAffectedEntities 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<DescribeAffectedEntitiesResponse> DescribeAffectedEntitiesAsync(DescribeAffectedEntitiesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeAffectedEntitiesRequestMarshaller();
            var unmarshaller = DescribeAffectedEntitiesResponseUnmarshaller.Instance;

            return InvokeAsync<DescribeAffectedEntitiesRequest,DescribeAffectedEntitiesResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #7
0
        /// <summary>
        /// Gets a list of entities that have been attached to events, based on the specified
        /// filter criteria. Entities can refer to individual customer resources, groups of customer
        /// resources, or any other construct, depending on the AWS service. Events that have
        /// impact beyond that of the attached entities, or where the extent of impact is unknown,
        /// include at least one entity indicating this. If no filter criteria are specified,
        /// all entities are returned. Results are sorted by the <code>lastUpdatedTime</code>
        /// of the entity, starting with the most recent.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeAffectedEntities service method.</param>
        /// 
        /// <returns>The response from the DescribeAffectedEntities service method, as returned by AWSHealth.</returns>
        /// <exception cref="Amazon.AWSHealth.Model.InvalidPaginationTokenException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.AWSHealth.Model.UnsupportedLocaleException">
        /// 
        /// </exception>
        public DescribeAffectedEntitiesResponse DescribeAffectedEntities(DescribeAffectedEntitiesRequest request)
        {
            var marshaller = new DescribeAffectedEntitiesRequestMarshaller();
            var unmarshaller = DescribeAffectedEntitiesResponseUnmarshaller.Instance;

            return Invoke<DescribeAffectedEntitiesRequest,DescribeAffectedEntitiesResponse>(request, marshaller, unmarshaller);
        }
コード例 #8
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeAffectedEntities operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeAffectedEntities operation on AmazonAWSHealthClient.</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 EndDescribeAffectedEntities
        ///         operation.</returns>
        public IAsyncResult BeginDescribeAffectedEntities(DescribeAffectedEntitiesRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DescribeAffectedEntitiesRequestMarshaller();
            var unmarshaller = DescribeAffectedEntitiesResponseUnmarshaller.Instance;

            return BeginInvoke<DescribeAffectedEntitiesRequest>(request, marshaller, unmarshaller,
                callback, state);
        }