DeleteCustomMetricCommand

Deletes a Device Defender detect custom metric.

Requires permission to access the DeleteCustomMetric  action.

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  API with metricName set to your custom metric name.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { IoTClient, DeleteCustomMetricCommand } from "@aws-sdk/client-iot"; // ES Modules import
// const { IoTClient, DeleteCustomMetricCommand } = require("@aws-sdk/client-iot"); // CommonJS import
const client = new IoTClient(config);
const input = { // DeleteCustomMetricRequest
  metricName: "STRING_VALUE", // required
};
const command = new DeleteCustomMetricCommand(input);
const response = await client.send(command);
// {};

DeleteCustomMetricCommand Input

See DeleteCustomMetricCommandInput for more details

Parameter
Type
Description
metricName
Required
string | undefined

The name of the custom metric.

DeleteCustomMetricCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
InternalFailureException
server

An unexpected error has occurred.

InvalidRequestException
client

The request is not valid.

ThrottlingException
client

The rate exceeds the limit.

IoTServiceException
Base exception class for all service exceptions from IoT service.