Skip to content

update_realtime_log_config async

update_realtime_log_config(
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    end_points: Optional[EndPointList] = None,
    fields: Optional[FieldList] = None,
    name: Optional[string] = None,
    arn: Optional[string] = None,
    sampling_rate: Optional[long] = None,
) -> UpdateRealtimeLogConfigResult

Updates a real-time log configuration.

When you update a real-time log configuration, all the parameters are updated with the values provided in the request. You cannot update some parameters independent of others. To update a real-time log configuration:

  1. Call GetRealtimeLogConfig to get the current real-time log configuration.

  2. Locally modify the parameters in the real-time log configuration that you want to update.

  3. Call this API (UpdateRealtimeLogConfig) by providing the entire real-time log configuration, including the parameters that you modified and those that you didn't.

You cannot update a real-time log configuration's Name or ARN.

Parameters:

  • end_points (Optional[EndPointList], default: None ) –

    Contains information about the Amazon Kinesis data stream where you are sending real-time log data.

  • fields (Optional[FieldList], default: None ) –

    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.

  • name (Optional[string], default: None ) –

    The name for this real-time log configuration.

  • arn (Optional[string], default: None ) –

    The Amazon Resource Name (ARN) for this real-time log configuration.

  • sampling_rate (Optional[long], default: None ) –

    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.

Raises:

Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
async def update_realtime_log_config(
    self,
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    end_points: Optional[
        "capo_cloudfront.types.end_point_list.EndPointList"
    ] = None,
    fields: Optional["capo_cloudfront.types.field_list.FieldList"] = None,
    name: Optional["capo_cloudfront.types.string.string"] = None,
    arn: Optional["capo_cloudfront.types.string.string"] = None,
    sampling_rate: Optional["capo_cloudfront.types.long.long"] = None,
) -> "capo_cloudfront.types.update_realtime_log_config_result.UpdateRealtimeLogConfigResult":
    """<p>Updates a real-time log configuration.</p> <p>When you update a real-time log configuration, all the parameters are updated with the values provided in the request. You cannot update some parameters independent of others. To update a real-time log configuration:</p> <ol> <li> <p>Call <code>GetRealtimeLogConfig</code> to get the current real-time log configuration.</p> </li> <li> <p>Locally modify the parameters in the real-time log configuration that you want to update.</p> </li> <li> <p>Call this API (<code>UpdateRealtimeLogConfig</code>) by providing the entire real-time log configuration, including the parameters that you modified and those that you didn't.</p> </li> </ol> <p>You cannot update a real-time log configuration's <code>Name</code> or <code>ARN</code>.</p>

    Args:
        end_points: <p>Contains information about the Amazon Kinesis data stream where you are sending real-time log data.</p>
        fields: <p>A list of fields to include in each real-time log record.</p> <p>For more information about fields, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-fields">Real-time log configuration fields</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
        name: <p>The name for this real-time log configuration.</p>
        arn: <p>The Amazon Resource Name (ARN) for this real-time log configuration.</p>
        sampling_rate: <p>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.</p>

    Raises:
        capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.no_such_realtime_log_config.NoSuchRealtimeLogConfig: <p>The real-time log configuration does not exist.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudfront.types.update_realtime_log_config_request.UpdateRealtimeLogConfigRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudfront.types.update_realtime_log_config_result.UpdateRealtimeLogConfigResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.update_realtime_log_config

        (
            output,
            http_response,
        ) = await capo_cloudfront._operations.cloudfront2020_05_31.update_realtime_log_config.async_update_realtime_log_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateRealtimeLogConfig")
    )
    input_: capo_cloudfront.types.update_realtime_log_config_request.UpdateRealtimeLogConfigRequest = {}
    if end_points is not None:
        input_["end_points"] = end_points
    if fields is not None:
        input_["fields"] = fields
    if name is not None:
        input_["name"] = name
    if arn is not None:
        input_["arn"] = arn
    if sampling_rate is not None:
        input_["sampling_rate"] = sampling_rate

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output