Skip to content

create_omni_dashboard

create_omni_dashboard(
    space_id: SpaceId,
    name: str,
    body: str,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    description: Optional[str] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateOmniDashboardOutput

Creates a new dashboard within a space. Use GetOmniDashboard and ListOmniDashboards to retrieve dashboards, UpdateOmniDashboard to modify one, and DeleteOmniDashboard to remove it.

Parameters:

  • space_id (SpaceId) –

    The unique ID of the space to create the dashboard in.

  • name (str) –

    A name that identifies the dashboard.

  • body (str) –

    The dashboard definition, as a JSON document. Maximum 1 MiB.

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

    An optional description of the dashboard.

  • tags (Optional[TagMap], default: None ) –

    The tags to associate with the dashboard.

  • client_token (Optional[ClientToken], default: None ) –

    Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.

Raises:

Examples:

Create a dashboard The following example creates a dashboard in a space from a JSON dashboard definition. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.create_omni_dashboard(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', name='service-health-overview', body='{"widgets":[{"type":"metric","x":0,"y":0,"width":12,"height":6,"properties":{"metrics":[["AWS/Lambda","Errors","FunctionName","OrderProcessor"]],"region":"us-east-1","title":"Lambda Errors"}}]}', description='Overview of service health metrics.', tags={'Team': 'observability'}, client_token='3f2a9c1e-7b04-4d8a-9e15-6c2b8d0f4a73')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def create_omni_dashboard(
    self,
    space_id: "capo_cloudwatchomni.types.space_id.SpaceId",
    name: str,
    body: str,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    description: Optional[str] = None,
    tags: Optional["capo_cloudwatchomni.types.tag_map.TagMap"] = None,
    client_token: Optional[
        "capo_cloudwatchomni.types.client_token.ClientToken"
    ] = None,
) -> "capo_cloudwatchomni.types.create_omni_dashboard_output.CreateOmniDashboardOutput":
    """Creates a new dashboard within a space. Use GetOmniDashboard and ListOmniDashboards to retrieve dashboards, UpdateOmniDashboard to modify one, and DeleteOmniDashboard to remove it.

    Args:
        space_id: The unique ID of the space to create the dashboard in.
        name: A name that identifies the dashboard.
        body: The dashboard definition, as a JSON document. Maximum 1 MiB.
        description: An optional description of the dashboard.
        tags: The tags to associate with the dashboard.
        client_token: Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.

    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:
        Create a dashboard
        The following example creates a dashboard in a space from a JSON dashboard definition. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.create_omni_dashboard(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', name='service-health-overview', body='{"widgets":[{"type":"metric","x":0,"y":0,"width":12,"height":6,"properties":{"metrics":[["AWS/Lambda","Errors","FunctionName","OrderProcessor"]],"region":"us-east-1","title":"Lambda Errors"}}]}', description='Overview of service health metrics.', tags={'Team': 'observability'}, client_token='3f2a9c1e-7b04-4d8a-9e15-6c2b8d0f4a73')
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.create_omni_dashboard_input.CreateOmniDashboardInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.create_omni_dashboard_output.CreateOmniDashboardOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.create_omni_dashboard

        output, http_response = (
            capo_cloudwatchomni._operations.cloud_watch_omni_frontend.create_omni_dashboard.create_omni_dashboard(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateOmniDashboard")
    )
    input_: capo_cloudwatchomni.types.create_omni_dashboard_input.CreateOmniDashboardInput = {
        "space_id": space_id,
        "name": name,
        "body": body,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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