Skip to content

update_dashboard

update_dashboard(
    arn: DashboardArn,
    name: DashboardName,
    *,
    config_overrides: Optional[BCMDashboardsClientConfig] = None,
    description: Optional[Description] = None,
    widgets: Optional[WidgetList] = None,
) -> UpdateDashboardResponse

Updates an existing dashboard's properties, including its name, description, and widget configurations.

Parameters:

  • arn (DashboardArn) –

    The ARN of the dashboard to update.

  • name (DashboardName) –

    The new name for the dashboard.

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

    The new description for the dashboard.

  • widgets (Optional[WidgetList], default: None ) –

    The updated array of widget configurations for the dashboard. Replaces all existing widgets.

Raises:

  • AccessDeniedException –

    You do not have sufficient permissions to perform this action. Verify your IAM permissions and any resource policies.

  • InternalServerException –

    An internal error occurred while processing the request. Retry your request. If the problem persists, contact Amazon Web Services Support.

  • ResourceNotFoundException –

    The specified resource (dashboard, policy, or widget) was not found. Verify the ARN and try again.

  • ThrottlingException –

    The request was denied due to request throttling. Reduce the frequency of requests and use exponential backoff.

  • ValidationException –

    The input parameters do not satisfy the requirements. Check the error message for specific validation details.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Updating a dashboard

>>> client.update_dashboard(arn='arn:aws:bcm-dashboards::123456789012:dashboard/abcd1234-ab12-12ab-1ab2-abcd1234efgh', name='cost-dashboards-updated', description='Dashboard for tracking costs version 2', widgets=[{'title': 'Monthly Cost Trend', 'width': 4, 'height': 7, 'horizontalOffset': 2, 'configs': [{'displayConfig': {'graph': {'costTrend': {'visualType': 'LINE'}}}, 'queryParameters': {'costAndUsage': {'granularity': 'MONTHLY', 'groupBy': [{'key': 'SERVICE', 'type': 'DIMENSION'}], 'metrics': ['UnblendedCost'], 'timeRange': {'endTime': {'type': 'RELATIVE', 'value': 'now'}, 'startTime': {'type': 'RELATIVE', 'value': '-3M'}}}}}]}])
Source code in docs_src/capo_bcm_dashboards/_services/bcm_dashboards.py
def update_dashboard(
    self,
    arn: "capo_bcm_dashboards.types.dashboard_arn.DashboardArn",
    name: "capo_bcm_dashboards.types.dashboard_name.DashboardName",
    *,
    config_overrides: Optional[BCMDashboardsClientConfig] = None,
    description: Optional[
        "capo_bcm_dashboards.types.description.Description"
    ] = None,
    widgets: Optional["capo_bcm_dashboards.types.widget_list.WidgetList"] = None,
) -> "capo_bcm_dashboards.types.update_dashboard_response.UpdateDashboardResponse":
    """<p>Updates an existing dashboard's properties, including its name, description, and widget configurations.</p>

    Args:
        arn: <p>The ARN of the dashboard to update.</p>
        name: <p>The new name for the dashboard.</p>
        description: <p>The new description for the dashboard.</p>
        widgets: <p>The updated array of widget configurations for the dashboard. Replaces all existing widgets.</p>

    Raises:
        capo_bcm_dashboards.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action. Verify your IAM permissions and any resource policies.</p>
        capo_bcm_dashboards.errors.internal_server_exception.InternalServerException: <p>An internal error occurred while processing the request. Retry your request. If the problem persists, contact Amazon Web Services Support.</p>
        capo_bcm_dashboards.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource (dashboard, policy, or widget) was not found. Verify the ARN and try again.</p>
        capo_bcm_dashboards.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Reduce the frequency of requests and use exponential backoff.</p>
        capo_bcm_dashboards.errors.validation_exception.ValidationException: <p>The input parameters do not satisfy the requirements. Check the error message for specific validation details.</p>
        capo_bcm_dashboards.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Updating a dashboard

        >>> client.update_dashboard(arn='arn:aws:bcm-dashboards::123456789012:dashboard/abcd1234-ab12-12ab-1ab2-abcd1234efgh', name='cost-dashboards-updated', description='Dashboard for tracking costs version 2', widgets=[{'title': 'Monthly Cost Trend', 'width': 4, 'height': 7, 'horizontalOffset': 2, 'configs': [{'displayConfig': {'graph': {'costTrend': {'visualType': 'LINE'}}}, 'queryParameters': {'costAndUsage': {'granularity': 'MONTHLY', 'groupBy': [{'key': 'SERVICE', 'type': 'DIMENSION'}], 'metrics': ['UnblendedCost'], 'timeRange': {'endTime': {'type': 'RELATIVE', 'value': 'now'}, 'startTime': {'type': 'RELATIVE', 'value': '-3M'}}}}}]}])
    """

    def _handler(
        req: "OperationRequest[capo_bcm_dashboards.types.update_dashboard_request.UpdateDashboardRequest]",
    ) -> OperationResponse[
        "capo_bcm_dashboards.types.update_dashboard_response.UpdateDashboardResponse"
    ]:
        import capo_bcm_dashboards._operations.awsbcm_dashboards_service.update_dashboard

        output, http_response = (
            capo_bcm_dashboards._operations.awsbcm_dashboards_service.update_dashboard.update_dashboard(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDashboard")
    )
    input_: capo_bcm_dashboards.types.update_dashboard_request.UpdateDashboardRequest = {
        "arn": arn,
        "name": name,
    }
    if description is not None:
        input_["description"] = description
    if widgets is not None:
        input_["widgets"] = widgets

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output