Lists detectors (the instances of a detector model).
Parameters:
-
detector_model_name
(DetectorModelName)
–
The name of the detector model whose detectors (instances) are listed.
-
state_name
(Optional[StateName], default:
None
)
–
A filter that limits results to those detectors (instances) in the given state.
-
next_token
(Optional[NextToken], default:
None
)
–
The token that you can use to return the next set of results.
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of results to be returned per request.
Raises:
Source code in docs_src/capo_iot_events_data/_services/io_t_events_data.py
| def list_detectors(
self,
detector_model_name: "capo_iot_events_data.types.detector_model_name.DetectorModelName",
*,
config_overrides: Optional[IoTEventsDataClientConfig] = None,
state_name: Optional["capo_iot_events_data.types.state_name.StateName"] = None,
next_token: Optional["capo_iot_events_data.types.next_token.NextToken"] = None,
max_results: Optional[
"capo_iot_events_data.types.max_results.MaxResults"
] = None,
) -> "capo_iot_events_data.types.list_detectors_response.ListDetectorsResponse":
"""<p>Lists detectors (the instances of a detector model).</p>
Args:
detector_model_name: <p>The name of the detector model whose detectors (instances) are listed.</p>
state_name: <p>A filter that limits results to those detectors (instances) in the given state.</p>
next_token: <p>The token that you can use to return the next set of results.</p>
max_results: <p>The maximum number of results to be returned per request.</p>
Raises:
capo_iot_events_data.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
capo_iot_events_data.errors.invalid_request_exception.InvalidRequestException: <p>The request was invalid.</p>
capo_iot_events_data.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found.</p>
capo_iot_events_data.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
capo_iot_events_data.errors.throttling_exception.ThrottlingException: <p>The request could not be completed due to throttling.</p>
capo_iot_events_data.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_iot_events_data.types.list_detectors_request.ListDetectorsRequest]",
) -> OperationResponse[
"capo_iot_events_data.types.list_detectors_response.ListDetectorsResponse"
]:
import capo_iot_events_data._operations.iot_columbo_data_service.list_detectors
output, http_response = (
capo_iot_events_data._operations.iot_columbo_data_service.list_detectors.list_detectors(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListDetectors")
)
input_: capo_iot_events_data.types.list_detectors_request.ListDetectorsRequest = {
"detector_model_name": detector_model_name
}
if state_name is not None:
input_["state_name"] = state_name
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|