Aliyun OSS icon

Aliyun OSS

Sends data to Aliyun OSS

File → Copy

AI-generated

Overview

The Aliyun OSS node's "File: Copy" operation allows you to copy a file (object) from one location to another within Aliyun Object Storage Service (OSS). This is useful for duplicating files, reorganizing storage, or creating backups. For example, you might use this operation to move an image from one bucket to another, or to create a versioned backup of a document.

Practical scenarios:

  • Duplicating files between buckets for redundancy.
  • Organizing files by copying them into different folders or buckets.
  • Automating backup workflows by copying important files to a backup location.

Properties

Name Meaning
Source Path The name of the source bucket and key name of the source object, separated by a slash (/). Example: /bucket/my-image.jpg
Destination Path The name of the destination bucket and key name of the destination object, separated by a slash (/). Example: /bucket/my-second-image.jpg
Additional Fields Collection of optional settings to control the copy operation. Includes:
- ACL: Authenticated Read, AWS Exec Read, Bucket Owner Full Control, Bucket Owner Read, Private, Public Read, Public Read Write
- Grant Full Control: Whether to give the grantee READ, READ_ACP, and WRITE_ACP permissions on the object
- Grant Read: Allow grantee to read the object data and its metadata
- Grant Read ACP: Allow grantee to read the object ACL
- Grant Write ACP: Allow grantee to write the ACL for the object
- Lock Legal Hold: Apply a legal hold to this object
- Lock Mode: Governance, Compliance
- Lock Retain Until Date: Set expiration date/time for object lock
- Metadata Directive: Copy, Replace
- Requester Pays: Requester pays for requests and data transfer
- Server Side Encryption: AES256, AWS:KMS
- Server Side Encryption Context: AWS KMS Encryption Context
- Server Side Encryption AWS KMS Key ID: KMS Key ID if using aws:kms
- Server Side Encryption Customer Algorithm: Algorithm for customer-provided encryption
- Server Side Encryption Customer Key: Customer-provided encryption key
- Server Side Encryption Customer Key MD5: MD5 digest of the encryption key
- Storage Class: Deep Archive, Glacier, Intelligent Tiering, One Zone IA, Standard, Standard IA
- Tagging Directive: Copy, Replace

Output

  • The output will be a JSON object containing the result of the copy operation.
  • The main field is typically CopyObjectResult, which includes details such as:
    • ETag: The entity tag of the copied object.
    • LastModified: Timestamp of when the object was copied.

Example output:

{
  "ETag": "\"686897696a7c876b7e\"",
  "LastModified": "2024-06-01T12:34:56.000Z"
}

Dependencies

  • External Service: Requires access to Aliyun OSS (Object Storage Service).
  • Credentials: n8n credential named aliyun with region, accessKeyId, and accessKeySecret.
  • Node Package: Uses the ali-oss npm package.

Troubleshooting

Common issues:

  • Invalid credentials: If your Access Key or Secret is incorrect, the node will fail to authenticate.
  • Incorrect paths: If the Source Path or Destination Path is malformed or points to non-existent objects/buckets, the operation will fail.
  • Permissions: Insufficient permissions on the source or destination bucket/object can cause errors.
  • API limits: Exceeding Aliyun OSS API rate limits may result in throttling or errors.

Error messages:

  • "NoSuchBucket": The specified bucket does not exist. Check your path.
  • "AccessDenied": Your credentials do not have permission for the requested operation.
  • "InvalidArgument": One or more parameters are invalid (e.g., malformed path).

How to resolve:

  • Double-check your credentials and ensure they have the necessary permissions.
  • Verify that both source and destination paths are correct and exist.
  • Ensure any additional fields (like encryption or ACLs) are set according to your OSS configuration.

Links and References

Discussion