:doc:`IoT <../../iot>` / Client / update_custom_metric

********************
update_custom_metric
********************



.. py:method:: IoT.Client.update_custom_metric(**kwargs)

  

  Updates a Device Defender detect custom metric.

   

  Requires permission to access the `UpdateCustomMetric <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateCustomMetric>`_  


  **Request Syntax**
  ::

    response = client.update_custom_metric(
        metricName='string',
        displayName='string'
    )
    
  :type metricName: string
  :param metricName: **[REQUIRED]** 

    The name of the custom metric. Cannot be updated.

    

  
  :type displayName: string
  :param displayName: **[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.

    

  
  
  :rtype: 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 ``number`` only 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**
  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoT.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`IoT.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  