Provides information about the number and type of attacks Shield has detected in the last year for all resources that belong to your account, regardless of whether you've defined Shield protections for them. This operation is available to Shield customers as well as to Shield Advanced customers.
The operation returns data for the time range of midnight UTC, one year ago, to midnight UTC, today. For example, if the current time is 2020-10-26 15:39:32 PDT, equal to 2020-10-26 22:39:32 UTC, then the time range for the attack data returned is from 2019-10-26 00:00:00 UTC to 2020-10-26 00:00:00 UTC.
The time range indicates the period covered by the attack statistics data items.
Raises:
-
InternalErrorException
–
Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_shield/_services/async_shield.py
| async def describe_attack_statistics(
self, *, config_overrides: Optional[AsyncShieldClientConfig] = None
) -> "capo_shield.types.describe_attack_statistics_response.DescribeAttackStatisticsResponse":
"""<p>Provides information about the number and type of attacks Shield has detected in the last year for all resources that belong to your account, regardless of whether you've defined Shield protections for them. This operation is available to Shield customers as well as to Shield Advanced customers.</p> <p>The operation returns data for the time range of midnight UTC, one year ago, to midnight UTC, today. For example, if the current time is <code>2020-10-26 15:39:32 PDT</code>, equal to <code>2020-10-26 22:39:32 UTC</code>, then the time range for the attack data returned is from <code>2019-10-26 00:00:00 UTC</code> to <code>2020-10-26 00:00:00 UTC</code>. </p> <p>The time range indicates the period covered by the attack statistics data items.</p>
Raises:
capo_shield.errors.internal_error_exception.InternalErrorException: <p>Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.</p>
capo_shield.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_shield.types.describe_attack_statistics_request.DescribeAttackStatisticsRequest]",
) -> AsyncOperationResponse[
"capo_shield.types.describe_attack_statistics_response.DescribeAttackStatisticsResponse"
]:
import capo_shield._operations.aws_shield_20160616.describe_attack_statistics
(
output,
http_response,
) = await capo_shield._operations.aws_shield_20160616.describe_attack_statistics.async_describe_attack_statistics(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeAttackStatistics")
)
input_: capo_shield.types.describe_attack_statistics_request.DescribeAttackStatisticsRequest = {}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|