Manage symbolic links using OSS SDK for Python 2.0
Symbolic links in Object Storage Service (OSS) work like file shortcuts on Windows and allow you to quickly access associated objects. This topic describes how to use the OSS SDK for Python to create and obtain symbolic links. This topic describes how to use the OSS SDK for Python to create and retrieve symbolic links.
Usage notes
-
The sample code in this topic uses the region ID
cn-hangzhouof the China (Hangzhou) region. By default, a public endpoint is used to access resources in a bucket. If you want to access resources in the bucket from other Alibaba Cloud services in the same region in which the bucket is located, use an internal endpoint. For more information about the regions and endpoints that OSS supports, see Regions and endpoints. -
To create a symbolic link, you must have the
oss:PutObjectpermission. To query a symbolic link, you must have theoss:GetObjectpermission. For more information, see Grant custom permissions to a RAM user.
Method
Create a symbolic link
put_symlink(request: PutSymlinkRequest, **kwargs) → PutSymlinkResult
Obtain a symbolic link
get_symlink(request: GetSymlinkRequest, **kwargs) → GetSymlinkResult
Request parameters
|
Parameter |
Type |
Description |
|
request |
PutSymlinkRequest |
The request parameters to create a symbolic link. For more information, see PutSymlinkRequest |
|
GetSymlinkRequest |
The request parameters to obtain a symbolic link. For more information, see GetSymlinkRequest |
Response parameters
|
Type |
Description |
|
PutSymlinkResult |
The return value. For more information, see PutSymlinkResult |
|
GetSymlinkResult |
The return value. For more information, see GetSymlinkResult |
For the complete definition of the method to create a symbolic link, see put_symlink.
For the complete definition of the method to obtain a symbolic link, see get_symlink.
Sample code
References
-
For the complete sample code for creating a symbolic link, see put_symlink.py.
-
For the complete sample code for obtaining a symbolic link, see get_symlink.py.