Skip to content

/AWS1/IF_ECA=>LISTTAGSFORRESOURCE()

About ListTagsForResource

Lists all tags currently on a named resource.

A tag is a key-value pair where the key and value are case-sensitive. You can use tags to categorize and track all your ElastiCache resources, with the exception of global replication group. When you add or remove tags on replication groups, those actions will be replicated to all nodes in the replication group. For more information, see Resource-level permissions.

If the cluster is not in the available state, ListTagsForResource returns an error.

Method Signature

METHODS /AWS1/IF_ECA~LISTTAGSFORRESOURCE
  IMPORTING
    !IV_RESOURCENAME TYPE /AWS1/ECASTRING OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ecataglistmessage
  RAISING
    /AWS1/CX_ECACACHECLSTNOTFNDF00
    /AWS1/CX_ECACACHEPRMGRNOTFND00
    /AWS1/CX_ECACACHESECGRNOTFND00
    /AWS1/CX_ECACACHESNETGRNOTFN00
    /AWS1/CX_ECAINVALIDARNFAULT
    /AWS1/CX_ECAINVREPLGRSTATEFA00
    /AWS1/CX_ECAINVSERVERLESSCAC01
    /AWS1/CX_ECAINVSERVERLESSCAC00
    /AWS1/CX_ECAREPLGRPNOTFNDFAULT
    /AWS1/CX_ECARSVDCACHENODENOT00
    /AWS1/CX_ECASERVERLESSCACHEN00
    /AWS1/CX_ECASERVERLESSCACHES00
    /AWS1/CX_ECASNAPNOTFOUNDFAULT
    /AWS1/CX_ECAUSERGRPNOTFNDFAULT
    /AWS1/CX_ECAUSERNOTFOUNDFAULT
    /AWS1/CX_ECACLIENTEXC
    /AWS1/CX_ECASERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_resourcename TYPE /AWS1/ECASTRING /AWS1/ECASTRING

The Amazon Resource Name (ARN) of the resource for which you want the list of tags, for example arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster or arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot.

For more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces.

RETURNING

oo_output TYPE REF TO /aws1/cl_ecataglistmessage /AWS1/CL_ECATAGLISTMESSAGE

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->listtagsforresource( |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_taglist( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_string = lo_row_1->get_key( ).
      lv_string = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.

ListTagsForResource

Lists all cost allocation tags currently on the named resource. A cost allocation tag is a key-value pair where the key is case-sensitive and the value is optional. You can use cost allocation tags to categorize and track your AWS costs.

DATA(lo_result) = lo_client->listtagsforresource( |arn:aws:elasticache:us-west-2:<my-account-id>:cluster:mycluster| ).