AWS IoT Wireless

2024/03/29 - AWS IoT Wireless - 3 new api methods

Changes  Add support for retrieving key historical and live metrics for LoRaWAN devices and gateways

GetMetrics (new) Link ¶

Get metrics.

See also: AWS API Documentation

Request Syntax

client.get_metrics(
    SummaryMetricQueries=[
        {
            'QueryId': 'string',
            'MetricName': 'DeviceRSSI'|'DeviceSNR'|'DeviceUplinkCount'|'DeviceDownlinkCount'|'DeviceUplinkLostCount'|'DeviceUplinkLostRate'|'DeviceJoinRequestCount'|'DeviceJoinAcceptCount'|'DeviceRoamingUplinkCount'|'DeviceRoamingDownlinkCount'|'GatewayUpTime'|'GatewayDownTime'|'GatewayRSSI'|'GatewaySNR'|'GatewayUplinkCount'|'GatewayDownlinkCount'|'GatewayJoinRequestCount'|'GatewayJoinAcceptCount'|'AwsAccountUplinkCount'|'AwsAccountDownlinkCount'|'AwsAccountUplinkLostCount'|'AwsAccountUplinkLostRate'|'AwsAccountJoinRequestCount'|'AwsAccountJoinAcceptCount'|'AwsAccountRoamingUplinkCount'|'AwsAccountRoamingDownlinkCount'|'AwsAccountDeviceCount'|'AwsAccountGatewayCount'|'AwsAccountActiveDeviceCount'|'AwsAccountActiveGatewayCount',
            'Dimensions': [
                {
                    'name': 'DeviceId'|'GatewayId',
                    'value': 'string'
                },
            ],
            'AggregationPeriod': 'OneHour'|'OneDay'|'OneWeek',
            'StartTimestamp': datetime(2015, 1, 1),
            'EndTimestamp': datetime(2015, 1, 1)
        },
    ]
)
type SummaryMetricQueries

list

param SummaryMetricQueries

The list of queries to retrieve summary metrics.

  • (dict) --

    The metric query object.

    • QueryId (string) --

      The id of the query.

    • MetricName (string) --

      The name of the metric.

    • Dimensions (list) --

      The dimensions of the metric.

      • (dict) --

        The required list of dimensions for the metric.

        • name (string) --

          The name of the dimension.

        • value (string) --

          The dimension's value.

    • AggregationPeriod (string) --

      The aggregation period of the metric.

    • StartTimestamp (datetime) --

      The start timestamp for summary metric query.

    • EndTimestamp (datetime) --

      The end timestamp for summary metric query.

rtype

dict

returns

Response Syntax

{
    'SummaryMetricQueryResults': [
        {
            'QueryId': 'string',
            'QueryStatus': 'Succeeded'|'Failed',
            'Error': 'string',
            'MetricName': 'DeviceRSSI'|'DeviceSNR'|'DeviceUplinkCount'|'DeviceDownlinkCount'|'DeviceUplinkLostCount'|'DeviceUplinkLostRate'|'DeviceJoinRequestCount'|'DeviceJoinAcceptCount'|'DeviceRoamingUplinkCount'|'DeviceRoamingDownlinkCount'|'GatewayUpTime'|'GatewayDownTime'|'GatewayRSSI'|'GatewaySNR'|'GatewayUplinkCount'|'GatewayDownlinkCount'|'GatewayJoinRequestCount'|'GatewayJoinAcceptCount'|'AwsAccountUplinkCount'|'AwsAccountDownlinkCount'|'AwsAccountUplinkLostCount'|'AwsAccountUplinkLostRate'|'AwsAccountJoinRequestCount'|'AwsAccountJoinAcceptCount'|'AwsAccountRoamingUplinkCount'|'AwsAccountRoamingDownlinkCount'|'AwsAccountDeviceCount'|'AwsAccountGatewayCount'|'AwsAccountActiveDeviceCount'|'AwsAccountActiveGatewayCount',
            'Dimensions': [
                {
                    'name': 'DeviceId'|'GatewayId',
                    'value': 'string'
                },
            ],
            'AggregationPeriod': 'OneHour'|'OneDay'|'OneWeek',
            'StartTimestamp': datetime(2015, 1, 1),
            'EndTimestamp': datetime(2015, 1, 1),
            'Timestamps': [
                datetime(2015, 1, 1),
            ],
            'Values': [
                {
                    'Min': 123.0,
                    'Max': 123.0,
                    'Sum': 123.0,
                    'Avg': 123.0,
                    'Std': 123.0,
                    'P90': 123.0
                },
            ],
            'Unit': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • SummaryMetricQueryResults (list) --

      The list of retrieved metrics.

      • (dict) --

        The result of metrics aggregation operation.

        • QueryId (string) --

          The id of the query.

        • QueryStatus (string) --

          The status of the metric query.

        • Error (string) --

          The error message for the summary metric query.

        • MetricName (string) --

          The name of the metric.

        • Dimensions (list) --

          The dimensions of the metric.

          • (dict) --

            The required list of dimensions for the metric.

            • name (string) --

              The name of the dimension.

            • value (string) --

              The dimension's value.

        • AggregationPeriod (string) --

          The aggregation period of the metric.

        • StartTimestamp (datetime) --

          The start timestamp for summary metric query.

        • EndTimestamp (datetime) --

          The end timestamp for summary metric query.

        • Timestamps (list) --

          The timestamp of each aggregation result.

          • (datetime) --

        • Values (list) --

          The list of aggregated metrics.

          • (dict) --

            The aggregated values of the metric.

            • Min (float) --

              The minimum of the values of the all data points collected during the period.

            • Max (float) --

              The maximum of the values of the all data points collected during the period.

            • Sum (float) --

              The sum of the values of the all data points collected during the period.

            • Avg (float) --

              The average of the values of the all data points collected during the period.

            • Std (float) --

              The standard deviation of the values of the all data points collected during the period.

            • P90 (float) --

              The 90th percentile of the values of the all data points collected during the period.

        • Unit (string) --

          The units of measurement to be used for interpreting the aggregation result.

GetMetricConfiguration (new) Link ¶

Get the metric configuration status for this account.

See also: AWS API Documentation

Request Syntax

client.get_metric_configuration()
rtype

dict

returns

Response Syntax

{
    'SummaryMetric': {
        'Status': 'Enabled'|'Disabled'
    }
}

Response Structure

  • (dict) --

    • SummaryMetric (dict) --

      The account's configuration status for summary metric aggregation.

      • Status (string) --

        The configuration of summary metric.

UpdateMetricConfiguration (new) Link ¶

Update the metric configuration.

See also: AWS API Documentation

Request Syntax

client.update_metric_configuration(
    SummaryMetric={
        'Status': 'Enabled'|'Disabled'
    }
)
type SummaryMetric

dict

param SummaryMetric

The value to be used to set summary metric configuration.

  • Status (string) --

    The configuration of summary metric.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --