Skip to content

Commit 8b88532

Browse files
CloudWatchLogs launches GetLogObject API with streaming support for efficient log data retrieval. Logs added support for new AccountPolicy type METRIC_EXTRACTION_POLICY. For more information, see CloudWatch Logs API documentation
1 parent 2efe31e commit 8b88532

20 files changed

+2067
-44
lines changed

generator/ServiceModels/logs/logs-2014-03-28.api.json

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,23 @@
775775
{"shape":"ServiceUnavailableException"}
776776
]
777777
},
778+
"GetLogObject":{
779+
"name":"GetLogObject",
780+
"http":{
781+
"method":"POST",
782+
"requestUri":"/"
783+
},
784+
"input":{"shape":"GetLogObjectRequest"},
785+
"output":{"shape":"GetLogObjectResponse"},
786+
"errors":[
787+
{"shape":"AccessDeniedException"},
788+
{"shape":"InvalidParameterException"},
789+
{"shape":"ResourceNotFoundException"},
790+
{"shape":"LimitExceededException"},
791+
{"shape":"InvalidOperationException"}
792+
],
793+
"endpoint":{"hostPrefix":"streaming-"}
794+
},
778795
"GetLogRecord":{
779796
"name":"GetLogRecord",
780797
"http":{
@@ -1710,6 +1727,7 @@
17101727
"type":"list",
17111728
"member":{"shape":"Arn"}
17121729
},
1730+
"Data":{"type":"blob"},
17131731
"DataAlreadyAcceptedException":{
17141732
"type":"structure",
17151733
"members":{
@@ -2579,6 +2597,13 @@
25792597
"type":"list",
25802598
"member":{"shape":"FieldIndex"}
25812599
},
2600+
"FieldsData":{
2601+
"type":"structure",
2602+
"members":{
2603+
"data":{"shape":"Data"}
2604+
},
2605+
"event":true
2606+
},
25822607
"FilterCount":{"type":"integer"},
25832608
"FilterLogEventsRequest":{
25842609
"type":"structure",
@@ -2789,6 +2814,28 @@
27892814
"logGroupFields":{"shape":"LogGroupFieldList"}
27902815
}
27912816
},
2817+
"GetLogObjectRequest":{
2818+
"type":"structure",
2819+
"required":["logObjectPointer"],
2820+
"members":{
2821+
"unmask":{"shape":"Unmask"},
2822+
"logObjectPointer":{"shape":"LogObjectPointer"}
2823+
}
2824+
},
2825+
"GetLogObjectResponse":{
2826+
"type":"structure",
2827+
"members":{
2828+
"fieldStream":{"shape":"GetLogObjectResponseStream"}
2829+
}
2830+
},
2831+
"GetLogObjectResponseStream":{
2832+
"type":"structure",
2833+
"members":{
2834+
"fields":{"shape":"FieldsData"},
2835+
"InternalStreamingException":{"shape":"InternalStreamingException"}
2836+
},
2837+
"eventstream":true
2838+
},
27922839
"GetLogRecordRequest":{
27932840
"type":"structure",
27942841
"required":["logRecordPointer"],
@@ -2960,6 +3007,13 @@
29603007
"enum":["OPENSEARCH"]
29613008
},
29623009
"Interleaved":{"type":"boolean"},
3010+
"InternalStreamingException":{
3011+
"type":"structure",
3012+
"members":{
3013+
"message":{"shape":"Message"}
3014+
},
3015+
"exception":true
3016+
},
29633017
"InvalidOperationException":{
29643018
"type":"structure",
29653019
"members":{},
@@ -3291,6 +3345,11 @@
32913345
"type":"list",
32923346
"member":{"shape":"LogGroup"}
32933347
},
3348+
"LogObjectPointer":{
3349+
"type":"string",
3350+
"max":512,
3351+
"min":1
3352+
},
32943353
"LogRecord":{
32953354
"type":"map",
32963355
"key":{"shape":"Field"},
@@ -3773,7 +3832,8 @@
37733832
"DATA_PROTECTION_POLICY",
37743833
"SUBSCRIPTION_FILTER_POLICY",
37753834
"FIELD_INDEX_POLICY",
3776-
"TRANSFORMER_POLICY"
3835+
"TRANSFORMER_POLICY",
3836+
"METRIC_EXTRACTION_POLICY"
37773837
]
37783838
},
37793839
"Priority":{

generator/ServiceModels/logs/logs-2014-03-28.docs.json

Lines changed: 44 additions & 3 deletions
Large diffs are not rendered by default.

generator/ServiceModels/logs/logs-2014-03-28.normal.json

Lines changed: 79 additions & 4 deletions
Large diffs are not rendered by default.

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,11 @@
712712
<property>Amazon.CloudWatchLogs.Model.GetLogGroupFieldsRequest.Time</property>
713713
<min>0</min>
714714
</property-value-rule>
715+
<property-value-rule>
716+
<property>Amazon.CloudWatchLogs.Model.GetLogObjectRequest.LogObjectPointer</property>
717+
<min>1</min>
718+
<max>512</max>
719+
</property-value-rule>
715720
<property-value-rule>
716721
<property>Amazon.CloudWatchLogs.Model.GetQueryResultsRequest.QueryId</property>
717722
<min>1</min>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the logs-2014-03-28.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
using Amazon.Runtime.EventStreams;
29+
using Amazon.Runtime.EventStreams.Internal;
30+
using Amazon.CloudWatchLogs.Model.Internal.MarshallTransformations;
31+
using Amazon.Runtime.EventStreams.Utils;
32+
using Amazon.Runtime.Internal.Util;
33+
34+
#pragma warning disable CS0612,CS0618,CS1570
35+
namespace Amazon.CloudWatchLogs.Model
36+
{
37+
/// <summary>
38+
/// A structure containing the extracted fields from a log event. These fields are extracted
39+
/// based on the log format and can be used for structured querying and analysis.
40+
/// </summary>
41+
public partial class FieldsData
42+
: IEventStreamEvent
43+
{
44+
private MemoryStream _data;
45+
46+
/// <summary>
47+
/// Gets and sets the property Data.
48+
/// <para>
49+
/// The actual log data content returned in the streaming response. This contains the
50+
/// fields and values of the log event in a structured format that can be parsed and processed
51+
/// by the client.
52+
/// </para>
53+
/// </summary>
54+
public MemoryStream Data
55+
{
56+
get { return this._data; }
57+
set { this._data = value; }
58+
}
59+
60+
// Check to see if Data property is set
61+
internal bool IsSetData()
62+
{
63+
return this._data != null;
64+
}
65+
66+
}
67+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the logs-2014-03-28.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.CloudWatchLogs.Model
31+
{
32+
/// <summary>
33+
/// Container for the parameters to the GetLogObject operation.
34+
/// Retrieves a large logging object (LLO) and streams it back. This API is used to fetch
35+
/// the content of large portions of log events that have been ingested through the PutOpenTelemetryLogs
36+
/// API. When log events contain fields that would cause the total event size to exceed
37+
/// 1MB, CloudWatch Logs automatically processes up to 10 fields, starting with the largest
38+
/// fields. Each field is truncated as needed to keep the total event size as close to
39+
/// 1MB as possible. The excess portions are stored as Large Log Objects (LLOs) and these
40+
/// fields are processed separately and LLO reference system fields (in the format <c>@ptr.$[path.to.field]</c>)
41+
/// are added. The path in the reference field reflects the original JSON structure where
42+
/// the large field was located. For example, this could be <c>@ptr.$['input']['message']</c>,
43+
/// <c>@ptr.$['AAA']['BBB']['CCC']['DDD']</c>, <c>@ptr.$['AAA']</c>, or any other path
44+
/// matching your log structure.
45+
/// </summary>
46+
public partial class GetLogObjectRequest : AmazonCloudWatchLogsRequest
47+
{
48+
private string _logObjectPointer;
49+
private bool? _unmask;
50+
51+
/// <summary>
52+
/// Gets and sets the property LogObjectPointer.
53+
/// <para>
54+
/// A pointer to the specific log object to retrieve. This is a required parameter that
55+
/// uniquely identifies the log object within CloudWatch Logs. The pointer is typically
56+
/// obtained from a previous query or filter operation.
57+
/// </para>
58+
/// </summary>
59+
[AWSProperty(Required=true, Min=1, Max=512)]
60+
public string LogObjectPointer
61+
{
62+
get { return this._logObjectPointer; }
63+
set { this._logObjectPointer = value; }
64+
}
65+
66+
// Check to see if LogObjectPointer property is set
67+
internal bool IsSetLogObjectPointer()
68+
{
69+
return this._logObjectPointer != null;
70+
}
71+
72+
/// <summary>
73+
/// Gets and sets the property Unmask.
74+
/// <para>
75+
/// A boolean flag that indicates whether to unmask sensitive log data. When set to true,
76+
/// any masked or redacted data in the log object will be displayed in its original form.
77+
/// Default is false.
78+
/// </para>
79+
/// </summary>
80+
public bool? Unmask
81+
{
82+
get { return this._unmask; }
83+
set { this._unmask = value; }
84+
}
85+
86+
// Check to see if Unmask property is set
87+
internal bool IsSetUnmask()
88+
{
89+
return this._unmask.HasValue;
90+
}
91+
92+
}
93+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the logs-2014-03-28.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.CloudWatchLogs.Model
31+
{
32+
/// <summary>
33+
/// The response from the GetLogObject operation.
34+
/// </summary>
35+
public partial class GetLogObjectResponse : AmazonWebServiceResponse, IDisposable
36+
{
37+
private GetLogObjectResponseStream _fieldStream;
38+
39+
/// <summary>
40+
/// Gets and sets the property FieldStream.
41+
/// </summary>
42+
public GetLogObjectResponseStream FieldStream
43+
{
44+
get { return this._fieldStream; }
45+
set { this._fieldStream = value; }
46+
}
47+
48+
// Check to see if FieldStream property is set
49+
internal bool IsSetFieldStream()
50+
{
51+
return this._fieldStream != null;
52+
}
53+
54+
#region Dispose Pattern
55+
56+
private bool _disposed;
57+
58+
/// <summary>
59+
/// Disposes of all managed and unmanaged resources.
60+
/// </summary>
61+
public void Dispose()
62+
{
63+
Dispose(true);
64+
GC.SuppressFinalize(this);
65+
}
66+
67+
/// <summary>
68+
/// Disposes of all managed and unmanaged resources.
69+
/// </summary>
70+
protected virtual void Dispose(bool disposing)
71+
{
72+
if (_disposed)
73+
return;
74+
75+
if (disposing)
76+
{
77+
this._fieldStream?.Dispose();
78+
this._fieldStream = null;
79+
}
80+
81+
this._disposed = true;
82+
}
83+
84+
#endregion
85+
}
86+
}

0 commit comments

Comments
 (0)