/AWS1/CL_S3C=>GETBUCKETLIFECYCLECONF()
¶
About GetBucketLifecycleConfiguration¶
This action gets an Amazon S3 on Outposts bucket's lifecycle configuration. To get an S3 bucket's lifecycle configuration, see GetBucketLifecycleConfiguration in the Amazon S3 API Reference.
Returns the lifecycle configuration information set on the Outposts bucket. For more information, see Using Amazon S3 on Outposts and for information about lifecycle configuration, see Object Lifecycle Management in Amazon S3 User Guide.
To use this action, you must have permission to perform the
s3-outposts:GetLifecycleConfiguration
action. The Outposts bucket owner
has this permission, by default. The bucket owner can grant this permission to others. For
more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing
Access Permissions to Your Amazon S3 Resources.
All Amazon S3 on Outposts REST API requests for this action require an additional parameter of x-amz-outpost-id
to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of s3-control
. For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the x-amz-outpost-id
derived by using the access point ARN, see the Examples section.
GetBucketLifecycleConfiguration
has the following special error:
-
Error code:
NoSuchLifecycleConfiguration
-
Description: The lifecycle configuration does not exist.
-
HTTP Status Code: 404 Not Found
-
SOAP Fault Code Prefix: Client
-
The following actions are related to
GetBucketLifecycleConfiguration
:
Method Signature¶
IMPORTING¶
Required arguments:¶
iv_accountid
TYPE /AWS1/S3CACCOUNTID
/AWS1/S3CACCOUNTID
¶
The Amazon Web Services account ID of the Outposts bucket.
iv_bucket
TYPE /AWS1/S3CBUCKETNAME
/AWS1/S3CBUCKETNAME
¶
The Amazon Resource Name (ARN) of the bucket.
For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.
For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format
arn:aws:s3-outposts:
. For example, to access the bucket: :outpost/ /bucket/ reports
through Outpostmy-outpost
owned by account123456789012
in Regionus-west-2
, use the URL encoding ofarn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports
. The value must be URL encoded.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_s3cgetbktlcconfresult
/AWS1/CL_S3CGETBKTLCCONFRESULT
¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->/aws1/if_s3c~getbucketlifecycleconf(
iv_accountid = |string|
iv_bucket = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
LOOP AT lo_result->get_rules( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lo_lifecycleexpiration = lo_row_1->get_expiration( ).
IF lo_lifecycleexpiration IS NOT INITIAL.
lv_date = lo_lifecycleexpiration->get_date( ).
lv_days = lo_lifecycleexpiration->get_days( ).
lv_expiredobjectdeletemark = lo_lifecycleexpiration->get_expiredobjdeletemarker( ).
ENDIF.
lv_id = lo_row_1->get_id( ).
lo_lifecyclerulefilter = lo_row_1->get_filter( ).
IF lo_lifecyclerulefilter IS NOT INITIAL.
lv_prefix = lo_lifecyclerulefilter->get_prefix( ).
lo_s3tag = lo_lifecyclerulefilter->get_tag( ).
IF lo_s3tag IS NOT INITIAL.
lv_tagkeystring = lo_s3tag->get_key( ).
lv_tagvaluestring = lo_s3tag->get_value( ).
ENDIF.
lo_lifecycleruleandoperato = lo_lifecyclerulefilter->get_and( ).
IF lo_lifecycleruleandoperato IS NOT INITIAL.
lv_prefix = lo_lifecycleruleandoperato->get_prefix( ).
LOOP AT lo_lifecycleruleandoperato->get_tags( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_tagkeystring = lo_row_3->get_key( ).
lv_tagvaluestring = lo_row_3->get_value( ).
ENDIF.
ENDLOOP.
lv_objectsizegreaterthanby = lo_lifecycleruleandoperato->get_objectsizegreaterthan( ).
lv_objectsizelessthanbytes = lo_lifecycleruleandoperato->get_objectsizelessthan( ).
ENDIF.
lv_objectsizegreaterthanby = lo_lifecyclerulefilter->get_objectsizegreaterthan( ).
lv_objectsizelessthanbytes = lo_lifecyclerulefilter->get_objectsizelessthan( ).
ENDIF.
lv_expirationstatus = lo_row_1->get_status( ).
LOOP AT lo_row_1->get_transitions( ) into lo_row_4.
lo_row_5 = lo_row_4.
IF lo_row_5 IS NOT INITIAL.
lv_date = lo_row_5->get_date( ).
lv_days = lo_row_5->get_days( ).
lv_transitionstorageclass = lo_row_5->get_storageclass( ).
ENDIF.
ENDLOOP.
LOOP AT lo_row_1->get_noncurrentversiontranss( ) into lo_row_6.
lo_row_7 = lo_row_6.
IF lo_row_7 IS NOT INITIAL.
lv_days = lo_row_7->get_noncurrentdays( ).
lv_transitionstorageclass = lo_row_7->get_storageclass( ).
ENDIF.
ENDLOOP.
lo_noncurrentversionexpira = lo_row_1->get_noncurrentversionexpir( ).
IF lo_noncurrentversionexpira IS NOT INITIAL.
lv_days = lo_noncurrentversionexpira->get_noncurrentdays( ).
lv_noncurrentversioncount = lo_noncurrentversionexpira->get_newernoncurrentversions( ).
ENDIF.
lo_abortincompletemultipar = lo_row_1->get_abortincompletempupload( ).
IF lo_abortincompletemultipar IS NOT INITIAL.
lv_daysafterinitiation = lo_abortincompletemultipar->get_daysafterinitiation( ).
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.