Skip to content

/AWS1/IF_S3=>LISTOBJECTANNOTATIONS()

About ListObjectAnnotations

Lists the annotations attached to an Amazon S3 object. Results are paginated, with a maximum of 1,000 annotations per object. Use the AnnotationPrefix parameter to filter the results by name prefix.

To use this operation, you must have the s3:ListObjectAnnotations permission.

Annotations are not supported by the following features: S3 Inventory Reports, API Gateway, S3 Storage Lens, Amazon S3 File Gateway, Amazon FSx, S3 on Outposts, and S3 Express One Zone (directory buckets).

The following operations are related to ListObjectAnnotations:

Method Signature

METHODS /AWS1/IF_S3~LISTOBJECTANNOTATIONS
  IMPORTING
    !IV_BUCKET TYPE /AWS1/S3_BUCKETNAME OPTIONAL
    !IV_KEY TYPE /AWS1/S3_OBJECTKEY OPTIONAL
    !IV_VERSIONID TYPE /AWS1/S3_OBJECTVERSIONID OPTIONAL
    !IV_MAXANNOTATIONRESULTS TYPE /AWS1/S3_MAXANNOTATIONRESULTS OPTIONAL
    !IV_ANNOTATIONPREFIX TYPE /AWS1/S3_ANNOTATIONPREFIX OPTIONAL
    !IV_CONTINUATIONTOKEN TYPE /AWS1/S3_TOKEN OPTIONAL
    !IV_REQUESTPAYER TYPE /AWS1/S3_REQUESTPAYER OPTIONAL
    !IV_EXPECTEDBUCKETOWNER TYPE /AWS1/S3_ACCOUNTID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_s3_listobjannotsout
  RAISING
    /AWS1/CX_S3_INVALIDPREFIX
    /AWS1/CX_S3_NOSUCHBUCKET
    /AWS1/CX_S3_NOSUCHKEY
    /AWS1/CX_S3_CLIENTEXC
    /AWS1/CX_S3_SERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_bucket TYPE /AWS1/S3_BUCKETNAME /AWS1/S3_BUCKETNAME

The name of the bucket that contains the object.

iv_key TYPE /AWS1/S3_OBJECTKEY /AWS1/S3_OBJECTKEY

The object key.

Optional arguments:

iv_versionid TYPE /AWS1/S3_OBJECTVERSIONID /AWS1/S3_OBJECTVERSIONID

The version ID of the object.

iv_maxannotationresults TYPE /AWS1/S3_MAXANNOTATIONRESULTS /AWS1/S3_MAXANNOTATIONRESULTS

The maximum number of annotations to return in the response. Maximum is 1,000.

iv_annotationprefix TYPE /AWS1/S3_ANNOTATIONPREFIX /AWS1/S3_ANNOTATIONPREFIX

Filter results to annotations whose name begins with the specified prefix.

iv_continuationtoken TYPE /AWS1/S3_TOKEN /AWS1/S3_TOKEN

Continuation token returned by a previous request to retrieve the next page.

iv_requestpayer TYPE /AWS1/S3_REQUESTPAYER /AWS1/S3_REQUESTPAYER

Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

This functionality is not supported for directory buckets.

iv_expectedbucketowner TYPE /AWS1/S3_ACCOUNTID /AWS1/S3_ACCOUNTID

The account ID of the expected bucket owner.

RETURNING

oo_output TYPE REF TO /aws1/cl_s3_listobjannotsout /AWS1/CL_S3_LISTOBJANNOTSOUT

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->listobjectannotations(
  iv_annotationprefix = |string|
  iv_bucket = |string|
  iv_continuationtoken = |string|
  iv_expectedbucketowner = |string|
  iv_key = |string|
  iv_maxannotationresults = 123
  iv_requestpayer = |string|
  iv_versionid = |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_annotations( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_annotationname = lo_row_1->get_annotationname( ).
      lv_lastmodified = lo_row_1->get_lastmodified( ).
      lv_etag = lo_row_1->get_etag( ).
      LOOP AT lo_row_1->get_checksumalgorithm( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_checksumalgorithm = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_size = lo_row_1->get_size( ).
      lv_replicationstatus = lo_row_1->get_replicationstatus( ).
    ENDIF.
  ENDLOOP.
  lv_bucketname = lo_result->get_bucket( ).
  lv_objectkey = lo_result->get_key( ).
  lv_objectversionid = lo_result->get_objectversionid( ).
  lv_annotationprefix = lo_result->get_annotationprefix( ).
  lv_maxannotationresults = lo_result->get_maxannotationresults( ).
  lv_annotationcount = lo_result->get_annotationcount( ).
  lv_token = lo_result->get_continuationtoken( ).
  lv_nexttoken = lo_result->get_nextcontinuationtoken( ).
  lv_requestcharged = lo_result->get_requestcharged( ).
ENDIF.