Skip to content

Commit

Permalink
feat(client-iot): Added support for IoT Rules Engine Kafka Action Hea…
Browse files Browse the repository at this point in the history
…ders
  • Loading branch information
awstools committed Sep 27, 2023
1 parent f392d88 commit 607458d
Show file tree
Hide file tree
Showing 16 changed files with 242 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ export interface CreateCertificateFromCsrCommandOutput extends CreateCertificate
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">CreateCertificateFromCsr</a> action.
* </p>
* <note>
* <p>The CSR must include a public key that is either an
* RSA key with a length of at least 2048 bits or an ECC key from NIST P-256 or NIST P-384 curves.
* For supported certificates, consult <a href="https://docs.aws.amazon.com/iot/latest/developerguide/x509-client-certs.html#x509-cert-algorithms">
* Certificate signing algorithms supported by IoT</a>.
* </p>
* <p>The CSR must include a public key that is either an RSA key with a length of at least
* 2048 bits or an ECC key from NIST P-256, NIST P-384, or NIST P-521 curves. For supported
* certificates, consult <a href="https://docs.aws.amazon.com/iot/latest/developerguide/x509-client-certs.html#x509-cert-algorithms"> Certificate signing algorithms supported by IoT</a>. </p>
* </note>
* <note>
* <p>Reusing the same certificate signing request (CSR)
Expand Down
12 changes: 12 additions & 0 deletions clients/client-iot/src/commands/CreateTopicRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ export interface CreateTopicRuleCommandOutput extends __MetadataBearer {}
* clientProperties: { // ClientProperties // required
* "<keys>": "STRING_VALUE",
* },
* headers: [ // KafkaHeaders
* { // KafkaActionHeader
* key: "STRING_VALUE", // required
* value: "STRING_VALUE", // required
* },
* ],
* },
* openSearch: { // OpenSearchAction
* roleArn: "STRING_VALUE", // required
Expand Down Expand Up @@ -435,6 +441,12 @@ export interface CreateTopicRuleCommandOutput extends __MetadataBearer {}
* clientProperties: { // required
* "<keys>": "STRING_VALUE",
* },
* headers: [
* {
* key: "STRING_VALUE", // required
* value: "STRING_VALUE", // required
* },
* ],
* },
* openSearch: {
* roleArn: "STRING_VALUE", // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import {
} from "@smithy/types";

import { IoTClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTClient";
import { DeleteDynamicThingGroupRequest, DeleteDynamicThingGroupResponse } from "../models/models_0";
import { DeleteDynamicThingGroupRequest } from "../models/models_0";
import { DeleteDynamicThingGroupResponse } from "../models/models_1";
import { de_DeleteDynamicThingGroupCommand, se_DeleteDynamicThingGroupCommand } from "../protocols/Aws_restJson1";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface DeletePackageVersionCommandOutput extends DeletePackageVersionR
* @public
* <p>Deletes a specific version from a software package.</p>
* <p>
* <b>Note:</b> If a package version is designated as default, you must remove the designation from the package using the <a>UpdatePackage</a> action.</p>
* <b>Note:</b> If a package version is designated as default, you must remove the designation from the software package using the <a>UpdatePackage</a> action.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface DeleteV2LoggingLevelCommandOutput extends __MetadataBearer {}
* // const { IoTClient, DeleteV2LoggingLevelCommand } = require("@aws-sdk/client-iot"); // CommonJS import
* const client = new IoTClient(config);
* const input = { // DeleteV2LoggingLevelRequest
* targetType: "DEFAULT" || "THING_GROUP" || "CLIENT_ID" || "SOURCE_IP" || "PRINCIPAL_ID", // required
* targetType: "DEFAULT" || "THING_GROUP" || "CLIENT_ID" || "SOURCE_IP" || "PRINCIPAL_ID" || "EVENT_TYPE" || "DEVICE_DEFENDER", // required
* targetName: "STRING_VALUE", // required
* };
* const command = new DeleteV2LoggingLevelCommand(input);
Expand Down
12 changes: 12 additions & 0 deletions clients/client-iot/src/commands/GetTopicRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ export interface GetTopicRuleCommandOutput extends GetTopicRuleResponse, __Metad
* // clientProperties: { // ClientProperties // required
* // "<keys>": "STRING_VALUE",
* // },
* // headers: [ // KafkaHeaders
* // { // KafkaActionHeader
* // key: "STRING_VALUE", // required
* // value: "STRING_VALUE", // required
* // },
* // ],
* // },
* // openSearch: { // OpenSearchAction
* // roleArn: "STRING_VALUE", // required
Expand Down Expand Up @@ -441,6 +447,12 @@ export interface GetTopicRuleCommandOutput extends GetTopicRuleResponse, __Metad
* // clientProperties: { // required
* // "<keys>": "STRING_VALUE",
* // },
* // headers: [
* // {
* // key: "STRING_VALUE", // required
* // value: "STRING_VALUE", // required
* // },
* // ],
* // },
* // openSearch: {
* // roleArn: "STRING_VALUE", // required
Expand Down
4 changes: 2 additions & 2 deletions clients/client-iot/src/commands/ListV2LoggingLevelsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface ListV2LoggingLevelsCommandOutput extends ListV2LoggingLevelsRes
* // const { IoTClient, ListV2LoggingLevelsCommand } = require("@aws-sdk/client-iot"); // CommonJS import
* const client = new IoTClient(config);
* const input = { // ListV2LoggingLevelsRequest
* targetType: "DEFAULT" || "THING_GROUP" || "CLIENT_ID" || "SOURCE_IP" || "PRINCIPAL_ID",
* targetType: "DEFAULT" || "THING_GROUP" || "CLIENT_ID" || "SOURCE_IP" || "PRINCIPAL_ID" || "EVENT_TYPE" || "DEVICE_DEFENDER",
* nextToken: "STRING_VALUE",
* maxResults: Number("int"),
* };
Expand All @@ -56,7 +56,7 @@ export interface ListV2LoggingLevelsCommandOutput extends ListV2LoggingLevelsRes
* // logTargetConfigurations: [ // LogTargetConfigurations
* // { // LogTargetConfiguration
* // logTarget: { // LogTarget
* // targetType: "DEFAULT" || "THING_GROUP" || "CLIENT_ID" || "SOURCE_IP" || "PRINCIPAL_ID", // required
* // targetType: "DEFAULT" || "THING_GROUP" || "CLIENT_ID" || "SOURCE_IP" || "PRINCIPAL_ID" || "EVENT_TYPE" || "DEVICE_DEFENDER", // required
* // targetName: "STRING_VALUE",
* // },
* // logLevel: "DEBUG" || "INFO" || "ERROR" || "WARN" || "DISABLED",
Expand Down
12 changes: 12 additions & 0 deletions clients/client-iot/src/commands/ReplaceTopicRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ export interface ReplaceTopicRuleCommandOutput extends __MetadataBearer {}
* clientProperties: { // ClientProperties // required
* "<keys>": "STRING_VALUE",
* },
* headers: [ // KafkaHeaders
* { // KafkaActionHeader
* key: "STRING_VALUE", // required
* value: "STRING_VALUE", // required
* },
* ],
* },
* openSearch: { // OpenSearchAction
* roleArn: "STRING_VALUE", // required
Expand Down Expand Up @@ -436,6 +442,12 @@ export interface ReplaceTopicRuleCommandOutput extends __MetadataBearer {}
* clientProperties: { // required
* "<keys>": "STRING_VALUE",
* },
* headers: [
* {
* key: "STRING_VALUE", // required
* value: "STRING_VALUE", // required
* },
* ],
* },
* openSearch: {
* roleArn: "STRING_VALUE", // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface SetV2LoggingLevelCommandOutput extends __MetadataBearer {}
* const client = new IoTClient(config);
* const input = { // SetV2LoggingLevelRequest
* logTarget: { // LogTarget
* targetType: "DEFAULT" || "THING_GROUP" || "CLIENT_ID" || "SOURCE_IP" || "PRINCIPAL_ID", // required
* targetType: "DEFAULT" || "THING_GROUP" || "CLIENT_ID" || "SOURCE_IP" || "PRINCIPAL_ID" || "EVENT_TYPE" || "DEVICE_DEFENDER", // required
* targetName: "STRING_VALUE",
* },
* logLevel: "DEBUG" || "INFO" || "ERROR" || "WARN" || "DISABLED", // required
Expand Down
2 changes: 1 addition & 1 deletion clients/client-iot/src/commands/UpdatePackageCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface UpdatePackageCommandOutput extends UpdatePackageResponse, __Met

/**
* @public
* <p>Updates the supported fields for a specific package.</p>
* <p>Updates the supported fields for a specific software package.</p>
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">UpdatePackage</a> and <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">GetIndexingConfiguration</a> actions.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface UpdatePackageConfigurationCommandOutput extends UpdatePackageCo

/**
* @public
* <p>Updates the package configuration.</p>
* <p>Updates the software package configuration.</p>
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">UpdatePackageConfiguration</a> and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html">iam:PassRole</a> actions.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
69 changes: 47 additions & 22 deletions clients/client-iot/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,28 @@ export interface IotSiteWiseAction {
roleArn: string | undefined;
}

/**
* @public
* <p>Specifies a Kafka header using key-value pairs when you create a Rule’s Kafka Action.
* You can use these headers to route data from IoT clients to downstream Kafka clusters
* without modifying your message payload.</p>
* <p>For more information about Rule's Kafka action, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/apache-kafka-rule-action.html">Apache Kafka</a>.
* </p>
*/
export interface KafkaActionHeader {
/**
* @public
* <p>The key of the Kafka header.</p>
*/
key: string | undefined;

/**
* @public
* <p>The value of the Kafka header.</p>
*/
value: string | undefined;
}

/**
* @public
* <p>Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.</p>
Expand Down Expand Up @@ -966,6 +988,12 @@ export interface KafkaAction {
* <p>Properties of the Apache Kafka producer client.</p>
*/
clientProperties: Record<string, string> | undefined;

/**
* @public
* <p>The list of Kafka headers that you specify.</p>
*/
headers?: KafkaActionHeader[];
}

/**
Expand Down Expand Up @@ -1934,8 +1962,10 @@ export interface Behavior {

/**
* @public
* <p>The criteria that determine if a device is behaving normally in regard to
* the <code>metric</code>.</p>
* <p>The criteria that determine if a device is behaving normally in regard to the <code>metric</code>.</p>
* <note>
* <p>In the IoT console, you can choose to be sent an alert through Amazon SNS when IoT Device Defender detects that a device is behaving anomalously.</p>
* </note>
*/
criteria?: BehaviorCriteria;

Expand Down Expand Up @@ -4718,6 +4748,8 @@ export interface SchedulingConfig {
* must be scheduled a minimum of thirty minutes from the current time. The date and time
* format for the <code>startTime</code> is YYYY-MM-DD for the date and HH:MM for the
* time.</p>
* <p>For more information on the syntax for <code>startTime</code> when using an API
* command or the Command Line Interface, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp">Timestamp</a>.</p>
*/
startTime?: string;

Expand All @@ -4730,6 +4762,8 @@ export interface SchedulingConfig {
* minutes. The maximum duration between <code>startTime</code> and <code>endTime</code> is
* two years. The date and time format for the <code>endTime</code> is YYYY-MM-DD for the
* date and HH:MM for the time.</p>
* <p>For more information on the syntax for <code>endTime</code> when using an API command
* or the Command Line Interface, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp">Timestamp</a>.</p>
*/
endTime?: string;

Expand Down Expand Up @@ -4991,15 +5025,10 @@ export interface CreateJobTemplateRequest {

/**
* @public
* <p>An S3 link to the job document to use in the template. Required if you don't specify a value for <code>document</code>.</p>
* <note>
* <p>If the job document resides in an S3 bucket, you must use a placeholder link when specifying the document.</p>
* <p>The placeholder link is of the following form:</p>
* <p>
* <code>$\{aws:iot:s3-presigned-url:https://s3.amazonaws.com/<i>bucket</i>/<i>key</i>\}</code>
* </p>
* <p>where <i>bucket</i> is your bucket name and <i>key</i> is the object in the bucket to which you are linking.</p>
* </note>
* <p>An S3 link, or S3 object URL, to the job document. The link is an Amazon S3 object URL and is required if you don't specify a value for <code>document</code>.</p>
* <p>For example, <code>--document-source https://s3.<i>region-code</i>.amazonaws.com/example-firmware/device-firmware.1.0</code>
* </p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html">Methods for accessing a bucket</a>.</p>
*/
documentSource?: string;

Expand Down Expand Up @@ -5795,7 +5824,7 @@ export interface OTAUpdateFile {

/**
* @public
* <p>A list of name/attribute pairs.</p>
* <p>A list of name-attribute pairs. They won't be sent to devices as a part of the Job document.</p>
*/
attributes?: Record<string, string>;
}
Expand Down Expand Up @@ -5895,7 +5924,8 @@ export interface CreateOTAUpdateRequest {

/**
* @public
* <p>A list of additional OTA update parameters which are name-value pairs.</p>
* <p>A list of additional OTA update parameters, which are name-value pairs.
* They won't be sent to devices as a part of the Job document.</p>
*/
additionalParameters?: Record<string, string>;

Expand Down Expand Up @@ -5965,7 +5995,7 @@ export interface CreateOTAUpdateResponse {
export interface CreatePackageRequest {
/**
* @public
* <p>The name of the new package.</p>
* <p>The name of the new software package.</p>
*/
packageName: string | undefined;

Expand Down Expand Up @@ -5995,7 +6025,7 @@ export interface CreatePackageRequest {
export interface CreatePackageResponse {
/**
* @public
* <p>The name of the package.</p>
* <p>The name of the software package.</p>
*/
packageName?: string;

Expand Down Expand Up @@ -6079,7 +6109,7 @@ export class ValidationException extends __BaseException {
export interface CreatePackageVersionRequest {
/**
* @public
* <p>The name of the associated package.</p>
* <p>The name of the associated software package.</p>
*/
packageName: string | undefined;

Expand Down Expand Up @@ -6143,7 +6173,7 @@ export interface CreatePackageVersionResponse {

/**
* @public
* <p>The name of the associated package.</p>
* <p>The name of the associated software package.</p>
*/
packageName?: string;

Expand Down Expand Up @@ -7582,11 +7612,6 @@ export interface DeleteDynamicThingGroupRequest {
expectedVersion?: number;
}

/**
* @public
*/
export interface DeleteDynamicThingGroupResponse {}

/**
* @internal
*/
Expand Down
Loading

0 comments on commit 607458d

Please sign in to comment.