Returns the definition and metadata of the specified view.
Parameters:
Raises:
Examples:
Get a view
The following example returns the definition and metadata of a view. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> client.get_view(name='view.service_errors')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
| def get_view(
self,
name: "capo_cloudwatchomni.types.view_name.ViewName",
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> "capo_cloudwatchomni.types.get_view_response.GetViewResponse":
"""Returns the definition and metadata of the specified view.
Args:
name: The name of the view.
Raises:
capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
capo_cloudwatchomni.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource does not exist.
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:
Get a view
The following example returns the definition and metadata of a view. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> client.get_view(name='view.service_errors')
"""
def _handler(
req: "OperationRequest[capo_cloudwatchomni.types.get_view_request.GetViewRequest]",
) -> OperationResponse[
"capo_cloudwatchomni.types.get_view_response.GetViewResponse"
]:
import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.get_view
output, http_response = (
capo_cloudwatchomni._operations.cloud_watch_omni_frontend.get_view.get_view(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetView")
)
input_: capo_cloudwatchomni.types.get_view_request.GetViewRequest = {
"name": name
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|