PutTableLogging
Explicitly disables access logging for a specified table.
Usage notes
-
Table-level logging configuration can only be used to disable logging. Currently, only disabled is supported for status. enabled and notConfigured are not allowed.
-
The log destination bucket, prefix, and other settings are determined by the table bucket-level configuration. Table-level configuration cannot specify the log delivery location separately.
-
OSS Tables requests that carry a request body must send Content-MD5. The value is the Base64-encoded MD5 digest of the actual request body. The server checks this header based on the signature type and the configuration.
-
To restore the table so that it follows the logging configuration of the table bucket, call the DeleteTableLogging operation.
Permissions
|
API |
Action |
Description |
|
PutTableLogging |
oss:PutTableLogging |
Disables access logging for the table (the table resource policy is also checked). |
Request syntax
PUT /tables/{tableBucketARN}/{namespace}/{name}/logging HTTP/1.1
Content-Type: application/json
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****
Content-MD5: {Base64(MD5(request-body))}
{
"status": "disabled"
}
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. |
|
namespace |
string |
Yes |
my_namespace |
The name of the top-level namespace that contains the table. This parameter is part of the URI. |
|
name |
string |
Yes |
my_table |
The table name. This parameter is part of the URI. |
|
status |
string |
Yes |
disabled |
The table-level logging status. Currently, only disabled is supported. enabled and notConfigured are not allowed. This parameter is part of the request body. |
Examples
The following example explicitly disables access logging for my_table in my_namespace.
Request example
PUT /tables/acs%3Aosstables%3Acn-hangzhou%3A1234567890%3Abucket%2Fmy-table-bucket/my_namespace/my_table/logging HTTP/1.1
Content-Type: application/json
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****
Content-MD5: eB5eJF1ptWaXm4bijSPyxw==
{
"status": "disabled"
}
Response example
HTTP/1.1 200 OK
Server: AliyunOSS
x-oss-request-id: 5C06A3B67B8B5A3DA422****
x-oss-server-time: 3
Error codes
|
Error code |
HTTP status code |
Description |
|
BadRequestException |
400 |
The request body format or parameters are invalid. |
|
ForbiddenException |
403 |
The required permissions are missing or the request is not allowed. |
|
NotFoundException |
404 |
The specified table bucket or table does not exist. |