Create Soft Link
Last Updated:2021-09-13
Interface Description
The PutSymlink interface is used to create the soft link (Symlink) for the existing destination object in the same bucket of BOS. You can access the destination object through this soft link.
Notes:
- The soft link file and destination object file need to be located in the same bucket.
- At present, the soft link can be set for object files of the standard storage, infrequent access, cold storage, and archive storage. The soft link file itself does not support the archive type. If the user specifies the archive type or does not specify the storage type and the default storage type of the bucket is archive type, it returns “CODE_INVALID_ARGUMENT”.
- When this interface is called to create the soft link, it does not check whether the destination file exists, and you have the permission to access the destination file. When you call the GetObject API using the soft link, check whether the user has the read permission of the soft link and destination file and the destination file exists.
- To create the soft link, you must have the corresponding write permission.
- If the header "x-bce-forbid-overwrite" is not specified and there is an object file with the same name as the soft link file, the object with the same name is overwritten by default during the creation of the soft link.
- It does not support the secondary soft link. No check is done when the user creates the secondary soft link, but the user cannot access the object data pointed to through the secondary soft link.
Request URI
PUT /v1/{bucketName}/{objectKey}?symlink
Request Header Parameters
Parameter Name | Parameter Type | Required? | Description | Example Value |
---|---|---|---|---|
xBceSymlinkTarget | String | Yes | Specify the destination file of the soft link. The naming convention is the same as the object. The destination file of the soft link cannot be the soft link file. | "xBceSymlinkTarget_example" |
xBceForbidOverwrite | String | No | Specify whether the object with the same name is overwritten during the creation of the soft link. If x-bce-forbid-overwrite is not specified, the object with the same name is overwritten by default. When x-bce-forbid-overwrite is specified as true, it indicates that overwriting the object with the same name is prohibited. When x-bce-forbid-overwrite is specified as false, it indicates that overwriting the object with the same name is allowed. | "xBceForbidOverwrite_example" |
xBceMeta_ | String | No | User-defined meta | "xBceMeta__example" |
xBceStorageClass | String | No | Specify the storage type of the soft link file. STANDARD represents the standard storage, STANDARD_IA represents the infrequent access, and COLD represents the cold storage. If it is not specified, it is the bucket storage by default. The soft link file itself does not support the archive type. | "xBceStorageClass_example" |
Request Body Parameters
None
Response Header Parameters
Parameter Name | Parameter Type | Description | Example Value |
---|---|---|---|
ETag | String | HTTP protocol entity tag of the destination object name for the soft link |
Response Body Parameters
None
Request Example
None
Response Example
HTTP/1.1 200 OK
<Common response header>
{ }
Error Code
Refer to the universal error code.