Retrieves the location of the metadata file for a specified table.
Usage notes
-
The returned
metadataLocationpoints to the current Iceberg metadata JSON file. -
The
versionTokenenables optimistic locking in subsequentUpdateTableMetadataLocationoperations. -
The
warehouseLocationis the OSS path to the table's warehouse.
Permissions
|
API |
Action |
Description |
|
GetTableMetadataLocation |
oss:GetTableMetadataLocation |
Retrieves the table metadata location and checks the table policy. |
Request syntax
GET /tables/{tableBucketARN}/{namespace}/{name}/metadata-location HTTP/1.1
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue
Request parameters
|
Parameter |
Type |
Required |
Example |
Description |
|
tableBucketARN |
string |
Yes |
acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket |
The ARN of the table bucket. The format is |
|
namespace |
string |
Yes |
my_namespace |
The name of the table's namespace. This parameter is part of the URI. |
|
name |
string |
Yes |
my_table |
The name of the table. This parameter is part of the URI. |
Response parameters
|
Parameter |
Type |
Example |
Description |
|
metadataLocation |
string |
oss://bucket/metadata/00000-xxx.metadata.json |
The OSS path to the current Iceberg metadata JSON file. |
|
versionToken |
string |
abc123def456 |
A version token for optimistic locking in subsequent |
|
warehouseLocation |
string |
oss://data-bucket/warehouse/ |
The OSS path to the table's warehouse. |
Examples
Sample request
GET /tables/acs%3Aosstables%3Acn-hangzhou%3A1234567890%3Abucket%2Fmy-table-bucket/my_namespace/my_table/metadata-location HTTP/1.1
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: Thu, 10 Apr 2025 08:00:00 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/osstables/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c****
Sample response
HTTP/1.1 200 OK
Server: AliyunOSS
x-oss-request-id: 5C06A3B67B8B5A3DA422****
x-oss-server-time: 3
Content-Type: application/json
{
"metadataLocation": "oss://data-bucket/metadata/00000-xxx.metadata.json",
"versionToken": "aaabbb",
"warehouseLocation": "oss://data-bucket/warehouse/"
}
SDKs
The following SDKs support the GetTableMetadataLocation operation:
ossutil command-line tool
For the corresponding ossutil command, see get-table-metadata-location.
Error codes
|
Error code |
HTTP status code |
Description |
|
ForbiddenException |
403 |
You do not have permission to perform this request. |
|
NotFoundException |
404 |
The requested resource does not exist. |