CloudWatch / Client / list_metric_data_query_definitions

list_metric_data_query_definitions

CloudWatch.Client.list_metric_data_query_definitions(**kwargs)

Lists the metric data query definitions in your account and Region.

The results are summaries that don’t include the expression. To get the full definition, call GetMetricDataQueryDefinition with its ID.

This operation supports pagination. Use the MaxResults and NextToken parameters to retrieve results in multiple calls.

Permissions

To list definitions, you need the cloudwatch:ListMetricDataQueryDefinitions permission. This permission applies to all definitions in the account and Region. The results aren’t filtered by tags.

See also: AWS API Documentation

Request Syntax

response = client.list_metric_data_query_definitions(
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • MaxResults (integer) – The maximum number of metric data query definitions to return in one call. The default is 100.

  • NextToken (string) – The token returned by a previous call to indicate where to continue retrieving results.

Return type:

dict

Returns:

Response Syntax

{
    'Items': [
        {
            'Id': 'string',
            'Path': 'string',
            'Type': 'PROMQL'|'SQL'|'METRIC_MATH',
            'UpdatedAt': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Items (list) –

      A list of metric data query definition summaries.

      • (dict) –

        Summary information about a metric data query definition. To get the expression, call GetMetricDataQueryDefinition.

        • Id (string) –

          The ID of the metric data query definition.

        • Path (string) –

          The path of the metric data query definition.

        • Type (string) –

          The language of the expression. Valid values are the following:

          • PROMQL – A PromQL query.

          • SQL – A CloudWatch Metrics Insights query.

          • METRIC_MATH – A metric math expression.

        • UpdatedAt (datetime) –

          The date and time when you last updated the metric data query definition.

    • NextToken (string) –

      The token to use when requesting the next set of results. If this field is absent, there are no more results to retrieve.