Skip to content

Commit ccd70b0

Browse files
author
awstools
committed
feat(client-iot): Job scheduling enables the scheduled rollout of a Job with start and end times and a customizable end behavior when end time is reached. This is available for continuous and snapshot jobs. Added support for MQTT5 properties to AWS IoT TopicRule Republish Action.
1 parent b941f46 commit ccd70b0

14 files changed

+830
-363
lines changed

clients/client-iot/src/IoT.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,8 +1405,7 @@ export class IoT extends IoTClient {
14051405

14061406
/**
14071407
* <p>Attaches the specified principal to the specified thing. A principal can be X.509
1408-
* certificates, IAM users, groups, and roles, Amazon Cognito identities or federated
1409-
* identities.</p>
1408+
* certificates, Amazon Cognito identities or federated identities.</p>
14101409
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">AttachThingPrincipal</a> action.</p>
14111410
*/
14121411
public attachThingPrincipal(

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ export interface AttachThingPrincipalCommandOutput extends AttachThingPrincipalR
3030

3131
/**
3232
* <p>Attaches the specified principal to the specified thing. A principal can be X.509
33-
* certificates, IAM users, groups, and roles, Amazon Cognito identities or federated
34-
* identities.</p>
33+
* certificates, Amazon Cognito identities or federated identities.</p>
3534
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">AttachThingPrincipal</a> action.</p>
3635
* @example
3736
* Use a bare-bones client and the command you need to make an API call.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
DeleteProvisioningTemplateRequestFilterSensitiveLog,
2020
DeleteProvisioningTemplateResponse,
2121
DeleteProvisioningTemplateResponseFilterSensitiveLog,
22-
} from "../models/models_0";
22+
} from "../models/models_1";
2323
import {
2424
deserializeAws_restJson1DeleteProvisioningTemplateCommand,
2525
serializeAws_restJson1DeleteProvisioningTemplateCommand,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
DeleteProvisioningTemplateVersionRequestFilterSensitiveLog,
2020
DeleteProvisioningTemplateVersionResponse,
2121
DeleteProvisioningTemplateVersionResponseFilterSensitiveLog,
22-
} from "../models/models_0";
22+
} from "../models/models_1";
2323
import {
2424
deserializeAws_restJson1DeleteProvisioningTemplateVersionCommand,
2525
serializeAws_restJson1DeleteProvisioningTemplateVersionCommand,

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ import {
1414
} from "@aws-sdk/types";
1515

1616
import { IoTClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTClient";
17-
import {
18-
ListStreamsRequest,
19-
ListStreamsRequestFilterSensitiveLog,
20-
ListStreamsResponse,
21-
ListStreamsResponseFilterSensitiveLog,
22-
} from "../models/models_1";
17+
import { ListStreamsRequest, ListStreamsRequestFilterSensitiveLog } from "../models/models_1";
18+
import { ListStreamsResponse, ListStreamsResponseFilterSensitiveLog } from "../models/models_2";
2319
import {
2420
deserializeAws_restJson1ListStreamsCommand,
2521
serializeAws_restJson1ListStreamsCommand,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
ListTagsForResourceRequestFilterSensitiveLog,
2020
ListTagsForResourceResponse,
2121
ListTagsForResourceResponseFilterSensitiveLog,
22-
} from "../models/models_1";
22+
} from "../models/models_2";
2323
import {
2424
deserializeAws_restJson1ListTagsForResourceCommand,
2525
serializeAws_restJson1ListTagsForResourceCommand,

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ import {
1414
} from "@aws-sdk/types";
1515

1616
import { IoTClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTClient";
17-
import { ListTargetsForPolicyRequest, ListTargetsForPolicyRequestFilterSensitiveLog } from "../models/models_1";
18-
import { ListTargetsForPolicyResponse, ListTargetsForPolicyResponseFilterSensitiveLog } from "../models/models_2";
17+
import {
18+
ListTargetsForPolicyRequest,
19+
ListTargetsForPolicyRequestFilterSensitiveLog,
20+
ListTargetsForPolicyResponse,
21+
ListTargetsForPolicyResponseFilterSensitiveLog,
22+
} from "../models/models_2";
1923
import {
2024
deserializeAws_restJson1ListTargetsForPolicyCommand,
2125
serializeAws_restJson1ListTargetsForPolicyCommand,

clients/client-iot/src/endpoint/EndpointParameters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const resolveClientEndpointParameters = <T>(
2424
};
2525

2626
export interface EndpointParameters extends __EndpointParameters {
27-
Region?: string;
27+
Region: string;
2828
UseDualStack?: boolean;
2929
UseFIPS?: boolean;
3030
Endpoint?: string;

clients/client-iot/src/endpoint/ruleset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const ruleSet: RuleSetObject = {
66
parameters: {
77
Region: {
88
builtIn: "AWS::Region",
9-
required: false,
9+
required: true,
1010
documentation: "The AWS region used to dispatch the request.",
1111
type: "String",
1212
},

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

Lines changed: 153 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,91 @@ export interface OpenSearchAction {
938938
id: string | undefined;
939939
}
940940

941+
/**
942+
* <p>A key-value pair that you define in the header. Both the key and the value are either
943+
* literal strings or valid <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html">substitution
944+
* templates</a>.</p>
945+
*/
946+
export interface UserProperty {
947+
/**
948+
* <p>A key to be specified in <code>UserProperty</code>.</p>
949+
*/
950+
key: string | undefined;
951+
952+
/**
953+
* <p>A value to be specified in <code>UserProperty</code>.</p>
954+
*/
955+
value: string | undefined;
956+
}
957+
958+
/**
959+
* <p>Specifies MQTT Version 5.0 headers information. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html"> MQTT</a> from
960+
* Amazon Web Services IoT Core Developer Guide.</p>
961+
*/
962+
export interface MqttHeaders {
963+
/**
964+
* <p>An <code>Enum</code> string value that indicates whether the payload is formatted as
965+
* UTF-8.</p>
966+
* <p>Valid values are <code>UNSPECIFIED_BYTES</code> and <code>UTF8_DATA</code>.</p>
967+
* <p>For more information, see <a href="https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901111">
968+
* Payload Format Indicator</a> from the MQTT Version 5.0 specification.</p>
969+
* <p>Supports <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html">substitution
970+
* templates</a>.</p>
971+
*/
972+
payloadFormatIndicator?: string;
973+
974+
/**
975+
* <p>A UTF-8 encoded string that describes the content of the publishing message.</p>
976+
* <p>For more information, see <a href="https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901118">
977+
* Content Type</a> from the MQTT Version 5.0 specification.</p>
978+
* <p>Supports <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html">substitution
979+
* templates</a>.</p>
980+
*/
981+
contentType?: string;
982+
983+
/**
984+
* <p>A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to describe
985+
* the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard
986+
* characters.</p>
987+
* <p>For more information, see <a href="https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901114">
988+
* Response Topic</a> from the MQTT Version 5.0 specification.</p>
989+
* <p>Supports <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html">substitution
990+
* templates</a>.</p>
991+
*/
992+
responseTopic?: string;
993+
994+
/**
995+
* <p>The base64-encoded binary data used by the sender of the request message to identify which request the response message is
996+
* for when it's received.</p>
997+
* <p>For more information, see <a href="https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901115">
998+
* Correlation Data</a> from the MQTT Version 5.0 specification.</p>
999+
* <note>
1000+
* <p>
1001+
* This binary data must be based64-encoded.
1002+
* </p>
1003+
* </note>
1004+
* <p>Supports <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html">substitution
1005+
* templates</a>.</p>
1006+
*/
1007+
correlationData?: string;
1008+
1009+
/**
1010+
* <p>A user-defined integer value that will persist a message at the message broker for a
1011+
* specified amount of time to ensure that the message will expire if it's no longer relevant to
1012+
* the subscriber. The value of <code>messageExpiry</code> represents the number of seconds
1013+
* before it expires. For more information about the limits of <code>messageExpiry</code>, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html">Amazon Web Services IoT Core message broker and protocol
1014+
* limits and quotas </a> from the Amazon Web Services Reference Guide.</p>
1015+
* <p>Supports <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html">substitution
1016+
* templates</a>.</p>
1017+
*/
1018+
messageExpiry?: string;
1019+
1020+
/**
1021+
* <p>An array of key-value pairs that you define in the MQTT5 header.</p>
1022+
*/
1023+
userProperties?: UserProperty[];
1024+
}
1025+
9411026
/**
9421027
* <p>Describes an action to republish to another topic.</p>
9431028
*/
@@ -957,6 +1042,12 @@ export interface RepublishAction {
9571042
* is 0.</p>
9581043
*/
9591044
qos?: number;
1045+
1046+
/**
1047+
* <p>MQTT Version 5.0 headers information. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html">
1048+
* MQTT</a> from the Amazon Web Services IoT Core Developer Guide.</p>
1049+
*/
1050+
headers?: MqttHeaders;
9601051
}
9611052

9621053
export enum CannedAccessControlList {
@@ -3629,6 +3720,41 @@ export interface PresignedUrlConfig {
36293720
expiresInSec?: number;
36303721
}
36313722

3723+
export enum JobEndBehavior {
3724+
CANCEL = "CANCEL",
3725+
FORCE_CANCEL = "FORCE_CANCEL",
3726+
STOP_ROLLOUT = "STOP_ROLLOUT",
3727+
}
3728+
3729+
/**
3730+
* <p>Specifies the date and time that a job will begin the rollout of the job document to all devices in the target group. Additionally, you can specify the end behavior for each job execution when it reaches the scheduled end time.</p>
3731+
*/
3732+
export interface SchedulingConfig {
3733+
/**
3734+
* <p>The time a job will begin rollout of the job document to all devices in the target
3735+
* group for a job. The <code>startTime</code> can be scheduled up to a year in advance and
3736+
* must be scheduled a minimum of thirty minutes from the current time.</p>
3737+
*/
3738+
startTime?: string;
3739+
3740+
/**
3741+
* <p>The time a job will stop rollout of the job document to all devices in the target
3742+
* group for a job. The <code>endTime</code> must take place no later than two years from
3743+
* the current time and be scheduled a minimum of thirty minutes from the current time. The
3744+
* minimum duration between <code>startTime</code> and <code>endTime</code> is thirty
3745+
* minutes. The maximum duration between <code>startTime</code> and <code>endTime</code> is
3746+
* two years. </p>
3747+
*/
3748+
endTime?: string;
3749+
3750+
/**
3751+
* <p>Specifies the end behavior for all job executions after a job reaches the selected
3752+
* <code>endTime</code>. If <code>endTime</code> is not selected when creating the job,
3753+
* then <code>endBehavior</code> does not apply.</p>
3754+
*/
3755+
endBehavior?: JobEndBehavior | string;
3756+
}
3757+
36323758
export enum TargetSelection {
36333759
CONTINUOUS = "CONTINUOUS",
36343760
SNAPSHOT = "SNAPSHOT",
@@ -3760,6 +3886,12 @@ export interface CreateJobRequest {
37603886
* </note>
37613887
*/
37623888
documentParameters?: Record<string, string>;
3889+
3890+
/**
3891+
* <p>The configuration that allows you to schedule a job for a future date and time in
3892+
* addition to specifying the end behavior for each job execution.</p>
3893+
*/
3894+
schedulingConfig?: SchedulingConfig;
37633895
}
37643896

37653897
export interface CreateJobResponse {
@@ -5815,29 +5947,6 @@ export interface DeletePolicyVersionRequest {
58155947
policyVersionId: string | undefined;
58165948
}
58175949

5818-
export interface DeleteProvisioningTemplateRequest {
5819-
/**
5820-
* <p>The name of the fleet provision template to delete.</p>
5821-
*/
5822-
templateName: string | undefined;
5823-
}
5824-
5825-
export interface DeleteProvisioningTemplateResponse {}
5826-
5827-
export interface DeleteProvisioningTemplateVersionRequest {
5828-
/**
5829-
* <p>The name of the provisioning template version to delete.</p>
5830-
*/
5831-
templateName: string | undefined;
5832-
5833-
/**
5834-
* <p>The provisioning template version ID to delete.</p>
5835-
*/
5836-
versionId: number | undefined;
5837-
}
5838-
5839-
export interface DeleteProvisioningTemplateVersionResponse {}
5840-
58415950
/**
58425951
* @internal
58435952
*/
@@ -6042,6 +6151,20 @@ export const OpenSearchActionFilterSensitiveLog = (obj: OpenSearchAction): any =
60426151
...obj,
60436152
});
60446153

6154+
/**
6155+
* @internal
6156+
*/
6157+
export const UserPropertyFilterSensitiveLog = (obj: UserProperty): any => ({
6158+
...obj,
6159+
});
6160+
6161+
/**
6162+
* @internal
6163+
*/
6164+
export const MqttHeadersFilterSensitiveLog = (obj: MqttHeaders): any => ({
6165+
...obj,
6166+
});
6167+
60456168
/**
60466169
* @internal
60476170
*/
@@ -6761,6 +6884,13 @@ export const PresignedUrlConfigFilterSensitiveLog = (obj: PresignedUrlConfig): a
67616884
...obj,
67626885
});
67636886

6887+
/**
6888+
* @internal
6889+
*/
6890+
export const SchedulingConfigFilterSensitiveLog = (obj: SchedulingConfig): any => ({
6891+
...obj,
6892+
});
6893+
67646894
/**
67656895
* @internal
67666896
*/
@@ -7492,35 +7622,3 @@ export const DeletePolicyRequestFilterSensitiveLog = (obj: DeletePolicyRequest):
74927622
export const DeletePolicyVersionRequestFilterSensitiveLog = (obj: DeletePolicyVersionRequest): any => ({
74937623
...obj,
74947624
});
7495-
7496-
/**
7497-
* @internal
7498-
*/
7499-
export const DeleteProvisioningTemplateRequestFilterSensitiveLog = (obj: DeleteProvisioningTemplateRequest): any => ({
7500-
...obj,
7501-
});
7502-
7503-
/**
7504-
* @internal
7505-
*/
7506-
export const DeleteProvisioningTemplateResponseFilterSensitiveLog = (obj: DeleteProvisioningTemplateResponse): any => ({
7507-
...obj,
7508-
});
7509-
7510-
/**
7511-
* @internal
7512-
*/
7513-
export const DeleteProvisioningTemplateVersionRequestFilterSensitiveLog = (
7514-
obj: DeleteProvisioningTemplateVersionRequest
7515-
): any => ({
7516-
...obj,
7517-
});
7518-
7519-
/**
7520-
* @internal
7521-
*/
7522-
export const DeleteProvisioningTemplateVersionResponseFilterSensitiveLog = (
7523-
obj: DeleteProvisioningTemplateVersionResponse
7524-
): any => ({
7525-
...obj,
7526-
});

0 commit comments

Comments
 (0)