Skip to content

get_protection_status async

get_protection_status(
    policy_id: PolicyId,
    *,
    config_overrides: Optional[AsyncFMSClientConfig] = None,
    member_account_id: Optional[AWSAccountId] = None,
    start_time: Optional[TimeStamp] = None,
    end_time: Optional[TimeStamp] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[PaginationMaxResults] = None,
) -> GetProtectionStatusResponse

If you created a Shield Advanced policy, returns policy-level attack summary information in the event of a potential DDoS attack. Other policy types are currently unsupported.

Parameters:

  • policy_id (PolicyId) –

    The ID of the policy for which you want to get the attack information.

  • member_account_id (Optional[AWSAccountId], default: None ) –

    The Amazon Web Services account that is in scope of the policy that you want to get the details for.

  • start_time (Optional[TimeStamp], default: None ) –

    The start of the time period to query for the attacks. This is a timestamp type. The request syntax listing indicates a number type because the default used by Firewall Manager is Unix time in seconds. However, any valid timestamp format is allowed.

  • end_time (Optional[TimeStamp], default: None ) –

    The end of the time period to query for the attacks. This is a timestamp type. The request syntax listing indicates a number type because the default used by Firewall Manager is Unix time in seconds. However, any valid timestamp format is allowed.

  • next_token (Optional[PaginationToken], default: None ) –

    If you specify a value for MaxResults and you have more objects than the number that you specify for MaxResults, Firewall Manager returns a NextToken value in the response, which you can use to retrieve another group of objects. For the second and subsequent GetProtectionStatus requests, specify the value of NextToken from the previous response to get information about another batch of objects.

  • max_results (Optional[PaginationMaxResults], default: None ) –

    Specifies the number of objects that you want Firewall Manager to return for this request. If you have more objects than the number that you specify for MaxResults, the response includes a NextToken value that you can use to get another batch of objects.

Raises:

Source code in docs_src/capo_fms/_services/async_fms.py
async def get_protection_status(
    self,
    policy_id: "capo_fms.types.policy_id.PolicyId",
    *,
    config_overrides: Optional[AsyncFMSClientConfig] = None,
    member_account_id: Optional[
        "capo_fms.types.aws_account_id.AWSAccountId"
    ] = None,
    start_time: Optional["capo_fms.types.time_stamp.TimeStamp"] = None,
    end_time: Optional["capo_fms.types.time_stamp.TimeStamp"] = None,
    next_token: Optional["capo_fms.types.pagination_token.PaginationToken"] = None,
    max_results: Optional[
        "capo_fms.types.pagination_max_results.PaginationMaxResults"
    ] = None,
) -> "capo_fms.types.get_protection_status_response.GetProtectionStatusResponse":
    """<p>If you created a Shield Advanced policy, returns policy-level attack summary information in the event of a potential DDoS attack. Other policy types are currently unsupported.</p>

    Args:
        policy_id: <p>The ID of the policy for which you want to get the attack information.</p>
        member_account_id: <p>The Amazon Web Services account that is in scope of the policy that you want to get the details for.</p>
        start_time: <p>The start of the time period to query for the attacks. This is a <code>timestamp</code> type. The request syntax listing indicates a <code>number</code> type because the default used by Firewall Manager is Unix time in seconds. However, any valid <code>timestamp</code> format is allowed.</p>
        end_time: <p>The end of the time period to query for the attacks. This is a <code>timestamp</code> type. The request syntax listing indicates a <code>number</code> type because the default used by Firewall Manager is Unix time in seconds. However, any valid <code>timestamp</code> format is allowed.</p>
        next_token: <p>If you specify a value for <code>MaxResults</code> and you have more objects than the number that you specify for <code>MaxResults</code>, Firewall Manager returns a <code>NextToken</code> value in the response, which you can use to retrieve another group of objects. For the second and subsequent <code>GetProtectionStatus</code> requests, specify the value of <code>NextToken</code> from the previous response to get information about another batch of objects.</p>
        max_results: <p>Specifies the number of objects that you want Firewall Manager to return for this request. If you have more objects than the number that you specify for <code>MaxResults</code>, the response includes a <code>NextToken</code> value that you can use to get another batch of objects.</p>

    Raises:
        capo_fms.errors.internal_error_exception.InternalErrorException: <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
        capo_fms.errors.invalid_input_exception.InvalidInputException: <p>The parameters of the request were invalid.</p>
        capo_fms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_fms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_fms.types.get_protection_status_request.GetProtectionStatusRequest]",
    ) -> AsyncOperationResponse[
        "capo_fms.types.get_protection_status_response.GetProtectionStatusResponse"
    ]:
        import capo_fms._operations.awsfms_20180101.get_protection_status

        (
            output,
            http_response,
        ) = await capo_fms._operations.awsfms_20180101.get_protection_status.async_get_protection_status(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetProtectionStatus")
    )
    input_: capo_fms.types.get_protection_status_request.GetProtectionStatusRequest = {
        "policy_id": policy_id
    }
    if member_account_id is not None:
        input_["member_account_id"] = member_account_id
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output