amazonka-iot-2.0: Amazon IoT SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Creating a Request

data CreateCustomMetric Source #

See: newCreateCustomMetric smart constructor.

Constructors

CreateCustomMetric' 

Fields

  • displayName :: Maybe Text

    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.

  • tags :: Maybe [Tag]

    Metadata that can be used to manage the custom metric.

  • metricName :: Text

    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.

  • metricType :: CustomMetricType

    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.

  • clientRequestToken :: Text

    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.

Instances

Instances details
ToJSON CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

ToHeaders CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

ToPath CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

ToQuery CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

AWSRequest CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

Associated Types

type AWSResponse CreateCustomMetric #

Generic CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

Associated Types

type Rep CreateCustomMetric :: Type -> Type #

Read CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

Show CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

NFData CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

Methods

rnf :: CreateCustomMetric -> () #

Eq CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

Hashable CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

type AWSResponse CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

type Rep CreateCustomMetric Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

type Rep CreateCustomMetric = D1 ('MetaData "CreateCustomMetric" "Amazonka.IoT.CreateCustomMetric" "amazonka-iot-2.0-6w03vgAfmrM1SG22OsNJXL" 'False) (C1 ('MetaCons "CreateCustomMetric'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "displayName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Tag]))) :*: (S1 ('MetaSel ('Just "metricName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "metricType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CustomMetricType) :*: S1 ('MetaSel ('Just "clientRequestToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newCreateCustomMetric Source #

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.

Constructors

CreateCustomMetricResponse' 

Fields

  • metricArn :: Maybe Text

    The Amazon Resource Number (ARN) of the custom metric. For example, arn:aws-partition:iot:region:accountId:custommetric/metricName

  • metricName :: Maybe Text

    The name of the custom metric to be used in the metric report.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic CreateCustomMetricResponse Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

Associated Types

type Rep CreateCustomMetricResponse :: Type -> Type #

Read CreateCustomMetricResponse Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

Show CreateCustomMetricResponse Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

NFData CreateCustomMetricResponse Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

Eq CreateCustomMetricResponse Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

type Rep CreateCustomMetricResponse Source # 
Instance details

Defined in Amazonka.IoT.CreateCustomMetric

type Rep CreateCustomMetricResponse = D1 ('MetaData "CreateCustomMetricResponse" "Amazonka.IoT.CreateCustomMetric" "amazonka-iot-2.0-6w03vgAfmrM1SG22OsNJXL" 'False) (C1 ('MetaCons "CreateCustomMetricResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "metricArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "metricName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

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.