createRealtimeLogConfig2020_05_31 method
Creates a real-time log configuration.
After you create a real-time log configuration, you can attach it to one or more cache behaviors to send real-time log data to the specified Amazon Kinesis data stream.
For more information about real-time log configurations, see Real-time logs in the Amazon CloudFront Developer Guide.
May throw RealtimeLogConfigAlreadyExists. May throw TooManyRealtimeLogConfigs. May throw InvalidArgument. May throw AccessDenied.
Parameter endPoints
:
Contains information about the Amazon Kinesis data stream where you are
sending real-time log data.
Parameter fields
:
A list of fields to include in each real-time log record.
For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
Parameter name
:
A unique name to identify this real-time log configuration.
Parameter samplingRate
:
The sampling rate for this real-time log configuration. The sampling rate
determines the percentage of viewer requests that are represented in the
real-time log data. You must provide an integer between 1 and 100,
inclusive.
Implementation
Future<CreateRealtimeLogConfigResult> createRealtimeLogConfig2020_05_31({
required List<EndPoint> endPoints,
required List<String> fields,
required String name,
required int samplingRate,
}) async {
ArgumentError.checkNotNull(endPoints, 'endPoints');
ArgumentError.checkNotNull(fields, 'fields');
ArgumentError.checkNotNull(name, 'name');
ArgumentError.checkNotNull(samplingRate, 'samplingRate');
final $result = await _protocol.send(
method: 'POST',
requestUri: '/2020-05-31/realtime-log-config',
payload: CreateRealtimeLogConfigRequest(
endPoints: endPoints,
fields: fields,
name: name,
samplingRate: samplingRate)
.toXml(
'CreateRealtimeLogConfigRequest',
attributes: [
_s.XmlAttribute(_s.XmlName('xmlns'),
'http://cloudfront.amazonaws.com/doc/2020-05-31/'),
],
),
exceptionFnMap: _exceptionFns,
);
return CreateRealtimeLogConfigResult.fromXml($result.body);
}