Skip to content

update_omni_dashboard async

update_omni_dashboard(
    space_id: SpaceId,
    dashboard_id: DashboardId,
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
    body: Optional[str] = None,
    name: Optional[str] = None,
    description: Optional[str] = None,
) -> UpdateOmniDashboardOutput

Updates an existing dashboard within a space. Only the provided fields are changed; omitted fields are left unchanged.

Parameters:

  • space_id (SpaceId) –

    The unique ID of the space.

  • dashboard_id (DashboardId) –

    The unique ID of the dashboard.

  • body (Optional[str], default: None ) –

    The new dashboard definition, as a JSON document. Maximum 1 MiB. Omit to leave unchanged.

  • name (Optional[str], default: None ) –

    A new name for the dashboard. Omit to leave unchanged.

  • description (Optional[str], default: None ) –

    A new description of the dashboard. Omit to leave unchanged.

Raises:

Examples:

Update a dashboard body The following example updates only the body of a dashboard; the name and description are left unchanged. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> await client.update_omni_dashboard(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', dashboard_id='c3d4e5f6-7a8b-4c9d-8e0f-1a2b3c4d5e6f', body='{"widgets":[{"type":"metric","x":0,"y":0,"width":24,"height":6,"properties":{"metrics":[["AWS/Lambda","Errors","FunctionName","OrderProcessor"],["AWS/Lambda","Throttles","FunctionName","OrderProcessor"]],"region":"us-east-1","title":"Lambda Errors and Throttles"}}]}')
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
async def update_omni_dashboard(
    self,
    space_id: "capo_cloudwatchomni.types.space_id.SpaceId",
    dashboard_id: "capo_cloudwatchomni.types.dashboard_id.DashboardId",
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
    body: Optional[str] = None,
    name: Optional[str] = None,
    description: Optional[str] = None,
) -> "capo_cloudwatchomni.types.update_omni_dashboard_output.UpdateOmniDashboardOutput":
    """Updates an existing dashboard within a space. Only the provided fields are changed; omitted fields are left unchanged.

    Args:
        space_id: The unique ID of the space.
        dashboard_id: The unique ID of the dashboard.
        body: The new dashboard definition, as a JSON document. Maximum 1 MiB. Omit to leave unchanged.
        name: A new name for the dashboard. Omit to leave unchanged.
        description: A new description of the dashboard. Omit to leave unchanged.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.conflict_exception.ConflictException: The operation could not be completed because of a conflict with the current state of the resource.
        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.service_quota_exceeded_exception.ServiceQuotaExceededException: A service quota was exceeded.
        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:
        Update a dashboard body
        The following example updates only the body of a dashboard; the name and description are left unchanged. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> await client.update_omni_dashboard(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', dashboard_id='c3d4e5f6-7a8b-4c9d-8e0f-1a2b3c4d5e6f', body='{"widgets":[{"type":"metric","x":0,"y":0,"width":24,"height":6,"properties":{"metrics":[["AWS/Lambda","Errors","FunctionName","OrderProcessor"],["AWS/Lambda","Throttles","FunctionName","OrderProcessor"]],"region":"us-east-1","title":"Lambda Errors and Throttles"}}]}')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatchomni.types.update_omni_dashboard_input.UpdateOmniDashboardInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatchomni.types.update_omni_dashboard_output.UpdateOmniDashboardOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.update_omni_dashboard

        (
            output,
            http_response,
        ) = await capo_cloudwatchomni._operations.cloud_watch_omni_frontend.update_omni_dashboard.async_update_omni_dashboard(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateOmniDashboard")
    )
    input_: capo_cloudwatchomni.types.update_omni_dashboard_input.UpdateOmniDashboardInput = {
        "space_id": space_id,
        "dashboard_id": dashboard_id,
    }
    if body is not None:
        input_["body"] = body
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output