Skip to content

put_synchronization_configuration

put_synchronization_configuration(
    file_system_id: FileSystemId,
    import_data_rules: ImportDataRuleList,
    expiration_data_rules: ExpirationDataRuleList,
    *,
    config_overrides: Optional[S3FilesClientConfig] = None,
    latest_version_number: Optional[int] = None,
) -> PutSynchronizationConfigurationResponse

Creates or updates the synchronization configuration for the specified S3 File System, including import data rules and expiration data rules.

Parameters:

  • file_system_id (FileSystemId) –

    The ID or Amazon Resource Name (ARN) of the S3 File System to configure synchronization for.

  • latest_version_number (Optional[int], default: None ) –

    The version number of the current synchronization configuration. Omit this value when creating a synchronization configuration for the first time. For subsequent updates, provide this value for optimistic concurrency control. If the version number does not match the current configuration, the request fails with a ConflictException.

  • import_data_rules (ImportDataRuleList) –

    An array of import data rules that control how data is imported from S3 into the file system.

  • expiration_data_rules (ExpirationDataRuleList) –

    An array of expiration data rules that control when cached data expires from the file system.

Raises:

  • ThrottlingException –

    The request was throttled. Retry your request using exponential backoff.

  • ConflictException –

    The request conflicts with the current state of the resource. This can occur when trying to create a resource that already exists or delete a resource that is in use.

  • InternalServerException –

    An internal server error occurred. Retry your request.

  • ResourceNotFoundException –

    The specified resource was not found. Verify that the resource exists and that you have permission to access it.

  • ValidationException –

    The input parameters are not valid. Check the parameter values and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_s3files/_services/s3_files.py
def put_synchronization_configuration(
    self,
    file_system_id: "capo_s3files.types.file_system_id.FileSystemId",
    import_data_rules: "capo_s3files.types.import_data_rule_list.ImportDataRuleList",
    expiration_data_rules: "capo_s3files.types.expiration_data_rule_list.ExpirationDataRuleList",
    *,
    config_overrides: Optional[S3FilesClientConfig] = None,
    latest_version_number: Optional[int] = None,
) -> "capo_s3files.types.put_synchronization_configuration_response.PutSynchronizationConfigurationResponse":
    """<p>Creates or updates the synchronization configuration for the specified S3 File System, including import data rules and expiration data rules.</p>

    Args:
        file_system_id: <p>The ID or Amazon Resource Name (ARN) of the S3 File System to configure synchronization for.</p>
        latest_version_number: <p>The version number of the current synchronization configuration. Omit this value when creating a synchronization configuration for the first time. For subsequent updates, provide this value for optimistic concurrency control. If the version number does not match the current configuration, the request fails with a <code>ConflictException</code>.</p>
        import_data_rules: <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
        expiration_data_rules: <p>An array of expiration data rules that control when cached data expires from the file system.</p>

    Raises:
        capo_s3files.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Retry your request using exponential backoff.</p>
        capo_s3files.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. This can occur when trying to create a resource that already exists or delete a resource that is in use.</p>
        capo_s3files.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_s3files.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify that the resource exists and that you have permission to access it.</p>
        capo_s3files.errors.validation_exception.ValidationException: <p>The input parameters are not valid. Check the parameter values and try again.</p>
        capo_s3files.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3files.types.put_synchronization_configuration_request.PutSynchronizationConfigurationRequest]",
    ) -> OperationResponse[
        "capo_s3files.types.put_synchronization_configuration_response.PutSynchronizationConfigurationResponse"
    ]:
        import capo_s3files._operations.s3_files.put_synchronization_configuration

        output, http_response = (
            capo_s3files._operations.s3_files.put_synchronization_configuration.put_synchronization_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutSynchronizationConfiguration")
    )
    input_: capo_s3files.types.put_synchronization_configuration_request.PutSynchronizationConfigurationRequest = {
        "file_system_id": file_system_id,
        "import_data_rules": import_data_rules,
        "expiration_data_rules": expiration_data_rules,
    }
    if latest_version_number is not None:
        input_["latest_version_number"] = latest_version_number

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output