IoT / Client / update_custom_metric
update_custom_metric¶
- IoT.Client.update_custom_metric(**kwargs)¶
Note
The IoT Device Defender detect feature will no longer be available to new customers starting August 31, 2026. If you would like to use the detect feature, sign up prior to August 31, 2026. To learn about alternatives to IoT Device Defender detect, see IoT Device Defender detect feature availability change in the IoT Device Defender Developer Guide. There is no change to IoT Device Defender audit availability.
Updates a Device Defender detect custom metric.
Requires permission to access the UpdateCustomMetric action.
See also: AWS API Documentation
Request Syntax
response = client.update_custom_metric( metricName='string', displayName='string' )
- Parameters:
metricName (string) –
[REQUIRED]
The name of the custom metric. Cannot be updated.
displayName (string) –
[REQUIRED]
Field represents a friendly name in the console for the custom metric, it doesn’t have to be unique. Don’t use this name as the metric identifier in the device metric report. Can be updated.
- Return type:
dict
- Returns:
Response Syntax
{ 'metricName': 'string', 'metricArn': 'string', 'metricType': 'string-list'|'ip-address-list'|'number-list'|'number', 'displayName': 'string', 'creationDate': datetime(2015, 1, 1), 'lastModifiedDate': datetime(2015, 1, 1) }
Response Structure
(dict) –
metricName (string) –
The name of the custom metric.
metricArn (string) –
The Amazon Resource Number (ARN) of the custom metric.
metricType (string) –
The type of the custom metric.
Warning
The type
numberonly takes a single metric value as an input, but while submitting the metrics value in the DeviceMetrics report, it must be passed as an array with a single value.displayName (string) –
A friendly name in the console for the custom metric
creationDate (datetime) –
The creation date of the custom metric in milliseconds since epoch.
lastModifiedDate (datetime) –
The time the custom metric was last modified in milliseconds since epoch.
Exceptions
IoT.Client.exceptions.InvalidRequestExceptionIoT.Client.exceptions.ResourceNotFoundExceptionIoT.Client.exceptions.ThrottlingExceptionIoT.Client.exceptions.InternalFailureException