Skip to content

update_findings async

update_findings(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    filters: Optional[AwsSecurityFindingFilters] = None,
    note: Optional[NoteUpdate] = None,
    record_state: Optional[RecordState] = None,
) -> UpdateFindingsResponse

UpdateFindings is a deprecated operation. Instead of UpdateFindings, use the BatchUpdateFindings operation.

The UpdateFindings operation updates the Note and RecordState of the Security Hub CSPM aggregated findings that the filter attributes specify. Any member account that can view the finding can also see the update to the finding.

Finding updates made with UpdateFindings aren't persisted if the same finding is later updated by the finding provider through the BatchImportFindings operation. In addition, Security Hub CSPM doesn't record updates made with UpdateFindings in the finding history.

Parameters:

Raises:

  • InternalException –

    Internal server error.

  • InvalidAccessException –

    The account doesn't have permission to perform this action.

  • InvalidInputException –

    The request was rejected because you supplied an invalid or out-of-range value for an input parameter.

  • LimitExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.

  • ResourceNotFoundException –

    The request was rejected because we can't find the specified resource.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def update_findings(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    filters: Optional[
        "capo_securityhub.types.aws_security_finding_filters.AwsSecurityFindingFilters"
    ] = None,
    note: Optional["capo_securityhub.types.note_update.NoteUpdate"] = None,
    record_state: Optional[
        "capo_securityhub.types.record_state.RecordState"
    ] = None,
) -> "capo_securityhub.types.update_findings_response.UpdateFindingsResponse":
    """<p> <code>UpdateFindings</code> is a deprecated operation. Instead of <code>UpdateFindings</code>, use the <code>BatchUpdateFindings</code> operation.</p> <p>The <code>UpdateFindings</code> operation updates the <code>Note</code> and <code>RecordState</code> of the Security Hub CSPM aggregated findings that the filter attributes specify. Any member account that can view the finding can also see the update to the finding.</p> <p>Finding updates made with <code>UpdateFindings</code> aren't persisted if the same finding is later updated by the finding provider through the <code>BatchImportFindings</code> operation. In addition, Security Hub CSPM doesn't record updates made with <code>UpdateFindings</code> in the finding history.</p>

    Args:
        filters: <p>A collection of attributes that specify which findings you want to update.</p>
        note: <p>The updated note for the finding.</p>
        record_state: <p>The updated record state for the finding.</p>

    Raises:
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.</p>
        capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.update_findings_request.UpdateFindingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.update_findings_response.UpdateFindingsResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.update_findings

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.update_findings.async_update_findings(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateFindings")
    )
    input_: capo_securityhub.types.update_findings_request.UpdateFindingsRequest = {}
    if filters is not None:
        input_["filters"] = filters
    if note is not None:
        input_["note"] = note
    if record_state is not None:
        input_["record_state"] = record_state

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