Below is the code I'm trying.
from minio.commonconfig import REPLACE, CopySource
# copy an object `src` from a bucket `darshan` to object `dest_obj`
result = client.copy_object(
"darshan",
"dest_obj",
CopySource("darshan", "src"),
)
print(result.object_name, result.version_id)
Errors:
- I have to specify the source object as
src/
if I specifysrc
below error:
S3Error: S3 operation failed; code: NoSuchKey, message: Object does not exist, resource: /darshan/src, request_id: 16682AB6445C2722, host_id: None, bucket_name: darshan, object_name: src
- Similarly, I have to specify the destination object as
dest_obj/
else it creates a file instead of copied folder. - After specifying src & dest object in this manner, it creates an empty directory
dest_obj
. Not copying any contents fromsrc