- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
UpdateCustomMetricCommand
Updates a Device Defender detect custom metric.
Requires permission to access the UpdateCustomMetric action.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { IoTClient, UpdateCustomMetricCommand } from "@aws-sdk/client-iot"; // ES Modules import
// const { IoTClient, UpdateCustomMetricCommand } = require("@aws-sdk/client-iot"); // CommonJS import
const client = new IoTClient(config);
const input = { // UpdateCustomMetricRequest
metricName: "STRING_VALUE", // required
displayName: "STRING_VALUE", // required
};
const command = new UpdateCustomMetricCommand(input);
const response = await client.send(command);
// { // UpdateCustomMetricResponse
// metricName: "STRING_VALUE",
// metricArn: "STRING_VALUE",
// metricType: "string-list" || "ip-address-list" || "number-list" || "number",
// displayName: "STRING_VALUE",
// creationDate: new Date("TIMESTAMP"),
// lastModifiedDate: new Date("TIMESTAMP"),
// };
UpdateCustomMetricCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
displayName Required | string | undefined | 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. |
metricName Required | string | undefined | The name of the custom metric. Cannot be updated. |
UpdateCustomMetricCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
creationDate | Date | undefined | The creation date of the custom metric in milliseconds since epoch. |
displayName | string | undefined | A friendly name in the console for the custom metric |
lastModifiedDate | Date | undefined | The time the custom metric was last modified in milliseconds since epoch. |
metricArn | string | undefined | The Amazon Resource Number (ARN) of the custom metric. |
metricName | string | undefined | The name of the custom metric. |
metricType | CustomMetricType | undefined | The type of the custom metric. The type |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalFailureException | server | An unexpected error has occurred. |
InvalidRequestException | client | The request is not valid. |
ResourceNotFoundException | client | The specified resource does not exist. |
ThrottlingException | client | The rate exceeds the limit. |
IoTServiceException | Base exception class for all service exceptions from IoT service. |