Skip to content

Commit 8709403

Browse files
author
awstools
committed
feat(client-iot): Release connectivity status query API which is a dedicated high throughput(TPS) API to query a specific device's most recent connectivity state and metadata.
1 parent be98eba commit 8709403

12 files changed

+670
-175
lines changed

clients/client-iot/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,14 @@ GetStatistics
13781378

13791379
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/iot/command/GetStatisticsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-iot/Interface/GetStatisticsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-iot/Interface/GetStatisticsCommandOutput/)
13801380

1381+
</details>
1382+
<details>
1383+
<summary>
1384+
GetThingConnectivityData
1385+
</summary>
1386+
1387+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/iot/command/GetThingConnectivityDataCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-iot/Interface/GetThingConnectivityDataCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-iot/Interface/GetThingConnectivityDataCommandOutput/)
1388+
13811389
</details>
13821390
<details>
13831391
<summary>

clients/client-iot/src/IoT.ts

+23
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,11 @@ import {
691691
GetStatisticsCommandInput,
692692
GetStatisticsCommandOutput,
693693
} from "./commands/GetStatisticsCommand";
694+
import {
695+
GetThingConnectivityDataCommand,
696+
GetThingConnectivityDataCommandInput,
697+
GetThingConnectivityDataCommandOutput,
698+
} from "./commands/GetThingConnectivityDataCommand";
694699
import {
695700
GetTopicRuleCommand,
696701
GetTopicRuleCommandInput,
@@ -1427,6 +1432,7 @@ const commands = {
14271432
GetPolicyVersionCommand,
14281433
GetRegistrationCodeCommand,
14291434
GetStatisticsCommand,
1435+
GetThingConnectivityDataCommand,
14301436
GetTopicRuleCommand,
14311437
GetTopicRuleDestinationCommand,
14321438
GetV2LoggingOptionsCommand,
@@ -3849,6 +3855,23 @@ export interface IoT {
38493855
cb: (err: any, data?: GetStatisticsCommandOutput) => void
38503856
): void;
38513857

3858+
/**
3859+
* @see {@link GetThingConnectivityDataCommand}
3860+
*/
3861+
getThingConnectivityData(
3862+
args: GetThingConnectivityDataCommandInput,
3863+
options?: __HttpHandlerOptions
3864+
): Promise<GetThingConnectivityDataCommandOutput>;
3865+
getThingConnectivityData(
3866+
args: GetThingConnectivityDataCommandInput,
3867+
cb: (err: any, data?: GetThingConnectivityDataCommandOutput) => void
3868+
): void;
3869+
getThingConnectivityData(
3870+
args: GetThingConnectivityDataCommandInput,
3871+
options: __HttpHandlerOptions,
3872+
cb: (err: any, data?: GetThingConnectivityDataCommandOutput) => void
3873+
): void;
3874+
38523875
/**
38533876
* @see {@link GetTopicRuleCommand}
38543877
*/

clients/client-iot/src/IoTClient.ts

+6
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,10 @@ import {
441441
GetRegistrationCodeCommandOutput,
442442
} from "./commands/GetRegistrationCodeCommand";
443443
import { GetStatisticsCommandInput, GetStatisticsCommandOutput } from "./commands/GetStatisticsCommand";
444+
import {
445+
GetThingConnectivityDataCommandInput,
446+
GetThingConnectivityDataCommandOutput,
447+
} from "./commands/GetThingConnectivityDataCommand";
444448
import { GetTopicRuleCommandInput, GetTopicRuleCommandOutput } from "./commands/GetTopicRuleCommand";
445449
import {
446450
GetTopicRuleDestinationCommandInput,
@@ -956,6 +960,7 @@ export type ServiceInputTypes =
956960
| GetPolicyVersionCommandInput
957961
| GetRegistrationCodeCommandInput
958962
| GetStatisticsCommandInput
963+
| GetThingConnectivityDataCommandInput
959964
| GetTopicRuleCommandInput
960965
| GetTopicRuleDestinationCommandInput
961966
| GetV2LoggingOptionsCommandInput
@@ -1230,6 +1235,7 @@ export type ServiceOutputTypes =
12301235
| GetPolicyVersionCommandOutput
12311236
| GetRegistrationCodeCommandOutput
12321237
| GetStatisticsCommandOutput
1238+
| GetThingConnectivityDataCommandOutput
12331239
| GetTopicRuleCommandOutput
12341240
| GetTopicRuleDestinationCommandOutput
12351241
| GetV2LoggingOptionsCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { IoTClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTClient";
9+
import {
10+
GetThingConnectivityDataRequest,
11+
GetThingConnectivityDataRequestFilterSensitiveLog,
12+
GetThingConnectivityDataResponse,
13+
GetThingConnectivityDataResponseFilterSensitiveLog,
14+
} from "../models/models_1";
15+
import { de_GetThingConnectivityDataCommand, se_GetThingConnectivityDataCommand } from "../protocols/Aws_restJson1";
16+
17+
/**
18+
* @public
19+
*/
20+
export type { __MetadataBearer };
21+
export { $Command };
22+
/**
23+
* @public
24+
*
25+
* The input for {@link GetThingConnectivityDataCommand}.
26+
*/
27+
export interface GetThingConnectivityDataCommandInput extends GetThingConnectivityDataRequest {}
28+
/**
29+
* @public
30+
*
31+
* The output of {@link GetThingConnectivityDataCommand}.
32+
*/
33+
export interface GetThingConnectivityDataCommandOutput extends GetThingConnectivityDataResponse, __MetadataBearer {}
34+
35+
/**
36+
* <p>Retrieves the live connectivity status per device.</p>
37+
* @example
38+
* Use a bare-bones client and the command you need to make an API call.
39+
* ```javascript
40+
* import { IoTClient, GetThingConnectivityDataCommand } from "@aws-sdk/client-iot"; // ES Modules import
41+
* // const { IoTClient, GetThingConnectivityDataCommand } = require("@aws-sdk/client-iot"); // CommonJS import
42+
* const client = new IoTClient(config);
43+
* const input = { // GetThingConnectivityDataRequest
44+
* thingName: "STRING_VALUE", // required
45+
* };
46+
* const command = new GetThingConnectivityDataCommand(input);
47+
* const response = await client.send(command);
48+
* // { // GetThingConnectivityDataResponse
49+
* // thingName: "STRING_VALUE",
50+
* // connected: true || false,
51+
* // timestamp: new Date("TIMESTAMP"),
52+
* // disconnectReason: "AUTH_ERROR" || "CLIENT_INITIATED_DISCONNECT" || "CLIENT_ERROR" || "CONNECTION_LOST" || "DUPLICATE_CLIENTID" || "FORBIDDEN_ACCESS" || "MQTT_KEEP_ALIVE_TIMEOUT" || "SERVER_ERROR" || "SERVER_INITIATED_DISCONNECT" || "THROTTLED" || "WEBSOCKET_TTL_EXPIRATION" || "CUSTOMAUTH_TTL_EXPIRATION" || "UNKNOWN" || "NONE",
53+
* // };
54+
*
55+
* ```
56+
*
57+
* @param GetThingConnectivityDataCommandInput - {@link GetThingConnectivityDataCommandInput}
58+
* @returns {@link GetThingConnectivityDataCommandOutput}
59+
* @see {@link GetThingConnectivityDataCommandInput} for command's `input` shape.
60+
* @see {@link GetThingConnectivityDataCommandOutput} for command's `response` shape.
61+
* @see {@link IoTClientResolvedConfig | config} for IoTClient's `config` shape.
62+
*
63+
* @throws {@link IndexNotReadyException} (client fault)
64+
* <p>The index is not ready.</p>
65+
*
66+
* @throws {@link InternalFailureException} (server fault)
67+
* <p>An unexpected error has occurred.</p>
68+
*
69+
* @throws {@link InvalidRequestException} (client fault)
70+
* <p>The request is not valid.</p>
71+
*
72+
* @throws {@link ResourceNotFoundException} (client fault)
73+
* <p>The specified resource does not exist.</p>
74+
*
75+
* @throws {@link ServiceUnavailableException} (server fault)
76+
* <p>The service is temporarily unavailable.</p>
77+
*
78+
* @throws {@link ThrottlingException} (client fault)
79+
* <p>The rate exceeds the limit.</p>
80+
*
81+
* @throws {@link UnauthorizedException} (client fault)
82+
* <p>You are not authorized to perform this operation.</p>
83+
*
84+
* @throws {@link IoTServiceException}
85+
* <p>Base exception class for all service exceptions from IoT service.</p>
86+
*
87+
* @public
88+
*/
89+
export class GetThingConnectivityDataCommand extends $Command
90+
.classBuilder<
91+
GetThingConnectivityDataCommandInput,
92+
GetThingConnectivityDataCommandOutput,
93+
IoTClientResolvedConfig,
94+
ServiceInputTypes,
95+
ServiceOutputTypes
96+
>()
97+
.ep(commonParams)
98+
.m(function (this: any, Command: any, cs: any, config: IoTClientResolvedConfig, o: any) {
99+
return [
100+
getSerdePlugin(config, this.serialize, this.deserialize),
101+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
102+
];
103+
})
104+
.s("AWSIotService", "GetThingConnectivityData", {})
105+
.n("IoTClient", "GetThingConnectivityDataCommand")
106+
.f(GetThingConnectivityDataRequestFilterSensitiveLog, GetThingConnectivityDataResponseFilterSensitiveLog)
107+
.ser(se_GetThingConnectivityDataCommand)
108+
.de(de_GetThingConnectivityDataCommand)
109+
.build() {
110+
/** @internal type navigation helper, not in runtime. */
111+
protected declare static __types: {
112+
api: {
113+
input: GetThingConnectivityDataRequest;
114+
output: GetThingConnectivityDataResponse;
115+
};
116+
sdk: {
117+
input: GetThingConnectivityDataCommandInput;
118+
output: GetThingConnectivityDataCommandOutput;
119+
};
120+
};
121+
}

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

+18-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,24 @@ export interface ListCommandExecutionsCommandOutput extends ListCommandExecution
3030
/**
3131
* <p>List all command executions.</p>
3232
* <important>
33-
* <p>You must provide only the
34-
* <code>startedTimeFilter</code> or the <code>completedTimeFilter</code> information. If you
35-
* provide both time filters, the API will generate an error.
36-
* You can use this information to find command executions that started within
37-
* a specific timeframe.</p>
33+
* <ul>
34+
* <li>
35+
* <p>You must provide only the <code>startedTimeFilter</code> or
36+
* the <code>completedTimeFilter</code> information. If you provide
37+
* both time filters, the API will generate an error. You can use
38+
* this information to retrieve a list of command executions
39+
* within a specific timeframe.</p>
40+
* </li>
41+
* <li>
42+
* <p>You must provide only the <code>commandArn</code> or
43+
* the <code>thingArn</code> information depending on whether you want
44+
* to list executions for a specific command or an IoT thing. If you provide
45+
* both fields, the API will generate an error.</p>
46+
* </li>
47+
* </ul>
48+
* <p>For more information about considerations for using this API, see
49+
* <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-remote-command-execution-start-monitor.html#iot-remote-command-execution-list-cli">List
50+
* command executions in your account (CLI)</a>.</p>
3851
* </important>
3952
* @example
4053
* Use a bare-bones client and the command you need to make an API call.

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { IoTClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTClient";
9-
import { ListDetectMitigationActionsExecutionsRequest } from "../models/models_1";
10-
import { ListDetectMitigationActionsExecutionsResponse } from "../models/models_2";
9+
import {
10+
ListDetectMitigationActionsExecutionsRequest,
11+
ListDetectMitigationActionsExecutionsResponse,
12+
} from "../models/models_2";
1113
import {
1214
de_ListDetectMitigationActionsExecutionsCommand,
1315
se_ListDetectMitigationActionsExecutionsCommand,

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

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ export * from "./GetPolicyCommand";
144144
export * from "./GetPolicyVersionCommand";
145145
export * from "./GetRegistrationCodeCommand";
146146
export * from "./GetStatisticsCommand";
147+
export * from "./GetThingConnectivityDataCommand";
147148
export * from "./GetTopicRuleCommand";
148149
export * from "./GetTopicRuleDestinationCommand";
149150
export * from "./GetV2LoggingOptionsCommand";

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -4522,7 +4522,10 @@ export interface CreateCommandRequest {
45224522
mandatoryParameters?: CommandParameter[] | undefined;
45234523

45244524
/**
4525-
* <p>The IAM role that allows access to create the command.</p>
4525+
* <p>The IAM role that you must provide when using the <code>AWS-IoT-FleetWise</code> namespace.
4526+
* The role grants IoT Device Management the permission to access IoT FleetWise resources
4527+
* for generating the payload for the command. This field is not required when you use the
4528+
* <code>AWS-IoT</code> namespace.</p>
45264529
* @public
45274530
*/
45284531
roleArn?: string | undefined;

0 commit comments

Comments
 (0)