Updated on 2026-09-11 GMT+08:00

Obtaining a Symbolic Link

Function

This API obtains a symbolic link. You can obtain the symbolic link information and the name of the target object that the symbolic link points to.

Versioning

By default, the target object that the current version of the symbolic link points to is obtained. You can obtain a specified version by specifying versionId.

If the current version of the symbolic link is a delete marker and versionId is not specified, OBS returns 404, with the response headers including x-obs-delete-marker (value: true) and x-obs-version-id (the version ID). Because the delete marker has no associated data, there is no target object to which the symbolic link points.

If the current version of the symbolic link is a delete marker and versionId is specified, OBS returns 200 and does not return x-obs-delete-marker in the response header.

Authorization

To call this API, you must be the object owner or have the permissions to obtain object metadata. You are advised to use IAM or bucket policies for authorization. For details about OBS authorization methods, see Differences Between OBS Permissions Control Methods.

  • If you use IAM for authorization, you need to use either role/policy-based authorization or identity policy-based authorization and configure the required permissions:
    • If you use role/policy-based authorization (IAM v3 APIs in the old IAM version), you must have the obs:object:getObject (versioning disabled) and obs:object:getObjectVersion (versioning enabled or suspended) permissions. For details, see Creating a Custom IAM Policy.
    • If you use identity policy-based authorization (IAM v5 APIs in the new IAM version), you must have the obs:object:GetObject (versioning disabled) and obs:object:GetObjectVersion (versioning enabled or suspended) permissions. For details, see Creating a Custom IAM Identity Policy.

      Action

      Access Level

      Resource Type (*: Required)

      Condition Key

      Alias

      Dependencies

      obs:object:getObject (versioning disabled)

      obs:object:getObjectVersion (versioning enabled or suspended)

      Read

      object *

      -

      obs:object:getObjectRetention

      -

      • obs:EpochTime
      • obs:SourceIp
      • obs:TlsVersion
      • obs:CustomDomain
  • If you use bucket policies for authorization, you must have the obs:object:GetObject (versioning disabled) and obs:object:GetObjectVersion (versioning enabled or suspended) permissions. For details, see Creating a Custom Bucket Policy.

URI

GET /

Calling Method

For details, see Calling APIs. Before calling this API, calculate the API signature and add it to the request.

Request Syntax

GET /objectName?symlink HTTP/1.1
Host: bucketname.obs.region.myhuaweicloud.com 
Date: Date
Authorization: SignatureValue

URI Parameters

Table 1 describes the request parameters.

Table 1 URI Parameters

Parameter

Type

Mandatory

Description

versionId

String

No

Definition

Version number of the symbolic link.

Constraints

N/A

Range

The value must contain 32 characters.

Default Value

N/A

symlink

Yes

String

Definition

An identifier that marks this API as related to symbolic link objects.

Constraints

When calculating the signature, add /BucketName/ObjectName?symlink to CanonicalizedResource. For details, see Using an Authorization Header.

Range

symlink

Default Value

N/A

Request Headers

This request uses common headers. For details, see Table 3.

Response Syntax

1
2
3
4
5
6
7
HTTP/1.1 status_code
Content-Type: type
Date: date
Content-Length: length
Etag: etag
Last-Modified: time
x-obs-symlink-target: target object name

Response Headers

Table 2 lists the response headers of this API.

Table 2 Response Headers

Header

Type

Description

x-obs-symlink-target

String

Definition

Name of the target object that the symbolic link points to. If the symbolic link is a delete marker, this header is not returned.

Range

N/A

Sample Request

GET /link-to-obs.jpg?symlink HTTP/1.1
Host: bucketname.obs.region.myhuaweicloud.com 
Date: Fri, 24 Feb 2012 06:38:30 GMT
Authorization: authorization

Sample Response

HTTP/1.1 200 OK
Server: OBS
Date: Fri, 24 Feb 2012 06:38:30 GMT
Last-Modified: Fri, 24 Feb 2012 06:07:48 GMT
Content-Length: 0
Connection: keep-alive
x-obs-request-id: 5650BD72207FB30443962F9A
x-obs-symlink-target: example.jpg
ETag: "A797938C31D59EDD08D86188F6D5****"

Sample Request: Obtaining a Symbolic Link by Specifying versionId

GET /link-to-obs.jpg?symlink&versionId=G0011196D3FBD85400005304000000ED HTTP/1.1
Host: bucketname.obs.region.myhuaweicloud.com 
Date: Fri, 24 Feb 2012 06:38:30 GMT
Authorization: authorization

Sample Response: Obtaining a Symbolic Link by Specifying versionId

HTTP/1.1 200 OK
Server: OBS
Date: Fri, 24 Feb 2012 06:38:30 GMT
Last-Modified: Fri, 24 Feb 2012 06:07:48 GMT
Content-Length: 0
Connection: keep-alive
x-obs-request-id: G0011196D3FBD85400005304000000ED
x-obs-symlink-target: example.jpg
ETag: "A797938C31D59EDD08D86188F6D5****"

Sample Request: Obtaining a Symbolic Link That Is a Delete Marker

GET /delete-marker-Symlink-object?symlink HTTP/1.1
Host: bucketname.obs.region.myhuaweicloud.com 
Date: Fri, 24 Feb 2012 06:38:30 GMT
Authorization: authorization

Sample Response: Obtaining a Symbolic Link That Is a Delete Marker

HTTP/1.1 404 Not Found
Server: OBS
Date: Fri, 24 Feb 2012 06:38:30 GMT
Last-Modified: Fri, 24 Feb 2012 06:07:48 GMT
ETag: "A797938C31D59EDD08D86188F6D5****"
Content-Length: 0
Connection: keep-alive
x-obs-request-id: 5650BD72207FB30443962F9A
x-obs-delete-marker: true
x-obs-version-id:  xxxxxxxxxxxxxxxxxxxxxxxxxxxxx