PutBucketLogging #
Overview #
Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging parameters.
AWS API Reference: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html
Method #
PUTBUCKETLOGGING
Import Parameters #
The request uses the following import parameters.
-
i_bucket_name (bucket in AWS) (Required)
Name of the bucket to create.
-
i_region (Required)
AWS Region of the Amazon S3 Bucket.
-
i_target_bucket(TargetBucket in AWS) (Required)
Specifies the bucket where you want Amazon S3 to store server access logs.
-
i_logging_enabled(Structure of LoggingEnabled in AWS)
Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket. For more information, see PUT Bucket logging in the Amazon Simple Storage Service API Reference.
-
i_prefix(TargetPrefix in AWS) (Required)
A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket.
-
i_x_amz_expected_b_owner(x-amz-expected-bucket-owner in AWS)
The account id of the expected bucket owner.
Export Parameters #
This method use the following export parameters:
-
e_http_status
HTTP Status code.
-
e_response_headers
Returns information about the request in format Name/Value pair values.
-
e_response_content
Response content in string format.
Example #
DATA: lo_s3 TYPE REF TO /lnkc/cl_sdk_aws_s3,
lv_http_status TYPE i,
lt_response_headers TYPE tihttpnvp,
lv_response_content TYPE string,
ls_logging_enabled TYPE /lnkc/aws_s3_s_loggingenabled.
TRY.
CREATE OBJECT lo_s3
EXPORTING
i_user_name = 'user_awsconnector'
i_access_key = 'acces_key_value'
i_secret_access_key = 'secret_acceskey_value'.
ENDTRY.
TRY.
CALL METHOD lo_s3->putbucketlogging
EXPORTING
i_bucket_name = 'i_bucket_name'
i_region = 'i_region'
i_target_bucket = 'i_target_bucket'
i_logging_enabled = ls_logging_enabled
i_prefix = 'i_prefix'
* i_x_amz_expected_b_owner =
IMPORTING
e_http_status = lv_http_status
e_response_headers = lt_response_headers
e_response_content = lv_response_content.
CATCH /lnkc/cx_sdk_aws .
" Error Message
ENDTRY.