Returns the number of events of each event type (issue, scheduled change, and account notification). If no filter is specified, the counts of all events in each category are returned.
This API operation uses pagination. Specify the nextToken parameter in the next request to return more results.
Parameters:
-
filter
(Optional[EventFilter], default:
None
)
–
Values to narrow the results returned.
-
aggregate_field
(eventAggregateField)
–
The only currently supported value is eventTypeCategory.
-
max_results
(Optional[maxResults], default:
None
)
–
The maximum number of items to return in one batch, between 10 and 100, inclusive.
-
next_token
(Optional[nextToken], default:
None
)
–
If the results of a search are large, only a portion of the results are returned, and a nextToken pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.
Raises:
Source code in docs_src/capo_health/_services/health.py
| def describe_event_aggregates(
self,
aggregate_field: "capo_health.types.event_aggregate_field.eventAggregateField",
*,
config_overrides: Optional[HealthClientConfig] = None,
filter: Optional["capo_health.types.event_filter.EventFilter"] = None,
max_results: Optional["capo_health.types.max_results.maxResults"] = None,
next_token: Optional["capo_health.types.next_token.nextToken"] = None,
) -> "capo_health.types.describe_event_aggregates_response.DescribeEventAggregatesResponse":
"""<p>Returns the number of events of each event type (issue, scheduled change, and account notification). If no filter is specified, the counts of all events in each category are returned.</p> <note> <p>This API operation uses pagination. Specify the <code>nextToken</code> parameter in the next request to return more results.</p> </note>
Args:
filter: <p>Values to narrow the results returned.</p>
aggregate_field: <p>The only currently supported value is <code>eventTypeCategory</code>.</p>
max_results: <p>The maximum number of items to return in one batch, between 10 and 100, inclusive.</p>
next_token: <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next batch of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.</p>
Raises:
capo_health.errors.invalid_pagination_token.InvalidPaginationToken: <p>The specified pagination token (<code>nextToken</code>) is not valid.</p>
capo_health.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_health.types.describe_event_aggregates_request.DescribeEventAggregatesRequest]",
) -> OperationResponse[
"capo_health.types.describe_event_aggregates_response.DescribeEventAggregatesResponse"
]:
import capo_health._operations.aws_health_20160804.describe_event_aggregates
output, http_response = (
capo_health._operations.aws_health_20160804.describe_event_aggregates.describe_event_aggregates(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeEventAggregates")
)
input_: capo_health.types.describe_event_aggregates_request.DescribeEventAggregatesRequest = {
"aggregate_field": aggregate_field
}
if filter is not None:
input_["filter"] = filter
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|