Skip to contents

Utility function to prepare the items parameter, a list of elements containing information about each file to be exported using the bulk_submit_export() method.

Usage

prepare_items_for_bulk_export(
  files,
  destination_volume,
  destination_location_prefix = NULL,
  overwrite = TRUE,
  properties = NULL
)

Arguments

files

A list of File objects or list of strings (IDs) of the files you are about to export to a volume.

destination_volume

Either a Volume object or the ID of the volume to which the file will be exported.

destination_location_prefix

Character. If the volume has been configured with a prefix parameter,
destination_location_prefix value will be prepended to location before attempting to create the file on the volume. This parameter can be treated as a path to a new file on the volume. The default value is NULL.

If you would like to export the file into a folder on the volume, please add folder name as the prefix before the file name in the "<folder-name>/" form. Remember to put a slash character ("/") at the end of the string.

Keep in mind that the same prefix will be added to all items (files) in the resulting list.

overwrite

Logical. If this is set to TRUE and a named file exists in the project where the alias is about to be created, the existing file will be deleted. FALSE by default.

Keep in mind that the same overwrite option will be applied to all items (files) in the resulting list.

properties

Named list of additional volume properties, like:

  • sse_algorithm - S3 server-side encryption to use when exporting to this bucket. Supported values: AES256 (SSE-S3 encryption), aws:kms, null (no server-side encryption). Default: AES256.

  • sse_aws_kms_key_id: Applies to type: s3. If AWS KMS encryption is used, this should be set to the required KMS key. If not set and aws:kms is set as sse_algorithm, default KMS key is used.

  • aws_canned_acl: S3 canned ACL to apply on the object during export. Supported values: any one of S3 canned ACLs; null (do not apply canned ACLs). Default: null.

Keep in mind that the same properties will be applied to all items (files) in the resulting list.

Value

List of body params items for for staring an export job.

Details

Based on the provided list of File objects or file IDs, this function allows you to set the following fields for each item:

  • source_file

  • destination_volume

  • destination_location

  • overwrite

  • properties

However, keep in mind that there are certain constraints:

  • The same destination_volume applies to all items in the . resulting list.

  • The same applies to overwrite and properties parameters.

  • By default, the destination_location field is populated with the source file name. Upon retrieval of the list of items for bulk export, you can manually update the destination_location field for each element of the list as needed. Additionally, you have the flexibility to manually modify any other fields in the list if required.

See also

Examples

if (FALSE) {
# Example 1: Prepare 3 items for bulk export action
file_object_1 <- a$files$get(id = "file_1_ID")
file_object_2 <- a$files$get(id = "file_2_ID")
file_object_3 <- a$files$get(id = "file_3_ID")

files_to_export <- list(file_object_1, file_object_2, file_object_3)

prepare_items_for_bulk_export(files_to_export,
  destination_volume = "aws_example_volume"
)
}
if (FALSE) {
# Example 2: Prepare 3 items for bulk export action into some folder
# on the volume - use folder name as prefix before file names
file_object_1 <- a$files$get(id = "file_1_ID")
file_object_2 <- a$files$get(id = "file_2_ID")
file_object_3 <- a$files$get(id = "file_3_ID")

files_to_export <- list(file_object_1, file_object_2, file_object_3)

prepare_items_for_bulk_export(files_to_export,
  destination_volume = "aws_example_volume",
  destination_location_prefix = "example_folder/"
)
}