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

********************
delete_custom_metric
********************



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

  

  Deletes a Device Defender detect custom metric.

   

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

   

  .. note::

    

    Before you can delete a custom metric, you must first remove the custom metric from all security profiles it's a part of. The security profile associated with the custom metric can be found using the `ListSecurityProfiles <https://docs.aws.amazon.com/iot/latest/apireference/API_ListSecurityProfiles.html>`__ API with ``metricName`` set to your custom metric name.

    

  

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


  **Request Syntax**
  ::

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

    The name of the custom metric.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

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

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

  