Skip to content

list_related_resources_for_audit_finding async

list_related_resources_for_audit_finding(
    finding_id: FindingId,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListRelatedResourcesForAuditFindingResponse

The related resources of an Audit finding. The following resources can be returned from calling this API:

  • DEVICE_CERTIFICATE

  • CA_CERTIFICATE

  • IOT_POLICY

  • COGNITO_IDENTITY_POOL

  • CLIENT_ID

  • ACCOUNT_SETTINGS

  • ROLE_ALIAS

  • IAM_ROLE

  • ISSUER_CERTIFICATE

This API is similar to DescribeAuditFinding's RelatedResources but provides pagination and is not limited to 10 resources. When calling DescribeAuditFinding for the intermediate CA revoked for active device certificates check, RelatedResources will not be populated. You must use this API, ListRelatedResourcesForAuditFinding, to list the certificates.

Parameters:

  • finding_id (FindingId) –

    The finding Id.

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

    A token that can be used to retrieve the next set of results, or null if there are no additional results.

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

    The maximum number of results to return at one time.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def list_related_resources_for_audit_finding(
    self,
    finding_id: "capo_iot.types.finding_id.FindingId",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    next_token: Optional["capo_iot.types.next_token.NextToken"] = None,
    max_results: Optional["capo_iot.types.max_results.MaxResults"] = None,
) -> "capo_iot.types.list_related_resources_for_audit_finding_response.ListRelatedResourcesForAuditFindingResponse":
    """<p>The related resources of an Audit finding. The following resources can be returned from calling this API:</p> <ul> <li> <p>DEVICE_CERTIFICATE</p> </li> <li> <p>CA_CERTIFICATE</p> </li> <li> <p>IOT_POLICY</p> </li> <li> <p>COGNITO_IDENTITY_POOL</p> </li> <li> <p>CLIENT_ID</p> </li> <li> <p>ACCOUNT_SETTINGS</p> </li> <li> <p>ROLE_ALIAS</p> </li> <li> <p>IAM_ROLE</p> </li> <li> <p>ISSUER_CERTIFICATE</p> </li> </ul> <note> <p>This API is similar to DescribeAuditFinding's <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeAuditFinding.html">RelatedResources</a> but provides pagination and is not limited to 10 resources. When calling <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeAuditFinding.html">DescribeAuditFinding</a> for the intermediate CA revoked for active device certificates check, RelatedResources will not be populated. You must use this API, ListRelatedResourcesForAuditFinding, to list the certificates.</p> </note>

    Args:
        finding_id: <p>The finding Id.</p>
        next_token: <p>A token that can be used to retrieve the next set of results, or <code>null</code> if there are no additional results.</p>
        max_results: <p>The maximum number of results to return at one time.</p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.list_related_resources_for_audit_finding_request.ListRelatedResourcesForAuditFindingRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.list_related_resources_for_audit_finding_response.ListRelatedResourcesForAuditFindingResponse"
    ]:
        import capo_iot._operations.aws_iot_service.list_related_resources_for_audit_finding

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.list_related_resources_for_audit_finding.async_list_related_resources_for_audit_finding(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRelatedResourcesForAuditFinding")
    )
    input_: capo_iot.types.list_related_resources_for_audit_finding_request.ListRelatedResourcesForAuditFindingRequest = {
        "finding_id": finding_id
    }
    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