List all monitors in an account. Optionally, you can list only monitors that have a specific status, by using the STATUS parameter.
Parameters:
-
next_token
(Optional[str], default:
None
)
–
The token for the next set of results. You receive this token from a previous call.
-
max_results
(Optional[MaxResults], default:
None
)
–
The number of query results that you want to return with this call.
-
monitor_status
(Optional[MonitorStatus], default:
None
)
–
The status of a monitor. The status can be one of the following
-
PENDING: The monitor is in the process of being created.
-
ACTIVE: The monitor is active.
-
INACTIVE: The monitor is inactive.
-
ERROR: Monitor creation failed due to an error.
-
DELETING: The monitor is in the process of being deleted.
Raises:
Source code in docs_src/capo_networkflowmonitor/_services/network_flow_monitor.py
| def list_monitors(
self,
*,
config_overrides: Optional[NetworkFlowMonitorClientConfig] = None,
next_token: Optional[str] = None,
max_results: Optional[
"capo_networkflowmonitor.types.max_results.MaxResults"
] = None,
monitor_status: Optional[
"capo_networkflowmonitor.types.monitor_status.MonitorStatus"
] = None,
) -> "capo_networkflowmonitor.types.list_monitors_output.ListMonitorsOutput":
"""<p>List all monitors in an account. Optionally, you can list only monitors that have a specific status, by using the <code>STATUS</code> parameter.</p>
Args:
next_token: <p>The token for the next set of results. You receive this token from a previous call.</p>
max_results: <p>The number of query results that you want to return with this call.</p>
monitor_status: <p>The status of a monitor. The status can be one of the following</p> <ul> <li> <p> <code>PENDING</code>: The monitor is in the process of being created.</p> </li> <li> <p> <code>ACTIVE</code>: The monitor is active.</p> </li> <li> <p> <code>INACTIVE</code>: The monitor is inactive.</p> </li> <li> <p> <code>ERROR</code>: Monitor creation failed due to an error.</p> </li> <li> <p> <code>DELETING</code>: The monitor is in the process of being deleted.</p> </li> </ul>
Raises:
capo_networkflowmonitor.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
capo_networkflowmonitor.errors.internal_server_exception.InternalServerException: <p>An internal error occurred.</p>
capo_networkflowmonitor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_networkflowmonitor.errors.validation_exception.ValidationException: <p>Invalid request.</p>
capo_networkflowmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_networkflowmonitor.types.list_monitors_input.ListMonitorsInput]",
) -> OperationResponse[
"capo_networkflowmonitor.types.list_monitors_output.ListMonitorsOutput"
]:
import capo_networkflowmonitor._operations.network_flow_monitor.list_monitors
output, http_response = (
capo_networkflowmonitor._operations.network_flow_monitor.list_monitors.list_monitors(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListMonitors")
)
input_: capo_networkflowmonitor.types.list_monitors_input.ListMonitorsInput = {}
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
if monitor_status is not None:
input_["monitor_status"] = monitor_status
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|