Skip to content

Commit 02c0750

Browse files
This release adds event-based logging feature that enables granular event logging controls for AWS IoT logs.
1 parent d0894f3 commit 02c0750

14 files changed

+502
-8
lines changed

generator/ServiceModels/iot/iot-2015-05-28.api.json

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9745,14 +9745,21 @@
97459745
},
97469746
"GetV2LoggingOptionsRequest":{
97479747
"type":"structure",
9748-
"members":{}
9748+
"members":{
9749+
"verbose":{
9750+
"shape":"VerboseFlag",
9751+
"location":"querystring",
9752+
"locationName":"verbose"
9753+
}
9754+
}
97499755
},
97509756
"GetV2LoggingOptionsResponse":{
97519757
"type":"structure",
97529758
"members":{
97539759
"roleArn":{"shape":"AwsArn"},
97549760
"defaultLogLevel":{"shape":"LogLevel"},
9755-
"disableAllLogs":{"shape":"DisableAllLogs"}
9761+
"disableAllLogs":{"shape":"DisableAllLogs"},
9762+
"eventConfigurations":{"shape":"LogEventConfigurations"}
97569763
}
97579764
},
97589765
"GroupNameAndArn":{
@@ -12422,6 +12429,30 @@
1242212429
"unit":{"shape":"String"}
1242312430
}
1242412431
},
12432+
"LogDestination":{
12433+
"type":"string",
12434+
"max":512,
12435+
"min":1,
12436+
"pattern":"^[.\\-_/#A-Za-z0-9]+$"
12437+
},
12438+
"LogEventConfiguration":{
12439+
"type":"structure",
12440+
"required":["eventType"],
12441+
"members":{
12442+
"eventType":{"shape":"LogEventType"},
12443+
"logLevel":{"shape":"LogLevel"},
12444+
"logDestination":{"shape":"LogDestination"}
12445+
}
12446+
},
12447+
"LogEventConfigurations":{
12448+
"type":"list",
12449+
"member":{"shape":"LogEventConfiguration"}
12450+
},
12451+
"LogEventType":{
12452+
"type":"string",
12453+
"max":512,
12454+
"min":1
12455+
},
1242512456
"LogGroupName":{"type":"string"},
1242612457
"LogLevel":{
1242712458
"type":"string",
@@ -14130,7 +14161,8 @@
1413014161
"members":{
1413114162
"roleArn":{"shape":"AwsArn"},
1413214163
"defaultLogLevel":{"shape":"LogLevel"},
14133-
"disableAllLogs":{"shape":"DisableAllLogs"}
14164+
"disableAllLogs":{"shape":"DisableAllLogs"},
14165+
"eventConfigurations":{"shape":"LogEventConfigurations"}
1413414166
}
1413514167
},
1413614168
"ShadowName":{
@@ -15987,6 +16019,7 @@
1598716019
"pattern":"[\\s\\S]*"
1598816020
},
1598916021
"Variance":{"type":"double"},
16022+
"VerboseFlag":{"type":"boolean"},
1599016023
"VerificationState":{
1599116024
"type":"string",
1599216025
"enum":[

generator/ServiceModels/iot/iot-2015-05-28.docs.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@
12291229
"BatchConfig": {
12301230
"base": "<p>Configuration settings for batching.</p>",
12311231
"refs": {
1232-
"HttpAction$batchConfig": "<p>The configuration settings for batching. For more information, see <a href=\"/iot/latest/developerguide/http_batching.html\">Batching HTTP action messages</a>.</p>"
1232+
"HttpAction$batchConfig": "<p>The configuration settings for batching. For more information, see <a href=\"https://docs.aws.amazon.com/iot/latest/developerguide/http_batching.html\"> Batching HTTP action messages</a>.</p>"
12331233
}
12341234
},
12351235
"BatchMode": {
@@ -5464,6 +5464,31 @@
54645464
"LocationAction$timestamp": "<p>The time that the location data was sampled. The default value is the time the MQTT message was processed.</p>"
54655465
}
54665466
},
5467+
"LogDestination": {
5468+
"base": null,
5469+
"refs": {
5470+
"LogEventConfiguration$logDestination": "<p> CloudWatch Log Group for event-based logging. Specifies where log events should be sent. The log destination for event-based logging overrides default Log Group for the specified event type and applies to all resources associated with that event. </p>"
5471+
}
5472+
},
5473+
"LogEventConfiguration": {
5474+
"base": "<p> Configuration for event-based logging that specifies which event types to log and their logging settings. Used for account-level logging overrides. </p>",
5475+
"refs": {
5476+
"LogEventConfigurations$member": null
5477+
}
5478+
},
5479+
"LogEventConfigurations": {
5480+
"base": null,
5481+
"refs": {
5482+
"GetV2LoggingOptionsResponse$eventConfigurations": "<p> The list of event configurations that override account-level logging. </p>",
5483+
"SetV2LoggingOptionsRequest$eventConfigurations": "<p> The list of event configurations that override account-level logging. </p>"
5484+
}
5485+
},
5486+
"LogEventType": {
5487+
"base": null,
5488+
"refs": {
5489+
"LogEventConfiguration$eventType": "<p> The type of event to log. These include event types like Connect, Publish, and Disconnect. </p>"
5490+
}
5491+
},
54675492
"LogGroupName": {
54685493
"base": null,
54695494
"refs": {
@@ -5476,6 +5501,7 @@
54765501
"EnableIoTLoggingParams$logLevel": "<p>Specifies the type of information to be logged.</p>",
54775502
"GetLoggingOptionsResponse$logLevel": "<p>The logging level.</p>",
54785503
"GetV2LoggingOptionsResponse$defaultLogLevel": "<p>The default log level.</p>",
5504+
"LogEventConfiguration$logLevel": "<p> The logging level for the specified event type. Determines the verbosity of log messages generated for this event type. </p>",
54795505
"LogTargetConfiguration$logLevel": "<p>The logging level.</p>",
54805506
"LoggingOptionsPayload$logLevel": "<p>The log level.</p>",
54815507
"SetV2LoggingLevelRequest$logLevel": "<p>The log level.</p>",
@@ -9488,6 +9514,12 @@
94889514
"Statistics$variance": "<p>The variance of the aggregated field values.</p>"
94899515
}
94909516
},
9517+
"VerboseFlag": {
9518+
"base": null,
9519+
"refs": {
9520+
"GetV2LoggingOptionsRequest$verbose": "<p> The flag is used to get all the event types and their respective configuration that event-based logging supports. </p>"
9521+
}
9522+
},
94919523
"VerificationState": {
94929524
"base": null,
94939525
"refs": {

generator/ServiceModels/iot/iot-2015-05-28.normal.json

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13063,7 +13063,14 @@
1306313063
},
1306413064
"GetV2LoggingOptionsRequest":{
1306513065
"type":"structure",
13066-
"members":{}
13066+
"members":{
13067+
"verbose":{
13068+
"shape":"VerboseFlag",
13069+
"documentation":"<p> The flag is used to get all the event types and their respective configuration that event-based logging supports. </p>",
13070+
"location":"querystring",
13071+
"locationName":"verbose"
13072+
}
13073+
}
1306713074
},
1306813075
"GetV2LoggingOptionsResponse":{
1306913076
"type":"structure",
@@ -13079,6 +13086,10 @@
1307913086
"disableAllLogs":{
1308013087
"shape":"DisableAllLogs",
1308113088
"documentation":"<p>Disables all logs.</p>"
13089+
},
13090+
"eventConfigurations":{
13091+
"shape":"LogEventConfigurations",
13092+
"documentation":"<p> The list of event configurations that override account-level logging. </p>"
1308213093
}
1308313094
}
1308413095
},
@@ -13137,7 +13148,7 @@
1313713148
},
1313813149
"batchConfig":{
1313913150
"shape":"BatchConfig",
13140-
"documentation":"<p>The configuration settings for batching. For more information, see <a href=\"/iot/latest/developerguide/http_batching.html\">Batching HTTP action messages</a>.</p>"
13151+
"documentation":"<p>The configuration settings for batching. For more information, see <a href=\"https://docs.aws.amazon.com/iot/latest/developerguide/http_batching.html\"> Batching HTTP action messages</a>.</p>"
1314113152
}
1314213153
},
1314313154
"documentation":"<p>Send data to an HTTPS endpoint.</p>"
@@ -16898,6 +16909,40 @@
1689816909
},
1689916910
"documentation":"<p>Describes how to interpret an application-defined timestamp value from an MQTT message payload and the precision of that value.</p>"
1690016911
},
16912+
"LogDestination":{
16913+
"type":"string",
16914+
"max":512,
16915+
"min":1,
16916+
"pattern":"^[.\\-_/#A-Za-z0-9]+$"
16917+
},
16918+
"LogEventConfiguration":{
16919+
"type":"structure",
16920+
"required":["eventType"],
16921+
"members":{
16922+
"eventType":{
16923+
"shape":"LogEventType",
16924+
"documentation":"<p> The type of event to log. These include event types like Connect, Publish, and Disconnect. </p>"
16925+
},
16926+
"logLevel":{
16927+
"shape":"LogLevel",
16928+
"documentation":"<p> The logging level for the specified event type. Determines the verbosity of log messages generated for this event type. </p>"
16929+
},
16930+
"logDestination":{
16931+
"shape":"LogDestination",
16932+
"documentation":"<p> CloudWatch Log Group for event-based logging. Specifies where log events should be sent. The log destination for event-based logging overrides default Log Group for the specified event type and applies to all resources associated with that event. </p>"
16933+
}
16934+
},
16935+
"documentation":"<p> Configuration for event-based logging that specifies which event types to log and their logging settings. Used for account-level logging overrides. </p>"
16936+
},
16937+
"LogEventConfigurations":{
16938+
"type":"list",
16939+
"member":{"shape":"LogEventConfiguration"}
16940+
},
16941+
"LogEventType":{
16942+
"type":"string",
16943+
"max":512,
16944+
"min":1
16945+
},
1690116946
"LogGroupName":{"type":"string"},
1690216947
"LogLevel":{
1690316948
"type":"string",
@@ -19474,6 +19519,10 @@
1947419519
"disableAllLogs":{
1947519520
"shape":"DisableAllLogs",
1947619521
"documentation":"<p>If true all logs are disabled. The default is false.</p>"
19522+
},
19523+
"eventConfigurations":{
19524+
"shape":"LogEventConfigurations",
19525+
"documentation":"<p> The list of event configurations that override account-level logging. </p>"
1947719526
}
1947819527
}
1947919528
},
@@ -22503,6 +22552,7 @@
2250322552
"pattern":"[\\s\\S]*"
2250422553
},
2250522554
"Variance":{"type":"double"},
22555+
"VerboseFlag":{"type":"boolean"},
2250622556
"VerificationState":{
2250722557
"type":"string",
2250822558
"enum":[

sdk/code-analysis/ServiceAnalysis/IoT/Generated/PropertyValueRules.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4023,6 +4023,17 @@
40234023
<property>Amazon.IoT.Model.KeyPair.PublicKey</property>
40244024
<min>1</min>
40254025
</property-value-rule>
4026+
<property-value-rule>
4027+
<property>Amazon.IoT.Model.LogEventConfiguration.EventType</property>
4028+
<min>1</min>
4029+
<max>512</max>
4030+
</property-value-rule>
4031+
<property-value-rule>
4032+
<property>Amazon.IoT.Model.LogEventConfiguration.LogDestination</property>
4033+
<min>1</min>
4034+
<max>512</max>
4035+
<pattern>^[.\-_/#A-Za-z0-9]+$</pattern>
4036+
</property-value-rule>
40264037
<property-value-rule>
40274038
<property>Amazon.IoT.Model.MaintenanceWindow.DurationInMinutes</property>
40284039
<min>1</min>

sdk/src/Services/IoT/Generated/Model/GetV2LoggingOptionsRequest.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,26 @@ namespace Amazon.IoT.Model
4141
/// </summary>
4242
public partial class GetV2LoggingOptionsRequest : AmazonIoTRequest
4343
{
44+
private bool? _verbose;
45+
46+
/// <summary>
47+
/// Gets and sets the property Verbose.
48+
/// <para>
49+
/// The flag is used to get all the event types and their respective configuration that
50+
/// event-based logging supports.
51+
/// </para>
52+
/// </summary>
53+
public bool? Verbose
54+
{
55+
get { return this._verbose; }
56+
set { this._verbose = value; }
57+
}
58+
59+
// Check to see if Verbose property is set
60+
internal bool IsSetVerbose()
61+
{
62+
return this._verbose.HasValue;
63+
}
4464

4565
}
4666
}

sdk/src/Services/IoT/Generated/Model/GetV2LoggingOptionsResponse.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public partial class GetV2LoggingOptionsResponse : AmazonWebServiceResponse
3636
{
3737
private LogLevel _defaultLogLevel;
3838
private bool? _disableAllLogs;
39+
private List<LogEventConfiguration> _eventConfigurations = AWSConfigs.InitializeCollections ? new List<LogEventConfiguration>() : null;
3940
private string _roleArn;
4041

4142
/// <summary>
@@ -74,6 +75,29 @@ internal bool IsSetDisableAllLogs()
7475
return this._disableAllLogs.HasValue;
7576
}
7677

78+
/// <summary>
79+
/// Gets and sets the property EventConfigurations.
80+
/// <para>
81+
/// The list of event configurations that override account-level logging.
82+
/// </para>
83+
/// <para />
84+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
85+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
86+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
87+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
88+
/// </summary>
89+
public List<LogEventConfiguration> EventConfigurations
90+
{
91+
get { return this._eventConfigurations; }
92+
set { this._eventConfigurations = value; }
93+
}
94+
95+
// Check to see if EventConfigurations property is set
96+
internal bool IsSetEventConfigurations()
97+
{
98+
return this._eventConfigurations != null && (this._eventConfigurations.Count > 0 || !AWSConfigs.InitializeCollections);
99+
}
100+
77101
/// <summary>
78102
/// Gets and sets the property RoleArn.
79103
/// <para>

sdk/src/Services/IoT/Generated/Model/HttpAction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ internal bool IsSetAuth()
6262
/// <summary>
6363
/// Gets and sets the property BatchConfig.
6464
/// <para>
65-
/// The configuration settings for batching. For more information, see <a href="/iot/latest/developerguide/http_batching.html">Batching
66-
/// HTTP action messages</a>.
65+
/// The configuration settings for batching. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/http_batching.html">
66+
/// Batching HTTP action messages</a>.
6767
/// </para>
6868
/// </summary>
6969
public BatchConfig BatchConfig

sdk/src/Services/IoT/Generated/Model/Internal/MarshallTransformations/GetV2LoggingOptionsRequestMarshaller.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ public IRequest Marshall(GetV2LoggingOptionsRequest publicRequest)
6262
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2015-05-28";
6363
request.HttpMethod = "GET";
6464

65+
66+
if (publicRequest.IsSetVerbose())
67+
request.Parameters.Add("verbose", StringUtils.FromBool(publicRequest.Verbose));
6568
request.ResourcePath = "/v2LoggingOptions";
69+
request.UseQueryString = true;
6670

6771
return request;
6872
}

sdk/src/Services/IoT/Generated/Model/Internal/MarshallTransformations/GetV2LoggingOptionsResponseUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont
6464
response.DisableAllLogs = unmarshaller.Unmarshall(context, ref reader);
6565
continue;
6666
}
67+
if (context.TestExpression("eventConfigurations", targetDepth))
68+
{
69+
var unmarshaller = new JsonListUnmarshaller<LogEventConfiguration, LogEventConfigurationUnmarshaller>(LogEventConfigurationUnmarshaller.Instance);
70+
response.EventConfigurations = unmarshaller.Unmarshall(context, ref reader);
71+
continue;
72+
}
6773
if (context.TestExpression("roleArn", targetDepth))
6874
{
6975
var unmarshaller = StringUnmarshaller.Instance;

0 commit comments

Comments
 (0)