Skip to content

search_entities

search_entities(
    entity_types: EntityTypes,
    *,
    config_overrides: Optional[IoTThingsGraphClientConfig] = None,
    filters: Optional[EntityFilters] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    namespace_version: Optional[Version] = None,
) -> SearchEntitiesResponse

Searches for entities of the specified type. You can search for entities in your namespace and the public namespace that you're tracking.

Parameters:

  • entity_types (EntityTypes) –

    The entity types for which to search.

  • filters (Optional[EntityFilters], default: None ) –

    Optional filter to apply to the search. Valid filters are NAME NAMESPACE, SEMANTIC_TYPE_PATH and REFERENCED_ENTITY_ID. REFERENCED_ENTITY_ID filters on entities that are used by the entity in the result set. For example, you can filter on the ID of a property that is used in a state.

    Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.

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

    The string that specifies the next page of results. Use this when you're paginating results.

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

    The maximum number of results to return in the response.

  • namespace_version (Optional[Version], default: None ) –

    The version of the user's namespace. Defaults to the latest version of the user's namespace.

Raises:

Source code in docs_src/capo_iotthingsgraph/_services/io_t_things_graph.py
def search_entities(
    self,
    entity_types: "capo_iotthingsgraph.types.entity_types.EntityTypes",
    *,
    config_overrides: Optional[IoTThingsGraphClientConfig] = None,
    filters: Optional[
        "capo_iotthingsgraph.types.entity_filters.EntityFilters"
    ] = None,
    next_token: Optional["capo_iotthingsgraph.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_iotthingsgraph.types.max_results.MaxResults"
    ] = None,
    namespace_version: Optional["capo_iotthingsgraph.types.version.Version"] = None,
) -> "capo_iotthingsgraph.types.search_entities_response.SearchEntitiesResponse":
    """<p>Searches for entities of the specified type. You can search for entities in your namespace and the public namespace that you're tracking.</p>

    Args:
        entity_types: <p>The entity types for which to search.</p>
        filters: <p>Optional filter to apply to the search. Valid filters are <code>NAME</code> <code>NAMESPACE</code>, <code>SEMANTIC_TYPE_PATH</code> and <code>REFERENCED_ENTITY_ID</code>. <code>REFERENCED_ENTITY_ID</code> filters on entities that are used by the entity in the result set. For example, you can filter on the ID of a property that is used in a state.</p> <p>Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.</p>
        next_token: <p>The string that specifies the next page of results. Use this when you're paginating results.</p>
        max_results: <p>The maximum number of results to return in the response.</p>
        namespace_version: <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>

    Raises:
        capo_iotthingsgraph.errors.internal_failure_exception.InternalFailureException: <p></p>
        capo_iotthingsgraph.errors.invalid_request_exception.InvalidRequestException: <p></p>
        capo_iotthingsgraph.errors.throttling_exception.ThrottlingException: <p></p>
        capo_iotthingsgraph.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iotthingsgraph.types.search_entities_request.SearchEntitiesRequest]",
    ) -> OperationResponse[
        "capo_iotthingsgraph.types.search_entities_response.SearchEntitiesResponse"
    ]:
        import capo_iotthingsgraph._operations.iot_things_graph_front_end_service.search_entities

        output, http_response = (
            capo_iotthingsgraph._operations.iot_things_graph_front_end_service.search_entities.search_entities(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SearchEntities")
    )
    input_: capo_iotthingsgraph.types.search_entities_request.SearchEntitiesRequest = {
        "entity_types": entity_types
    }
    if filters is not None:
        input_["filters"] = filters
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if namespace_version is not None:
        input_["namespace_version"] = namespace_version

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