CloudWatchOmni / Client / list_alerts

list_alerts

CloudWatchOmni.Client.list_alerts(**kwargs)

Lists alerts within a space, optionally filtered by exact name(s), a single name prefix, or exact alertId(s), with pagination.

Use GetAlert to retrieve a single alert’s full detail.

See also: AWS API Documentation

Request Syntax

response = client.list_alerts(
    spaceId='string',
    filterCriteria={
        'names': [
            'string',
        ],
        'namePrefix': 'string',
        'ids': [
            'string',
        ],
        'stateValue': [
            'OK'|'WARNING'|'CRITICAL'|'NODATA',
        ],
        'notificationsEnabled': True|False
    },
    sortBy='NAME'|'STATE',
    sortOrder='ASC'|'DESC',
    nextToken='string',
    maxResults=123
)
Parameters:
  • spaceId (string) –

    [REQUIRED]

    The unique ID of the space.

  • filterCriteria (dict) –

    Filter criteria narrowing which alerts are returned. All members are optional; the three name/id filters are mutually exclusive.

    • names (list) –

      Filter to alerts whose name exactly matches any entry (OR semantics). Mutually exclusive with {@code namePrefix} and {@code ids}.

      • (string) –

    • namePrefix (string) –

      Filter to alerts whose name starts with this prefix. Mutually exclusive with {@code names} and {@code ids}.

    • ids (list) –

      Filter to alerts whose {@link AlertId} exactly matches any entry (OR semantics). Mutually exclusive with {@code names} and {@code namePrefix}.

      • (string) –

        The stable alert identifier: a 32-character lowercase hex uuid, minted by the backend on create and immutable across updates.

        It deliberately carries no name, so that a future rename cannot change an alert’s identity and break the ARNs, saved links and IAM policies pointing at it. Use {@code name} to display an alert and {@code alertId} to address one.

    • stateValue (list) –

      Filter to alerts currently in any of these states (OR semantics).

      • (string) –

        Flat alert state. Severity is folded in: a WARNING/CRITICAL alert reports that state directly. {@code NODATA} indicates the evaluation produced no data (subject to the rule’s noData.treatAs handling).

    • notificationsEnabled (boolean) –

      Filter to alerts by whether notifications are enabled.

  • sortBy (string) – The field to sort results by.

  • sortOrder (string) – The order in which to sort results.

  • nextToken (string) – A token to retrieve the next page of results.

  • maxResults (integer) – The maximum number of alerts to return per page.

Return type:

dict

Returns:

Response Syntax

{
    'items': [
        {
            'name': 'string',
            'alertId': 'string',
            'spaceId': 'string',
            'profileId': 'string',
            'notificationStatus': 'ENABLED'|'DISABLED',
            'state': {
                'value': 'OK'|'WARNING'|'CRITICAL'|'NODATA',
                'transitionedAt': datetime(2015, 1, 1),
                'contributorSummary': {
                    'warningCount': 123,
                    'criticalCount': 123
                },
                'data': {
                    'thresholdBreached': 123.0
                }
            },
            'createdAt': datetime(2015, 1, 1),
            'updatedAt': datetime(2015, 1, 1),
            'alertArn': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • items (list) –

      The list of alert summaries.

      • (dict) –

        Summary representation of an alert used in list responses.

        • name (string) –

          The name of the alert.

        • alertId (string) –

          The stable alert identifier (see {@link Alert#alertId}). Use it to address the alert; it is also the ARN’s resource id.

        • spaceId (string) –

          The ID of the space the alert belongs to.

        • profileId (string) –

          The ID of the access profile associated with the alert.

        • notificationStatus (string) –

          Whether notifications are enabled.

        • state (dict) –

          Live evaluation state (read-only, system-managed).

          • value (string) –

            Current flat state.

          • transitionedAt (datetime) –

            When the alert transitioned to its current state.

          • contributorSummary (dict) –

            Counts of contributors currently breaching each severity threshold. Present only when contributor-level tracking is active; absent until the first contributor breaches a {@code WARNING} or {@code CRITICAL} threshold.

            • warningCount (integer) –

              Number of contributors currently breaching the warning threshold.

            • criticalCount (integer) –

              Number of contributors currently breaching the critical threshold.

          • data (dict) –

            Structured detail about why the alert is in its current state.

            • thresholdBreached (float) –

              For COUNT_OF_RESULTS alerts, the row count that breached; null for FIELD_VALUE (multi-contributor) alerts.

        • createdAt (datetime) –

          The timestamp when the alert was created.

        • updatedAt (datetime) –

          The timestamp when the alert was last updated.

        • alertArn (string) –

          The Amazon Resource Name (ARN) of the alert.

    • nextToken (string) –

      A token to retrieve the next page of results, or null if there are no more results.

Exceptions