Renaming Objects

Prev Next

In S3, renaming an object requires copying the object and then deleting the source object. VAST Cluster supports renaming an object using a single copy request which specifies to replace the object with its copy.

The rename operation moves the object with its ACL and metadata.

Renaming Semantics and Directory Management

Source names and destination names may include double slashes and leading slashes, with the following implications in terms of directories and regular objects:  

Source Name

Destination Name

Rename Operation

mybucket/a

mybucket/b

  • Looks for an object named ‘a' and renames it 'b’.

  • Does not look for a directory.

mybucket/a/

mybucket/b

  • Looks for an object named ‘a/’ and renames it 'b/'

  • Looks for a directory named ‘a' and renames it 'b’

mybucket/a/

mybucket/b/

  • Looks for an object named ‘a/’ and renames it ‘b/’

  • Looks for a directory named ‘a' and renames it 'b’

mybucket/a//

mybucket/b//

  • Looks for an object named ‘a//’ and renames it ‘b//’

  • Looks for a directory called ‘a/’ and renames it ‘b/’

How to Make a Rename Object Request

To rename an object, include the following header in a CopyObject request:

x-amz-copy-disposition: replace

If this header is included in the request, then:

  • The optional x-amz-metadata-directive header may not be used to specify that you want to replace object metadata with metadata provided in the request. Only copying object metadata from the source object is allowed.

  • The following headers are not allowed:

    • x-amz-aclx-amz-grant-full-control

    • x-amz-grant-read

    • x-amz-grant-read-acp

    • x-amz-grant-write-acp