Creates a symbolic link that points to an object in a bucket.
Use cases
Symbolic links are unique to OSS. Use them to:
Create short, human-readable aliases for objects with long or complex keys.
Maintain backward-compatible paths when reorganizing your object key structure.
Point multiple logical paths to a single physical object without duplicating data.
Usage notes
OSS does not validate the target object when creating a symbolic link — it does not check whether the target exists, whether its storage class is valid, or whether the target is accessible.
When API operations such as
GetObjectaccess the target through a symbolic link, OSS checks both the access control list (ACL) of the symbolic link and the ACL of the target object.
Permissions
By default, an Alibaba Cloud account has full permissions. RAM users and RAM roles under an Alibaba Cloud account have no permissions by default. Grant the required permissions through RAM policy or Bucket Policy.
| API | Action | Condition |
|---|---|---|
| PutSymlink | oss:PutObject | Always required |
| PutSymlink | oss:PutObjectTagging | Required only when specifying object tags via x-oss-tagging |
Syntax
ossutil api put-symlink --bucket <value> --key <value> --symlink-target <value> [flags]Parameters
| Parameter | Type | Description |
|---|---|---|
--bucket | string | Name of the bucket. |
--key | string | Full path (object key) of the symbolic link to create. |
--symlink-target | string | Object key of the target that the symbolic link points to. |
--object-acl | string | Access control list (ACL) of the object. |
--forbid-overwrite | string | Whether to overwrite an object with the same name during the PutSymlink operation. |
--storage-class | string | Storage class of the object that you want to upload. |
The put-symlink command maps to the PutSymlink API operation. For all supported flags, see Command-line options.Example
Create a symbolic link examplelink that points to targetobject in examplebucket:
ossutil api put-symlink --bucket examplebucket --key examplelink --symlink-target targetobject