copy-object

Copies an object from a source object to a target object, or can be used to rename an object, or to change the metadata of an object.

Usage

copy-object --bucket <value> --copy-source <value> --key <value>

Supported Options

--bucket: Bucket name
--acl <value>: The Access Control List (ACL) lets you manage access to buckets and objects.
  <value> specifies the following Hedvig-supported options:
    private: Object owner permission only
    public-read: Read permission by any user
    public-read-write: Read and write permission by any user
    authenticated-read: Read permission by authenticated users
    bucket-owner-read: Read permission by bucket owner
    bucket-owner-full-control: Full control by bucket owner
--content-disposition: Object presentation information
--content-encoding: Object content-encoding method
--content-md5: This is a required parameter when lock setting is on.
--content-type: Object content type
--copy-source: Source object to copy from. Format is <bucketName>/<objectName>?versionId=<versionid>
--grant-full-control: Grants full control to user
--grant-read: Grants read permission to user
--grant-read-acp: Grants read ACP permission to user
--grant-write-acp: Grants write ACP permission to user
--key: Object name
--metadata: User-defined map of key value pairs
--metadata-directive: REPLACE or COPY source object’s metadata
--object-lock-legal-hold-status: ON or OFF
--object-lock-mode: COMPLIANCE or GOVERNANCE
--object-lock-retain-until-date: date and time for lock settings to expire
--server-side-encryption: Object encryption, value: AES256

Example

aws s3api copy-object --endpoint http://<hostname>:<port_number> --profile testuser1 --bucket target_example_bucket --key target_example_object --acl private --copy-source '/source_example_bucket/source_example_object'
aws s3api copy-object --endpoint http://<hostname>:<port_number> --profile testuser1 --bucket target_example_bucket --key target_example_object --acl private --copy-source '/source_example_bucket/source_example_object' --object-lock-mode GOVERNANCE --object-lock-retain-until-date 2020-12-11 --object-lock-legal-hold-status ON

Loading...