Skip to content

/AWS1/IF_DPL=>LISTTAGSFORRESOURCE()

About ListTagsForResource

Returns a list of tags for the resource identified by a specified Amazon Resource Name (ARN). Tags are used to organize and categorize your CodeDeploy resources.

Method Signature

METHODS /AWS1/IF_DPL~LISTTAGSFORRESOURCE
  IMPORTING
    !IV_RESOURCEARN TYPE /AWS1/DPLARN OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/DPLNEXTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_dpllisttgsforresrcout
  RAISING
    /AWS1/CX_DPLARNNOTSUPPORTEDEX
    /AWS1/CX_DPLINVALIDARNEX
    /AWS1/CX_DPLRESRCARNREQUIREDEX
    /AWS1/CX_DPLCLIENTEXC
    /AWS1/CX_DPLSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_resourcearn TYPE /AWS1/DPLARN /AWS1/DPLARN

The ARN of a CodeDeploy resource. ListTagsForResource returns all the tags associated with the resource that is identified by the ResourceArn.

Optional arguments:

iv_nexttoken TYPE /AWS1/DPLNEXTTOKEN /AWS1/DPLNEXTTOKEN

An identifier returned from the previous ListTagsForResource call. It can be used to return the next set of applications in the list.

RETURNING

oo_output TYPE REF TO /aws1/cl_dpllisttgsforresrcout /AWS1/CL_DPLLISTTGSFORRESRCOUT

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->listtagsforresource(
  iv_nexttoken = |string|
  iv_resourcearn = |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_tags( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_key = lo_row_1->get_key( ).
      lv_value = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.