bucket_rename_file - jaybgager/tracertools GitHub Wiki

Renames a file on a cloudfiles-managed S3-style bucket. Requires permission to write to the bucket.

Arguments:

  • file_path (string, mandatory)
    • the absolute path on the bucket to the file you want to rename
  • new_name (string, mandatory)
    • the new name you want to give the file
    • must include file extension if one was present in original

Example

INPUT:

import tracertools as tt

tt.bucket_rename_file(
    file_path = "bucket://path/to/old_filename"
    new_name = "new_filename"
)

This will change the file's absolute path from bucket://path/to/old_filename to bucket://path/to/new_filename