GetTableBucketLogging

Updated at:

Queries the access logging configuration of a specified table bucket.

Usage notes

  • If logging is not enabled, this operation still returns 200, and LoggingEnabled in the response is an empty object {}.

  • The empty LoggingEnabled in the response indicates the response format only. To disable logging, call the DeleteTableBucketLogging operation, or set BucketLoggingStatus to an empty object {} and call the PutTableBucketLogging operation.

Permissions

API

Action

Description

GetTableBucketLogging

oss:GetTableBucketLogging

Queries the access logging configuration of the table bucket.

Request syntax

GET /buckets/{tableBucketARN}/logging HTTP/1.1
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: GMT Date
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/osstables/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c****

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. Format: acs:osstables:{region}:{uid}:bucket/{bucketName}. This parameter is part of the URI, and must be URL-encoded when placed in the path.

Examples

The following example queries the access logging configuration of the specified table bucket. The LoggingEnabled structure in the response body is the same as the request parameters of the PutTableBucketLogging operation. If logging is not enabled, the operation still returns 200, and LoggingEnabled is an empty object {} that indicates the response format only. To disable logging, you still need to call the DeleteTableBucketLogging operation or set BucketLoggingStatus to an empty object.

Request example

GET /buckets/acs%3Aosstables%3Acn-hangzhou%3A1234567890%3Abucket%2Fmy-table-bucket/logging 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****

Response example

HTTP/1.1 200 OK
Content-Type: application/json
Server: AliyunOSS
x-oss-request-id: 5C06A3B67B8B5A3DA422****
x-oss-server-time: 3

{
  "BucketLoggingStatus": {
    "LoggingEnabled": {
      "TargetBucket": "my-log-bucket",
      "TargetPrefix": "tablelog/",
      "TargetSuffix": {
        "UseRandomPart": false
      },
      "PushSuccessMarker": false,
      "LoggingRole": "",
      "ObjectKeyFormat": "Flat"
    }
  }
}

Error codes

Error code

HTTP status code

Description

ForbiddenException

403

The required permissions are missing or the request is not allowed.

NotFoundException

404

The specified table bucket does not exist.