Lists the views in the caller's account and region. Returns a summary for each view, optionally filtered by view type. View definitions are not included — use GetView to retrieve them.
Parameters:
-
type
(Optional[ViewType], default:
None
)
–
Return only views of this ownership category.
-
max_results
(Optional[int], default:
None
)
–
The maximum number of views to return per page.
-
next_token
(Optional[str], default:
None
)
–
A token to retrieve the next page of results.
Raises:
Examples:
List the views in an account and Region
The following example returns a page of view summaries, filtered to user-created views. Definitions are not included — call GetView to retrieve them. A nextToken is returned when more results are available. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> client.list_views(type='USER', max_results=10)
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
| def list_views(
self,
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = None,
type: Optional["capo_cloudwatchomni.types.view_type.ViewType"] = None,
max_results: Optional[int] = None,
next_token: Optional[str] = None,
) -> "capo_cloudwatchomni.types.list_views_response.ListViewsResponse":
"""Lists the views in the caller's account and region. Returns a summary for each view, optionally filtered by view type. View definitions are not included — use GetView to retrieve them.
Args:
type: Return only views of this ownership category.
max_results: The maximum number of views to return per page.
next_token: A token to retrieve the next page of results.
Raises:
capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
List the views in an account and Region
The following example returns a page of view summaries, filtered to user-created views. Definitions are not included — call GetView to retrieve them. A nextToken is returned when more results are available. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> client.list_views(type='USER', max_results=10)
"""
def _handler(
req: "OperationRequest[capo_cloudwatchomni.types.list_views_request.ListViewsRequest]",
) -> OperationResponse[
"capo_cloudwatchomni.types.list_views_response.ListViewsResponse"
]:
import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.list_views
output, http_response = (
capo_cloudwatchomni._operations.cloud_watch_omni_frontend.list_views.list_views(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListViews")
)
input_: capo_cloudwatchomni.types.list_views_request.ListViewsRequest = {}
if type is not None:
input_["type"] = type
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
|