This operation is not supported for directory buckets.
Deletes tags from the general purpose bucket if attribute based access control (ABAC) is not enabled for the bucket. When you enable ABAC for a general purpose bucket, you can no longer use this operation for that bucket and must use UntagResource instead.
To use this operation, you must have permission to perform the s3:PutBucketTagging action. By default, the bucket owner has this permission and can grant this permission to others.
The following operations are related to DeleteBucketTagging:
You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.
Parameters:
-
bucket
(BucketName)
–
The bucket that has the tag set to be removed.
-
expected_bucket_owner
(Optional[AccountId], default:
None
)
–
The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).
Raises:
Examples:
To delete bucket tags
The following example deletes bucket tags.
>>> await client.delete_bucket_tagging(bucket='examplebucket')
Source code in docs_src/capo_s3/_services/async_s3.py
| async def delete_bucket_tagging(
self,
bucket: "capo_s3.types.bucket_name.BucketName",
*,
config_overrides: Optional[AsyncS3ClientConfig] = None,
expected_bucket_owner: Optional["capo_s3.types.account_id.AccountId"] = None,
) -> None:
"""<note> <p>This operation is not supported for directory buckets.</p> </note> <p>Deletes tags from the general purpose bucket if attribute based access control (ABAC) is not enabled for the bucket. When you <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/buckets-tagging-enable-abac.html">enable ABAC for a general purpose bucket</a>, you can no longer use this operation for that bucket and must use <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UntagResource.html">UntagResource</a> instead.</p> <p>To use this operation, you must have permission to perform the <code>s3:PutBucketTagging</code> action. By default, the bucket owner has this permission and can grant this permission to others. </p> <p>The following operations are related to <code>DeleteBucketTagging</code>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html">GetBucketTagging</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html">PutBucketTagging</a> </p> </li> </ul> <important> <p>You must URL encode any signed header values that contain spaces. For example, if your header value is <code>my file.txt</code>, containing two spaces after <code>my</code>, you must URL encode this value to <code>my%20%20file.txt</code>.</p> </important>
Args:
bucket: <p>The bucket that has the tag set to be removed.</p>
expected_bucket_owner: <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
Raises:
capo_s3.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To delete bucket tags
The following example deletes bucket tags.
>>> await client.delete_bucket_tagging(bucket='examplebucket')
"""
async def _handler(
req: "AsyncOperationRequest[capo_s3.types.delete_bucket_tagging_request.DeleteBucketTaggingRequest]",
) -> AsyncOperationResponse[None]:
import capo_s3._operations.amazon_s3.delete_bucket_tagging
(
output,
http_response,
) = await capo_s3._operations.amazon_s3.delete_bucket_tagging.async_delete_bucket_tagging(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteBucketTagging")
)
input_: capo_s3.types.delete_bucket_tagging_request.DeleteBucketTaggingRequest = {
"bucket": bucket
}
if expected_bucket_owner is not None:
input_["expected_bucket_owner"] = expected_bucket_owner
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|