Skip to content

Commit 358a73e

Browse files
author
awstools
committed
feat(client-iot): GA release the ability to enable/disable IoT Fleet Indexing for Device Defender and Named Shadow information, and search them through IoT Fleet Indexing APIs. This includes Named Shadow Selection as a part of the UpdateIndexingConfiguration API.
1 parent 559d71c commit 358a73e

File tree

7 files changed

+139
-25
lines changed

7 files changed

+139
-25
lines changed

clients/client-iot/src/IoT.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,8 @@ export class IoT extends IoTClient {
13311331
* <p>Attaches the specified policy to the specified principal (certificate or other
13321332
* credential).</p>
13331333
* <p>
1334-
* <b>Note:</b> This action is deprecated. Please use <a>AttachPolicy</a> instead.</p>
1334+
* <b>Note:</b> This action is deprecated and works as
1335+
* expected for backward compatibility, but we won't add enhancements. Use <a>AttachPolicy</a> instead.</p>
13351336
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">AttachPrincipalPolicy</a> action.</p>
13361337
*/
13371338
public attachPrincipalPolicy(

clients/client-iot/src/commands/AttachPrincipalPolicyCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export interface AttachPrincipalPolicyCommandOutput extends __MetadataBearer {}
2828
* <p>Attaches the specified policy to the specified principal (certificate or other
2929
* credential).</p>
3030
* <p>
31-
* <b>Note:</b> This action is deprecated. Please use <a>AttachPolicy</a> instead.</p>
31+
* <b>Note:</b> This action is deprecated and works as
32+
* expected for backward compatibility, but we won't add enhancements. Use <a>AttachPolicy</a> instead.</p>
3233
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">AttachPrincipalPolicy</a> action.</p>
3334
* @example
3435
* Use a bare-bones client and the command you need to make an API call.

clients/client-iot/src/commands/ListThingGroupsForThingCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
} from "@aws-sdk/types";
1414

1515
import { IoTClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTClient";
16-
import { ListThingGroupsForThingRequest, ListThingGroupsForThingResponse } from "../models/models_1";
16+
import { ListThingGroupsForThingRequest } from "../models/models_1";
17+
import { ListThingGroupsForThingResponse } from "../models/models_2";
1718
import {
1819
deserializeAws_restJson1ListThingGroupsForThingCommand,
1920
serializeAws_restJson1ListThingGroupsForThingCommand,

clients/client-iot/src/models/models_1.ts

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4181,6 +4181,30 @@ export enum DeviceDefenderIndexingMode {
41814181
VIOLATIONS = "VIOLATIONS",
41824182
}
41834183

4184+
/**
4185+
* <p>Provides additional filters for specific data sources. Named shadow is the only data source that currently supports and requires a filter.
4186+
* To add named shadows to your fleet indexing configuration, set <code>namedShadowIndexingMode</code> to be <code>ON</code> and
4187+
* specify your shadow names in <code>filter</code>.</p>
4188+
*/
4189+
export interface IndexingFilter {
4190+
/**
4191+
* <p>The shadow names that you select to index. The default maximum number of shadow names for indexing is 10. To increase
4192+
* the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management
4193+
* Quotas</a> in the <i>Amazon Web Services General Reference</i>.
4194+
* </p>
4195+
*/
4196+
namedShadowNames?: string[];
4197+
}
4198+
4199+
export namespace IndexingFilter {
4200+
/**
4201+
* @internal
4202+
*/
4203+
export const filterSensitiveLog = (obj: IndexingFilter): any => ({
4204+
...obj,
4205+
});
4206+
}
4207+
41844208
export enum NamedShadowIndexingMode {
41854209
OFF = "OFF",
41864210
ON = "ON",
@@ -4277,6 +4301,13 @@ export interface ThingIndexingConfiguration {
42774301
* <p>Contains custom field names and their data type.</p>
42784302
*/
42794303
customFields?: Field[];
4304+
4305+
/**
4306+
* <p>Provides additional filters for specific data sources. Named shadow is the only data source that currently supports and requires a filter.
4307+
* To add named shadows to your fleet indexing configuration, set <code>namedShadowIndexingMode</code> to be <code>ON</code> and
4308+
* specify your shadow names in <code>filter</code>.</p>
4309+
*/
4310+
filter?: IndexingFilter;
42804311
}
42814312

42824313
export namespace ThingIndexingConfiguration {
@@ -8395,24 +8426,3 @@ export namespace ListThingGroupsForThingRequest {
83958426
...obj,
83968427
});
83978428
}
8398-
8399-
export interface ListThingGroupsForThingResponse {
8400-
/**
8401-
* <p>The thing groups.</p>
8402-
*/
8403-
thingGroups?: GroupNameAndArn[];
8404-
8405-
/**
8406-
* <p>The token to use to get the next set of results, or <b>null</b> if there are no additional results.</p>
8407-
*/
8408-
nextToken?: string;
8409-
}
8410-
8411-
export namespace ListThingGroupsForThingResponse {
8412-
/**
8413-
* @internal
8414-
*/
8415-
export const filterSensitiveLog = (obj: ListThingGroupsForThingResponse): any => ({
8416-
...obj,
8417-
});
8418-
}

clients/client-iot/src/models/models_2.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import {
4949
Configuration,
5050
DetectMitigationActionsTaskTarget,
5151
DomainConfigurationStatus,
52+
GroupNameAndArn,
5253
LogTargetType,
5354
RegistrationConfig,
5455
Status,
@@ -58,6 +59,27 @@ import {
5859
ViolationEventOccurrenceRange,
5960
} from "./models_1";
6061

62+
export interface ListThingGroupsForThingResponse {
63+
/**
64+
* <p>The thing groups.</p>
65+
*/
66+
thingGroups?: GroupNameAndArn[];
67+
68+
/**
69+
* <p>The token to use to get the next set of results, or <b>null</b> if there are no additional results.</p>
70+
*/
71+
nextToken?: string;
72+
}
73+
74+
export namespace ListThingGroupsForThingResponse {
75+
/**
76+
* @internal
77+
*/
78+
export const filterSensitiveLog = (obj: ListThingGroupsForThingResponse): any => ({
79+
...obj,
80+
});
81+
}
82+
6183
/**
6284
* <p>The input for the ListThingPrincipal operation.</p>
6385
*/

clients/client-iot/src/protocols/Aws_restJson1.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@ import {
837837
Field,
838838
FleetMetricNameAndArn,
839839
GroupNameAndArn,
840+
IndexingFilter,
840841
InternalServerException,
841842
Job,
842843
JobExecution,
@@ -24326,6 +24327,14 @@ const serializeAws_restJson1HttpUrlDestinationConfiguration = (
2432624327
};
2432724328
};
2432824329

24330+
const serializeAws_restJson1IndexingFilter = (input: IndexingFilter, context: __SerdeContext): any => {
24331+
return {
24332+
...(input.namedShadowNames != null && {
24333+
namedShadowNames: serializeAws_restJson1NamedShadowNamesFilter(input.namedShadowNames, context),
24334+
}),
24335+
};
24336+
};
24337+
2432924338
const serializeAws_restJson1IotAnalyticsAction = (input: IotAnalyticsAction, context: __SerdeContext): any => {
2433024339
return {
2433124340
...(input.batchMode != null && { batchMode: input.batchMode }),
@@ -24523,6 +24532,17 @@ const serializeAws_restJson1MqttContext = (input: MqttContext, context: __SerdeC
2452324532
};
2452424533
};
2452524534

24535+
const serializeAws_restJson1NamedShadowNamesFilter = (input: string[], context: __SerdeContext): any => {
24536+
return input
24537+
.filter((e: any) => e != null)
24538+
.map((entry) => {
24539+
if (entry === null) {
24540+
return null as any;
24541+
}
24542+
return entry;
24543+
});
24544+
};
24545+
2452624546
const serializeAws_restJson1NumberList = (input: number[], context: __SerdeContext): any => {
2452724547
return input
2452824548
.filter((e: any) => e != null)
@@ -25095,6 +25115,7 @@ const serializeAws_restJson1ThingIndexingConfiguration = (
2509525115
return {
2509625116
...(input.customFields != null && { customFields: serializeAws_restJson1Fields(input.customFields, context) }),
2509725117
...(input.deviceDefenderIndexingMode != null && { deviceDefenderIndexingMode: input.deviceDefenderIndexingMode }),
25118+
...(input.filter != null && { filter: serializeAws_restJson1IndexingFilter(input.filter, context) }),
2509825119
...(input.managedFields != null && { managedFields: serializeAws_restJson1Fields(input.managedFields, context) }),
2509925120
...(input.namedShadowIndexingMode != null && { namedShadowIndexingMode: input.namedShadowIndexingMode }),
2510025121
...(input.thingConnectivityIndexingMode != null && {
@@ -26777,6 +26798,15 @@ const deserializeAws_restJson1ImplicitDeny = (output: any, context: __SerdeConte
2677726798
} as any;
2677826799
};
2677926800

26801+
const deserializeAws_restJson1IndexingFilter = (output: any, context: __SerdeContext): IndexingFilter => {
26802+
return {
26803+
namedShadowNames:
26804+
output.namedShadowNames != null
26805+
? deserializeAws_restJson1NamedShadowNamesFilter(output.namedShadowNames, context)
26806+
: undefined,
26807+
} as any;
26808+
};
26809+
2678026810
const deserializeAws_restJson1IndexNamesList = (output: any, context: __SerdeContext): string[] => {
2678126811
const retVal = (output || [])
2678226812
.filter((e: any) => e != null)
@@ -27353,6 +27383,18 @@ const deserializeAws_restJson1MitigationActionParams = (
2735327383
} as any;
2735427384
};
2735527385

27386+
const deserializeAws_restJson1NamedShadowNamesFilter = (output: any, context: __SerdeContext): string[] => {
27387+
const retVal = (output || [])
27388+
.filter((e: any) => e != null)
27389+
.map((entry: any) => {
27390+
if (entry === null) {
27391+
return null as any;
27392+
}
27393+
return __expectString(entry) as any;
27394+
});
27395+
return retVal;
27396+
};
27397+
2735627398
const deserializeAws_restJson1NonCompliantResource = (output: any, context: __SerdeContext): NonCompliantResource => {
2735727399
return {
2735827400
additionalInfo:
@@ -28581,6 +28623,7 @@ const deserializeAws_restJson1ThingIndexingConfiguration = (
2858128623
customFields:
2858228624
output.customFields != null ? deserializeAws_restJson1Fields(output.customFields, context) : undefined,
2858328625
deviceDefenderIndexingMode: __expectString(output.deviceDefenderIndexingMode),
28626+
filter: output.filter != null ? deserializeAws_restJson1IndexingFilter(output.filter, context) : undefined,
2858428627
managedFields:
2858528628
output.managedFields != null ? deserializeAws_restJson1Fields(output.managedFields, context) : undefined,
2858628629
namedShadowIndexingMode: __expectString(output.namedShadowIndexingMode),

codegen/sdk-codegen/aws-models/iot.json

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,7 @@
18021802
],
18031803
"traits": {
18041804
"smithy.api#deprecated": {},
1805-
"smithy.api#documentation": "<p>Attaches the specified policy to the specified principal (certificate or other\n credential).</p>\n <p>\n <b>Note:</b> This action is deprecated. Please use <a>AttachPolicy</a> instead.</p>\n <p>Requires permission to access the <a href=\"https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions\">AttachPrincipalPolicy</a> action.</p>",
1805+
"smithy.api#documentation": "<p>Attaches the specified policy to the specified principal (certificate or other\n credential).</p>\n <p>\n <b>Note:</b> This action is deprecated and works as\n expected for backward compatibility, but we won't add enhancements. Use <a>AttachPolicy</a> instead.</p>\n <p>Requires permission to access the <a href=\"https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions\">AttachPrincipalPolicy</a> action.</p>",
18061806
"smithy.api#http": {
18071807
"method": "PUT",
18081808
"uri": "/principal-policies/{policyName}",
@@ -15615,6 +15615,20 @@
1561515615
]
1561615616
}
1561715617
},
15618+
"com.amazonaws.iot#IndexingFilter": {
15619+
"type": "structure",
15620+
"members": {
15621+
"namedShadowNames": {
15622+
"target": "com.amazonaws.iot#NamedShadowNamesFilter",
15623+
"traits": {
15624+
"smithy.api#documentation": "<p>The shadow names that you select to index. The default maximum number of shadow names for indexing is 10. To increase \n the limit, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits\">Amazon Web Services IoT Device Management \n Quotas</a> in the <i>Amazon Web Services General Reference</i>.\n </p>"
15625+
}
15626+
}
15627+
},
15628+
"traits": {
15629+
"smithy.api#documentation": "<p>Provides additional filters for specific data sources. Named shadow is the only data source that currently supports and requires a filter.\n To add named shadows to your fleet indexing configuration, set <code>namedShadowIndexingMode</code> to be <code>ON</code> and \n specify your shadow names in <code>filter</code>.</p>"
15630+
}
15631+
},
1561815632
"com.amazonaws.iot#InlineDocument": {
1561915633
"type": "string"
1562015634
},
@@ -22385,6 +22399,12 @@
2238522399
]
2238622400
}
2238722401
},
22402+
"com.amazonaws.iot#NamedShadowNamesFilter": {
22403+
"type": "list",
22404+
"member": {
22405+
"target": "com.amazonaws.iot#ShadowName"
22406+
}
22407+
},
2238822408
"com.amazonaws.iot#NamespaceId": {
2238922409
"type": "string",
2239022410
"traits": {
@@ -25598,6 +25618,16 @@
2559825618
}
2559925619
}
2560025620
},
25621+
"com.amazonaws.iot#ShadowName": {
25622+
"type": "string",
25623+
"traits": {
25624+
"smithy.api#length": {
25625+
"min": 1,
25626+
"max": 64
25627+
},
25628+
"smithy.api#pattern": "^[a-zA-Z0-9:_-]+$"
25629+
}
25630+
},
2560125631
"com.amazonaws.iot#SigV4Authorization": {
2560225632
"type": "structure",
2560325633
"members": {
@@ -27474,6 +27504,12 @@
2747427504
"traits": {
2747527505
"smithy.api#documentation": "<p>Contains custom field names and their data type.</p>"
2747627506
}
27507+
},
27508+
"filter": {
27509+
"target": "com.amazonaws.iot#IndexingFilter",
27510+
"traits": {
27511+
"smithy.api#documentation": "<p>Provides additional filters for specific data sources. Named shadow is the only data source that currently supports and requires a filter.\n To add named shadows to your fleet indexing configuration, set <code>namedShadowIndexingMode</code> to be <code>ON</code> and \n specify your shadow names in <code>filter</code>.</p>"
27512+
}
2747727513
}
2747827514
},
2747927515
"traits": {

0 commit comments

Comments
 (0)