Skip to content

list_indexes

list_indexes(
    *,
    config_overrides: Optional[ResourceExplorer2ClientConfig] = None,
    type: Optional[IndexType] = None,
    regions: Optional[RegionList] = None,
    max_results: Optional[int] = None,
    next_token: Optional[str] = None,
) -> ListIndexesOutput

Retrieves a list of all of the indexes in Amazon Web Services Regions that are currently collecting resource information for Amazon Web Services Resource Explorer.

Parameters:

  • type (Optional[IndexType], default: None ) –

    If specified, limits the output to only indexes of the specified Type, either LOCAL or AGGREGATOR.

    Use this option to discover the aggregator index for your account.

  • regions (Optional[RegionList], default: None ) –

    If specified, limits the response to only information about the index in the specified list of Amazon Web Services Regions.

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

    The maximum number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value appropriate to the operation. If additional items exist beyond those included in the current response, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results.

    An API operation can return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

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

    The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from. The pagination tokens expire after 24 hours.

Raises:

Source code in docs_src/capo_resource_explorer_2/_services/resource_explorer2.py
def list_indexes(
    self,
    *,
    config_overrides: Optional[ResourceExplorer2ClientConfig] = None,
    type: Optional["capo_resource_explorer_2.types.index_type.IndexType"] = None,
    regions: Optional[
        "capo_resource_explorer_2.types.region_list.RegionList"
    ] = None,
    max_results: Optional[int] = None,
    next_token: Optional[str] = None,
) -> "capo_resource_explorer_2.types.list_indexes_output.ListIndexesOutput":
    """<p>Retrieves a list of all of the indexes in Amazon Web Services Regions that are currently collecting resource information for Amazon Web Services Resource Explorer.</p>

    Args:
        type: <p>If specified, limits the output to only indexes of the specified Type, either <code>LOCAL</code> or <code>AGGREGATOR</code>.</p> <p>Use this option to discover the aggregator index for your account.</p>
        regions: <p>If specified, limits the response to only information about the index in the specified list of Amazon Web Services Regions.</p>
        max_results: <p>The maximum number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value appropriate to the operation. If additional items exist beyond those included in the current response, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results.</p> <note> <p>An API operation can return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p> </note>
        next_token: <p>The parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value of the previous call's <code>NextToken</code> response to indicate where the output should continue from. The pagination tokens expire after 24 hours.</p>

    Raises:
        capo_resource_explorer_2.errors.access_denied_exception.AccessDeniedException: <p>The credentials that you used to call this operation don't have the minimum required permissions.</p>
        capo_resource_explorer_2.errors.internal_server_exception.InternalServerException: <p>The request failed because of internal service error. Try your request again later.</p>
        capo_resource_explorer_2.errors.throttling_exception.ThrottlingException: <p>The request failed because you exceeded a rate limit for this operation. For more information, see <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html">Quotas for Resource Explorer</a>.</p>
        capo_resource_explorer_2.errors.validation_exception.ValidationException: <p>You provided an invalid value for one of the operation's parameters. Check the syntax for the operation, and try again.</p>
        capo_resource_explorer_2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_resource_explorer_2.types.list_indexes_input.ListIndexesInput]",
    ) -> OperationResponse[
        "capo_resource_explorer_2.types.list_indexes_output.ListIndexesOutput"
    ]:
        import capo_resource_explorer_2._operations.resource_explorer.list_indexes

        output, http_response = (
            capo_resource_explorer_2._operations.resource_explorer.list_indexes.list_indexes(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListIndexes")
    )
    input_: capo_resource_explorer_2.types.list_indexes_input.ListIndexesInput = {}
    if type is not None:
        input_["type"] = type
    if regions is not None:
        input_["regions"] = regions
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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