createRealtimeLogConfig method

Future<CreateRealtimeLogConfigResult> createRealtimeLogConfig({
  1. required List<EndPoint> endPoints,
  2. required List<String> fields,
  3. required String name,
  4. required int samplingRate,
})

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 AccessDenied. May throw InvalidArgument. May throw RealtimeLogConfigAlreadyExists. May throw TooManyRealtimeLogConfigs.

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. You can specify a whole number between 1 and 100 (inclusive) to determine the percentage of viewer requests that are represented in the real-time log data.

Implementation

Future<CreateRealtimeLogConfigResult> createRealtimeLogConfig({
  required List<EndPoint> endPoints,
  required List<String> fields,
  required String name,
  required int samplingRate,
}) async {
  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'),
    exceptionFnMap: _exceptionFns,
  );
  return CreateRealtimeLogConfigResult.fromXml($result.body);
}