Skip to content

list_connectors

list_connectors(
    *,
    config_overrides: Optional[Inspector2ClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[ConnectorNextToken] = None,
    filter_criteria: Optional[ConnectorFilterCriteria] = None,
) -> ListConnectorsResponse

Lists connectors in your account. Results are paginated. Use the nextToken parameter to retrieve the next page of results.

Parameters:

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

    The maximum number of results to return in a single call. To retrieve the remaining results, make another request with the nextToken value returned from this request.

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

    A token to use for paginating results. Set this value to null for the first request. For subsequent calls, use the nextToken value returned from the previous request.

  • filter_criteria (Optional[ConnectorFilterCriteria], default: None ) –

    The filter criteria to apply to the list of connectors.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

    For Enable, you receive this error if you attempt to use a feature in an unsupported Amazon Web Services Region.

  • InternalServerException –

    The request has failed due to an internal failure of the Amazon Inspector service.

  • ThrottlingException –

    The limit on the number of requests per second was exceeded.

  • ValidationException –

    The request has failed validation due to missing required fields or having invalid inputs.

  • UnknownServiceError –

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

Examples:

List all Azure customer-managed connectors

>>> client.list_connectors(max_results=10, filter_criteria={'provider': [{'comparison': 'EQUALS', 'value': 'AZURE'}], 'connectorType': [{'comparison': 'EQUALS', 'value': 'CUSTOMER_MANAGED'}]})
Source code in docs_src/capo_inspector2/_services/inspector2.py
def list_connectors(
    self,
    *,
    config_overrides: Optional[Inspector2ClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[
        "capo_inspector2.types.connector_next_token.ConnectorNextToken"
    ] = None,
    filter_criteria: Optional[
        "capo_inspector2.types.connector_filter_criteria.ConnectorFilterCriteria"
    ] = None,
) -> "capo_inspector2.types.list_connectors_response.ListConnectorsResponse":
    """<p>Lists connectors in your account. Results are paginated. Use the <code>nextToken</code> parameter to retrieve the next page of results.</p>

    Args:
        max_results: <p>The maximum number of results to return in a single call. To retrieve the remaining results, make another request with the <code>nextToken</code> value returned from this request.</p>
        next_token: <p>A token to use for paginating results. Set this value to null for the first request. For subsequent calls, use the <code>nextToken</code> value returned from the previous request.</p>
        filter_criteria: <p>The filter criteria to apply to the list of connectors.</p>

    Raises:
        capo_inspector2.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p> <p> For <code>Enable</code>, you receive this error if you attempt to use a feature in an unsupported Amazon Web Services Region. </p>
        capo_inspector2.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal failure of the Amazon Inspector service.</p>
        capo_inspector2.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_inspector2.errors.validation_exception.ValidationException: <p>The request has failed validation due to missing required fields or having invalid inputs.</p>
        capo_inspector2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List all Azure customer-managed connectors

        >>> client.list_connectors(max_results=10, filter_criteria={'provider': [{'comparison': 'EQUALS', 'value': 'AZURE'}], 'connectorType': [{'comparison': 'EQUALS', 'value': 'CUSTOMER_MANAGED'}]})
    """

    def _handler(
        req: "OperationRequest[capo_inspector2.types.list_connectors_request.ListConnectorsRequest]",
    ) -> OperationResponse[
        "capo_inspector2.types.list_connectors_response.ListConnectorsResponse"
    ]:
        import capo_inspector2._operations.inspector2.list_connectors

        output, http_response = (
            capo_inspector2._operations.inspector2.list_connectors.list_connectors(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_inspector2.types.list_connectors_request.ListConnectorsRequest",
    ) -> dict[str, Any]:
        import capo_inspector2.types.list_connectors_request

        return capo_inspector2.types.list_connectors_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_inspector2.types.list_connectors_response.ListConnectorsResponse",
    ) -> dict[str, Any]:
        import capo_inspector2.types.list_connectors_response

        return capo_inspector2.types.list_connectors_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListConnectors",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_inspector2.types.list_connectors_request.ListConnectorsRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if filter_criteria is not None:
        input_["filter_criteria"] = filter_criteria

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output