A symbolic link points to a target object in a bucket without duplicating it — similar to a shortcut. In a versioning-enabled bucket, each symbolic link can have multiple versions, and different versions can point to different target objects. This topic shows how to create and retrieve symbolic links using the OSS Python SDK V2.
Prerequisites
Before you begin, ensure that you have:
A versioning-enabled OSS bucket
The
oss:PutObjectpermission to create a symbolic link, or theoss:GetObjectpermission to retrieve one. For details, see Grant custom permissions to a RAM user
Usage notes
The sample code uses the China (Hangzhou) region (
cn-hangzhou) with the public endpoint. To access OSS from other Alibaba Cloud services in the same region, use an internal endpoint. For a full list of regions and endpoints, see OSS regions and endpoints.You cannot create a symbolic link for a delete marker in a versioning-enabled bucket.