| Copyright | (c) 2013-2021 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | None |
Amazonka.IoT.CreateCustomMetric
Description
Use this API to define a Custom Metric published by your devices to Device Defender.
Requires permission to access the CreateCustomMetric action.
Synopsis
- data CreateCustomMetric = CreateCustomMetric' {
- displayName :: Maybe Text
- tags :: Maybe [Tag]
- metricName :: Text
- metricType :: CustomMetricType
- clientRequestToken :: Text
- newCreateCustomMetric :: Text -> CustomMetricType -> Text -> CreateCustomMetric
- createCustomMetric_displayName :: Lens' CreateCustomMetric (Maybe Text)
- createCustomMetric_tags :: Lens' CreateCustomMetric (Maybe [Tag])
- createCustomMetric_metricName :: Lens' CreateCustomMetric Text
- createCustomMetric_metricType :: Lens' CreateCustomMetric CustomMetricType
- createCustomMetric_clientRequestToken :: Lens' CreateCustomMetric Text
- data CreateCustomMetricResponse = CreateCustomMetricResponse' {
- metricName :: Maybe Text
- metricArn :: Maybe Text
- httpStatus :: Int
- newCreateCustomMetricResponse :: Int -> CreateCustomMetricResponse
- createCustomMetricResponse_metricName :: Lens' CreateCustomMetricResponse (Maybe Text)
- createCustomMetricResponse_metricArn :: Lens' CreateCustomMetricResponse (Maybe Text)
- createCustomMetricResponse_httpStatus :: Lens' CreateCustomMetricResponse Int
Creating a Request
data CreateCustomMetric Source #
See: newCreateCustomMetric smart constructor.
Constructors
| CreateCustomMetric' | |
Fields
| |
Instances
newCreateCustomMetric Source #
Arguments
| :: Text | |
| -> CustomMetricType | |
| -> Text | |
| -> CreateCustomMetric |
Create a value of CreateCustomMetric with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:displayName:CreateCustomMetric', createCustomMetric_displayName - 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 once defined.
$sel:tags:CreateCustomMetric', createCustomMetric_tags - Metadata that can be used to manage the custom metric.
$sel:metricName:CreateCustomMetric', createCustomMetric_metricName - The name of the custom metric. This will be used in the metric report
submitted from the device/thing. Shouldn't begin with aws:. Cannot
be updated once defined.
$sel:metricType:CreateCustomMetric', createCustomMetric_metricType - The type of the custom metric. Types include string-list,
ip-address-list, number-list, and number.
$sel:clientRequestToken:CreateCustomMetric', createCustomMetric_clientRequestToken - Each custom metric must have a unique client request token. If you try
to create a new custom metric that already exists with a different
token, an exception occurs. If you omit this value, Amazon Web Services
SDKs will automatically generate a unique client request.
Request Lenses
createCustomMetric_displayName :: Lens' CreateCustomMetric (Maybe Text) Source #
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 once defined.
createCustomMetric_tags :: Lens' CreateCustomMetric (Maybe [Tag]) Source #
Metadata that can be used to manage the custom metric.
createCustomMetric_metricName :: Lens' CreateCustomMetric Text Source #
The name of the custom metric. This will be used in the metric report
submitted from the device/thing. Shouldn't begin with aws:. Cannot
be updated once defined.
createCustomMetric_metricType :: Lens' CreateCustomMetric CustomMetricType Source #
The type of the custom metric. Types include string-list,
ip-address-list, number-list, and number.
createCustomMetric_clientRequestToken :: Lens' CreateCustomMetric Text Source #
Each custom metric must have a unique client request token. If you try to create a new custom metric that already exists with a different token, an exception occurs. If you omit this value, Amazon Web Services SDKs will automatically generate a unique client request.
Destructuring the Response
data CreateCustomMetricResponse Source #
See: newCreateCustomMetricResponse smart constructor.
Constructors
| CreateCustomMetricResponse' | |
Fields
| |
Instances
newCreateCustomMetricResponse Source #
Create a value of CreateCustomMetricResponse with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:metricName:CreateCustomMetric', createCustomMetricResponse_metricName - The name of the custom metric to be used in the metric report.
$sel:metricArn:CreateCustomMetricResponse', createCustomMetricResponse_metricArn - The Amazon Resource Number (ARN) of the custom metric, e.g.
arn:aws-partition:iot:region:accountId:custommetric/metricName
$sel:httpStatus:CreateCustomMetricResponse', createCustomMetricResponse_httpStatus - The response's http status code.
Response Lenses
createCustomMetricResponse_metricName :: Lens' CreateCustomMetricResponse (Maybe Text) Source #
The name of the custom metric to be used in the metric report.
createCustomMetricResponse_metricArn :: Lens' CreateCustomMetricResponse (Maybe Text) Source #
The Amazon Resource Number (ARN) of the custom metric, e.g.
arn:aws-partition:iot:region:accountId:custommetric/metricName
createCustomMetricResponse_httpStatus :: Lens' CreateCustomMetricResponse Int Source #
The response's http status code.