Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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' {
- metricArn :: Maybe Text
- metricName :: Maybe Text
- httpStatus :: Int
- newCreateCustomMetricResponse :: Int -> CreateCustomMetricResponse
- createCustomMetricResponse_metricArn :: Lens' CreateCustomMetricResponse (Maybe Text)
- createCustomMetricResponse_metricName :: Lens' CreateCustomMetricResponse (Maybe Text)
- createCustomMetricResponse_httpStatus :: Lens' CreateCustomMetricResponse Int
Creating a Request
data CreateCustomMetric Source #
See: newCreateCustomMetric
smart constructor.
CreateCustomMetric' | |
|
Instances
newCreateCustomMetric Source #
:: 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
- The friendly name in the console for the custom metric. This name
doesn't have to be unique. Don't use this name as the metric
identifier in the device metric report. You can update the friendly name
after you define it.
$sel:tags:CreateCustomMetric'
, createCustomMetric_tags
- Metadata that can be used to manage the custom metric.
CreateCustomMetric
, createCustomMetric_metricName
- The name of the custom metric. This will be used in the metric report
submitted from the device/thing. The name can't begin with aws:
. You
can't change the name after you define it.
$sel:metricType:CreateCustomMetric'
, createCustomMetric_metricType
- The type of the custom metric.
The type number
only takes a single metric value as an input, but when
you submit the metrics value in the DeviceMetrics report, you must pass
it as an array with a single value.
$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 #
The friendly name in the console for the custom metric. This name doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. You can update the friendly name after you define it.
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. The name can't begin with aws:
. You
can't change the name after you define it.
createCustomMetric_metricType :: Lens' CreateCustomMetric CustomMetricType Source #
The type of the custom metric.
The type number
only takes a single metric value as an input, but when
you submit the metrics value in the DeviceMetrics report, you must pass
it as an array with a single value.
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.
CreateCustomMetricResponse' | |
|
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:
CreateCustomMetricResponse
, createCustomMetricResponse_metricArn
- The Amazon Resource Number (ARN) of the custom metric. For example,
arn:
aws-partition
:iot:
region
:
accountId
:custommetric/
metricName
CreateCustomMetric
, createCustomMetricResponse_metricName
- The name of the custom metric to be used in the metric report.
$sel:httpStatus:CreateCustomMetricResponse'
, createCustomMetricResponse_httpStatus
- The response's http status code.
Response Lenses
createCustomMetricResponse_metricArn :: Lens' CreateCustomMetricResponse (Maybe Text) Source #
The Amazon Resource Number (ARN) of the custom metric. For example,
arn:
aws-partition
:iot:
region
:
accountId
:custommetric/
metricName
createCustomMetricResponse_metricName :: Lens' CreateCustomMetricResponse (Maybe Text) Source #
The name of the custom metric to be used in the metric report.
createCustomMetricResponse_httpStatus :: Lens' CreateCustomMetricResponse Int Source #
The response's http status code.